87 lines
2.2 KiB
VimL
87 lines
2.2 KiB
VimL
" Custom Mappings
|
|
imap jj <Esc>
|
|
|
|
"---------------
|
|
" Tabs
|
|
"---------------
|
|
set tabstop=4
|
|
set softtabstop=4
|
|
set shiftwidth=4
|
|
set noexpandtab
|
|
|
|
" Use case insensitive search, except when using capital letters
|
|
set ignorecase
|
|
set smartcase
|
|
|
|
" When opening a new line and no filetype-specific indenting is enabled, keep
|
|
" the same indent as the line you're currently on. Useful for READMEs, etc.
|
|
set autoindent
|
|
|
|
" Display line numbers on the left
|
|
set number
|
|
|
|
" Increase undo limit
|
|
set history=1000
|
|
|
|
" Disable swap files
|
|
set noswapfile
|
|
|
|
" Show lines above and below cursor
|
|
set scrolloff=5
|
|
|
|
" Update every 300 ms
|
|
set updatetime=300
|
|
|
|
|
|
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
|
if empty(glob(data_dir . '/autoload/plug.vim'))
|
|
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
|
endif
|
|
|
|
|
|
"---------------
|
|
" Plugins
|
|
"---------------
|
|
call plug#begin()
|
|
Plug 'preservim/NERDTree'
|
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
|
Plug 'ntpeters/vim-better-whitespace'
|
|
Plug 'mhinz/vim-startify'
|
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
|
Plug 'cespare/vim-toml', { 'branch': 'main' }
|
|
Plug 'snakemake/snakemake', {'rtp': 'misc/vim'}
|
|
Plug 'airblade/vim-gitgutter'
|
|
call plug#end()
|
|
|
|
nnoremap <leader>n :NERDTreeFocus<CR>
|
|
nnoremap <C-n> :NERDTree<CR>
|
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
|
nnoremap <C-f> :NERDTreeFind<CR>
|
|
|
|
let g:NERDTreeGitStatusUseNerdFonts = 1 " you should install nerdfonts by yourself. default: 0
|
|
|
|
"---------------
|
|
"COC Config
|
|
"---------------
|
|
|
|
" Use tab for trigger completion with characters ahead and navigate.
|
|
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
|
" other plugin before putting this into your config.
|
|
inoremap <silent><expr> <TAB>
|
|
\ pumvisible() ? "\<C-n>" :
|
|
\ <SID>check_back_space() ? "\<TAB>" :
|
|
\ coc#refresh()
|
|
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
|
|
|
function! s:check_back_space() abort
|
|
let col = col('.') - 1
|
|
return !col || getline('.')[col - 1] =~# '\s'
|
|
endfunction
|
|
|
|
|
|
"---------------
|
|
"Gitgutter
|
|
"---------------
|
|
"turn off background of git sign column
|
|
highlight! link SignColumn LineNr
|