-
Notifications
You must be signed in to change notification settings - Fork 4
/
vimrc
74 lines (64 loc) · 2.19 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
" Some of the good parts (TM) from `$VIMRUNTIME/defaults.vim` are included here.
set mouse=a " Enable use of the mouse in all modes.
set history=10000 " Vim's default: 50. Neovim's default: 10000.
set incsearch " Search while typing the search command and...
set hlsearch " ...hightlight matches.
set shortmess-=S
set shortmess+=F
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
set maxmem=2000000 " Lots of memory for each buffer.
set maxmemtot=2000000 " Lots of memory for all buffers together.
if has('unix')
source ~/.vim/common.vim
elseif has('win32')
source ~/vimfiles/common.vim
endif
" TODO: explain.
if has('unix')
let s:vimfiles = $HOME .. '/.vim'
elseif has('win32')
" Use $HOME or $USERPROFILE?
let s:vimfiles = $HOME .. '/vimfiles'
endif
if exists('s:vimfiles')
if !isdirectory(s:vimfiles .. '/swp')
call mkdir(s:vimfiles .. '/swp', 'p')
endif
if !isdirectory(s:vimfiles .. '/undo')
call mkdir(s:vimfiles .. '/undo', 'p')
endif
if !isdirectory(s:vimfiles .. '/backup')
call mkdir(s:vimfiles .. '/backup', 'p')
endif
let &dir = s:vimfiles .. '/swp//'
let &undodir = s:vimfiles .. '/undo'
let &backupdir = s:vimfiles .. '/backup'
endif
" https://stackoverflow.com/questions/1549263/how-can-i-create-a-folder-if-it-doesnt-exist
" https://vim.wikia.com/wiki/Automatically_create_tmp_or_backup_directories
" If running inside screen, use these escape sequences to name the window (set the title
" of the VT100 emulated by screen).
if &term =~# 'screen'
set t_ts=k
set t_fs=\
endif " The settings for those termcap codes are taken from
" https://vim.wikia.com/wiki/Automatically_set_screen_title.
if exists('&belloff')
set belloff=all
endif
" Fallback method to disable beeping in case the 'belloff' option doesn't exist or doesn't
" work. See :h 'vb' and :h exists().
if !exists('+belloff')
set visualbell
set t_vb=
endif
" I copied this from sensible.vim [1]. Neovim doesn't need it [2].
if has('autocmd')
filetype plugin indent on
endif
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
" [1]: https://github.com/tpope/vim-sensible/blob/master/plugin/sensible.vim
" [2]: https://github.com/neovim/neovim/issues/2676