History
Article Edit Discussion

Standard editing shotcuts

From Vim Tips Wiki

(Redirected from VimTip1387)
Jump to: navigation, search
[edit]

Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Previous Tip Next Tip [edit]

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.


Rate it:
Share it: Email this to a friend Share with Delicious Share with Stumbleupon Share with Digg
Hubs Featured Partners Wikia messages

Gaming
Entertainment
Cartoons & Comics
Science Fiction
Books
Biggest Wikis
See all...

DC Comics Database Project
Halo Fanon Wikia
Marvel Comics Database Project
The wiki for all things Yu-Gi-Oh!
See more...

ArmchairGM
Entertainment
Politics
Tunes

Wikia is hiring
Send this article to a friend
"Standard editing shotcuts"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation