.vimrc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. " Specify a directory for plugins
  2. " " - For Neovim: stdpath('data') . '/plugged'
  3. " " - Avoid using standard Vim directory names like 'plugin'
  4. set number
  5. " Show matching words during a search.
  6. set showmatch
  7. set visualbell
  8. " Override the ignorecase option if searching for capital letters.
  9. " This will allow you to search specifically for capital letters.
  10. set smartcase
  11. " Enable auto completion menu after pressing TAB.
  12. set wildmenu
  13. " Make wildmenu behave like similar to Bash completion.
  14. set wildmode=list:longest
  15. " There are certain files that we would never want to edit with Vim.
  16. " Wildmenu will ignore files with these extensions.
  17. set wildignore=*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx
  18. " Ignore capital letters during search.
  19. set ignorecase
  20. set shiftwidth=4
  21. set softtabstop=4
  22. set ruler
  23. " Set the commands to save in history default number is 20.
  24. set undolevels=1000
  25. set backspace=indent,eol,start
  26. set background=dark
  27. set expandtab!
  28. "set spell
  29. "set spelllang=en,es
  30. set pastetoggle=<F3>
  31. filetype on
  32. filetype indent on
  33. filetype plugin on
  34. syntax on
  35. " Show partial command you type in the last line of the screen.
  36. set showcmd
  37. " Do not save backup files.
  38. set nobackup
  39. " Highlight cursor line underneath the cursor horizontally.
  40. " set cursorline
  41. " Highlight cursor line underneath the cursor vertically.
  42. " set cursorcolumn
  43. autocmd FileType java set breakindentopt=shift:4
  44. "NERDTree
  45. " Start NERDTree when Vim starts with a directory argument.
  46. autocmd StdinReadPre * let s:std_in=1
  47. autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
  48. \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif
  49. " Exit Vim if NERDTree is the only window left.
  50. autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() |
  51. \ quit | endif