A segunda parte:
" +++ Shortcuts +++
" Open Buffer
nnoremap l :buffers
" Vertically split screen
nnoremap / :vs
" Split screen
nnoremap - :split
" Delete Current Buffer
nnoremap ’ :bd
" Buffers Navigation
map , :bp
map . :bn
" force reload current file
map r :e!
" Alternate between windows
map e w
“” Faster saving and exiting
nnoremap w :w!
nnoremap q :q!
nnoremap x :x
if has(‘nvim’)
" Source Vim configuration
nnoremap 1 :w! | :source ~/.config/nvim/init.vim
: " Open Vim configuration file for editing
nnoremap 2 :e ~/.config/nvim/init.vim
" Source Vim configuration file and install plugins
nnoremap 3 :source ~/.config/nvim/init.vim | :PlugInstall
else
" Source Vim configuration
nnoremap 1 :w! | :source ~/.vimrc
" Open Vim configuration file for editing
nnoremap 2 :e ~/.vimrc
" Source Vim configuration file and install plugins
nnoremap 3 :source ~/.vimrc | :PlugInstall
endif
" NERDTree Config
nnoremap F :NERDTreeFocus
nnoremap :NERDTree
nnoremap :NERDTreeToggle
nnoremap :NERDTreeFind
" Show hidden files on NERDTree
let NERDTreeShowHidden=1
" Start NERDTree when Vim starts with a directory argument.
" autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists(‘s:std_in’) |
\ execute ‘NERDTree’ argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
" Exit Vim if NERDTree is the only window left.
" autocmd BufEnter * if tabpagenr(’$’) == 1 && winnr(’$’) == 1 && exists(‘b:NERDTree’) && b:NERDTree.isTabTree() |
" \ quit | endif
" AutoRefresh when NERDTreeFocus
autocmd BufEnter NERD_tree_* | execute ‘normal R’
" CoC extensions
let g:coc_global_extensions = [‘coc-tsserver’, ‘coc-json’]
" Add CoC Prettier if prettier is installed
if isdirectory(’./node_modules’) && isdirectory(’./node_modules/prettier’)
let g:coc_global_extensions += [‘coc-prettier’]
endif
" Add CoC ESLint if ESLint is installed
if isdirectory(’./node_modules’) && isdirectory(’./node_modules/eslint’)
let g:coc_global_extensions += [‘coc-eslint’]
endif
" Remap keys for applying codeAction to the current buffer.
nmap da (coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap qf (coc-fix-current)
" coc.vim config
set hidden
set cmdheight=2
set updatetime=300
set shortmess+=c
set signcolumn=yes
nmap gd (coc-definition)
nmap gy (coc-type-definition)
nmap gi (coc-implementation)
nmap gr (coc-references)
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync(‘highlight’)
" Symbol renaming.
nmap rn (coc-rename)
" Use K to show documentation in preview window
nnoremap K :call show_documentation()
function! s:show_documentation()
if (index([‘vim’,‘help’], &filetype) >= 0)
execute ‘h ‘.expand(’’)
else
call CocAction(‘doHover’)
endif
endfunction
" end coc.vim config
let g:fugitive_pty = 0
" filenames like .xml, .html, .xhtml, …
" These are the file extensions where this plugin is enabled.
"
let g:closetag_filenames = '.html,.xhtml,.phtml,*.js’
" filenames like .xml, .xhtml, …
" This will make the list of non-closing tags self-closing in the specified files.
"
let g:closetag_xhtml_filenames = '.xhtml,.jsx’
" filetypes like xml, html, xhtml, …
" These are the file types where this plugin is enabled.
"
let g:closetag_filetypes = ‘html,xhtml,phtml’
" filetypes like xml, xhtml, …
" This will make the list of non-closing tags self-closing in the specified files.
"
let g:closetag_xhtml_filetypes = ‘xhtml,jsx’
" integer value [0|1]
" This will make the list of non-closing tags case-sensitive (e.g. <Link>
will be closed while <link>
won’t.)
"
let g:closetag_emptyTags_caseSensitive = 1
" dict
" Disables auto-close if not in a “valid” region (based on filetype)
"
let g:closetag_regions = {
\ ‘typescript.tsx’: ‘jsxRegion,tsxRegion’,
\ ‘javascript.jsx’: ‘jsxRegion’,
\ ‘javascript.js’: ‘jsxRegion’,
\ ‘typescriptreact’: ‘jsxRegion,tsxRegion’,
\ ‘javascriptreact’: ‘jsxRegion’,
\ }
" Shortcut for closing tags, default is ‘>’
"
let g:closetag_shortcut = ‘>’
" Add > at current position without closing the current tag, default is ‘’
"
let g:closetag_close_shortcut = ‘>’
[karenina@Arch ~]$