Last active
August 12, 2022 01:29
-
-
Save ivanlynch/274c2ca8646287dc783a67fbbb14e3b7 to your computer and use it in GitHub Desktop.
Vim configuration
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 clipboard=unnamed | |
set ruler | |
set shiftwidth=2 | |
set mouse=a | |
set cursorline | |
set number | |
"set completeopt=menu,noinsert | |
set encoding=utf-8 | |
"set hidden | |
"set nobackup | |
"set nowritebackup | |
"set cmdheight=2 | |
"set updatetime=300 | |
"set shortmess+=c | |
call plug#begin('~/.config/nvim/plugged') | |
" Github Copilot | |
Plug 'github/copilot.vim' | |
" Terminal management tmux | |
"Plug 'christoomey/vim-tmux-navigator' | |
" Snippets | |
Plug 'honza/vim-snippets' | |
" Tag along | |
Plug 'AndrewRadev/tagalong.vim' | |
" Syntax highlight | |
Plug 'sheerun/vim-polyglot' | |
" CSS Colorizer | |
Plug 'ap/vim-css-color' | |
" Status Bar | |
Plug 'maximbaz/lightline-ale' | |
Plug 'itchyny/lightline.vim' | |
" Themes | |
Plug 'morhetz/gruvbox' | |
"Plug 'shinchu/lightline-gruvbox.vim' | |
" Tailwind CSS | |
Plug 'iamcco/coc-tailwindcss', {'do': 'yarn install --frozen-lockfile && yarn run build'} | |
" Tree | |
Plug 'scrooloose/nerdtree' | |
" Fuzzy Finder | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
" Conquer of completion | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
" Identline | |
Plug 'yggdroot/indentline' | |
" Comentarios | |
Plug 'scrooloose/nerdcommenter' | |
" LSP | |
Plug 'neovim/nvim-lspconfig' | |
" Autopairs | |
Plug 'jiangmiao/auto-pairs' | |
call plug#end() | |
colorscheme gruvbox | |
let mapleader=" " | |
let NERDTreeQuitOnOpen=1 | |
nnoremap <Leader>w :w<CR> | |
nnoremap <Leader>q :q<CR> | |
nnoremap <Leader>nt :NERDTreeFind<CR> | |
" Conquer of completion keymaps | |
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) | |
"Este sirve para mover las lineas arriba o abajo precionando alt | |
nnoremap ∆ :m .+1<CR>== | |
nnoremap ˚ :m .-2<CR>== | |
inoremap ∆ <Esc>:m .+1<CR>==gi | |
inoremap ˚ <Esc>:m .-2<CR>==gi | |
vnoremap ∆ :m '>+1<CR>gv=gv | |
vnoremap ˚ :m '<-2<CR>gv=gv | |
" Buscar texto en archivos dentro del directorio CTRL + P | |
nmap <C-p> :Ag<CR> | |
" Buscar archivos dentro del repositorio git CTRL + G | |
nmap <C-g> :GFiles<CR> | |
" Buscar archivos dentro de una carpeta CTRL + F | |
nmap <C-f> :Files<CR> | |
" coc config | |
let g:coc_global_extensions = [ | |
\ 'coc-snippets', | |
\ 'coc-pairs', | |
\ 'coc-tsserver', | |
\ 'coc-eslint', | |
\ 'coc-prettier', | |
\ 'coc-json', | |
\ ] | |
" Setup for prettier | |
command! -nargs=0 Prettier :call CocAction('runCommand', 'prettier.formatFile') | |
let g:NERDTreeIgnore = ['^node_modules$'] | |
" sync open file with NERDTree | |
" " Check if NERDTree is open or active | |
function! IsNERDTreeOpen() | |
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1) | |
endfunction | |
let g:NERDTreeFileExtensionHighlightFullName = 1 | |
let g:NERDTreeExactMatchHighlightFullName = 1 | |
let g:NERDTreePatternMatchHighlightFullName = 1 | |
nmap ++ <Plug>NERDCommenterToggle | |
" Use <C-l> for trigger snippet expand. | |
imap <C-l> <Plug>(coc-snippets-expand) | |
" Use <C-j> for select text for visual placeholder of snippet. | |
vmap <C-j> <Plug>(coc-snippets-select) | |
" Use <C-j> for jump to next placeholder, it's default of coc.nvim | |
let g:coc_snippet_next = '<c-j>' | |
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim | |
let g:coc_snippet_prev = '<c-k>' | |
" Use <C-j> for both expand and jump (make expand higher priority.) | |
imap <C-j> <Plug>(coc-snippets-expand-jump) | |
" Copy text to clipboard | |
noremap <Leader>y "*y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment