From c581e72110ad1665efd12d7a2f6ce1093ba558f0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 16 Jul 2019 13:12:01 +0200 Subject: [PATCH] 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. --- .config/vifm/vifmrc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 662442a..9e0d307 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -411,6 +411,7 @@ nmap Q :q " for now they use space for my leader key - so we can't switch panels with " space, use tab for that nnoremap +nnoremap t " Start shell in current directory nnoremap s :shell @@ -428,11 +429,17 @@ nnoremap o :!nvim " Open file in the background using its default program nnoremap gb :file &l -" Yank current directory path into the clipboard -nnoremap yd :!echo %d | xclip %i +" yank current directory path into the clipboard +nnoremap yd :!echo -n %d | xclip -selection "clipboard" %i -" Yank current file path into the clipboard -nnoremap yf :!echo %c:p | xclip %i +" yank current file path into the clipboard +nnoremap yf :!echo -n %c:p | xclip -selection "clipboard" %i + +" yank current filename without path into the clipboard +nnoremap yn :!echo -n %c | xclip -selection "clipboard" %i + +" yank root of current file's name into the clipboard +nnoremap yr :!echo -n %c:r | xclip -selection "clipboard" %i " Mappings for faster renaming nnoremap I cw