Skip to content

Commit

Permalink
Expand %% in command mode to dir of current file
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt committed Apr 10, 2012
1 parent 8801a13 commit bdf9af5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ syntax on
" Sudo to write - http://forrst.com/posts/Use_w_to_sudo_write_a_file_with_Vim-uAN
cnoremap w!! w !sudo tee % >/dev/null
" expand %% to directory of current file
cnoremap %% <C-R>=expand('%:h').'/'<cr>
" Automatically load vimrc after it was updated
autocmd vimrc bufwritepost .vimrc,vimrc source $MYVIMRC

Expand Down

0 comments on commit bdf9af5

Please sign in to comment.