|
| 1 | +" Inicializar Plug |
| 2 | +call plug#begin('~/.vim/plugged') |
| 3 | + |
| 4 | +" Plugins |
| 5 | +Plug 'easymotion/vim-easymotion' |
| 6 | +Plug 'preservim/nerdtree' |
| 7 | +Plug 'rakr/vim-one' |
| 8 | +Plug 'ryanoasis/vim-devicons' |
| 9 | +Plug 'morhetz/gruvbox' |
| 10 | +Plug 'sheerun/vim-polyglot' |
| 11 | +Plug 'liuchengxu/vim-which-key' |
| 12 | +Plug 'christianrickert/vim-firefly' |
| 13 | +Plug 'vim-airline/vim-airline' |
| 14 | +Plug 'vim-airline/vim-airline-themes' |
| 15 | +Plug 'chxuan/vimplus-startify' |
| 16 | +Plug 'junegunn/fzf' |
| 17 | +Plug 'junegunn/fzf.vim' |
| 18 | +Plug 'tpope/vim-commentary' |
| 19 | +Plug 'SirVer/ultisnips' |
| 20 | +Plug 'honza/vim-snippets' |
| 21 | +Plug 'neoclide/coc.nvim', {'branch': 'release'} |
| 22 | +Plug 'tpope/vim-fugitive' |
| 23 | +Plug 'airblade/vim-gitgutter' |
| 24 | +Plug 'mattn/emmet-vim' |
| 25 | + |
| 26 | +call plug#end() |
| 27 | +let g:deoplete#enable_at_startup = 1 |
| 28 | +let g:gitgutter_enabled = 1 |
| 29 | + |
| 30 | +" Registro de teclas en which-key para el local leader |
| 31 | +autocmd! User vim-which-key call which_key#register(',', 'g:which_key_map') |
| 32 | +" Configuración general |
| 33 | +set relativenumber |
| 34 | +set showcmd |
| 35 | +set showmatch |
| 36 | +set tabpagemax=10 |
| 37 | +set showtabline=2 |
| 38 | +set laststatus=2 |
| 39 | +set timeoutlen=500 |
| 40 | +let g:EasyMotion_do_mapping = 0 |
| 41 | +let g:EasyMotion_max_count = 3 |
| 42 | +let g:coc_disable_startup_warning = 1 |
| 43 | +" Configuración de colores y temas |
| 44 | +colorscheme firefly |
| 45 | +let g:dark_transp_bg = 0 |
| 46 | +if (has("termguicolors")) |
| 47 | + set termguicolors |
| 48 | +endif |
| 49 | + |
| 50 | +" Configuración de Airline |
| 51 | +let g:airline_theme = 'dark' |
| 52 | +let g:airline_powerline_fonts = 1 |
| 53 | +let g:airline#extensions#tabline#enabled = 1 |
| 54 | +let g:airline#extensions#tabline#fnamemod = ':t' |
| 55 | +let g:airline#extensions#tabline#left_sep = ' ' |
| 56 | +let g:airline#extensions#tabline#left_alt_sep = '|' |
| 57 | + |
| 58 | +" Configuración de NERDTree |
| 59 | +let g:nerdtree_tabs_open_on_console_startup = 1 |
| 60 | +let g:nerdtree_tabs_autoclose = 1 |
| 61 | + |
| 62 | +" Configuración de which-key |
| 63 | +let mapleader = "\<Space>" |
| 64 | +let g:maplocalleader = ',' |
| 65 | +let g:which_key_map = {} |
| 66 | +let g:which_key_map['f'] = { |
| 67 | + \ 'name' : '+files' , |
| 68 | + \ 'f' : [':tabnew | :Files', 'New tab and file'], |
| 69 | + \ 'g' : [':GFiles', 'Git Files'], |
| 70 | + \ 'b' : [':Buffers', 'Buffer Files'], |
| 71 | + \ 'r' : [':Rg', 'Grep Files'], |
| 72 | + \ 'h': [':History', 'Search command history with fzf'], |
| 73 | + \ 'l': [':Lines', 'Search lines in files with fzf'], |
| 74 | + \ } |
| 75 | + |
| 76 | +let g:which_key_map['t'] = { |
| 77 | + \ 'name' : '+tabs' , |
| 78 | + \ 'n' : [':tabnew', 'New tab'], |
| 79 | + \ 't' : [':Buffers Tabs', ':tabs'], |
| 80 | + \ 'd' : [':tabnew | split', 'Split tab'], |
| 81 | + \ 'o' : [':tabnew #', 'Reopen last closed tab'], |
| 82 | + \ } |
| 83 | + |
| 84 | +let g:which_key_map['m'] = { |
| 85 | + \ 'name': '+easymotion', |
| 86 | + \ 's': ['<Plug>(easymotion-s)', 'Search character'], |
| 87 | + \ 'f': ['<Plug>(easymotion-f)', 'Search character in direction'], |
| 88 | + \ } |
| 89 | +let g:which_key_map['w'] = { |
| 90 | + \ 'name': '+windows', |
| 91 | + \ 'h': [':wincmd h', 'Move to left window'], |
| 92 | + \ 'j': [':wincmd j', 'Move to bottom window'], |
| 93 | + \ 'k': [':wincmd k', 'Move to top window'], |
| 94 | + \ 'l': [':wincmd l', 'Move to right window'], |
| 95 | + \ 's': [':split', 'Split window horizontally'], |
| 96 | + \ 'v': [':vsplit', 'Split window vertically'], |
| 97 | + \ 'c': [':close', 'Close current window'], |
| 98 | + \ 'o': [':only', 'Close all other windows'], |
| 99 | + \ 'm': [':resize +5', 'Increase window height'], |
| 100 | + \ 'n': [':resize -5', 'Decrease window height'], |
| 101 | + \ 'd': [':resize +10', 'Increase window height'], |
| 102 | + \ 'u': [':resize -10', 'Decrease window height'], |
| 103 | + \ } |
| 104 | +let g:which_key_map['p'] = { |
| 105 | + \ 'name': '+plugins', |
| 106 | + \ 'i': [':PlugInstall', 'Install plugins'], |
| 107 | + \ 'u': [':PlugUpdate', 'Update plugins'], |
| 108 | + \ 'c': [':PlugClean', 'Clean unused plugins'], |
| 109 | + \ } |
| 110 | +let g:which_key_map['g'] = { |
| 111 | + \ 'name': '+git', |
| 112 | + \ 's': [':Gstatus', 'Git status'], |
| 113 | + \ 'd': [':Gdiff', 'Git diff'], |
| 114 | + \ 'c': [':Gcommit', 'Git commit'], |
| 115 | + \ 'p': [':Gpush', 'Git push'], |
| 116 | + \ 'l': [':Gpull', 'Git pull'], |
| 117 | + \ } |
| 118 | + |
| 119 | +" Mapeo de comandos de GitGutter |
| 120 | +let g:which_key_map['h'] = { |
| 121 | + \ 'name': '+gitgutter', |
| 122 | + \ 'p': [':GitGutterPreviewHunk', 'Preview hunk'], |
| 123 | + \ 'n': [':GitGutterNextHunk', 'Next hunk'], |
| 124 | + \ 'P': [':GitGutterPrevHunk', 'Previous hunk'], |
| 125 | + \ } |
| 126 | +let g:which_key_map['c'] = { |
| 127 | + \ 'name': '+coc.nvim', |
| 128 | + \ 'e': [':CocCommand explorer', 'Open Explorer'], |
| 129 | + \ 'r': [':CocCommand rename', 'Rename Symbol'], |
| 130 | + \ 'f': [':CocCommand prettier.formatFile', 'Format Document with Prettier'], |
| 131 | + \ 'a': [':CocCommand eslint.executeAutofix', 'Fix ESLint Issues'], |
| 132 | + \ 'd': [':CocDiagnostics', 'Diagnostics'], |
| 133 | + \ 's': [':CocCommand workspace.showOutput', 'Show Output'], |
| 134 | + \ } |
| 135 | + |
| 136 | +let g:which_key_map[' '] = [':Files', 'search files'] |
| 137 | +" Atajos de teclado |
| 138 | +nnoremap <silent> <Leader><Space> :WhichKey '<Space>'<CR> |
| 139 | +nnoremap <silent> <space>e :NERDTreeToggle<CR> |
| 140 | +"nnoremap <silent> <Leader>s :PlugStatus<CR> |
| 141 | +nnoremap <S-H> :tabprevious<CR> |
| 142 | +nnoremap <S-L> :tabnext<CR> |
| 143 | +nnoremap <silent> <localleader> :<c-u>WhichKey ','<CR> |
| 144 | +nnoremap <S-n> :tabnew<CR>:file<CR> |
| 145 | +nnoremap <S-d> :tabclose<CR> |
| 146 | +nmap s <Plug>(easymotion-s) |
| 147 | +inoremap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" |
| 148 | +inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<C-h>" |
| 149 | +nnoremap <C-h> :wincmd h<CR> |
| 150 | +nnoremap <C-j> :wincmd j<CR> |
| 151 | +nnoremap <C-k> :wincmd k<CR> |
| 152 | +nnoremap <C-l> :wincmd l<CR> |
| 153 | +" Usar <Tab> para navegar por las opciones de autocompletado |
| 154 | +inoremap <silent><expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" |
| 155 | +inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
| 156 | +inoremap <silent><expr> <CR> pumvisible() ? coc#_select_confirm() : "\<CR>" |
| 157 | +" Mapear Enter para confirmar selección en pumvisible |
| 158 | +inoremap <silent><expr> <CR> pumvisible() ? coc#_select_confirm() : "\<CR>" |
| 159 | +
|
| 160 | +" Mapear Ctrl+S para guardar el archivo |
| 161 | +noremap <silent> <C-s> :w<CR> |
| 162 | +
|
| 163 | +" Configuración de vimplus-startify |
| 164 | +let g:startify_custom_header = [ |
| 165 | + \ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣤⣤⣤⣤⡼⠀⢀⡀⣀⢱⡄⡀⠀⠀⠀⢲⣤⣤⣤⣤⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', |
| 166 | + \ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣴⣾⣿⣿⣿⣿⣿⡿⠛⠋⠁⣤⣿⣿⣿⣧⣷⠀⠀⠘⠉⠛⢻⣷⣿⣽⣿⣿⣷⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀', |
| 167 | + \ '⠀⠀⠀⠀⠀⠀⢀⣴⣞⣽⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠠⣿⣿⡟⢻⣿⣿⣇⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣟⢦⡀⠀⠀⠀⠀⠀⠀', |
| 168 | + \ '⠀⠀⠀⠀⠀⣠⣿⡾⣿⣿⣿⣿⣿⠿⣻⣿⣿⡀⠀⠀⠀⢻⣿⣷⡀⠻⣧⣿⠆⠀⠀⠀⠀⣿⣿⣿⡻⣿⣿⣿⣿⣿⠿⣽⣦⡀⠀⠀⠀⠀', |
| 169 | + \ '⠀⠀⠀⠀⣼⠟⣩⣾⣿⣿⣿⢟⣵⣾⣿⣿⣿⣧⠀⠀⠀⠈⠿⣿⣿⣷⣈⠁⠀⠀⠀⠀⣰⣿⣿⣿⣿⣮⣟⢯⣿⣿⣷⣬⡻⣷⡄⠀⠀⠀', |
| 170 | + \ '⠀⠀⢀⡜⣡⣾⣿⢿⣿⣿⣿⣿⣿⢟⣵⣿⣿⣿⣷⣄⠀⣰⣿⣿⣿⣿⣿⣷⣄⠀⢀⣼⣿⣿⣿⣷⡹⣿⣿⣿⣿⣿⣿⢿⣿⣮⡳⡄⠀⠀', |
| 171 | + \ '⠀⢠⢟⣿⡿⠋⣠⣾⢿⣿⣿⠟⢃⣾⢟⣿⢿⣿⣿⣿⣾⡿⠟⠻⣿⣻⣿⣏⠻⣿⣾⣿⣿⣿⣿⡛⣿⡌⠻⣿⣿⡿⣿⣦⡙⢿⣿⡝⣆⠀', |
| 172 | + \ '⠀⢯⣿⠏⣠⠞⠋⠀⣠⡿⠋⢀⣿⠁⢸⡏⣿⠿⣿⣿⠃⢠⣴⣾⣿⣿⣿⡟⠀⠘⢹⣿⠟⣿⣾⣷⠈⣿⡄⠘⢿⣦⠀⠈⠻⣆⠙⣿⣜⠆', |
| 173 | + \ '⢀⣿⠃⡴⠃⢀⡠⠞⠋⠀⠀⠼⠋⠀⠸⡇⠻⠀⠈⠃⠀⣧⢋⣼⣿⣿⣿⣷⣆⠀⠈⠁⠀⠟⠁⡟⠀⠈⠻⠀⠀⠉⠳⢦⡀⠈⢣⠈⢿⡄', |
| 174 | + \ '⣸⠇⢠⣷⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⠿⠿⠋⠀⢻⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⢾⣆⠈⣷', |
| 175 | + \ '⡟⠀⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣶⣤⡀⢸⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⡄⢹', |
| 176 | + \ '⡇⠀⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⠈⣿⣼⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠃⢸', |
| 177 | + \ '⢡⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⠶⣶⡟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡼', |
| 178 | + \ '⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡾⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁', |
| 179 | + \ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡁⢠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀', |
| 180 | + \ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⣿⣼⣀⣠⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀' |
| 181 | +\ ] |
| 182 | + |
| 183 | + |
| 184 | +let g:startify_align_center = 1 |
| 185 | +let g:startify_lists = [ |
| 186 | + \ { 'type': 'files', 'header': [' Recientes'] }, |
| 187 | + \ { 'type': 'dir', 'header': [' Directorio '. getcwd()] }, |
| 188 | + \ { 'type': 'sessions', 'header': [' Sesiones'] }, |
| 189 | + \ { 'type': 'bookmarks', 'header': [' Marcadores'] }, |
| 190 | + \ ] |
| 191 | +" Configuración para coc.nvim |
| 192 | +let g:coc_global_extensions = [ |
| 193 | + \ 'coc-json', |
| 194 | + \ 'coc-tsserver', |
| 195 | + \ 'coc-html', |
| 196 | + \ 'coc-css', |
| 197 | + \ 'coc-eslint', |
| 198 | + \ 'coc-prettier', |
| 199 | + \ ] |
| 200 | + |
| 201 | +" Registro de teclas en which-key |
| 202 | +call which_key#register('<Space>', "g:which_key_map") |
0 commit comments