From d10998d1993d0360217b5048a41e911d9562630c Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Mon, 23 Jan 2023 01:06:18 +0100 Subject: [PATCH] vim wayland stuff --- home/.config/nvim/init.vim | 6 ++++++ home/.config/nvim/noplug.vim | 8 +++++++- home/.vimrc | 8 +++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 96fe012..7ef5ceb 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -43,6 +43,12 @@ let mapleader=" " map t :echo "leader tested!" map h :noh +" copy to wayland clipboard when leader is used. (note, install gvim for this) +vnoremap wy y :call system("wl-copy", @") +nnoremap wY Y :call system("wl-copy", @") +nnoremap wy y :call system("wl-copy", @") +nnoremap wyy yy :call system("wl-copy", @") + " copy to system clipboard when leader is used. (note, install gvim for this) vnoremap y "+y nnoremap Y "+Y diff --git a/home/.config/nvim/noplug.vim b/home/.config/nvim/noplug.vim index ee6fe4d..1687735 100644 --- a/home/.config/nvim/noplug.vim +++ b/home/.config/nvim/noplug.vim @@ -43,6 +43,12 @@ let mapleader=" " map t :echo "leader tested!" map h :noh +" copy to wayland clipboard when leader is used. (note, install gvim for this) +vnoremap wy y :call system("wl-copy", @") +nnoremap wY Y :call system("wl-copy", @") +nnoremap wy y :call system("wl-copy", @") +nnoremap wyy yy :call system("wl-copy", @") + " copy to system clipboard when leader is used. (note, install gvim for this) vnoremap y "+y nnoremap Y "+Y @@ -58,7 +64,7 @@ map " :vsplit " split with , then %" map % :split -" :W to save file as root" +" :W to write file as root" command W :SudaWrite " :E to open file as root" diff --git a/home/.vimrc b/home/.vimrc index 3c8b760..0a572e0 100644 --- a/home/.vimrc +++ b/home/.vimrc @@ -36,6 +36,12 @@ let mapleader=" " map t :echo "leader tested!" map h :noh +" copy to wayland clipboard when leader is used. (note, install gvim for this) +vnoremap wy y :call system("wl-copy", @") +nnoremap wY Y :call system("wl-copy", @") +nnoremap wy y :call system("wl-copy", @") +nnoremap wyy yy :call system("wl-copy", @") + " copy to system clipboard when leader is used. (note, install gvim for this) vnoremap y "+y nnoremap Y "+Y @@ -51,7 +57,7 @@ map " :vsplit " split with , then %" map % :split -" :W to save file as root" +" :W to write file as root" command W :w ! sudo tee % " Set completeopt to have a better completion experience" set completeopt=menuone,noinsert,noselect