~/
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.

.vimrc 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. " ~/.vimrc
  2. """ Vim-Plug ====================================
  3. if empty(glob('~/.vim/autoload/plug.vim'))
  4. silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  5. \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  6. autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  7. endif
  8. call plug#begin('~/.vim/plugged') " Minimalist Vim Plugin Manager
  9. """ Settings ====================================
  10. Plug 'tpope/vim-sensible' " Sensible Defaults
  11. set t_BE= " Disable bracketed paste
  12. set nocompatible " be iMproved, required
  13. set nobackup "
  14. set noswapfile "
  15. set termencoding=utf-8 " UTF8 as default encoding
  16. set encoding=utf-8 " ...
  17. set scrolloff=100
  18. """ Input =======================================
  19. set mouse=a " Enable mouse support
  20. set clipboard=unnamedplus " Share X11 clipboard
  21. let mapleader = ','
  22. "
  23. nnoremap <C-h> <C-w>h
  24. nnoremap <C-j> <C-w>j
  25. nnoremap <C-k> <C-w>k
  26. nnoremap <C-l> <C-w>l
  27. " Fold Mappings
  28. inoremap <leader>z <C-O>za
  29. nnoremap <leader>z za
  30. onoremap <leader>z <C-C>za
  31. vnoremap <leader>z zf
  32. " Use <leader>/ to clear search highlight
  33. nmap <silent> <leader>/ :nohlsearch<CR>
  34. "
  35. set pastetoggle=<F2>
  36. set listchars=tab:\|.,trail:.,extends:#,nbsp:.
  37. " Write target file as sudo using 'tee' buffer
  38. function SudoWrite()
  39. w !sudo tee %
  40. endfunction
  41. """ Display =====================================
  42. Plug 'vim-airline/vim-airline'
  43. Plug 'vim-airline/vim-airline-themes'
  44. let g:airline#extensions#tabline#enabled = 1
  45. Plug 'edkolev/tmuxline.vim'
  46. let g:tmuxline_powerline_separators = 0
  47. if has('gui_running')
  48. try
  49. colorscheme slate
  50. set guifont=Noto\ Mono\ Regular\ 10
  51. set background=dark
  52. set guioptions-=m "remove menu bar
  53. set guioptions-=T "remove toolbar
  54. set guioptions-=r "remove right-hand scroll bar
  55. set guioptions-=L "remove left-hand scroll bar
  56. catch
  57. endtry
  58. endif
  59. """ Utilities ===================================
  60. Plug 'spolu/dwm.vim' " Tiled Window Management
  61. Plug 'Shougo/vimfiler.vim' " Powerful file explorer
  62. Plug 'tpope/vim-eunuch' " Helpers for UNIX
  63. Plug 'tpope/vim-dispatch' " Async Build/Test
  64. Plug 'benmills/vimux' " tmux Integration
  65. Plug 'mileszs/ack.vim' " Enhanced Grepping within Vim
  66. if executable('ag')
  67. let g:ackprg = 'ag --vimgrep'
  68. endif
  69. Plug 'ctrlpvim/ctrlp.vim' " Fuzzy file/buffer/mru/tag/etc finder
  70. let g:ctrlp_map = '<c-p>'
  71. let g:ctrlp_cmd = 'CtrlP'
  72. let g:ctrlp_custom_ignore = {
  73. \ 'dir': '\v[\/]\.(git|hg|svn)$',
  74. \ 'file': '\v\.(exe|so|dll)$',
  75. \ 'link': 'some_bad_symbolic_links',
  76. \ }
  77. let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
  78. Plug 'universal-ctags/ctags' " ctags implementation
  79. Plug 'majutsushi/tagbar' " Displays tags in a window
  80. nmap <F8> :TagbarToggle<CR>
  81. Plug 'francoiscabrol/ranger.vim'
  82. """ Languages ===================================
  83. Plug 'sheerun/vim-polyglot' " Language Support
  84. Plug 'scrooloose/syntastic' " Syntax checking hacks for vim
  85. nmap <leader>c :SyntasticCheck<CR>
  86. set statusline+=%#warningmsg#
  87. set statusline+=%{SyntasticStatuslineFlag()}
  88. set statusline+=%*
  89. let g:syntastic_always_populate_loc_list = 1
  90. let g:syntastic_auto_loc_list = 1
  91. let g:syntastic_check_on_open = 1
  92. let g:syntastic_check_on_wq = 0
  93. let g:syntastic_error_symbol="S>"
  94. let g:syntastic_style_error_symbol="E>"
  95. let g:syntastic_warning_symbol="W>"
  96. let g:syntastic_style_warning_symbol="W>"
  97. Plug 'fatih/vim-go' " Go development plugin for Vim
  98. let g:go_auto_type_info = 1
  99. let g:go_highlight_functions = 1
  100. let g:go_highlight_methods = 1
  101. let g:go_highlight_structs = 1
  102. let g:go_highlight_interfaces = 1
  103. let g:go_highlight_operators = 1
  104. let g:go_highlight_build_constraints = 1
  105. let g:go_highlight_extra_types = 1
  106. """ Editor ======================================
  107. set tabstop=4 " Tabs are 4 columns
  108. set shiftwidth=4 " ...
  109. set softtabstop=4 " ...
  110. set expandtab " Change tabs to spaces
  111. set list " Show whitespace
  112. set number " Show line numbers
  113. set wrap linebreak nolist
  114. autocmd BufWritePre * %s/\s\+$//e " Delete trailing whitespace on save
  115. Plug 'tpope/vim-sleuth' " Heuristically set buffer options
  116. Plug 'nathanaelkane/vim-indent-guides' " Visaully display indent level
  117. Plug 'junegunn/vim-easy-align' " Easier text alignment
  118. xmap ga <Plug>(EasyAlign)
  119. nmap ga <Plug>(EasyAlign)
  120. Plug 'ervandew/supertab' " Vim insert mode completions with Tab
  121. Plug 'tpope/vim-surround' " Quoting/Parenthesizing made simple
  122. Plug 'junegunn/limelight.vim' " Hyperfocus-writing in Vim
  123. """ Version Control System ======================
  124. Plug 'airblade/vim-gitgutter' " Show git diff in the gutter
  125. nmap <Leader>ha <Plug>GitGutterStageHunk
  126. nmap <Leader>hr <Plug>GitGutterUndoHunk
  127. Plug 'tpope/vim-fugitive' " Git wrapper
  128. Plug 'tpope/vim-git' " Git integration
  129. Plug 'mattn/gist-vim' " Gist upload (GitHub)
  130. call plug#end()