Tip #299: Open file under cursor.
tip karma |
Rating -6/12, Viewed by 888
|
created: |
|
August 6, 2002 4:23 |
|
complexity: |
|
intermediate |
author: |
|
Little Dragon |
|
as of Vim: |
|
5.7 |
A little thing that I did and found quite useful:
function! OpenFileUnderCursor()
let FileName = expand("<cfile>")
let OldPath = getcwd()
silent cd %:p:h
execute "silent sp +e " . FileName
execute "silent cd " . OldPath
endfunction
map! silent <M-e> :call OpenFileUnderCursor()<CR>
Then use Alt+E on a filename to open it (relative to the directory the current file resides in).
<<Changing case with regular expressions |
Making a tags file for IDL (Interactive Data Language) >>
Additional Notes
|