-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
127 lines (99 loc) · 2.71 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
" PLUGIN MANAGER 'vim-plug/junegunn' :PlugInstall :PlugClean :PlugStatus
set nu relativenumber
set mouse=a
set numberwidth=1
set clipboard=unnamedplus
syntax enable
set showcmd
set nowrap
set ruler
set encoding=utf-8
set showmatch
set sw=4
set laststatus=2
"set smartindent
set incsearch
set hlsearch
set smartcase
set ignorecase
set splitright
" -- HTML TEMPLATE
autocmd BufNewFile *.html 0r ~/.vim/templates/html.skel
" -- AUTOCOMPLETION
filetype plugin on
set omnifunc=syntaxcomplete#Complete
" -- AUTOMATED vim-plug INSTALLATION
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
" -- INIT PLUGINS--
call plug#begin('~/.vim/plugged')
" STATUS BAR
Plug 'maximbaz/lightline-ale'
Plug 'itchyny/lightline.vim'
" IDE
Plug 'easymotion/vim-easymotion'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
"Plug 'terryma/vim-multiple-cursors' ( otro de cursores multiples )
" COMMENTS
Plug 'preservim/nerdcommenter'
" HIGHLIGHT LANGUAGES
Plug 'sheerun/vim-polyglot'
" TYPING
Plug 'jiangmiao/auto-pairs'
Plug 'alvan/vim-closetag'
"Plug 'tpope/vim-surround'
" TMUX
"Plug 'benmills/vimux'
Plug 'christoomey/vim-tmux-navigator'
" AUTOCOMPLETION
"Plug 'sirver/ultisnips'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Tree & navigation
Plug 'scrooloose/nerdtree'
let NERDTreeQuitOnOpen=1
let g:EasyMotion_smartcase=1
let g:closetag_filenames = "*.html,*.xhtml,*.phtml,*.php,*.jsx"
command! -nargs=0 Prettier :CocCommand prettier.forceFormatDocument
call plug#end()
" --END PLUGINS--
let mapleader=' '
" Plugin maps
map <Leader>nt :NERDTreeFind<CR>
map <Leader>s <Plug>(easymotion-s2)
" Search files references
map <Leader>p :Files<CR>
" Search function or variable references
noremap <Leader>gs :CocSearch
" Split & split resize
nnoremap <Leader>j :sp<CR>
nnoremap <Leader>l :vsp<CR>
nnoremap <Leader>> 10<C-w>>
nnoremap <Leader>< 10<C-w><
map <S-t> :vert:term<CR>
map <Leader>t :term<CR>
" Quick save & quit
nnoremap <Leader>w :w<CR>
nnoremap <Leader>q :q<CR>
" Go to's
nmap <silent>gd <Plug>(coc-definition)
nmap <silent>gy <Plug>(coc-type-definition)
nmap <silent>gi <Plug>(coc-implementation)
nmap <silent>gr <Plug>(coc-references)
" Format code
nmap <leader>f :Prettier<CR>
" Faster scrolling
nnoremap <S-j> 10j
nnoremap <S-k> 10k
nnoremap <S-l> $
nnoremap <S-h> ^
" Run current file
nnoremap <Leader>x :!node %<cr>
" Current path to clipboard
nnoremap <Leader>r :.!pwd<CR>
" Easy ESC
:imap jk <Esc>