Advertisement
d1cor

.config/nvim/init.vim

Jan 13th, 2025
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.57 KB | None | 0 0
  1. " set leader key
  2. let g:mapleader = "\<Space>"
  3.  
  4.  
  5. " Optional:
  6.  
  7.  
  8.  
  9. "set foldmethod=indent
  10. set cursorline
  11. set autoindent
  12. set background=dark
  13. set tabstop=2
  14. "set columns=120
  15. "set lines=50
  16. colorscheme desert
  17. set shiftwidth=2
  18.  
  19. "set list listchars=tab:❘-,trail:·,extends:»,precedes:«,nbsp:×
  20. "set list listchars=tab:»-,trail:·,extends:»,precedes:«
  21. "set listchars=tab:\.\
  22. "set list
  23.  
  24. syntax on
  25. set nu
  26.  
  27. if has("autocmd")
  28.   au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  29. endif
  30.  
  31. so ~/.config/nvim/plugins.vim
  32.  
  33. set guifont=Monospace\ 9
  34. set clipboard=unnamedplus
  35.  
  36. tnoremap <Esc> <C-\><C-n>
  37.  
  38. au BufNewFile,BufRead *.{c,cpp,cu,pov,m} :vmap cc :s/^/\/\/ <CR> :noh <CR>
  39.  
  40. "map <F9> :w<CR>:!clear;python3 %; read<CR>"
  41. autocmd FileType python map <buffer> <F9> :w<CR>:exec '! python3' shellescape(@%, 1)<CR>
  42. autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:exec '! python3' shellescape(@%, 1)<CR>
  43.  
  44. cmap w!! w !sudo tee %
  45.  
  46. "save with ctrl+s
  47. nmap <c-s> :w<CR>
  48. imap <c-s> <Esc>:w<CR>a
  49.  
  50. "exit with ctrl+q
  51. nmap <c-q> :q<CR>
  52. imap <c-q> <Esc>:q<CR>
  53.  
  54.  
  55. " moverse entre tabs
  56. nnoremap <C-Left> gT
  57. nnoremap <C-Right> gt
  58.  
  59. nnoremap <buffer> H :<C-u>execute "!pydoc3 " . expand("<cword>")<CR>
  60.  
  61. "-----------------------------------------------------------------------
  62. "----------------------------------------------------------------Minimap
  63. " Para poder usar minimap debe instalar code-minimap
  64. " (https://github.com/wfxr/code-minimap/), esto se hace a traves de cargo,
  65. " para instalar cargo ejecute en la terminal:
  66. " curl https://sh.rustup.rs -sSf | sh
  67. " Esto descargará un script e iniciará la instalación.
  68. " Si todo va bien, veras esto:
  69. " Rust is installed now. Great!
  70. " Ahora podra instalar code-minimap ejecutando en la terminal:
  71. " cargo install --locked code-minimap
  72.  
  73. " Deshabilitar el minimapa para tipos de archivos específicos
  74. let g:minimap_block_filetypes = ['fugitive', 'nerdtree', 'tagbar']
  75.  
  76. " Deshabilitar el minimapa para tipos de buffers específicos
  77. let g:minimap_block_buftypes = ['nofile', 'nowrite', 'quickfix', 'terminal', 'prompt', 'fzf', 'pymode']
  78.  
  79. " Cerrar minimapa para tipos de archivos especificos
  80. let g:minimap_close_filetypes = ['starify', 'netrw', 'vim-plug', 'vim-blunde']
  81.  
  82. " Resaltar el rango de lineas visibles
  83. let g:minimap_highlight_range = 1
  84.  
  85. " Atajos de teclado
  86. " Abrir/Cerrar Minimap
  87. nnoremap <leader>m :MinimapToggle<CR>
  88. " Cerrar Minimap
  89. nnoremap <leader>mq :MinimapClose<CR>
  90. " Refrescar Minimap
  91. nnoremap <leader>mr :MinimapRefresh<CR>
  92.  
  93.  
  94. " enable mouse interaction
  95. set mouse=a
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement