On 11/14/11 18:47, Dun Peal wrote:
I'd like to setup a keyboard shortcut that would work similar to `gf`,
except it will regard the entire cursor line as the filename to open.

So for example, if I'm on a line that contains the text "foo bar
baz.", and hit the shortcut, the file "foo bar baz." - a new one if it
doesn't already exist - will be :edit'ed.

I'd do a mapping something like

  :nnoremap <f4> :exec 'e '.getline('.')<cr>

(change the "e" to "sp" if you'd rather split the file in a new window rather than edit in the window containing your list of files).

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to