-
Notifications
You must be signed in to change notification settings - Fork 20
/
vimrc
147 lines (106 loc) · 3.36 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
" This setting prevents vim from emulating the original vi's bugs and limitations.
set nocompatible
set tags=.git/tags
" Set default encoding to UTF-8.
set encoding=utf-8 fileencodings=
" The first setting sets up 2-space tabs, the second tells vi to use 2 spaces when text is indented (auto or with the manual indent adjustmenters), and the third tells vi not to auto-replace spaces with tab characters.
set tabstop=2
set shiftwidth=2
set expandtab
" I indent my code myself, thank you very much.
" set nocindent
" set noautoindent
" Automatic indentation
set autoindent
set smarttab
" This setting will cause the cursor to very briefly jump to a brace/parenthese/bracket's match whenever you type a closing or opening brace/parenthese/bracket.
set showmatch
" Keep 5 lines of context when scrolling
set scrolloff=5
" This setting prevents vi from making its annoying beeps when a command doesn't work. Instead, it briefly flashes the screen -- much less annoying.
" set noerrorbells
" set vb t_vb=
" Case insensitive matching.
set ignorecase
" Automatically save before :next, :make etc.
set autowrite
" Backspace and cursor keys wrap
set whichwrap+=<,>,h,l
" Allow backspacing over everything in insert mode.
set backspace=start,indent,eol
" Tell vim which characters to show for expanded TABs,
" trailing whitespace, and end-of-lines. VERY useful!
set listchars=tab:>-,trail:·,eol:$
" Make backup file
set backup
set backupdir=/tmp
set directory=/tmp
" Turn on wild menu
set wildmenu
" Path/file expansion in colon-mode.
set wildmode=longest:full,list:full,list:longest
set wildchar=<TAB>
" Enable vim modelines
" set modeline
" file for autosaved session
let g:ausession=".vimsession"
" Yes, we have a fast terminal
set ttyfast
" Make backup file
set nobackup
" Highlight search matches
set hlsearch
" Enable filetype-specific indenting and plugins
filetype on
filetype indent on
filetype plugin on
" Enable syntax highlighting
syntax enable
" Use brighter colors if has a dark background.
set background=dark
" Comments should be grey
highlight Comment ctermfg=grey
" Support all three, in this order
set ffs=unix,mac,dos
" None of these should be word dividers, so make them not be
set isk+=_,$,@,%,#,-
" make sure it can save viminfo
" set viminfo+=!
" How many lines of history to remember
set history=1000
" Space it out a little more (easier to read)
set lsp=0
" This setting ensures that each window contains a statusline that displays the current cursor position.
set ruler
set cmdheight=1
set laststatus=2
set statusline=%F%h%m%w%r\ %Y\ (%{&ff})%=\ %c%V,\ %l/%L\ (%P)
" Make backspace work normal
set backspace=2
" Disable mouse input
set mouse=
" Tell us when anything is changed via :...
set report=0
" Don't artificially wrap long lines on the screen
set nowrap
" Use bash instead of sh
set shell=/bin/bash
" Make window splitting behave
set noequalalways
set splitbelow
" Enable this if you mistype :w as :W or :q as :Q.
nmap :W :w
nmap :W! :w!
nmap :Q :q
nmap :Q! :q!
nmap :Wq! :wq!
nmap :WQ! :wq!
" Open where I left off
set viminfo='1000,\"1000,:20,%,n~/.viminfo
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
autocmd BufWritePre * :%s/\s\+$//e
" highlight ExtraTabs ctermbg=red guibg=red
let ruby_space_errors = 1
let c_space_errors = 1
highlight SignColumn ctermbg=black
set runtimepath^=~/.vim/bundle/ctrlp.vim