Configuration file for vim on macos
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. " ------------------
  2. " __
  3. " .--.--.|__|.--------.----.----.
  4. " | | || || | _| __|
  5. " \___/ |__||__|__|__|__| |____|
  6. " ------------------
  7. "
  8. " Basic settings
  9. " --------------
  10. set nocompatible
  11. filetype plugin indent on
  12. syntax enable
  13. set number relativenumber
  14. set path+=**
  15. set wildmode=longest,list,full
  16. set encoding=UTF-8
  17. set cursorline
  18. set showmatch " matching brackets
  19. set linebreak
  20. set ignorecase " case insensitive matching
  21. set smartcase " smart case matching
  22. "set clipboard+=unnamedplus
  23. set mouse=a
  24. set tabstop=4
  25. set shiftwidth=4
  26. set softtabstop=4
  27. set spelllang=en_us
  28. set fillchars+=eob:~
  29. set showtabline=2
  30. set laststatus=2
  31. set backspace=indent,eol,start " more powerful backspacing
  32. " ------------------
  33. " Basic styling
  34. " ------------------
  35. highlight Comment cterm=italic
  36. highlight CursorLine ctermbg=Black cterm=NONE
  37. highlight CursorLineNr ctermbg=Black cterm=bold ctermfg=Green
  38. highlight LineNr ctermbg=Black ctermfg=White
  39. " OS detection
  40. " ---------------------------------------------
  41. if !exists("g:os_current")
  42. if system('uname -s') == "Linux\n"
  43. let g:os_current = "Linux"
  44. elseif system('uname -s') == "Darwin\n"
  45. let g:os_current = "Darwin"
  46. else
  47. echom "Error: the current operating system won't support my Vim Config"
  48. let g:os_current = "Other"
  49. endif
  50. endif
  51. " ---------------------------------------------
  52. " Plugin settings
  53. " ------------------
  54. call plug#begin()
  55. Plug 'sonph/onehalf', { 'rtp': 'vim' }
  56. Plug 'https://github.com/Badacadabra/vim-archery'
  57. Plug 'vim-airline/vim-airline'
  58. Plug 'vim-airline/vim-airline-themes'
  59. Plug 'lervag/vimtex'
  60. Plug 'Valloric/YouCompleteMe'
  61. Plug 'preservim/nerdtree'
  62. call plug#end()
  63. " Theme configuration
  64. " ------------------
  65. colorscheme onehalfdark "archery
  66. let g:airline_theme = 'onehalfdark' "'archery'
  67. set t_Co=256
  68. let g:airline_powerline_fonts=1
  69. let g:airline#extensions#tabline#left_sep = ' '
  70. let g:airline#extensions#tabline#left_alt_sep = '|'
  71. let g:airline_symbols = {}
  72. let g:airline_symbols.colnr = ' ㏇:'
  73. " LaTeX
  74. let g:tex_flavor='latex'
  75. set sw=2
  76. set iskeyword+=:
  77. let g:vimtex_view_method = "skim"
  78. let g:vimtex_compiler_latexmk= {'options' : ['-pdf', '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode',],} " we need to enable -shell-escape to be able to use externalization library for avioiding recompiling unchanged diagrams/graphs created using tikz/pgfplots
  79. if !exists('g:ycm_semantic_triggers')
  80. let g:ycm_semantic_triggers = {}
  81. endif
  82. au VimEnter * let g:ycm_semantic_triggers.tex=g:vimtex#re#youcompleteme
  83. " ---------------------------------------------
  84. " Miscelanious
  85. " ---------------------------------------------
  86. " Easier write command
  87. let mapleader = " "
  88. nnoremap <leader>w <Cmd>write<CR>
  89. " NERDTree
  90. nnoremap <leader>n :NERDTreeFocus<CR>
  91. nnoremap <C-n> :NERDTree<CR>
  92. nnoremap <C-t> :NERDTreeToggle<CR>
  93. nnoremap <C-f> :NERDTreeFind<CR>
  94. let g:NERDTreeQuitOnOpen = 1