-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
221 lines (176 loc) · 5.21 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
call plug#begin('~/.vim/plugged')
"tema
Plug 'joshdick/onedark.vim'
"air-line
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"coc
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"sintaxe
Plug 'sheerun/vim-polyglot'
"git
Plug 'airblade/vim-gitgutter'
"rainbow
Plug 'luochen1990/rainbow'
"JSX syntax highlighting and indenting
"Plug 'maxmellon/vim-jsx-pretty'
"close tag
"Plug 'mattn/emmet-vim'
"sintaxe sytale components
"Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
"close brackets
Plug 'jiangmiao/auto-pairs'
"tex
Plug 'lervag/vimtex'
"Ale
Plug 'dense-analysis/ale'
call plug#end()
""""""""""""""""""""""""
"configurações iniciais"
""""""""""""""""""""""""
syntax on
colorscheme onedark
set hidden
"set list "mostar caracteres invisíveis
set autoindent "novas linhas herdão a indentação da linha anterior
"set shiftround
"set ignorecase "Maiúsculo = minusculo na pesquisa
"set incsearch "mastra a busca parcial
set number
"set mouse=a
"set title
"set cursorline
"set encoding=utf-8 " Importante para o YCM
"set termguicolors
set wildmenu
set confirm
"set magic
"set ttimeoutlen=0
"configurações iniciais coc
set updatetime=300
""""""""""""""""""""""""
" NerdTree "
""""""""""""""""""""""""
"let NERDTreeMinimalUI=1
""""""""""""""""""""""""
" rainbow "
""""""""""""""""""""""""
let g:rainbow_active = 1
"let g:rainbow_conf = {
"\ 'guifgs': [ '#e5c07b', '#e06c75','Aquamarine', '#c678dd', 'firebrick','lightyellow', 'DeepPink', 'BlueViolet'],
"\ 'ctermfgs': ['lightyellow', 'lightblue', 'lightcyan', 'lightmagenta'],
"\}
""""""""""""""""""""""""
" coc-vim "
""""""""""""""""""""""""
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice.
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
let b:coc_diagnostic_disable = 1
""""""""""""""""""""""""
" cursor "
""""""""""""""""""""""""
if has("autocmd")
au VimEnter,InsertLeave * silent execute '!echo -ne "\e[2 q"' | redraw!
au InsertEnter,InsertChange *
\ if v:insertmode == 'i' |
\ silent execute '!echo -ne "\e[6 q"' | redraw! |
\ elseif v:insertmode == 'r' |
\ silent execute '!echo -ne "\e[4 q"' | redraw! |
\ endif
au VimLeave * silent execute '!echo -ne "\e[ q"' | redraw!
endif
""""""""""""""""""""""""
" vim-airline "
""""""""""""""""""""""""
let g:airline_theme='onedark'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
""""""""""""""""""""""""
" ale "
""""""""""""""""""""""""
let g:ale_linters = {
\'c': ['gcc'],
\'cpp': ['g++']}
"let g:ale_fixers={'python': ['black']}
" \'python': ['python -m mypy'] }
"let g:ale_linters = {'c': ['gcc']}
"let b:ale_fixers = ['prettier', 'eslint']
let g:ale_disable_lsp = 1
let g:ale_lint_on_enter = 0
let g:ale_fix_on_save = 1
let g:ale_fix_on_enter = 0
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 0
"let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
"let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++1z'
"let g:ale_sign_error = '❌'
"let g:ale_sign_warning = '⚠️'
let g:ale_sign_error = '●'
let g:ale_sign_warning = '●'
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
highlight ALEErrorSign ctermbg=NONE ctermfg=red
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow
""""""""""""""""""""""""
" termbug "
""""""""""""""""""""""""
packadd termdebug
let g:termbug_popup = 0
let g:termdebug_wide = 163
""""""""""""""""""""""""
" jsx "
""""""""""""""""""""""""
let g:vim_jsx_pretty_highlight_close_tag = 1
""""""""""""""""""""""""
" jsx "
""""""""""""""""""""""""
let g:user_emmet_settings = {
\ 'javascript' : {
\ 'extends' : 'jsx',
\ },
\}
""""""""""""""""""""""""
" atalhos "
""""""""""""""""""""""""
let mapleader="\<space>"
map Q :quit<CR>
map <leader>; A;<esc>
map <C-q> :quit!<CR>
map <leader>j :bo term<CR>
"movimentação rapida nas abas
map <leader>f <C-6>
map <C-h> :bprevious<CR>
map <C-l> :bnext<CR>
"Movimentação de tela rápida
"nmap <silent> <C-h> <C-w>h
"nmap <silent> <C-j> <C-w>j
"nmap <silent> <C-k> <C-w>k
"nmap <silent> <C-l> <C-w>l
"Quicky space to normal mode
imap jj <esc>
"NERDTree
"nnoremap <leader>n :NERDTreeFocus<CR>
"nnoremap <C-n> :NERDTree<CR>
"nnoremap <C-t> :NERDTreeToggle<CR>
"nnoremap <C-f> :NERDTreeFind<CR>
"seleção híbrida para mostrar o numero de linha
"autocmd InsertEnter * :set norelativenumber
"autocmd InsertLeave * :set relativenumber