-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
236 lines (185 loc) · 5.11 KB
/
.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
set runtimepath^=~/.vim
let &packpath = &runtimepath
call plug#begin('~/.config/nvim/plugged')
" Syntax / Autocomplete Plugs
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'neoclide/vim-jsx-improve'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Go Plugs
Plug 'fatih/vim-go'
Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' }
Plug 'zchee/deoplete-go', { 'do': 'make'}
" Search Plugs
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'haya14busa/incsearch.vim'
" Git Plugs
Plug 'tpope/vim-fugitive'
Plug 'idanarye/vim-merginal'
Plug 'jreybert/vimagit'
Plug 'airblade/vim-gitgutter'
" Shortcut Plugs
Plug 'Raimondi/delimitMate'
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-commentary'
Plug 'mattn/emmet-vim'
Plug 'tpope/vim-surround'
Plug 'wellle/targets.vim'
" Statusline / Filetree Plugs
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
" Style Plugs
Plug 'ryanoasis/vim-devicons'
Plug 'Yggdroot/indentLine'
" Linting / Cleaning Plugs
Plug 'w0rp/ale'
Plug 'ntpeters/vim-better-whitespace'
" Colorschemes
Plug 'mkarmona/colorsbox'
Plug 'exitface/synthwave.vim'
Plug 'nanotech/jellybeans.vim'
Plug 'jacoborus/tender.vim'
call plug#end()
syntax on
set statusline=%f
set statusline+=%{fugitive#statusline()}
set noswapfile
set mouse=a
set scrolloff=1
set number
set cursorline
" Set to auto read when a file is changed from the outside
set autoread
" Tab and space formatting
set tabstop=2
set expandtab
set autoindent
set shiftwidth=2
set shiftround
set copyindent
set smarttab
set smartindent
set nowrap
set encoding=UTF-8
set completeopt-=preview
" git gutter update time
set updatetime=100
" makes tab completion in vim console insanely better
set wildmode=longest,list
" automatically un-highlights when you do anything
let g:incsearch#auto_nohlsearch = 1
let NERDTreeShowHidden = 1
let g:jsx_ext_required = 0
let g:closetag_filenames = '*.html,*.js'
let g:closetag_shortcut = '>'
" Airline settings
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_powerline_fonts = 1
let g:airline_theme = 'jellybeans'
" after a re-source, fix syntax matching issues (concealing brackets):
if exists('g:loaded_webdevicons')
call webdevicons#softRefresh()
endif
" Use deoplete (auto-complete)
let g:deoplete#enable_at_startup = 1
" Tab from the top of autocomplete
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ deoplete#mappings#manual_complete()
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
" Autocomplete across files
set complete=.,b,u,w,t,]
" ALE SETTINGS
" Error and warning signs.
let g:ale_sign_error = '⤫'
let g:ale_sign_warning = '⚠'
" Javascript linting
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
" END ALE SETTINGS
" Set color
colo jellybeans
filetype plugin on
if (has("termguicolors"))
set termguicolors
endif
" Fast saving
nmap <leader>w :w<CR>
nmap <leader>wa :wa<CR>
" Search files and commits
nnoremap <C-A> :Ag<CR>
nnoremap <C-F> :FZF<CR>
nnoremap <C-G> :GFiles<CR>
nnoremap <C-G><C-E> :GFiles?<CR>
nnoremap <C-M> :Commit<CR>
nnoremap <C-T> :Windows<CR>
" Trim white space
nnoremap <C-S><C-T> :StripWhitespace<CR>
"makes nerdtree close if it's the only window left
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Search for text in files
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map # <Plug>(incsearch-nohl-*)
map * <Plug>(incsearch-nohl-#)
map g/ <Plug>(incsearch-stay)
set smartcase
set ignorecase
" highlights all found search terms
set hlsearch
" Go to word or line
map <Space>k <Plug>(easymotion-b)
map <Space>j <Plug>(easymotion-w)
" Buffer settings
set splitbelow
set splitright
set hid
nnoremap <Space>h :bp<CR>
nnoremap <Space>l :bn<CR>
nnoremap <C-B> :Buffers<CR>
nnoremap <C-X> :bd!<CR>
nnoremap rr :source ~/.config/nvim/init.vim<CR>
nnoremap <C-N> :NERDTreeToggle<CR>
" Inserts new line where cursor is without entering insert mode
nnoremap <CR> i<CR><Esc><BS>
" Indent guide
let g:indentLine_char = '⎸'
let g:indentLine_enabled = 1
let g:indentLine_color_gui = '#345260'
" Go SETTINGS
au FileType go set noexpandtab
au FileType go set shiftwidth=4
au FileType go set softtabstop=4
au FileType go set tabstop=4
" Go HIGHLIGHT
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_structs = 1
let g:go_highlight_types = 1
" Highlights same ID use
let g:go_auto_sameids = 1
" snakecase to json tags in Go
let g:go_addtags_transform = "snakecase"
" Go auto import deps
let g:go_fmt_command = "goimports"
" Go show type info in status line
let g:go_auto_type_info = 1
" Go extra lint buffer silence
let g:go_fmt_fail_silently = 1
" clear previous search on start
let @/ = ''