Permalink
Browse files

Fix the `&` command in normal and visual modes.

The default mapping repeats the last substitution command, but it
discards the flags. These mappings retain the flags, and work in visual
mode as well as normal mode.
  • Loading branch information...
1 parent 3d8bc4c commit 8dabf73ffb327ac5e5647a8740ce982d8474d28e @nelstrom committed Apr 14, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 vimrc
View
3 vimrc
@@ -189,6 +189,9 @@ map <leader>et :tabe %%
map <leader>er :e <C-R>=expand("%:r")."."<CR>
" Shortcuts for visual selections {{{2
nmap gV `[v`]
+" Substitute command repetition {{{2
+nnoremap & :~&<Enter>
+vnoremap & :~&<Enter>
" Alignment commands {{{1
if exists(":Tabularize")
nmap <Leader>a= :Tabularize /=<CR>

0 comments on commit 8dabf73

Please sign in to comment.