Add yanking filepath/dir from vifm to clipboard

Use yd for directory, yf for file path, yn for file name (without full
path), yr for yanking the root of current filename. Makes use of xclip
to work.
This commit is contained in:
Marty Oehme 2019-07-16 13:12:01 +02:00
parent c42625f4be
commit c581e72110

View file

@ -411,6 +411,7 @@ nmap Q :q<cr>
" for now they use space for my leader key - so we can't switch panels with " for now they use space for my leader key - so we can't switch panels with
" space, use tab for that " space, use tab for that
nnoremap <space> <nop> nnoremap <space> <nop>
nnoremap <space><space> t
" Start shell in current directory " Start shell in current directory
nnoremap s :shell<cr> nnoremap s :shell<cr>
@ -428,11 +429,17 @@ nnoremap o :!nvim <cr>
" Open file in the background using its default program " Open file in the background using its default program
nnoremap gb :file &<cr>l nnoremap gb :file &<cr>l
" Yank current directory path into the clipboard " yank current directory path into the clipboard
nnoremap yd :!echo %d | xclip %i<cr> nnoremap yd :!echo -n %d | xclip -selection "clipboard" %i<cr>
" Yank current file path into the clipboard " yank current file path into the clipboard
nnoremap yf :!echo %c:p | xclip %i<cr> nnoremap yf :!echo -n %c:p | xclip -selection "clipboard" %i<cr>
" yank current filename without path into the clipboard
nnoremap yn :!echo -n %c | xclip -selection "clipboard" %i<cr>
" yank root of current file's name into the clipboard
nnoremap yr :!echo -n %c:r | xclip -selection "clipboard" %i<cr>
" Mappings for faster renaming " Mappings for faster renaming
nnoremap I cw<c-a> nnoremap I cw<c-a>