diff --git a/config_files/.vimrc b/config_files/.vimrc index 80a88e2..adcc514 100644 --- a/config_files/.vimrc +++ b/config_files/.vimrc @@ -64,14 +64,14 @@ highlight nonText ctermbg=NONE " --------------------------------------------------------------------- " copy to the clipboard from vim : in visual mode, select text with -" 'v' (or 'V' for whole lines, Ctrl-v for a block), then type -" 'y' ('' is ',' since it is set in base settings) : -" the selected lines are piped to 'wl-copy' and can be pasted -" anywhere (C-v, middle click). note : the range is whole lines, a -" partial-line selection copies the full lines. requires -" 'wl-clipboard' installed (for the screen-level equivalent, see -" the 'C-a Y' binding in .screenrc) -vnoremap y :w !wl-copy +" 'v' or 'V' or Ctrl-v, then type 'y'. +" ('' is ',' since it is set in base settings). +" the selected lines are piped to the first clipboard tool available +" on the machine (wl-copy (wayland), then xclip, then xsel (X11)), +" and can be pasted anywhere. +" note : the range is whole lines, a partial-line selection copies +" the full lines. +vnoremap y :w !sh -c 'wl-copy 2>/dev/null || xclip -selection clipboard 2>/dev/null || xsel --clipboard --input' " --------------------------------------------------------------------- " indentation