-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.init.vim
More file actions
257 lines (221 loc) · 6.65 KB
/
Copy path.init.vim
File metadata and controls
257 lines (221 loc) · 6.65 KB
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
" - - - - - - - - - - - -
" D E P E N D E N C I E S \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
" You need to run ./scripts/install-nvim-dependencies.sh
"
" Then install every plugins with :PluginInstall or :PluginUpdate
"
let g:python_host_prog = '/usr/bin/python'
let g:python3_host_prog = '/usr/bin/python3'
" - - - - - - -
" P L U G I N S \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
call plug#begin('~/.config/nvim/plugged')
" THEMES AND UI
Plug 'liuchengxu/space-vim-dark'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree'
" APPLICATIONS
Plug 'simnalamburt/vim-mundo'
Plug 'kien/ctrlp.vim'
Plug 'jreybert/vimagit'
Plug 'jceb/vim-orgmode'
" COMMANDS
Plug 'rbgrouleff/bclose.vim'
Plug 'tpope/vim-surround'
Plug 'tomtom/tcomment_vim'
Plug 'tpope/vim-speeddating'
" AUTOCOMP AND SNIPPETS
Plug 'w0rp/ale'
Plug 'roxma/nvim-completion-manager'
Plug 'SirVer/ultisnips'
Plug 'jiangmiao/auto-pairs'
Plug 'autozimu/LanguageClient-neovim', { 'do': ':UpdateRemotePlugins' }
Plug 'Shougo/neco-syntax'
"" General
Plug 'honza/vim-snippets'
"" VimScript
Plug 'Shougo/neco-vim'
"" CSS
Plug 'othree/csscomplete.vim'
"" PHP
Plug 'StanAngeloff/php.vim'
Plug 'roxma/LanguageServer-php-neovim', {'do': 'composer install && composer run-script parse-stubs'}
"" JavaScript
Plug 'pangloss/vim-javascript'
Plug 'jelera/vim-javascript-syntax'
Plug 'roxma/nvim-cm-tern', {'do': 'npm install'}
Plug 'roxma/ncm-flow'
""" React.js
Plug 'mxw/vim-jsx'
Plug 'maxmellon/vim-jsx-pretty'
"" Python
Plug 'davidhalter/jedi-vim'
call plug#end()
filetype plugin indent on
" - - - - - - - - - - - - - - - - - - - - - -
" T H E M E & & U S E R I N T E R F A C E \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
syntax enable
set encoding=utf-8
set fileencoding=utf-8
set wildmenu
set relativenumber
set hlsearch
set noerrorbells
set showmatch
set novisualbell
set cursorline
set ttimeoutlen=10
hi Comment cterm=bold
set background=dark
colorscheme space-vim-dark
set colorcolumn=80
highlight ColorColumn ctermbg=234
highlight Normal ctermbg=black
" - - - - - - - - - - - - - - - - - -
" F E E L S & & U T I L I T I E S \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
set autoread
set ignorecase
set nobackup
set nowb
set noswapfile
set smarttab
set tabstop=2
set shiftwidth=2
set expandtab
set hidden
set foldenable
set foldmethod=indent
set foldlevelstart=20
set splitbelow
set splitright
set scrolloff=2
set clipboard+=unnamedplus
set undofile
set undodir=~/.nvim/undo
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" - - - - - - - - - - - - - - - - -
" L A N G U A G E S C O N F I G S \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
" General
" -Omnicompletion
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType c set omnifunc=ccomplete#Complete
set cot-=preview
" PHP
autocmd FileType php set makeprg=php\ -l\ %
autocmd FileType php set errorformat=%m\ in\ %f\ on\ line\ %l
autocmd FileType php LanguageClientStart
function! PhpSyntaxOverride()
hi! def link phpDocTags phpDefine
hi! def link phpDocParam phpType
endfunction
augroup phpSyntaxOverride
autocmd!
autocmd FileType php call PhpSyntaxOverride()
augroup END
" PYTHON
let g:python_support_python3_requirements = add(get(g:,'python_support_python3_requirements',[]),'jedi')
let g:python_support_python3_requirements = add(get(g:,'python_support_python3_requirements',[]),'mistune')
let g:python_support_python3_requirements = add(get(g:,'python_support_python3_requirements',[]),'psutil')
let g:python_support_python3_requirements = add(get(g:,'python_support_python3_requirements',[]),'setproctitle')
" JavaScript
let g:jsx_ext_required = 0
let g:vim_jsx_pretty_colorful_config = 1
" - - - - - - - - - - - - - - -
" P L U G I N S C O N F I G S \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
" Airline
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='violet'
" nvim-completion-manager
let g:cm_refresh_length = 1
let g:cm_matcher_module = "cm_matchers.fuzzy_matcher"
" Ultisnips
let g:UltiSnipsExpandTrigger = "<C-L>"
let g:UltiSnipsJumpForwardTrigger = "<C-N>"
let g:UltiSnipsJumpBackwardTrigger = "<C-P>"
let g:UltiSnipsRemoveSelectModeMappings = 0
" GitGutter
let g:gitgutter_map_keys = 0
" Ale
" let g:ale_javascript_eslint_executable = 'eslint'
let g:ale_javascript_eslint_use_global = 1
" let g:ale_linter_aliases = {'javascript.jsx': 'javascript', 'jsx': 'javascript'}
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
" - - - - - - - - - - - - - -
" C U S T O M M A P P I N G \ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"
let mapleader = "\<Space>"
" Disable C-Z
nnoremap <c-z> <nop>
" Hide search highlight
nnoremap <leader>/ :nohlsearch<CR>
" Start help command in vertical split
nnoremap <leader>h :vert h<space>
" Paste global clipboard to another line
nnoremap <leader>p o<ESC>"+p
nnoremap <leader>P O<ESC>"+p
" Move lines
nnoremap <C-K> ddkP
nnoremap <C-J> ddp
vnoremap <C-K> dkP`[V`]
vnoremap <C-J> dp`[V`]
" Stay in visual mode after indent
vnoremap < <gv
vnoremap > >gv
" Highlight same variable
nnoremap <leader>* *``
" Manipulate terminal
tnoremap <Esc> <C-\><C-n>
tnoremap <C-D> <c-\><c-n>:Bclose!<CR>
" Applications toggle A-
nnoremap <Leader>au :MundoToggle<CR>
nnoremap <Leader>an :NERDTreeToggle<CR>
nnoremap <Leader>ap :CtrlP<CR>
nnoremap <Leader>ag :Magit<CR>
" Manipulate windows W-
nnoremap <leader>wd <C-W>q
nnoremap <leader>wv <C-W>v
nnoremap <leader>ws <C-W>s
nnoremap <leader>wj <C-W><C-J>
nnoremap <leader>wk <C-W><C-K>
nnoremap <leader>wl <C-W><C-L>
nnoremap <leader>wh <C-W><C-H>
nnoremap <leader>wJ <C-W><S-J>
nnoremap <leader>wK <C-W><S-K>
nnoremap <leader>wL <C-W><S-L>
nnoremap <leader>wH <C-W><S-H>
" Manipulate tabs T-
nnoremap <leader>td :tabclose<CR>
nnoremap <leader>tt :tabonly<CR>
nnoremap <leader>tn :tabnew %<CR>
" Manipulate buffers B-
nnoremap <leader>bb :ls<CR>:b<space>
nnoremap <leader>bt <C-^>
nnoremap <leader>bd :Bclose!<CR>
nnoremap gb :bn<CR>
nnoremap gB :bp<CR>
" Error E-
nnoremap <leader>ek :ALEPrevious<CR>
nnoremap <leader>ej :ALENext<CR>
" Toggling between languages L-
nnoremap <leader>lh :set ft=html<CR>
nnoremap <leader>lp :set ft=php<CR>
nnoremap <leader>lj :set ft=javascript<CR>
" Open important files O-
nnoremap <leader>od :e ~/.init.vim<CR>
nnoremap <leader>oa :e ~/.agenda.org<CR>