From 0f954c6cbd19080b1cf9253c64466d3af10dd586 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 1 Feb 2021 19:25:01 +0100 Subject: tmux and vim terminal stuff --- vimrc | 87 ++++++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 58 insertions(+), 29 deletions(-) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 492b1a7..c946cbf 100644 --- a/vimrc +++ b/vimrc @@ -29,42 +29,71 @@ nnoremap :!make " Set up the left-right actions just right: " ----------------------------------------- -"nnoremap :tabprev -"nnoremap :tabnext -"inoremap :tabprev -"inoremap :tabnext -"" nnoremap :tabnew -"nnoremap :tabprev -"nnoremap :tabnext - -nnoremap :bprevious -nnoremap :bnext -inoremap :bprevious -inoremap :bnext - -nnoremap :bprevious -nnoremap :bnext -inoremap :bprevious -inoremap :bnext +" Map Shift-{Left,Right} to the previous/next buffer +" both in normal mode and in insert mode. +" This is for urxvt on buster (rxvt-unicode-256color) +" and a screen launched in that (screen-bce) +nnoremap [d :bprevious +nnoremap [c :bnext +inoremap [d :bprevious +inoremap [c :bnext +" This makes it work in a tmux on urxvt, +" in xterm, and in tmux/screen in xterm. nnoremap [1;2D :bprevious nnoremap [1;2C :bnext inoremap [1;2D :bprevious inoremap [1;2C :bnext -nnoremap [D :bprevious -nnoremap [C :bnext -inoremap [D :bprevious -inoremap [C :bnext - -nnoremap [d :bprevious -nnoremap [c :bnext -inoremap [d :bprevious -inoremap [c :bnext -" nnoremap :bnew -nnoremap :bprevious -nnoremap :bnext +" Navigate in (split) windows +" up/down/left/right +" in xterm: +nnoremap [1;3A :wincmd k +nnoremap [1;3B :wincmd j +nnoremap [1;3D :wincmd h +nnoremap [1;3C :wincmd l +inoremap [1;3A :wincmd k +inoremap [1;3B :wincmd j +inoremap [1;3D :wincmd h +inoremap [1;3C :wincmd l + +" in urxvt I can't get Alt- to work, so use ;/,. +" the up/down clash with to exit insert mode, followed by / to search :/ +"nnoremap ; :wincmd k +"nnoremap / :wincmd j +nnoremap , :wincmd h +nnoremap . :wincmd l +"inoremap ; :wincmd k +"inoremap / :wincmd j +inoremap , :wincmd h +inoremap . :wincmd l + +" nnoremap :bprevious +" nnoremap :bnext + +" nnoremap :bprevious +" nnoremap :bnext +" inoremap :bprevious +" inoremap :bnext +" +" nnoremap :bprevious +" nnoremap :bnext +" inoremap :bprevious +" inoremap :bnext +" +" +" nnoremap [D :bprevious +" nnoremap [C :bnext +" inoremap [D :bprevious +" inoremap [C :bnext +" +" +" nnoremap :bprevious +" nnoremap :bnext +" +" nnoremap :bprevious +" nnoremap :bnext if &term =~ '^screen' " tmux will send xterm-style keys when xterm-keys is on -- cgit v1.2.3