Updated vimrc for terminal use
This commit is contained in:
@@ -2,6 +2,11 @@ Installation:
|
|||||||
|
|
||||||
git clone https://github.com/Pezz89/vimconfig.git ~/.vim
|
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)
|
Local vimrc (.lvimrc)
|
||||||
once plugins have been installed, it is possible to set up a vimrc locally for both machine and individual projects
|
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
|
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
|
||||||
|
|||||||
+36
-16
@@ -36,7 +36,7 @@ Plugin 'tpope/vim-surround'
|
|||||||
Plugin 'easymotion/vim-easymotion'
|
Plugin 'easymotion/vim-easymotion'
|
||||||
Plugin 'Yggdroot/indentLine'
|
Plugin 'Yggdroot/indentLine'
|
||||||
Plugin 'mindriot101/vim-yapf'
|
Plugin 'mindriot101/vim-yapf'
|
||||||
Plugin 'vim-scripts/TaskList.vim'
|
" Plugin 'vim-scripts/TaskList.vim'
|
||||||
Plugin 'vim-scripts/MatlabFilesEdition'
|
Plugin 'vim-scripts/MatlabFilesEdition'
|
||||||
Plugin 'lervag/vimtex'
|
Plugin 'lervag/vimtex'
|
||||||
Plugin 'bjoernd/vim-ycm-tex'
|
Plugin 'bjoernd/vim-ycm-tex'
|
||||||
@@ -48,7 +48,7 @@ filetype indent on
|
|||||||
" General vim settings
|
" General vim settings
|
||||||
" ====================================
|
" ====================================
|
||||||
" Set the default shell
|
" Set the default shell
|
||||||
set shell=zsh\ -l
|
set shell=zsh
|
||||||
|
|
||||||
" Set spell checker language
|
" Set spell checker language
|
||||||
set spelllang=en_gb
|
set spelllang=en_gb
|
||||||
@@ -110,15 +110,12 @@ set wildmenu
|
|||||||
" Redraw only when we need to.
|
" Redraw only when we need to.
|
||||||
set lazyredraw
|
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
|
" 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.
|
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
|
||||||
" The following changes the default filetype back to 'tex':
|
" The following changes the default filetype back to 'tex':
|
||||||
let g:tex_flavor='latex'
|
let g:tex_flavor='latex'
|
||||||
|
|
||||||
" ====================================
|
" ====================================
|
||||||
" Easymotion Settings
|
" Easymotion Settings
|
||||||
" ====================================
|
" ====================================
|
||||||
@@ -390,18 +387,15 @@ nmap <F5> :call TogglePep257()<CR>
|
|||||||
nmap <leader>n :enew<CR>
|
nmap <leader>n :enew<CR>
|
||||||
|
|
||||||
" Move to the next buffer
|
" Move to the next buffer
|
||||||
nmap <leader>l :bnext<CR>
|
nmap <leader>bl :bnext<CR>
|
||||||
|
|
||||||
" Move to the previous buffer
|
" Move to the previous buffer
|
||||||
nmap <leader>h :bprevious<CR>
|
nmap <leader>bh :bprevious<CR>
|
||||||
|
|
||||||
" Close the current buffer and move to the previous one
|
" Close the current buffer and move to the previous one
|
||||||
" This replicates the idea of closing a tab
|
" This replicates the idea of closing a tab
|
||||||
nmap <leader>bq :bp <BAR> bd! #<CR>
|
nmap <leader>bq :bp <BAR> bd! #<CR>
|
||||||
|
|
||||||
" Show all open buffers and their status
|
|
||||||
nmap <leader>bl :ls<CR>
|
|
||||||
|
|
||||||
" Toggle the NerdTree file browser menu
|
" Toggle the NerdTree file browser menu
|
||||||
nnoremap <F4> :NERDTreeToggle<CR>
|
nnoremap <F4> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
@@ -431,11 +425,33 @@ vmap <C-v> <Plug>(expand_region_shrink)
|
|||||||
" Stop strange window from popping up when accidentally press q:
|
" Stop strange window from popping up when accidentally press q:
|
||||||
map q: :q
|
map q: :q
|
||||||
|
|
||||||
" Navigate vim windows with hjkl
|
:nmap <silent> <C-h> :wincmd h<CR>
|
||||||
nnoremap <c-j> <c-w>j
|
:nmap <silent> <C-j> :wincmd j<CR>
|
||||||
nnoremap <c-k> <c-w>k
|
:nmap <silent> <C-k> :wincmd k<CR>
|
||||||
nnoremap <c-h> <c-w>h
|
:nmap <silent> <C-l> :wincmd l<CR>
|
||||||
nnoremap <c-l> <c-w>l
|
|
||||||
|
" Window resizing mappings /*{{{*/
|
||||||
|
if bufwinnr(1)
|
||||||
|
noremap <silent> <S-H> :vertical resize +1<CR>
|
||||||
|
noremap <silent> <S-L> :vertical resize -1<CR>
|
||||||
|
noremap <silent> <S-J> :resize +1<CR>
|
||||||
|
noremap <silent> <S-K> :resize -1<CR>
|
||||||
|
endif
|
||||||
|
|
||||||
|
nmap <leader>r <C-w>R
|
||||||
|
|
||||||
|
" window navigation/manipulation
|
||||||
|
nmap <leader>h :topleft vnew<CR>
|
||||||
|
nmap <leader>l :botright vnew<CR>
|
||||||
|
nmap <leader>k :topleft new<CR>
|
||||||
|
nmap <leader>j :botright new<CR>
|
||||||
|
|
||||||
|
" Close the current window
|
||||||
|
nmap <leader>x :q!<CR>
|
||||||
|
|
||||||
|
" Quickly open a terminal
|
||||||
|
nmap <leader>t :term<CR>
|
||||||
|
tnoremap <Esc> <C-\><C-n>
|
||||||
|
|
||||||
" Quickly edit/reload the vimrc file
|
" Quickly edit/reload the vimrc file
|
||||||
nmap <silent> <leader>ev :e $MYVIMRC<CR>
|
nmap <silent> <leader>ev :e $MYVIMRC<CR>
|
||||||
@@ -445,6 +461,10 @@ nnoremap <leader>ez :vsp ~/.zshrc<CR>
|
|||||||
" Call yapf formatting
|
" Call yapf formatting
|
||||||
nnoremap <leader>y :call Yapf()<cr>
|
nnoremap <leader>y :call Yapf()<cr>
|
||||||
|
|
||||||
|
" 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
|
" Source local vim script for the current machine
|
||||||
|
|||||||
Reference in New Issue
Block a user