forked from rafi/vim-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
86 lines (74 loc) · 2.02 KB
/
init.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
" Vim Initialization
" ------------------
" Global Mappings "{{{
" Use spacebar as leader and ; as secondary-leader
" Required before loading plugins!
let g:mapleader="\<Space>"
let g:maplocalleader=';'
" Release keymappings prefixes, evict entirely for use of plug-ins.
nnoremap <Space> <Nop>
xnoremap <Space> <Nop>
nnoremap , <Nop>
xnoremap , <Nop>
nnoremap ; <Nop>
xnoremap ; <Nop>
nnoremap m <Nop>
xnoremap m <Nop>
" }}}
" Ensure cache directory "{{{
if ! isdirectory(expand($VARPATH))
" Create missing dirs i.e. cache/{undo,backup}
call mkdir(expand('$VARPATH/undo'), 'p')
call mkdir(expand('$VARPATH/backup'))
endif
" }}}
" Load vault settings "{{{
if filereadable(expand('$VIMPATH/.vault.vim'))
execute 'source' expand('$VIMPATH/.vault.vim')
endif
" }}}
" Setup dein {{{
if &runtimepath !~# '/dein.vim'
let s:dein_dir = expand('$VARPATH/dein').'/repos/github.com/Shougo/dein.vim'
if ! isdirectory(s:dein_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_dir
endif
execute 'set runtimepath+='.substitute(
\ fnamemodify(s:dein_dir, ':p') , '/$', '', '')
endif
" }}}
" Load less plugins while SSHing to remote machines {{{
if len($SSH_CLIENT)
let $VIM_MINIMAL = 1
endif
" }}}
" Disable default plugins "{{{
" Disable menu.vim
if has('gui_running')
set guioptions=Mc
endif
" Disable pre-bundled plugins
let g:loaded_getscript = 1
let g:loaded_getscriptPlugin = 1
let g:loaded_gzip = 1
let g:loaded_logiPat = 1
let g:loaded_matchit = 1
let g:loaded_matchparen = 1
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
let g:loaded_netrwFileHandlers = 1
let g:loaded_netrwSettings = 1
let g:loaded_rrhelper = 1
let g:loaded_ruby_provider = 1
let g:loaded_shada_plugin = 1
let g:loaded_spellfile_plugin = 1
let g:loaded_tar = 1
let g:loaded_tarPlugin = 1
let g:loaded_tutor_mode_plugin = 1
let g:loaded_2html_plugin = 1
let g:loaded_vimball = 1
let g:loaded_vimballPlugin = 1
let g:loaded_zip = 1
let g:loaded_zipPlugin = 1
" }}}
" vim: set foldmethod=marker ts=2 sw=2 tw=80 noet :