-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_vimrc
161 lines (153 loc) · 4.3 KB
/
dot_vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugins
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Install and run vim-plug on first run
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Install plugins
call plug#begin()
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'
Plug 'lifepillar/vim-solarized8'
"Plug 'vim-airline/vim-airline'
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdcommenter'
Plug 'airblade/vim-gitgutter'
Plug 'whatyouhide/vim-gotham'
Plug 'dikiaap/minimalist'
Plug 'jiangmiao/auto-pairs'
"Plug 'davidhalter/jedi-vim'
Plug 'scrooloose/nerdtree'
Plug 'neomake/neomake'
Plug 'machakann/vim-highlightedyank'
Plug 'tmhedberg/SimpylFold'
Plug 'tpope/vim-fugitive'
Plug 'christoomey/vim-tmux-navigator'
Plug 'edkolev/tmuxline.vim'
Plug 'svermeulen/vim-cutlass'
call plug#end()
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugin configuration
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Code checking with neomake
let g:neomake_python_enabled_makers = ['pylint']
call neomake#configure#automake('nrwi', 500)
" nerdtree
let NERDTreeIgnore = ['\.pyc$', '^__pycache__$']
autocmd StdinReadPre * let s:std_in=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" fzf
let g:fzf_nvim_statusline = 0 " disable statusline overwriting
" vim-gutter
set updatetime=100
" " ctrlp: open new and existing files in a new tab
" let g:ctrlp_open_new_file = 't'
" let g:ctrlp_prompt_mappings = {
" \ 'AcceptSelection("e")': ['<2-LeftMouse>'],
" \ 'AcceptSelection("t")': ['<cr>'],
" \ }
" simplyfold: default to unfolded
autocmd FileType python setlocal foldenable foldlevel=20
" vim-cutlass
nnoremap x d
xnoremap x d
nnoremap xx dd
nnoremap X D
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Key mappings
""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader=","
nmap <leader>nf :NERDTreeFind<CR>
nmap <leader>nt :NERDTreeToggle<CR>
nnoremap <silent> <leader>f :Files<CR>
nnoremap <silent> <leader>b :Buffers<CR>
nnoremap <silent> <leader>w :Windows<CR>
nnoremap <silent> <leader><C-h> :tabprevious<CR>
nnoremap <silent> <leader><C-l> :tabnext<CR>
"" Do not yank deleted contents for these mappings
"nnoremap d "_d
"nnoremap s "_s
"nnoremap c "_c
"vnoremap d "_d
"vnoremap s "_s
"vnoremap c "_c
" Spelling
"nnoremap <leader>s :set spell!<CR>
" j/k will move virtual lines (lines that wrap)
noremap <silent> <expr> j (v:count == 0 ? 'gj' : 'j')
noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k')
" Exit insert mode with jk or kj
inoremap jk <esc>
inoremap kj <esc>
" Toggle search higlights
nnoremap <leader>s :set hlsearch!<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" UI and syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors
set termguicolors
set background=dark
set t_Co=256
" Theme
colorscheme gotham256
"let g:airline_theme='gotham256'
"let g:airline_powerline_fonts = 0
" lightline
set laststatus=2
"let g:lightline = { 'colorscheme': 'gotham256' }
set noshowmode
" Cursor line
set cursorline
hi CursorLine guibg=Grey10
" Line numbers
set number
" Enable mouse support
set mouse=a
" Wild menu
set wildmenu
set wildchar=<TAB>
set wildignore+=*.DS_STORE,*.db
" Encoding
set encoding=utf-8
" Syntax
syntax on
" Nextflow syntax highlighting
au BufNewFile,BufRead *.nf set filetype=groovy
" Indentation, spaces and tabs
filetype indent on
set tabstop=4
set softtabstop=4
set expandtab
set shiftwidth=4
set list
set listchars=tab:›\ ,trail:.,extends:#,nbsp:.
set wrap
set backspace=indent,eol,start
" Do not comment new lines automatically
autocmd BufNewFile,BufRead,FileType,OptionSet * set formatoptions-=cro
autocmd BufNewFile,BufRead,FileType,OptionSet * setlocal formatoptions-=cro
" Search
set ignorecase
set hlsearch
set incsearch
" Misc
set showmatch
set showmode
set showcmd
" Different cursors for insert vs other mode
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
" Use the clipboard register for yank, delete and put
" noremap y "+y
" vnoremap y "+y
" noremap yy "+yy
" vnoremap yy "+yy
" noremap d "+d
" vnoremap d "+d
" noremap dd "+dd
" vnoremap dd "+dd
" noremap p "+p
" vnoremap p "+p