-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
295 lines (247 loc) · 7.34 KB
/
vimrc
File metadata and controls
295 lines (247 loc) · 7.34 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
" General Options ------------- {{{
set nocompatible
set nobackup
set noswapfile
set ignorecase
set smartcase
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
syntax on
set number
set showmatch
set novisualbell
set noerrorbells
set noruler
set showcmd
set foldenable
set foldmethod=marker
filetype plugin indent on
set foldlevelstart=0
let mapleader = ","
let maplocalleader = "º"
nnoremap <leader>N :setlocal number!<cr>
nnoremap <leader>q ysiw
noremap mm :NERDTreeToggle<CR>
set timeoutlen=200 ttimeoutlen=0
" display extra whitespaces
"set list
"set listchars=trail:.
" }}}
" Color Scheme ----------------- {{{
" colorscheme casu
set t_Co=256
colorscheme fu
" }}}
" Search ------------ {{{
set hlsearch incsearch
noremap <silent><leader>. :nohlsearch<cr>
" }}}
" Syntax higlight ---- {{{
" Trailing whitespaces
highlight trailingWhitespaces ctermbg=green guibg=green
nnoremap <leader>w :match trailingWhitespaces /\v +$/<cr>
nnoremap <leader>W :match trailingWhitespaces //<cr>
" Syntax check
" let g:syntastic_quiet_messages = { "level": "warnings" }
let g:syntastic_disabled_filetypes=['html']
let g:syntastic_ignore_files = ['\m\.html$']
"let g:syntastic_javascript_checkers = ['eslint']
" autocmd FileType javascript let b:syntastic_checkers = findfile('.eslintrc.js', '.;') !=# '' ? ['eslint'] : []
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_loc_list_height = 5
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 1
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_error_symbol = '❌'
let g:syntastic_style_error_symbol = '⁉️'
let g:syntastic_warning_symbol = '⚠️'
let g:syntastic_style_warning_symbol = '💩'
highlight link SyntasticErrorSign SignColumn
highlight link SyntasticWarningSign SignColumn
highlight link SyntasticStyleErrorSign SignColumn
highlight link SyntasticStyleWarningSign SignColumn
let g:jsx_ext_required = 0
" }}}
" Bundle configuration ---------- {{{
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" alternatively, pass a path where Vundle should install bundles
"let path = '~/some/path/here'
"call vundle#rc(path)
" let Vundle manage Vundle, required
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'jQuery'
Bundle 'SuperTab'
Bundle 'scrooloose/syntastic'
Bundle 'scrooloose/nerdtree'
Bundle 'jistr/vim-nerdtree-tabs'
Bundle 'ragtag.vim'
Bundle 'http://github.com/rstacruz/sparkup.git', {'rtp': 'vim/'}
Bundle 'surround.vim'
Bundle 'kien/ctrlp.vim'
"Bundle 'vim-scripts/Conque-Shell'
Bundle 'docteurklein/vim-symfony'
Bundle 'xolox/vim-misc'
Bundle 'xolox/vim-notes'
Bundle 'docteurklein/php-getter-setter.vim'
"Bundle 'pangloss/vim-javascript'
"Bundle 'othree/javascript-libraries-syntax.vim'
Bundle 'matthewsimo/angular-vim-snippets'
Bundle 'tpope/vim-rails'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'tpope/vim-unimpaired'
Bundle 'lrvick/Conque-Shell'
Bundle 'moll/vim-node'
"Plugin 'Valloric/YouCompleteMe'
Plugin 'isRuslan/vim-es6'
Plugin 'mxw/vim-jsx'
Plugin 'pangloss/vim-javascript'
" }}}
" NERDTree Configuration ---------- {{{
noremap <F2> :NERDTreeToggle<CR>
noremap <F3> :NERDTreeFind<CR>:NERDTreeTabsOpen<CR>
let g:nerdtree_tabs_open_on_console_startup=0
let g:NERDTreeDirArrows = 1
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
let g:NERDTreeGlyphReadOnly = 1
" }}}
" Ctrl-P Configuration -------- {{{
let g:ctrlp_show_hidden = 1
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|public$|log\|tmp\|vendor\|cache$\|node_modules\|bower_components\|target\|coverage\|android\|ios',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
" }}}
" Buffers and Windows mappings --------- {{{
noremap <F4> :bp<CR>
noremap <F5> :bn<CR>
""" Windows
" Movimiento entre ventanas
noremap <C-l> <C-w>l
noremap <C-k> <C-w>k
noremap <C-j> <C-w>j
noremap <C-h> <C-w>h
" Windows sizes
noremap <C-left> 3<C-w><
noremap <C-right> 3<C-w>>
noremap <C-up> 3<C-w>+
noremap <C-down> 3<C-w>-
" Switcheos horizontales y verticales
nnoremap <Leader>l <C-w>L
nnoremap <Leader>k <C-w>K
nnoremap <Leader>j <C-w>J
nnoremap <Leader>h <C-w>H
nnoremap <Leader>- <C-w>-
nnoremap <Leader>+ <C-w>+
" Maximizar una ventana vertical y horizontalmente
nnoremap <Leader>m <C-w>\|<C-w>_
nnoremap <Leader>n <C-w>=
" MiniBufExpl
"nnoremap <Leader>b :MBEToggle<cr>
" }}}
" Vim-notes plugin configuration ---------- {{{
noremap <C-t> <C-w>s:Note TODO Tasks:<CR>10<C-w>-
"au! BufNew * :if &ft=='notes' | res 10 | endif
" }}}
" Mappings para el modo insert ---------- {{{
" Paso a mayusculas la palabra que acabo de escribir
inoremap <c-u> <esc>vbUea
" Mapeo 'jk' para pasar del modo "insert" a "normal"
inoremap jk <esc>
" Autocompletado de llaves - Lo comento porque no es muy practico :-P
" inoremap { {}<esc>ha<cr><esc>kA<cr>
" }}}
" 'Forzamos' las nuevas costumbres ---------- {{{
" Me fuerzo la costumbre deshabilitando <esc> :-P
" inoremap <esc> <nop>
" Lo mismo para las flechitas
" noremap <left> <nop>
" noremap <right> <nop>
" noremap <up> <nop>
" noremap <down> <nop>
" }}}
" Operator pending mappings ----------{{{
" Operar sobre la seleccion en el siguiente/anterior par de ()
onoremap in( :<c-u>normal! f(vi<cr>
onoremap il( :<c-u>normal! F)vi<cr>
" Mappings para editar rapido el .vimrc
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" }}}
" Mappings utiles ---------- {{{
" Mappings para "wrappear" texto
vnoremap <leader>" <esc>`<i"<esc>`>a"<esc>
vnoremap <leader>' <esc>`<i'<esc>`>a'<esc>
" Ir al principio y al final de la linea actual
nnoremap H ^
nnoremap L $
" JSON beautify
nmap =j :%!python -m json.tool<CR>
" Abreviaturas
iabbrev @@ info@casu-net.com.ar
iabbrev ccopy Copyright 2014 Gabriel Casullo, all rights reserved
" }}}
" Status Line ---------- {{{
set statusline=%n-\ " Buffer number
set statusline+=%f " Path to the file
set statusline+=%= " Switch to the right side
set statusline+=%l " Current line
set statusline+=/ " Separator
set statusline+=%L " Total lines
" }}}
" Autocommands ----------- {{{
augroup filetype_htmltwig
autocmd!
autocmd BufNewFile,BufRead *.html.twig set syntax=htmltwig
augroup END
" }}}
" Vimscript file settings ------------- {{{
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}
" Sessions ---------- {{{
noremap <F6> :mksession ~/.vim/sessions/last-session.vim<cr>
"noremap <F7> :source ~/.vim/sessions/last-session.vim<cr>
" }}}
" Function keys for TERM=xterm in osX ------------- {{{
map <Esc>OP <F1>
map <Esc>OQ <F2>
map <Esc>OR <F3>
map <Esc>OS <F4>
map <Esc>[16~ <F5>
map <Esc>[17~ <F6>
map <Esc>[18~ <F7>
map <Esc>[19~ <F8>
map <Esc>[20~ <F9>
map <Esc>[21~ <F10>
map <Esc>[23~ <F11>
map <Esc>[24~ <F12>
" }}}
" Snippets ------------- {{{
":source ~/.vim/snippets/html.snippets
" }}}
" Nodejs debugging ------------- {{{
"
" please install ConqueShell (https://github.com/lrvick/Conque-Shell)
function! DebugJs()
let cmd="node --debug-brk "
if( expand('%:e') == "coffee")
let cmd="coffee --nodejs --debug-brk "
endif
"exec "silent ConqueTermVSplit bash -ic \"(" . cmd . @% . " &) ; sleep 1s && node-vim-inspector\""
exec "silent ConqueTermVSplit bash -ic \"node-vim-inspector\""
endfunction
" launch debug on ctrl-d
nnoremap <C-d> :call DebugJs()<CR>
" }}}