From 7a15fceb1b761a6d91c716d1e70f53a581dfc35f Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 20 Sep 2021 12:20:48 +0800 Subject: [PATCH] feat: switch pane with hjkloq --- cli/vim/init.vim | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/cli/vim/init.vim b/cli/vim/init.vim index 13ba20c..d41b68c 100644 --- a/cli/vim/init.vim +++ b/cli/vim/init.vim @@ -62,7 +62,14 @@ nnoremap 5 :b5 nnoremap w :w nnoremap :noh -function! WSLCopy() +nnoremap h h +nnoremap j j +nnoremap k k +nnoremap l l +nnoremap o o +nnoremap q q + +function! XCopy() " Why is this not a built-in Vim script function?! let [line_start, column_start] = getpos("'<")[1:2] let [line_end, column_end] = getpos("'>")[1:2] @@ -76,11 +83,12 @@ function! WSLCopy() endfunction function! YankFileLineNo() - let @+=expand("%") . ':' . line(".") - echo @+ + let yl=expand("%") . ':' . line(".") + call system('tmux set-buffer "'.yl.'"') + "let @+=yl endfunction -xnoremap y :call WSLCopy() +xnoremap y :call XCopy() nnoremap yl :call YankFileLineNo() nmap "" ysiW" @@ -226,8 +234,8 @@ nnoremap sc :Grepper -tool grep nnoremap sa :Grepper -tool ag " ==== quickfix configuration ==== -nnoremap j :cn -nnoremap k :cp +nnoremap cj :cn +nnoremap ck :cp "" ==== NERDTree configuration ====