Saturday, May 5, 2012

Insert the directory of the current buffer in command line mode

Hi all,

I saw one line command map used to insert the directory of the current
buffer in command line mode in steve losh's vimrc:

cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'

I imagined it would insert directory of the current buffer when enter
%% in command mode. But it seemed not work as I imagine. So what I
missed?

Thanks.

--
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

No comments:

Post a Comment