Skip to content

Commit

Permalink
Add vim shortcut: copy the relative path of a file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
padi committed Jun 7, 2016
1 parent 17800c6 commit 5125d39
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vim/settings/yadr-keymap.vim
Expand Up @@ -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 //
Expand Down

0 comments on commit 5125d39

Please sign in to comment.