-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotvim.txt
206 lines (138 loc) · 6.54 KB
/
dotvim.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
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
201
202
203
204
205
206
*dotvim.txt* some dotfiles for vim
====================================================================
CONTENTS *DotVimContents*
1. Directories .......... |DotVimDirectories|
2. Bundles .............. |DotVimBundles|
3. Customizing .......... |DotVimConfigure|
4. Other ................ |DotVimOther|
====================================================================
Section 1: Directories *DotVimDirectories*
The directory layout of this set of dotfiles looks something like:
.vim/
├─ .backup/ ......... |DotVimHidden|
├─ .env/ ............ |DotVimPandemic|
├─ .swap/ ........... |DotVimHidden|
├─ .undo/ ........... |DotVimHidden|
├─ autoload/ ........ |DotVimPlugin|
├─ bundle/ .......... |DotVimBundles|
├─ bundle.remote/ ... |DotVimBundles|
├─ common/ .......... |DotVimCommonConfig|
├─ doc/ ............. |DotVimPlugin|
├─ ftdetect/ ........ |DotVimPlugin|
├─ hosts/ ........... |DotVimHosts|
├─ pandemic-bundles . |DotVimPandemic|
├─ plugin/ .......... |DotVimPlugin|
├─ presets/ ......... |DotVimPresets|
├─ setup.sh ......... |DotVimPandemic|
├─ snippets/ ........ |DotVimSnippets|
└─ vimrc ............ |DotVimConfigure|
Todo: Figure out if it's possible to link to helptags outside of
this file?
--------------------------------------------------------------------
Section 1.1: Temporary files *DotVimHidden*
We configure vim to store all turds/temporary files to common
directories within ~/.vim/
See: .backup/ |backup| (`help backup`)
.swap/ |swap-file| (`help swap-file`)
.undo/ |undodir| (`help undodir`)
====================================================================
Section 2: Bundles *DotVimDirectories*
If pathogen can be found (in autoload, or a bundle directory), it
will be loaded and in sequence add paths from `bundle` and
`bundle.remote` to the runtimepath.
The `bundle` directory is intended to hold _local_ vim bundles,
while the `bundle.remote` holds bundles that are managed by
Pandemic.
Want to install a package?
If it's for testing out, or something you only need on one specific
host, just clone it to the `bundles` directory, and let Pathogen
autoload it. Remember to run `:Helptags` (vim -c Helptags -c quit)
to get access to any documentation that comes with the bundle.
If it's something you want in all your vim environments, add it to
`pandemic-bundles` and run `setup.sh`.
Todo: Look into using another plugin manager?
* Vundle (https://github.com/VundleVim/Vundle.vim)
* dein.vim (https://github.com/Shougo/dein.vim)
* vim-plug (https://github.com/junegunn/vim-plug)
See: |runtimepath| (`help runtimepath`)
--------------------------------------------------------------------
Section 2.1: Pathogen *DotVimPathogen*
If pathogen can be found (in autoload, or a bundle directory), it
will be loaded and in sequence add paths from `bundle` and
`bundle.remote` to the runtimepath.
See: https://github.com/tpope/vim-pathogen
--------------------------------------------------------------------
Section 2.2: Pandemic *DotVimPandemic*
Everything in `bundle.remote` is handled by Pandemic. The file
`pandemic-bundles` contains a list of common plugins to install and
keep up to date.
Pandemic is a python package and script, so we install it in its own
virtualenv, `.env`.
The script `setup.sh` will:
1. Make sure Pandemic is installed in `.env`, and up to date.
2. Update all bundles in `bundle.remote` using the `pandemic-bundles`
config.
3. Update helptags using the Pathogen `:Helptags` command.
See: https://github.com/jwcxz/vim-pandemic
====================================================================
Section 3: Customize *DotVimConfigure*
Vim settings are split into multiple, smaller vim-files. The
~/.vim/vimrc sets up swap/backup turds (see |DotVimHidden|), and then
sources files from the following directories, in order:
1. ~/.vim/common |DotVimCommonConfig|
2. ~/.vim/presets |DotVimPresets|
3. ~/.vim/hosts |DotVimHosts|
--------------------------------------------------------------------
Section 3.1: Common configuration *DotVimCommonConfig*
All `*.vim' files in in ~/.vim/common gets sourced, no matter what.
If you want to set a common setting, set it there.
--------------------------------------------------------------------
Section 3.2: Preset configurations *DotVimPresets*
This directory contain configuration presets.
Each named preset ~/.vim/presets/<name>.vim gets loaded if it appears
in the environment variable |$VIMPRESETS|.
*$VIMPRESETS*
|$VIMPRESETS| is a ':'-separated ordered list of presets to load.
Example: `! export VIMPRESETS='work:unix:color16'`
--------------------------------------------------------------------
Section 3.3: Host configuration *DotVimHosts*
Configuration for a specific host can be split into separate configs
and put into ~/.vim/hosts/<hostname>.vim
If the output of `hostname()` contains `<hostname>`, the config is
loaded (`hostname() =~ <hostname>`).
This means that the <hostname> can be the FQDN of the host, or just a
label. If the hostname is 'myhost.example.org', any of the following
files should match:
- myhost.example.org.vim
- myhost.example.vim
- example.org.vim
- myhost.vim
Unfortunately, so will:
- host.example.vim
- h.vim
Todo: Implement better hostname matching
See: |hostname()| (`help hostname()`)
====================================================================
Section 4: Other stuff *DotVimOther*
--------------------------------------------------------------------
Section 4.1: Plugins *DotVimPlugin*
All 3rd party plugins are basically added as `bundles` using Pathogen.
This frees up the vim plugin directory structure so that we can use them as
intended, but for our own functionality.
- autoload
- colors
- compiler
- ftplugin
- indent
- keymap
- lang
- macros
- plugin
- tools
- tutor
These folders now contains custom plugins that are bundled with this dotvim
setup.
--------------------------------------------------------------------
Section 4.2: Snipmate snippets *DotVimSnippets*
Just a directory for storing text snippets.
See: https://github.com/garbas/vim-snipmate