From 5125d393f73993ff5b6aa2c4e45528dd3890f4ab Mon Sep 17 00:00:00 2001 From: Marc Ignacio Date: Tue, 7 Jun 2016 14:29:39 +0800 Subject: [PATCH] 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 --- vim/settings/yadr-keymap.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/settings/yadr-keymap.vim b/vim/settings/yadr-keymap.vim index b6f0acf..d6ee932 100644 --- a/vim/settings/yadr-keymap.vim +++ b/vim/settings/yadr-keymap.vim @@ -131,6 +131,7 @@ imap <% %>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 ,cf :let @* = expand("%:~") +nnoremap ,cr :let @* = expand("%") nnoremap ,cn :let @* = expand("%:t") "Clear current search highlight by double tapping //