Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

159 lines
5.1 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. "
  2. " Vim settings for @mscoutermarsh
  3. "
  4. " Settings in this file may depend on plugins, so let's install them first.
  5. " Not to be confused with the contents of ~/.vim/plugin/* which are
  6. " configuration options for each plugin and automatically loaded by Vim.
  7. source ~/.vim/plugin/plugins.vim
  8. " Set leader
  9. let mapleader = ","
  10. noh
  11. " Leader Mappings
  12. map <Leader>w :update<CR>
  13. map <Leader>q :qall<CR>
  14. map <Leader>gs :Gstatus<CR>
  15. " Recently edited files
  16. map <Leader>h :History<CR>
  17. " CtrlP use FZF (faster!)
  18. nnoremap <C-p> :Files<Cr>
  19. noremap <leader>u :w<Home>silent <End> !urlview<CR>
  20. syntax on
  21. filetype plugin on
  22. autocmd Filetype scss if getfsize(@%) > 300 | setlocal syntax=OFF | endif
  23. augroup twig_ft
  24. au!
  25. autocmd BufNewFile,BufRead *.html.inky set syntax=eruby
  26. augroup END
  27. set autoread " Auto reload changed files
  28. set wildmenu " Tab autocomplete in command mode
  29. set backspace=indent,eol,start " http://vi.stackexchange.com/a/2163
  30. set laststatus=2 " Show status line on startup
  31. set splitright " Open new splits to the right
  32. set splitbelow " Open new splits to the bottom
  33. set lazyredraw " Reduce the redraw frequency
  34. set ttyfast " Send more characters in fast terminals
  35. set nowrap " Don't wrap long lines
  36. set listchars=extends:→ " Show arrow if line continues rightwards
  37. set listchars+=precedes:← " Show arrow if line continues leftwards
  38. set nobackup nowritebackup noswapfile " Turn off backup files
  39. set noerrorbells novisualbell " Turn off visual and audible bells
  40. set expandtab shiftwidth=2 tabstop=2 " Two spaces for tabs everywhere
  41. set history=500
  42. " set hlsearch " Highlight search results
  43. set ignorecase smartcase " Search queries intelligently set case
  44. set incsearch " Show search results as you type
  45. set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape
  46. set showcmd " Show size of visual selection
  47. set t_Co=256
  48. set clipboard=unnamedplus
  49. " Persistent undo
  50. set undodir=~/.vim/undo/
  51. set undofile
  52. set undolevels=1000
  53. set undoreload=10000
  54. " Ignored files/directories from autocomplete (and CtrlP)
  55. set wildignore+=*/tmp/*
  56. set wildignore+=*.so
  57. set wildignore+=*.zip
  58. set wildignore+=*/vendor/bundle/*
  59. set wildignore+=*/node_modules/
  60. "-------------------------------------------------------------------------------
  61. " Interface
  62. "-------------------------------------------------------------------------------
  63. set number " Enable line numbers
  64. set scrolloff=5 " Leave 5 lines of buffer when scrolling
  65. set sidescrolloff=10 " Leave 10 characters of horizontal buffer when scrolling
  66. "-------------------------------------------------------------------------------
  67. " Colors & Formatting
  68. "-------------------------------------------------------------------------------
  69. let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
  70. let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
  71. if (has("termguicolors"))
  72. set termguicolors
  73. endif
  74. let g:material_style='oceanic'
  75. set background=dark
  76. colorscheme vim-material
  77. let g:airline_theme='material'
  78. " Showcase comments in italics
  79. highlight Comment cterm=italic gui=italic
  80. " Open most recently used files on start
  81. " autocmd VimEnter * Mru .
  82. " Easy tab navigation
  83. nnoremap <C-Left> :tabprevious<CR>
  84. nnoremap <C-Right> :tabnext<CR>
  85. " Golang specific settings
  86. let g:go_highlight_build_constraints = 1
  87. let g:go_highlight_extra_types = 1
  88. let g:go_highlight_fields = 1
  89. let g:go_highlight_functions = 1
  90. let g:go_highlight_methods = 1
  91. let g:go_highlight_operators = 1
  92. let g:go_highlight_structs = 1
  93. let g:go_highlight_types = 1
  94. let g:go_auto_type_info = 1
  95. let g:go_fmt_command = "goimports"
  96. " Find/replace
  97. vnoremap <C-r> "hy:%s/<C-r>h//g<left><left><left>
  98. nnoremap <leader>e :noh<CR>
  99. " let g:auto_save = 1 " enable AutoSave on Vim startup
  100. " let g:auto_save_in_insert_mode = 0 " do not save in insert mode
  101. " Get off my lawn - helpful when learning Vim :)
  102. nnoremap <C-c> :echoe "Use Esc"<CR>
  103. nnoremap <Left> :echoe "Use h"<CR>
  104. nnoremap <Right> :echoe "Use l"<CR>
  105. nnoremap <Up> :echoe "Use k"<CR>
  106. nnoremap <Down> :echoe "Use j"<CR>
  107. nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
  108. nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
  109. let g:Tlist_WinWidth = 40
  110. " Syntastic max file size for python
  111. let g:syntastic_python_pylint_post_args="--max-line-length=120"
  112. "-------------------------------------------------------------------------------
  113. " Neovim-specific configurations
  114. "-------------------------------------------------------------------------------
  115. if has('nvim')
  116. let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  117. set termguicolors
  118. " Fix vim-tmux-navigator <C-h> https://git.io/viGRU
  119. nmap <BS> <C-W>h
  120. " Fix vim-tmux-navigator <C-h> https://git.io/vS5QH
  121. nmap <BS> :<C-u>TmuxNavigateLeft<CR>
  122. endif
  123. command! -complete=file -nargs=1 Rpdf :r !pdftotext -nopgbrk <q-args> - |fmt -csw78
  124. autocmd VimLeave * call system("xsel -ib", getreg('+'))
  125. packadd termdebug