forked from tony/vim-config-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.vim
200 lines (147 loc) · 4.29 KB
/
settings.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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
" Use a low updatetime. This is used by CursorHold
set updatetime=1000
" I like my word boundary to be a little bigger than the default
" set iskeyword+=<,>,[,],:,-,`,!
" set iskeyword-=_
" Writes to the unnamed register also writes to the * and + registers. This
" makes it easy to interact with the system clipboard
if has ('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
"===============================================================================
" General Settings
"===============================================================================
syntax on
" This took a while to figure out. Neocomplcache + iTerm + the CursorShape
" fix is causing the completion menu popup to flash the first result. Tested it
" with AutoComplPop and the behavior doesn't exist, so it's isolated to
" Neocomplcache... :( Dug into the source for both and saw that AutoComplPop is
" setting lazyredraw to be on during automatic popup...
set lazyredraw
" Solid line for vsplit separator
" this is breaking 朋友‘s vimrc on osx.
" set fcs=vert:│
" Turn on the mouse, since it doesn't play well with tmux anyway. This way I can
" scroll in the terminal
set mouse=a
" Give one virtual space at end of line
set virtualedit=onemore
" Turn on line number
set number
" Always splits to the right and below
set splitright
set splitbelow
" Sets how many lines of history vim has to remember
set history=10000
" Set to auto read when a file is changed from the outside
set autoread
" Set to auto write file
set autowriteall
" Display unprintable chars
" set list
" this is breaking 朋友‘s vimrc on osx.
" set listchars=tab:▸\ ,extends:❯,precedes:❮,nbsp:␣
" set showbreak=↪
" Minimal number of screen lines to keep above and below the cursor
set scrolloff=10
" Min width of the number column to the left
set numberwidth=1
" Open all folds initially
set foldmethod=indent
set foldlevelstart=99
" No need to show mode due to Powerline
set noshowmode
set wildmode=list:longest,full
set wildmenu "turn on wild menu
" set wildignore
" See ignore.vim
"netrw.vim"{{{
" Change default directory.
set browsedir=current
"}}}
" Allow changing buffer without saving it first
set hidden
" Set backspace config
set backspace=eol,start,indent
" Case insensitive search
set ignorecase
set smartcase
" Set sensible heights for splits
" set winheight=50
" Setting this causes problems with Unite-outline. Don't really need it
" set winminheight=5
" Make search act like search in modern browsers
set incsearch
" Make regex a little easier to type
set magic
" Don't show matching brackets
set noshowmatch
" Show incomplete commands
set showcmd
" Turn off sound
set vb
set t_vb=
" Always show the statusline
set laststatus=2
" Explicitly set encoding to utf-8
set encoding=utf-8
" Column width indicator
set colorcolumn=+1
" Lower the delay of escaping out of other modes
set timeout timeoutlen=1000 ttimeoutlen=0
" Fix meta-keys which generate <Esc>A .. <Esc>z
if !has('gui_running')
" let c='a'
" while c <= 'z'
" exec "set <M-".c.">=\e".c
" exec "imap \e".c." <M-".c.">"
" let c = nr2char(1+char2nr(c))
" endw
" Map these two on its own to enable Alt-Shift-J and Alt-Shift-K. If I map the
" whole spectrum of A-Z, it screws up mouse scrolling somehow. Mouse events
" must be interpreted as some form of escape sequence that interferes.
" exec 'set <M-J>=J'
" exec 'set <M-K>=K'
endif
try
lang en_us
catch
endtry
" Turn backup off
set nobackup
set nowritebackup
set noswapfile
" Tab settings
set expandtab
set shiftwidth=2
set tabstop=8
set softtabstop=2
set smarttab
" Text display settings
set linebreak
" set textwidth=80
set autoindent
set nowrap
set whichwrap+=h,l,<,>,[,]
" no backup-files like bla~
set nobackup
set nowritebackup
" }}}
set relativenumber
set number
" enables the reading of .vimrc, .exrc and .gvimrc in the current directory.
set exrc
" Use vimgrep.
"set grepprg=internal
"" Use grep.
set grepprg=grep\ -inH
" http://stackoverflow.com/questions/15660669/what-is-a-un-file-or-or-why-does-vim-in-the-terminal-make-the-un-file
" no undo file
set noundofile
" Start the find and replace command across the entire file
vmap <leader>z <Esc>:%s/<c-r>=GetVisual()<cr>/
" http://stackoverflow.com/a/24167309
let g:netrw_dirhistmax = 0
set timeout timeoutlen=1000 ttimeoutlen=100