-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
93 lines (76 loc) · 1.83 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
92
93
set nocompatible
runtime! plugin/sensible.vim
let &t_ut=''
let mapleader = "\<Space>"
"Column indicators {{{
let &colorcolumn="80,100,".join(range(120,320),",")
" }}}
" Folding {{{
set foldmethod=syntax
set foldlevel=99
set foldnestmax=5 " max 10 depth
set foldenable " do fold files by default on open
set foldlevelstart=10 " open most folds by default
" space open/closes folds
nnoremap <F8> za
" }}}
" Whitespace stuff {{{
set nowrap
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set whichwrap+=<,>,h,l
" }}}
" Searching {{{
set hlsearch
set ignorecase
set smartcase
" }}}
" Tab completion {{{
set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
" }}}
" Scrolling {{{
set scrolloff=8 "Start scrolling when we're 8 lines away from margins
set sidescrolloff=15
set sidescroll=1
" }}}
" nicer pasting {{{
set pastetoggle=<F12>
" }}}
"save as sudo trick
cmap w!! %!sudo tee > /dev/null %
" Opens an edit command with the path of the currently edited file filled in
" Normal mode: <Leader>e
map <Leader>ff :e <C-R>=expand("%:p:h") . "/" <CR>
map <Leader><Tab> :bn <CR>
" autoreload vimrc {{{
augroup reload_vimrc " {
autocmd!
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END " }
" }}}
" gitcommit {{{
augroup git
au!
au FileType gitcommit setlocal spell
augroup END
" }}}
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby {{{
augroup ruby
au!
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,Guardfile,config.ru} setlocal filetype=ruby
augroup END
" }}}
" add json syntax highlighting {{{
augroup json
au!
au BufNewFile,BufRead *.{json} setlocal filetype=javascript
augroup END
" }}}
" vim:foldmethod=marker:foldlevel=0
if filereadable(expand("~/.vimrc_background"))
let base16colorspace=256
source ~/.vimrc_background
endif