From 5449fc76dd0b390935a39e9cc070df9621eb10e1 Mon Sep 17 00:00:00 2001 From: Sam Perry Date: Sun, 6 Dec 2015 14:12:34 +0000 Subject: [PATCH] Updated vimrc for terminal use --- README.md | 5 +++++ vimrc.symlink | 52 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 169ef46..a996bd2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ Installation: git clone https://github.com/Pezz89/vimconfig.git ~/.vim +link nvim config files to correct location. + mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config} + ln -s ~/.vim $XDG_CONFIG_HOME/nvim + ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim + Local vimrc (.lvimrc) once plugins have been installed, it is possible to set up a vimrc locally for both machine and individual projects create a file called .lvimrc in the home directory and it will be sourced any time a file is accessed in a sub folder of that directory diff --git a/vimrc.symlink b/vimrc.symlink index ce87ba3..08d961a 100644 --- a/vimrc.symlink +++ b/vimrc.symlink @@ -36,7 +36,7 @@ Plugin 'tpope/vim-surround' Plugin 'easymotion/vim-easymotion' Plugin 'Yggdroot/indentLine' Plugin 'mindriot101/vim-yapf' -Plugin 'vim-scripts/TaskList.vim' +" Plugin 'vim-scripts/TaskList.vim' Plugin 'vim-scripts/MatlabFilesEdition' Plugin 'lervag/vimtex' Plugin 'bjoernd/vim-ycm-tex' @@ -48,7 +48,7 @@ filetype indent on " General vim settings " ==================================== " Set the default shell -set shell=zsh\ -l +set shell=zsh " Set spell checker language set spelllang=en_gb @@ -110,15 +110,12 @@ set wildmenu " Redraw only when we need to. set lazyredraw -" move vertically by visual line. If lines are wrapped due to lack of screen -" space they are still navigated as expected -nnoremap j gj -nnoremap k gk " OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to " 'plaintex' instead of 'tex', which results in vim-latex not being loaded. " The following changes the default filetype back to 'tex': let g:tex_flavor='latex' + " ==================================== " Easymotion Settings " ==================================== @@ -390,18 +387,15 @@ nmap :call TogglePep257() nmap n :enew " Move to the next buffer -nmap l :bnext +nmap bl :bnext " Move to the previous buffer -nmap h :bprevious +nmap bh :bprevious " Close the current buffer and move to the previous one " This replicates the idea of closing a tab nmap bq :bp bd! # -" Show all open buffers and their status -nmap bl :ls - " Toggle the NerdTree file browser menu nnoremap :NERDTreeToggle @@ -431,11 +425,33 @@ vmap (expand_region_shrink) " Stop strange window from popping up when accidentally press q: map q: :q -" Navigate vim windows with hjkl -nnoremap j -nnoremap k -nnoremap h -nnoremap l +:nmap :wincmd h +:nmap :wincmd j +:nmap :wincmd k +:nmap :wincmd l + +" Window resizing mappings /*{{{*/ +if bufwinnr(1) + noremap :vertical resize +1 + noremap :vertical resize -1 + noremap :resize +1 + noremap :resize -1 +endif + +nmap r R + +" window navigation/manipulation +nmap h :topleft vnew +nmap l :botright vnew +nmap k :topleft new +nmap j :botright new + +" Close the current window +nmap x :q! + +" Quickly open a terminal +nmap t :term +tnoremap " Quickly edit/reload the vimrc file nmap ev :e $MYVIMRC @@ -445,6 +461,10 @@ nnoremap ez :vsp ~/.zshrc " Call yapf formatting nnoremap y :call Yapf() +" move vertically by visual line. If lines are wrapped due to lack of screen +" space they are still navigated as expected +nnoremap j gj +nnoremap k gk " ==================================== " Source local vim script for the current machine