History of SelectedVimTips

Version 1

SelectedVimTips

some collected vim tips and settings for manipulating files

Created by: xing, Last modification: 06 May 2005 (14:05 UTC) by xing

useful .(g)vimrc mappings

vim to the rescue!

what do you do when you have a php function in front of you and you don't know what it does or you can't remember in what order the parameters are passed in?

i'm not sure what you do, but i move my cursor onto that function and hit <Ctrl-P>. that's it!

just recently i stumbled accross this useful vim tip:
it allows you to position your cursor on any php function and using your mapping it will open the appropriate page on www.php.net

i use this in my .vimrc
{code()}
nmap <c-p> :!lynx -accept_all_cookies http://us2.php.net/
R
W\#function.
R
W<CR>
{code}

and this in my .gvimrc
{code()}
nmap <c-p> :!opera -newpage http://us2.php.net/
R
W\#function.
R
W<CR>
{code}

obviously you can replace opera with your favourite browser and replace the mapping with your preferred mapping. unfortunately lynx doesn't work in gvim and thus you need to open the page in an external browser.

Note: don't forget to use <Ctrl-R> and <Ctrl-W> to get ^R and ^W


some useful .vimrc settings

{code()}
if has("autocmd")
" source the .vimrc file on save to apply all changes immediately
autocmd! bufwritepost .vimrc source ~/.vimrc
endif
{code}
Page History
Date/CommentUserIPVersion
28 Mar 2006 (13:39 UTC)
xing194.152.164.4522
Current • Source
xing194.152.164.4521
View • Compare • Difference • Source
xing194.152.164.4520
View • Compare • Difference • Source
xing194.152.164.4519
View • Compare • Difference • Source
xing194.152.164.4517
View • Compare • Difference • Source
xing194.152.164.4516
View • Compare • Difference • Source
xing194.152.164.4515
View • Compare • Difference • Source
xing194.152.164.4514
View • Compare • Difference • Source
xing194.152.164.4513
View • Compare • Difference • Source
xing194.152.164.4512
View • Compare • Difference • Source
xing194.152.164.4511
View • Compare • Difference • Source
xing194.152.164.4510
View • Compare • Difference • Source
xing194.152.164.459
View • Compare • Difference • Source
xing194.152.164.458
View • Compare • Difference • Source
xing194.152.164.457
View • Compare • Difference • Source
xing194.152.164.456
View • Compare • Difference • Source
xing194.152.164.455
View • Compare • Difference • Source
xing194.152.164.454
View • Compare • Difference • Source
xing194.152.164.453
View • Compare • Difference • Source
xing194.152.164.452
View • Compare • Difference • Source
xing194.152.164.451
View • Compare • Difference • Source