-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim_setup.txt
78 lines (69 loc) · 3.57 KB
/
vim_setup.txt
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
set nocompatible | filetype indent plugin on | syn on
set tabstop=4
set shiftwidth=4
set softtabstop=4
set number
set belloff=all
fun! EnsureVamIsOnDisk(plugin_root_dir)
" windows users may want to use http://mawercer.de/~marc/vam/index.php
" to fetch VAM, VAM-known-repositories and the listed plugins
" without having to install curl, 7-zip and git tools first
" -> BUG [4] (git-less installation)
let vam_autoload_dir = a:plugin_root_dir.'/vim-addon-manager/autoload'
if isdirectory(vam_autoload_dir)
return 1
else
if 1 == confirm("Clone VAM into ".a:plugin_root_dir."?","&Y\n&N")
" I'm sorry having to add this reminder. Eventually it'll pay off.
call confirm("Remind yourself that most plugins ship with ".
\"documentation (README*, doc/*.txt). It is your ".
\"first source of knowledge. If you can't find ".
\"the info you're looking for in reasonable ".
\"time ask maintainers to improve documentation")
call mkdir(a:plugin_root_dir, 'p')
execute '!git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager '.
\ shellescape(a:plugin_root_dir, 1).'/vim-addon-manager'
" VAM runs helptags automatically when you install or update
" plugins
exec 'helptags '.fnameescape(a:plugin_root_dir.'/vim-addon-manager/doc')
endif
return isdirectory(vam_autoload_dir)
endif
endfun
fun! SetupVAM()
" Set advanced options like this:
" let g:vim_addon_manager = {}
" let g:vim_addon_manager.key = value
" Pipe all output into a buffer which gets written to disk
" let g:vim_addon_manager.log_to_buf =1
" Example: drop git sources unless git is in PATH. Same plugins can
" be installed from www.vim.org. Lookup MergeSources to get more control
" let g:vim_addon_manager.drop_git_sources = !executable('git')
" let g:vim_addon_manager.debug_activation = 1
" VAM install location:
let c = get(g:, 'vim_addon_manager', {})
let g:vim_addon_manager = c
let c.plugin_root_dir = expand('$HOME/.vim/vim-addons', 1)
if !EnsureVamIsOnDisk(c.plugin_root_dir)
echohl ErrorMsg | echomsg "No VAM found!" | echohl NONE
return
endif
let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager'
" Tell VAM which plugins to fetch & load:
call vam#ActivateAddons([], {'auto_install' : 0})
" sample: call vam#ActivateAddons(['pluginA','pluginB', ...], {'auto_install' : 0})
" Also See "plugins-per-line" below
" Addons are put into plugin_root_dir/plugin-name directory
" unless those directories exist. Then they are activated.
" Activating means adding addon dirs to rtp and do some additional
" magic
" How to find addon names?
" - look up source from pool
" - (<c-x><c-p> complete plugin names):
" You can use name rewritings to point to sources:
" ..ActivateAddons(["github:foo", .. => github://foo/vim-addon-foo
" ..ActivateAddons(["github:user/repo", .. => github://user/repo
" Also see section "2.2. names of addons and addon sources" in VAM's documentation
endfun
call SetupVAM()
ActivateAddons vim-snippets snipmate