[Tipz] Expansions on the Vim Command Line
Ian Langworth
bass at ccs.neu.edu
Wed Aug 11 14:27:30 EDT 2004
Hopefully you have a key that swaps you to the last file editing
and position you were in that file. It might look like this:
:map = <Esc>:e#<CR>
'#' is "replaced with the alternate file name." Additionally,
'%' becomes the current file name and '<cword>' is the word
under the cursor. See ':help cmdline-special' for more info.
For example, say you're working with code and you want to search
for all instances of the function name your cursor is on in
a single keystroke:
:nmap <F8> :!grep -r <cword> /path/to/codebase
--
Ian Langworth
Project Guerrilla
Northeastern University
College of Computer and Information Science
More information about the Tipz
mailing list