Advertisement
Guest User

vimrc 2018-06-29

a guest
Jun 5th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 6.59 KB | None | 0 0
  1. " == VIM PLUG =================================================================
  2. call plug#begin('~/.local/share/nvim/plugged')
  3.  
  4. " Syntax Highlighting
  5. Plug 'crusoexia/vim-monokai'
  6.  
  7. " UI Prettyfying
  8. Plug 'bling/vim-airline'              " Changes the status line to use those arrow things
  9. Plug 'vim-airline/vim-airline-themes' " Makes the airline at the bottom look nice and boring
  10. Plug 'miyakogi/seiya.vim'             " Something about transparency? Makes vim look nice
  11.  
  12. " Navigation
  13. Plug 'jeetsukumaran/vim-buffergator'  " List buffers in side bar
  14. Plug 'rbgrouleff/bclose.vim'          " Close buffers with <leader>bd
  15. Plug 'kien/ctrlp.vim'                 " Fuzzy file search in git directory
  16. Plug 'scrooloose/nerdtree'            " Document tree
  17.  
  18. " Editing
  19. Plug 'Shougo/deoplete.nvim'           " Autocomplete. NOTE: Requires 'neovim' package for python
  20. Plug 'Shougo/neco-syntax'             " Syntax source for autocomplete
  21. Plug 'scrooloose/nerdcommenter'       " For Ctrl+/ commenting like in Sublime Text
  22. Plug 'junegunn/vim-easy-align'        " Text alignment
  23. Plug 'dhruvasagar/vim-table-mode'     " Creating tables in text
  24.  
  25. " Syntax Stuff
  26. Plug 'pangloss/vim-javascript'
  27. Plug 'mxw/vim-jsx'
  28.  
  29. " Miscellaneous
  30. Plug 'tpope/vim-fugitive'             " Git stuff for vim. Haven't configured yet lol
  31. Plug 'edkolev/tmuxline.vim'           " Basically makes tmux have the same appearance as vim
  32. Plug 'vimwiki/vimwiki'                " Personal wiki and diary
  33.  
  34. call plug#end()
  35.  
  36. " == CONFIG STUFF =============================================================
  37.  
  38. " Line numbers on left side
  39. set number
  40. " set number of previous commands to save
  41. set history=1000
  42. " Automatically read changes to a file
  43. set autoread
  44.  
  45. " enable filetype detection
  46. filetype plugin indent on
  47.  
  48. " change leader from \ to , (easier to reach)
  49. let mapleader = ","
  50. let g:mapleader = ","
  51.  
  52. " show command options when you press tab
  53. set wildmenu
  54.  
  55. " ignore these when expanding wildcards
  56. set wildignore=*.o,*~,*.pyc,*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
  57.  
  58. " hide buffers instead of just closing them
  59. set hidden
  60.  
  61. " allow backspace in insert mode
  62. set backspace=eol,start,indent
  63. " allow keys that move the cursor left/right to move to the prev/next line
  64. set whichwrap+=<,>,h,l
  65.  
  66. " ignore case when searching
  67. set ignorecase
  68. " override ignorecase if the search contains uppercase characters
  69. set smartcase
  70. " highlight all matches in a search
  71. set hlsearch
  72. " incrementally search
  73. set incsearch
  74. " searches do not around EOF
  75. set nowrapscan
  76.  
  77. " pretty self explanatory. Only redraw when you need to
  78. set lazyredraw
  79.  
  80. " magic
  81. set magic
  82.  
  83. " no idea what this does lol
  84. set mat=2
  85.  
  86. " no annoying noises on error
  87. set noerrorbells
  88. set novisualbell
  89.  
  90. " apparently nvim doesn't use this so idk
  91. set t_vb=
  92.  
  93. " set timeout to wait for a mapped sequence to complete
  94. set tm=500
  95.  
  96. " enable syntax highlighting
  97. syntax enable
  98. " set colorscheme
  99. colorscheme monokai
  100.  
  101. " duh
  102. set encoding=utf8
  103. " Set order of EOL formats to try
  104. set ffs=unix,dos,mac
  105.  
  106. " turn tabs to spaces (yeah fight me)
  107. set expandtab
  108. set smarttab
  109.  
  110. " set tab size to 4 spaces (vimwiki uses 2 spaces though lol)
  111. set shiftwidth=4
  112. set tabstop=4
  113. set softtabstop=4
  114.  
  115. " highlight cursor line
  116. set cursorline
  117.  
  118. " wrap really long lines
  119. set linebreak
  120. " set max line to 500 chars
  121. set textwidth=500
  122.  
  123. " continue indentation from current line when starting a new line
  124. set autoindent
  125. " do smart autoindenting when starting a new line
  126. set smartindent
  127. " wrap lines longer than the width of the window
  128. set wrap
  129.  
  130. " Moving around
  131.  
  132. " j and k but they work for line wraps too
  133. nnoremap j gj
  134. nnoremap k gk
  135.  
  136. " remap moving between splits
  137. map <C-j> <C-W>j
  138. map <C-k> <C-W>k
  139. map <C-h> <C-W>h
  140. map <C-l> <C-W>l
  141.  
  142. " close buffer
  143. map <leader>bd :Bclose<cr>
  144.  
  145. " change current directory to the current file
  146. map <leader>cd :cd %:p:h<cr>:pwd<cr>
  147.  
  148.  
  149. " something about switching between buffers? I don't use this but if I take it out something will probably break lol
  150. try
  151.     set switchbuf=useopen,usetab,newtab
  152.     set stal=2
  153. catch
  154. endtry
  155.  
  156. " Return to last edit position when opening files
  157. au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  158.  
  159. " enable mouse stuff
  160. set mouse=a
  161.  
  162. " change backup and swap directories
  163. " a cron job will clean these out every once in a while
  164. set backupdir=~/.vim/backup//
  165. set directory=~/.vim/swp//
  166.  
  167. " == PLUGIN STUFF =============================================================
  168.  
  169. " Vim Airline Config
  170. let g:airline_theme='minimalist'
  171. set showtabline=0
  172. let g:airline_powerline_fonts = 1
  173. " don't show something on the last line because airline takes care of that or something
  174. set noshowmode
  175.  
  176. " CtrlP
  177. let g:ctrlp_custom_ignore = {
  178.   \ 'dir':  '\v[\/](\.(git|hg|svn)|\_site|node_modules)$',
  179.   \ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$',
  180. \}
  181. let g:ctrlp_working_path_mode = 'r'
  182.  
  183. nmap <leader>p :CtrlP<cr>
  184. nmap <leader>bb :CtrlPBuffer<cr>
  185. nmap <leader>bm :CtrlPMixed<cr>
  186. nmap <leader>bs :CtrlPMRU<cr>
  187.  
  188. " Buffergator
  189. let g:buffergator_viewport_split_policy = 'R'
  190. let g:buffergator_suppress_keymaps = 1
  191. let g:buffergator_show_full_directory_path = 0
  192.  
  193. nmap <leader>bl :BuffergatorOpen<cr>
  194. " open new buffer
  195. nmap <leader>T :enew<cr>
  196. nmap <leader>bq :bp <BAR> bd #<cr>
  197.  
  198. " NERDCommenter
  199. let g:NERDSpaceDelims = 1
  200. let g:NERDCompactSexyComs = 1
  201. let g:NERDDefaultAlign = 'left'
  202. let g:NERDCommentEmptyLines = 1
  203.  
  204. " map Ctrl+/ to toggle comments like in Sublime Text
  205. nmap <C-_> <leader>c<space>
  206. vmap <C-_> <leader>c<space>
  207.  
  208. " NERDTree
  209. " There are probably more things that nerdtree should ignore but like, I barely use it
  210. let NERDTreeIgnore = ['\.pyc$']
  211.  
  212. " Enable seiya mystery plugin
  213. let g:seiya_auto_enable=1
  214.  
  215. " Deoplete
  216. let g:deoplete#enable_at_startup = 1
  217.  
  218. inoremap <silent><expr> <TAB>
  219.         \ pumvisible() ? "\<C-n>" :
  220.         \ <SID>check_back_space() ? "\<TAB>" :
  221.         \ deoplete#mappings#manual_complete()
  222.         function! s:check_back_space() abort "{{{
  223.         let col = col('.') - 1
  224.         return !col || getline('.')[col - 1]  =~ '\s'
  225.         endfunction"}}}<Paste>
  226.  
  227. " vim-jsx thing
  228. let g:jsx_ext_required = 0
  229.  
  230. " tmuxline
  231. let g:tmuxline_preset = {
  232.     \'a': '#S',
  233.     \'y': ['%R', '%a', '%Y'],
  234.     \'z': '#h',
  235.     \'win': ['#I', '#W'],
  236.     \'cwin': ['#I', '#W'],
  237.     \'options': {'status-justify': 'left'}
  238. \}
  239.  
  240. " vimwiki directory in google drive
  241. let g:vimwiki_list = [{'path':'~/gdrive/vimwiki', 'path_html':'~/gdrive/vimwiki/html'}]
  242.  
  243. " == SYNTAX SPECIFIC STUFF ====================================================
  244. au FileType python source ~/.config/nvim/python.vim
  245. au FIleType vimwiki source ~/.config/nvim/vimwiki.vim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement