Bug#739656: vim: dot-repeated shellout commands lose their escaped options?

Michael O'Donnell mod.reportbug at b0rken.com
Fri Feb 21 00:27:14 UTC 2014

Package: vim
Version: 2:7.4.161-1
Severity: normal
Tags: upstream

Dear Maintainer,

I frequently use vim's shellout capabilities to feed a buffer to some
external command and replace the buffer with that command's stdout.
For example, I often sort a group of lines (up to the next blank line)
by positioning the cursor on the first line and then saying:


...and I am then able to repeat that process on other groups of lines by
positioning the cursor on the first line of each group and then either
using the 'bang' notation, thus:


...or else by positioning the cursor and then just simply using dot in
its generic capacity as the Do-That-Again command.  When I am using a
command such as awk that might involve options like percent signs that
are meaningful to Vim it is necessary to escape those symbols with a
backslash, and that also works fine.  For example, this command:

   !!awk '{ printf( "\%s\n", "Percent signs need backslashes." ); }'

...works as intended the first time it's used and every time it's repeated
thereafter, as long as it's repeated using the bang notation, thus:


...which yields this:

   Percent signs need backslashes.

...but if you instead attempt to repeat that command using dot, the result
is an error involving the unexpected mention of the current filename,
which indicates that the percent sign has somehow lost its protective
backslash and is being presented to Vim's command processor naked, which
(at the moment I'm composing this bug report) yields:


This is not a showstopper (I see it at least as far back as version
7.2.411) but should probably be on the bug-list...


  --Michael O'Donnell

-- Package-specific info:

--- real paths of main Vim binaries ---
/usr/bin/vi   is /usr/bin/vim.gnome
/usr/bin/vim  is /usr/bin/vim.gnome
/usr/bin/gvim is /usr/bin/vim.gnome

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.5.2 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vim depends on:
ii  libacl1      2.2.52-1
ii  libc6        2.17-97
ii  libgpm2      1.20.4-6.1
ii  libselinux1  2.2.2-1
ii  libtinfo5    5.9+20140118-1
ii  vim-common   2:7.4.161-1
ii  vim-runtime  2:7.4.161-1

vim recommends no packages.

Versions of packages vim suggests:
ii  exuberant-ctags [ctags]  1:5.9~svn20110310-6
ii  vim-doc                  2:7.4.161-1
ii  vim-scripts              20130814

-- debconf-show failed

More information about the pkg-vim-maintainers mailing list