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.

152 lines
4.8 KiB

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