From ebc1ea9cc72c067cc8f03106f3205277d42d7762 Mon Sep 17 00:00:00 2001 From: yan Date: Sat, 14 Apr 2012 16:40:50 -0700 Subject: [PATCH] Added `,cn` to copy name of current file into system clipboard --- README.md | 3 ++- vim/plugin/settings/yadr-keymap.vim | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c2fb7690..a497553b 100644 --- a/README.md +++ b/README.md @@ -351,7 +351,8 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke #### Utility * `,ig` - toggle visual indentation guides - * `,cf` - Copy Filename of current file into system (not vi) paste buffer + * `,cf` - Copy Filename of current file (full path) into system (not vi) paste buffer + * `,cn` - Copy Filename of current file (name only, no path) * `,vc` - (Vim Command) copies the command under your cursor and executes it in vim. Great for testing single line changes to vimrc. * `,yw` - yank a word from anywhere within the word (so you don't have to go to the beginning of it) * `,ow` - overwrite a word with whatever is in your yank buffer - you can be anywhere on the word. saves having to visually select it diff --git a/vim/plugin/settings/yadr-keymap.vim b/vim/plugin/settings/yadr-keymap.vim index 14e84379..6f6f8a83 100644 --- a/vim/plugin/settings/yadr-keymap.vim +++ b/vim/plugin/settings/yadr-keymap.vim @@ -158,6 +158,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 ,cn :let @* = expand("%:t") "Clear current search highlight by double tapping // nmap // :nohlsearch