-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc_min
112 lines (91 loc) · 2.2 KB
/
.vimrc_min
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
" use different .vim directory for easy switching
let &rtp = substitute(&rtp, '\.vim\>', '.vim_min', 'g')
set nocompatible
filetype off
" Vundle settings
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" plugins
Plugin 'airblade/vim-gitgutter'
Plugin 'vim-scripts/ShowTrailingWhitespace'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-fugitive'
Plugin 'fatih/vim-go'
" color schemes
Plugin 'altercation/vim-colors-solarized'
call vundle#end()
filetype plugin indent on
" basic editor config
syntax on
set background=dark
colorscheme solarized
set hidden
set noswapfile
set noerrorbells
set visualbell
set t_vb=
set autoindent
set smartindent
set smarttab
set expandtab
set shiftwidth=2
set tabstop=2
set softtabstop=2
set wrap
set linebreak
set colorcolumn=80
set scrolloff=8
set sidescrolloff=15
set sidescroll=1
set ruler
set number
set showcmd
set noshowmode
set autoread
set backspace=2
set cul
hi CursorLine term=none cterm=none ctermbg=8
set gcr=a:blinkon0
" avoid wearing out shift key
nore ; :
nore , ;
" easier move between splits
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap Y y$
" mvim settings
if has("gui_running")
set guioptions-=T
set guioptions-=r
set guioptions-=L
endif
set guifont=Hack:h12
" ctrlp settings
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn)|\_site)$',
\ 'file': '\v\.(exe|so|dll|class|png|jpg|jpeg)$',
\}
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
let g:ctrlp_working_path_mode = 'r'
" spell check by file type
autocmd FileType Markdown setlocal spell
autocmd FileType HTML setlocal spell
autocmd FileType eruby setlocal spell
" force file type for unknowns
au BufNewFile,BufRead *.ejs set filetype=html
au BufNewFile,BufRead *.jst.ejs set filetype=html
au BufNewFile,BufRead *.es6 set filetype=javascript
" remove trailing whitespace
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd FileType c,cpp,ruby,eruby,markdown,python,sh,vim autocmd BufWritePre <buffer>
\ :call <SID>StripTrailingWhitespaces()