-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
156 lines (128 loc) · 4.91 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
" .vimrc - Basic settings
" ======================================================================
" Basic options
" ======================================================================
" Load plugins
if filereadable(expand("~/.vim/plugins.vim"))
source ~/.vim/plugins.vim
endif
" Basics
set encoding=utf-8
set shell=/bin/bash
set history=1000 " keep lines of command line history
set ttyfast
set showcmd " display incomplete commands
set showmode " display mode
set showmatch " jump back and forth to matching paran
set backspace=indent,eol,start " allow backspacing over everything in insert mode
" When the page starts to scroll, keep the cursor 8 lines from the top and 8
" lines from the bottom and 15 lines on the left
set scrolloff=8
set sidescrolloff=15
set sidescroll=1
" Indentation (Softtabs, 2 spaces): rb, html, css, js
set expandtab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set autoindent " copy indent from current line when starting a new line
set nowrap " do not wrap long lines
" Escape quickly
set ttimeout
set ttimeoutlen=100
" Max column to search for syntax.
" This helps to avoid very slow redrawing for an XML file that is one.
set synmaxcol=500
" Folding
set foldmethod=indent " fold based on indent
set nofoldenable " don't fold by default
" Backup / Undo
set backupdir=~/.vim/backup
set undodir=~/.vim/undo
set undofile
set undolevels=1000 " maximum number of changes that can be undone
set undoreload=10000 " maximum number lines to save for undo on a buffer reload
set noswapfile " OMG I can't take it anymore!
" No beeps
set noerrorbells visualbell t_vb=
" Always open vertical splits to the right and automatically make them the same size
set splitright
set equalalways
" Tab completion options in Command mode
set wildmode=list:longest,list:full
set wildmenu
" wildignore - A file that matches with one of these patterns is ignored when completing file or directory names
" Disable output and VCS files
set wildignore+=*.o,*.out,*.obj,*.pyc,.git,.hg,*.rbc,*.rbo,*.class,.svn,*.gem
" Disable archive files
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
" Disable images
set wildignore+=*.gif,*.GIF,*.jpg,*.JPG,*.png,*.PNG,*.svg,*.SVG,*.pdf,*.PDF,*.psd,*.PSD
" Disable temp and backup files
set wildignore+=*.swp,*~,._*,.DS_Store
" Ignore bundler, sass cache
set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/*
" Ignore Rails bin, db, log, script, temp, and public stuff
set wildignore+=bin/**,db/migrate/**,log/**,public/cache/**,public/sitemaps/**,public/stylesheets/**,public/system/**,script/**,tmp/**,vendor/**
" Ignore Node modules
set wildignore+=node_modules/**
" Use modeline overrides
set modeline
set modelines=10
" Make sure that unsaved buffers that are to be put in the background are
" allowed to go in there (ie. the 'must save first' error doesn't come up)
set hidden
" ======================================================================
" Search
" ======================================================================
set incsearch " do incremental searching
set hlsearch
set ignorecase
set smartcase
" ======================================================================
" UI
" ======================================================================
set ruler " show the cursor position all the time
set number " show line numbers
set numberwidth=4
set background=dark
colorscheme solarized
syntax enable " Turn on syntax highlighting allowing local overrides
set list listchars=tab:▸\ ,trail:· " Show tabs and trailing whitespace
" ======================================================================
" Status line
" ======================================================================
if has("statusline")
set laststatus=2 " Always display the status bar
set statusline=%t "tail of the filename
set statusline+=[%{strlen(&fenc)?&fenc:'none'}, "file encoding
set statusline+=%{&ff}] "file format
set statusline+=%h "help file flag
set statusline+=%y "filetype
set statusline+=%r "read only flag
set statusline+=%m "modified flag
set statusline+=%= "left/right separator
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
endif
" ======================================================================
" Ctags
" ======================================================================
"
" Fugitive will set tags=.git/tags. Until we stop using Fugitive let's roll
" with that.
" ======================================================================
" Beyond the basics
" ======================================================================
" Plugin configurations
if filereadable(expand("~/.vim/plugin_config.vim"))
source ~/.vim/plugin_config.vim
endif
" Key mappings, functions, autocommands
if filereadable(expand("~/.vim/keymaps_etc.vim"))
source ~/.vim/keymaps_etc.vim
endif
" Local vimrc
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif