Last active
December 8, 2019 18:03
-
-
Save LorhanSohaky/6b76a5becfd2be72ba8cc60536f87e53 to your computer and use it in GitHub Desktop.
.vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set smarttab | |
set cindent | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set encoding=UTF-8 | |
syntax on | |
" Specify a directory for plugins | |
call plug#begin('~/.vim/plugged') | |
Plug 'vim-airline/vim-airline' | |
Plug 'tpope/vim-fugitive' | |
Plug 'scrooloose/nerdcommenter' "Para comentar linhas | |
Plug 'joshdick/onedark.vim' "Tema | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'scrooloose/nerdtree' " Menu lateral | |
Plug 'HerringtonDarkholme/yats.vim' | |
Plug 'xuyuanp/nerdtree-git-plugin' | |
Plug 'ctrlpvim/ctrlp.vim' "CTRL-P | |
Plug 'tiagofumo/vim-nerdtree-syntax-highlight' " Menu lateral bonitinho | |
Plug 'ryanoasis/vim-devicons' " Icones para o menu lateral | |
Plug 'airblade/vim-gitgutter' " Linha modificada | |
call plug#end() | |
colorscheme onedark | |
nmap <C-n> :NERDTreeToggle<CR> | |
vmap <C-_> <plug>NERDCommenterToggle | |
nmap <C-_> <plug>NERDCommenterToggle | |
let g:NERDTreeIgnore = ['^node_modules$'] | |
" coc config | |
let g:coc_global_extensions = [ | |
\ 'coc-snippets', | |
\ 'coc-pairs', | |
\ 'coc-tsserver', | |
\ 'coc-eslint', | |
\ 'coc-prettier', | |
\ 'coc-json', | |
\ ] | |
" Use tab for trigger completion with characters ahead and navigate. | |
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin. | |
inoremap <silent><expr> <TAB> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<TAB>" : | |
\ coc#refresh() | |
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | |
function! s:check_back_space() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~# '\s' | |
endfunction | |
" Use K to show documentation in preview window | |
nnoremap <silent> K :call <SID>show_documentation()<CR> | |
function! s:show_documentation() | |
if (index(['vim','help'], &filetype) >= 0) | |
execute 'h '.expand('<cword>') | |
else | |
call CocAction('doHover') | |
endif | |
endfunction | |
nmap <F2> <Plug>(coc-rename) | |
" Remap keys for gotos | |
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) | |
" Use `:Format` to format current buffer | |
command! -nargs=0 Format :call CocAction('format') | |
let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist)|(\.(swp|ico|git|svn))$' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment