.vimrc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  2. " "
  3. " A VIMRC FOR THE MODERN ERA "
  4. " "
  5. " author'd: jwdashel "
  6. " created: 8/24/2020; spokane valley, wa "
  7. " "
  8. " "
  9. " notes: assembled from ghosts of vimrcs past "
  10. " to them, i pay my respects "
  11. " "
  12. " "
  13. """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  14. """""""""""
  15. " GIVEN TWEAKS
  16. " adjustments to make vim sane
  17. "
  18. set nocompatible
  19. syntax on
  20. set nostartofline
  21. set visualbell
  22. set mouse=""
  23. set cmdheight=2
  24. set history=1000
  25. set timeout timeoutlen=5000 ttimeoutlen=100
  26. set showcmd
  27. "" files
  28. set hidden
  29. set wildmenu
  30. set wildmode=longest,list
  31. set confirm
  32. filetype indent on
  33. filetype plugin on
  34. au! BufNewFile,BufRead *.fish setf fish
  35. "" swp files
  36. set noswapfile
  37. set nobackup
  38. set nowritebackup
  39. "" insert mode
  40. set backspace=indent,eol,start
  41. "" normal mode
  42. map Y y$
  43. nnoremap j gj
  44. nnoremap k gk
  45. nnoremap q<Space> q:
  46. "" visual mode
  47. vmap > >gv
  48. vmap < <gv
  49. "" statusline
  50. set ruler
  51. set laststatus=2
  52. "" search
  53. set hlsearch
  54. set ignorecase
  55. set smartcase
  56. set incsearch
  57. "
  58. """""""""""""""""""""""""""""
  59. """""""""""
  60. " VISUAL TWEAKS
  61. " adjustments to make vim pretty
  62. "
  63. set number
  64. set relativenumber
  65. set scrolloff=5
  66. set cursorline
  67. hi CursorLine ctermbg=15 term=none cterm=none
  68. hi Visual ctermbg=11 term=none cterm=none
  69. hi LineNr ctermfg=8 term=none cterm=none
  70. hi CursorLineNr ctermfg=13 term=none cterm=none
  71. hi Error ctermfg=8 ctermbg=10
  72. "
  73. """""""""""""""""""""""""""""
  74. """""""""""
  75. " FUNCTIONAL TWEAKS
  76. " adjustments to make vim useful
  77. "
  78. "" normal mode
  79. nnoremap <Space> :
  80. let mapleader="_"
  81. nmap <leader>w :set list!<CR>
  82. nmap <leader>n :NERDTreeToggle<CR>
  83. "" instert mode
  84. set autoindent
  85. set smartindent
  86. set smarttab
  87. "
  88. """""""""""""""""""""""""""""
  89. """""""""""
  90. " PLUGINS
  91. "
  92. call plug#begin('~/.vim/plugged')
  93. Plug 'tpope/vim-surround'
  94. Plug 'tpope/vim-fugitive'
  95. Plug 'tpope/vim-unimpaired'
  96. Plug 'tpope/vim-eunuch'
  97. Plug 'tpope/vim-speeddating'
  98. Plug 'tpope/vim-commentary'
  99. Plug 'preservim/nerdtree'
  100. Plug 'vim-scripts/taglist.vim'
  101. Plug 'itchyny/lightline.vim'
  102. Plug 'michaeljsmith/vim-indent-object'
  103. Plug 'easymotion/vim-easymotion'
  104. Plug 'mileszs/ack.vim'
  105. Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
  106. Plug 'junegunn/fzf.vim'
  107. Plug 'mike-hearn/vim-combosearch'
  108. call plug#end()
  109. """""""""""
  110. " PLUGIN CONFIGURE
  111. let g:lightline = {
  112. \ 'colorscheme': 'Tomorrow' ,
  113. \ 'active': {
  114. \ 'left': [ [ 'mode', 'paste' ],
  115. \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ],
  116. \ 'right': [ [ 'lineinfo' ],
  117. \ [ 'percent' ],
  118. \ [ 'fileformat', 'fileencoding', 'filetype', 'bufnum' ] ]
  119. \ },
  120. \ 'component': {
  121. \ 'bufnum': 'b%n'
  122. \ },
  123. \ 'component_function': {
  124. \ 'gitbranch': 'FugitiveHead'
  125. \ },
  126. \ }
  127. hi EasyMotionTarget2Second ctermfg=DarkRed ctermbg=none
  128. hi EasyMotionTarget2First ctermfg=DarkRed ctermbg=none
  129. nnoremap <C-b> :Buffers<CR>
  130. nnoremap <C-f> :Files<CR>
  131. nnoremap <C-p> :ComboSearch<CR>
  132. "
  133. """""""""""""""""""""""""""""