Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
filenames + clipboard + vim
""" copy filename of current file to clipboard
map <Leader>cf :silent exe '!echo -n % \| pbcopy'<CR>:echo bufname('%')<CR>
""" edit filename from clipboard
map <silent> <Leader>ef :call EditFromClipboard()<CR>
function EditFromClipboard()
let filename = expand(fnameescape(system('pbpaste')))
if filereadable(filename)
exe 'edit ' . filename
else
echo 'not a file: ' . filename
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.