Advertisement
tyler569

.vimrc

Aug 23rd, 2017
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 3.73 KB | None | 0 0
  1.  
  2. set nocompatible    " Because what's even the point without this?
  3. set encoding=utf-8  " It's two thousand $year !
  4. set hidden          " Allow hidden buffers - something required this
  5.  
  6. execute pathogen#infect()
  7.  
  8. " Plugin config
  9.  
  10. " vim-airline
  11. let g:airline_powerline_fonts = 1
  12. let g:airline#extensions#tabline#enabled = 0
  13. set noshowmode              " Redundant - airline shows the mode
  14.  
  15. " syntastic
  16. let g:syntastic_always_populate_loc_list = 1
  17. let g:syntastic_auto_loc_list = 1
  18. let g:syntastic_check_on_open = 0
  19. let g:syntastic_check_on_wq = 0
  20.  
  21. let g:syntastic_cpp_compiler = "clang"
  22. let g:syntastic_cpp_compiler_options = "-std=c++14"
  23.  
  24. " delimitMate
  25. let g:delimitMate_expand_cr = 1
  26. let g:delimitMate_expand_space = 1
  27.  
  28.  
  29.  
  30. syntax on
  31. filetype plugin indent on
  32.  
  33. " 256 colors and colorscheme
  34. "if $TERM =~ "256color"
  35. "    set t_Co=256
  36. "endif
  37. colorscheme slate
  38.  
  39. " We have the tehnology for italics
  40. if $TERM =~ "italic"
  41.     highlight Comment cterm=italic
  42. endif
  43.  
  44. " Tell terminal my name
  45. set titlestring=vim\ %{expand(\"%t\")}
  46.  
  47. " Indentation rules
  48. set expandtab               " Tabs -> spaces
  49. set softtabstop=4           " Tabs -> spaces gooder
  50. set tabstop=4               " Show tabs as 4 spaces
  51. set shiftwidth=4            " Reident 4 spaces
  52. set cindent                 " C indentation rules
  53. set cinoptions=:0,g0        " Move 'public:' etc. to the left
  54.  
  55. " Backups and swapfiles
  56. set backupdir=~/.vim/backup " Backups over there
  57. set directory=~/.vim/swap   " Swapfiles over there
  58. set writebackup             " Do actually do backups
  59. if has('persistent_undo')
  60.     set undodir=~/.vim/undo     " Persistent undo
  61.     set undofile                " See above
  62. endif
  63.  
  64. " UI
  65. set number                  " Line numbers ...
  66. highlight LineNr ctermfg=darkgrey
  67.                             " ... in a better color
  68. set numberwidth=3           " Start linenumbers at 3 digits
  69. "set relativenumber          " Line numbers relative to current location
  70. set laststatus=2            " Status line for file names
  71. set backspace=2             " Make backspace work
  72. set showcmd                 " Show incomplete commands
  73. set wildmenu                " Menu for command mode
  74. set lazyredraw              " Don't redraw the screen in macros etc.
  75. set showmatch               " Highlight matching [{()}]
  76. set display=lastline,uhex   " Show the last line even if it is too long
  77. set visualbell              " I don't do bell sounds
  78. set scrolloff=2             " Show 2 lines of context
  79. "set listchars=tab:→\ ,trail:▸
  80. "set list                    " Show hidden undesirable characters
  81.  
  82. " Searching
  83. set incsearch               " Search as you type
  84. set hlsearch                " Highlight all matches
  85. set ignorecase              " Ignore case on searching ...
  86. set smartcase               " ... unless I use a capital
  87.  
  88. " Folding
  89. set foldmethod=indent       " Fold on indentation - should always be right (enough)
  90. set foldnestmax=3           " Don't fold too deep though
  91. set nofoldenable            " And not by default plx
  92.  
  93.  
  94. " I hate typing - these make it (slightly) less painful
  95. nnoremap q:     :q
  96. nnoremap :Q     :q
  97. nnoremap :W     :w
  98.  
  99. let mapleader=","
  100.  
  101. nnoremap <leader><tab>      gg=G
  102. nnoremap <leader><space>    :nohlsearch<CR>
  103. nnoremap <leader>s          :w<CR>
  104. nnoremap <leader>?          :tab help<CR>
  105. nnoremap <leader>b          :buffers<CR>
  106. nnoremap <leader>m          :<C-U>exe "buffer" . v:count1<CR>
  107.  
  108. inoremap ;<CR>              <END>;<CR>
  109.  
  110. " Backup to /tmp except what's in /tmp
  111. set backup
  112. set backupdir=/tmp
  113. set backupskip=/tmp
  114. set directory=/tmp
  115. set writebackup
  116.  
  117. " When moving between panes, C-hjkl instead of C-w C-hjkl
  118. nnoremap <C-H> <C-W><C-H>
  119. nnoremap <C-J> <C-W><C-J>
  120. nnoremap <C-K> <C-W><C-K>
  121. nnoremap <C-L> <C-W><C-L>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement