Add vim shortcut: copy the relative path of a file

I've been using ,cf for some of the time, but sometimes I don't want the full path for a variety of reasons:
- any command where relative path suffices (running tests, removing files)
- the full path won't work if I'm using MacVim and the project is within vagrant cli
This commit is contained in:
Marc Ignacio 2016-06-07 14:29:39 +08:00
parent 17800c6ecd
commit 5125d393f7

View File

@ -131,6 +131,7 @@ imap <silent> <C-J> <% %><Esc>2hi
" copy current filename into system clipboard - mnemonic: (c)urrent(f)ilename
" this is helpful to paste someone the path you're looking at
nnoremap <silent> ,cf :let @* = expand("%:~")<CR>
nnoremap <silent> ,cr :let @* = expand("%")<CR>
nnoremap <silent> ,cn :let @* = expand("%:t")<CR>
"Clear current search highlight by double tapping //