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.

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