Standard editing shotcuts
From Vim Tips Wiki
Duplicate tip
This tip is very similar to the following:
These tips need to be merged – see the merge guidelines.
Tip: #1387 - Standard editing shotcuts
Created: November 14, 2006 14:34 Complexity: basic Author: Lrkwz Version: 5.7 Karma: -6/18 Imported from: Tip#1387
Having replaced notepad with gvim, these are my preferred editing shortcuts:
" Copy to 'clipboard registry' vmap <C-C> "*y " Search selected text vmap / y/<C-R>"<CR> " Select all text nmap <C-A> 1G^vG$[edit]
Comments
straightforward
vmap / y/<C-R>"<CR>
would face problems with special symbols.
Another mapping I saw elsewhere may help with that
vmap // y/<C-R>=substitute(escape(@", '\\/.*$^~[]'), "\n", "\\\\n", "g")<CR>
Have you seen vim70/mswin.vim, it comes with Vim 7.0 (and prior versions). It sets up a bunch of behavior that makes Vim work nice with Windows. Just source it in your vimrc. It's worth reading through for some ideas if you don't want to use the entire thing.
" Search selected text "vmap / y/<C-R>"<CR> " [http://vimplugin.sf.net/cgi-bin/help?tag={{urlencode:#}} :help #], :help * " Select all text "nmap <C-A> 1G^vG$ nmap <C-A> ggVG
AFAIK, '*' and '#' only work with keyword under/after cursor, not with selected text...
'*' and '#' can easily be configured to grab the current visual selection.
Read through VimTip1
It's very convenient.
Categories: Duplicate | Review | VimTip