From fead1d51630b9d7fdcdf7aaa29b25e3714097da2 Mon Sep 17 00:00:00 2001 From: dummy Date: Sun, 4 Feb 2018 04:12:59 -0500 Subject: [PATCH] add system clipboard support for vim+tmux --- .tmux.conf | 5 +++-- .vimrc | 15 +++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 109ba8b..1780252 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -10,8 +10,9 @@ set -s escape-time 50 setw -g mouse on # copy selection to X windows clipboard -set -g set-clipboard on -bind-key -T copy-mode-vi y send copy-selection-and-cancel\; run "tmux save -|xsel -b > /dev/null 2>&1" +#set -g set-clipboard off +bind-key -T copy-mode-vi v send -X begin-selection +bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null" ########################################## # TERMINAL EMULATOR TITLES diff --git a/.vimrc b/.vimrc index a2da96a..c53a671 100644 --- a/.vimrc +++ b/.vimrc @@ -5,14 +5,21 @@ colorscheme deus " don't clutter directories with backup files set nobackup set nowritebackup - set tabstop=4 set shiftwidth=4 " set to same as tabstop for auto-indent +set clipboard=unnamedplus + +" folding set foldmethod=syntax -set foldnestmax=2 -set foldlevelstart=99 -set foldcolumn=3 +set foldnestmax=1 +set foldlevelstart=0 +set foldcolumn=2 set autoindent +" Don't screw up folds when inserting text that might affect them, until +" " leaving insert mode. Foldmethod is local to the window. Protect against +" " screwing up folding when switching between windows. + autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif + autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif " filename auto-completion set wildmode=longest,list,full