-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
91 lines (68 loc) · 2.02 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
" Use Vim extensions; must be first thing in file
set nocompatible
" Use a POSIX compliant shell
set shell=/bin/bash
" BEGIN Vundle setup
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Plugins
Plugin 'kien/ctrlp.vim'
Plugin 'ddollar/nerdcommenter'
Plugin 'scrooloose/nerdtree'
Plugin 'godlygeek/tabular'
Plugin 'drmikehenry/vim-fontsize'
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-surround'
Plugin 'bronson/vim-trailing-whitespace'
" Plugin 'Valloric/YouCompleteMe' " https://github.com/Valloric/YouCompleteMe#installation
Plugin 'mileszs/ack.vim'
" Languages and Frameworks
Plugin 'tpope/vim-rails' " Ruby/Rails
Plugin 'spf13/PIV' " PHP
Plugin 'fatih/vim-go' " Go
Plugin 'evidens/vim-twig' " Twig
Plugin 'juvenn/mustache.vim' " Mustache
Plugin 'elixir-lang/vim-elixir' " Elixir
Plugin 'pangloss/vim-javascript' " JavaScript
Plugin 'posva/vim-vue' " Vue
" Themes
Plugin 'altercation/vim-colors-solarized'
Plugin 'chriskempson/base16-vim'
call vundle#end()
filetype plugin indent on
" END Vundle setup
" Sane window change shortcuts
nnoremap <c-h> <c-w>h
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l
" Force a few lines above and below the cursor
set scrolloff=4
" Smart relative numbering
set relativenumber
set number
" Highlight the right column
execute "set colorcolumn=" . join(range(81,512), ',')
" Shortcut to clear highlighting
nnoremap <leader>x noh
" Space for code folding
nnoremap <space> za
vnoremap <space> zf
" 2-space tabs
set shiftwidth=2 tabstop=2 softtabstop=2 smarttab expandtab
" NERDTree
nnoremap <leader>n :NERDTreeToggle<cr>
" Show whitespace characters
set listchars=tab:├─
nnoremap <leader>l :set invlist<cr>
" Shortcut to fix trailing whitespace
nnoremap <leader>s :%s/\s\+$<cr>
" PHP Plugin config
let php_sync_method=0
" Use silver searcher instead of ack when available
if executable('ag')
let g:ackprg = 'ag --vimgrep --smart-case'
endif