-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
94 lines (73 loc) · 2.13 KB
/
init.vim
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
"""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""
if $VIMHOME == ''
" Default to the absolute path to the vimfiles root.
let $VIMHOME=fnamemodify(resolve(expand('<sfile>:p')), ':h')
endif
" Load Vundle.vim plugin and definitions
source $VIMHOME/bundle.vim
" Disable backups
set nobackup nowb noswapfile
" Allow backspacing over start of insert
" See https://vimdoc.sourceforge.net/htmldoc/options.html#'backspace'
set backspace=2
" Enable persistent undo
" See https://amix.dk/blog/post/19548
set undodir=$VIMHOME/undo
set undofile
set undolevels=1000
set undoreload=10000
"""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors, fonts, and aethetics
"""""""""""""""""""""""""""""""""""""""""""""""""
" Highlight current line
set cursorline
let g:solarized_termtrans=1 " Enable color scheme transparency
colo solarized
set t_Co=256
"""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tabs, and indentation
"""""""""""""""""""""""""""""""""""""""""""""""""
" Default indent settings
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2
" Line numbering
set number
" Word wrap without breaking words
set formatoptions=1
set lbr
" Auto indent
set ai
" Smart indent
set si
" Wrap lines
set wrap
" Draw ruler
set colorcolumn=80
" Selectively strip trailing whitespace. See https://stackoverflow.com/a/6496995
fun! StripTrailingWhitespace()
if &ft =~ 'gitcommit'
return
endif
%s/\s\+$//e
endfun
" Delete trailing whitespace on save
autocmd BufWritePre * call StripTrailingWhitespace()
"""""""""""""""""""""""""""""""""""""""""""""""""
" => Miscellaneous
"""""""""""""""""""""""""""""""""""""""""""""""""
" snipMate.vim
let g:snips_author = substitute(system('git config user.name'), '\n$', '', 'g')
let g:snips_email = substitute(system('git config user.email'), '\n$', '', 'g')
let g:snipMate = {}
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ginkgo'] = 'ginkgo,go'
let g:snipMate.scope_aliases['rspec'] = 'rspec,ruby'
" Command mappings
source $VIMHOME/mappings.vim
" Filetype settings
source $VIMHOME/ftsettings.vim
source $VIMHOME/projections.vim