Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 273 lines (188 sloc) 8.637 kb
496f4e6 @wycats Initial stab at a README
wycats authored
1 # Janus: Carlhuda's vim Distribution
2
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
3 This is a basic distribution of vim plugins and tools intended to be run
4 on top of the latest MacVIM snapshot.
496f4e6 @wycats Initial stab at a README
wycats authored
5
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
6 We (Carl and Yehuda) both use this distribution for our own use, and
7 welcome patches and contributions to help make it an effective way to
8 get started with vim and then use it productively for years to come.
496f4e6 @wycats Initial stab at a README
wycats authored
9
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
10 At present, we are still learning to use vim ourselves, so you should
11 anticipate a period of rapid development while we get a handle on the
12 best tools for the job. So far, we have mostly integrated existing
13 plugins and tools, and we anticipate to continue doing so while also
14 writing our own plugins as appropriate.
496f4e6 @wycats Initial stab at a README
wycats authored
15
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
16 In general, you can expect that the tools we use work well together and
17 that we have given careful thought to the experience of using MacVIM
18 with the tools in question. If you run into an issue using it, please
19 report an issue to the issue tracker.
496f4e6 @wycats Initial stab at a README
wycats authored
20
25e6fc6 @tmm1 Update README w/ links to slides/cheatsheet/downloads, and add some info...
tmm1 authored
21 ## Pre-requisites
22
23 Janus is built primarily for [MacVim](http://code.google.com/p/macvim/) on OSX.
24 Download it [here](https://github.com/b4winckler/macvim/downloads).
25
26 Alternatively, you can use Janus with the bundled console `vim` installation on
27 OSX (via Terminal), or with any other vim or gvim installation.
28
29 Debian/Ubuntu users can `apt-get install vim-full` for a similar setup.
30
496f4e6 @wycats Initial stab at a README
wycats authored
31 ## Installation
32
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
33 0. `for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old;
34 done`
ef427bb @tmm1 install instructions still wrong
tmm1 authored
35 1. `git clone git://github.com/carlhuda/janus.git ~/.vim`
45ff74b @tmm1 fix install instructions
tmm1 authored
36 2. `cd ~/.vim`
496f4e6 @wycats Initial stab at a README
wycats authored
37 3. `rake`
38
312018f @benburkert Add a bootstrap script.
benburkert authored
39 or
40
b4731dd @c0 Changed curl installation url to https since github now redirects http t...
c0 authored
41 `curl https://github.com/carlhuda/janus/raw/master/bootstrap.sh -o - | sh`
312018f @benburkert Add a bootstrap script.
benburkert authored
42
25e6fc6 @tmm1 Update README w/ links to slides/cheatsheet/downloads, and add some info...
tmm1 authored
43 ## Customization
44
45 Create `~/.vimrc.local` and `~/.gvimrc.local` for any local
46 customizations.
47
48 For example, to override the default color schemes:
49
50 echo color desert > ~/.vimrc.local
51 echo color molokai > ~/.gvimrc.local
52
496f4e6 @wycats Initial stab at a README
wycats authored
53 ## Updating to the latest version
54
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
55 To update to the latest version of the distribution, just run `rake`
56 again inside your `~/.vim` directory.
496f4e6 @wycats Initial stab at a README
wycats authored
57
49ed638 @tmm1 update README
tmm1 authored
58 # Intro to VIM
59
60 Here's some tips if you've never used VIM before:
61
25e6fc6 @tmm1 Update README w/ links to slides/cheatsheet/downloads, and add some info...
tmm1 authored
62 ## Tutorials
49ed638 @tmm1 update README
tmm1 authored
63
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
64 * Type `vimtutor` into a shell to go through a brief interactive
65 tutorial inside VIM.
25e6fc6 @tmm1 Update README w/ links to slides/cheatsheet/downloads, and add some info...
tmm1 authored
66 * Read the slides at [VIM: Walking Without Crutches](http://walking-without-crutches.heroku.com/#1).
49ed638 @tmm1 update README
tmm1 authored
67
68 ## Modes
69
70 * VIM has two modes:
71 * insert mode- stuff you type is added to the buffer
72 * normal mode- keys you hit are interpretted as commands
73 * To enter insert mode, hit `i`
74 * To exit insert mode, hit `<ESC>`
75
76 ## Useful commands
77
78 * Use `:q` to exit vim
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
79 * Certain commands are prefixed with a `<Leader>` key, which maps to `\`
80 by default. Use `let mapleader = ","` to change this.
25e6fc6 @tmm1 Update README w/ links to slides/cheatsheet/downloads, and add some info...
tmm1 authored
81 * Keyboard [cheat sheet](http://walking-without-crutches.heroku.com/image/images/vi-vim-cheat-sheet.png).
49ed638 @tmm1 update README
tmm1 authored
82
496f4e6 @wycats Initial stab at a README
wycats authored
83 # Features
84
85 This vim distribution includes a number of packages built by others.
86
a05b0d8 @wycats Update the README
wycats authored
87 ## Base Customizations
88
89 Janus ships with a number of basic customizations for vim:
90
91 * Line numbers
92 * Ruler (line and column numbers)
93 * No wrap (turn off per-buffer via set :wrap)
94 * Soft 2-space tabs, and default hard tabs to 2 spaces
05c4ff9 @tmm1 update readable about tabs
tmm1 authored
95 * Show tailing whitespace as `.`
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
96 * Make searching highlighted, incremental, and case insensitive unless a
97 capital letter is used
a05b0d8 @wycats Update the README
wycats authored
98 * Always show a status line
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
99 * Allow backspacing over everything (identations, eol, and start
100 characters) in insert mode
101 * `<Leader>e` expands to `:e {directory of current file}/` (open in the
102 current buffer)
103 * `<Leader>tr` expands to `:te {directory of current file}/` (open in a
104 new MacVIM tab)
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
105 * `<C-P>` inserts the directory of the current file into a command
028d8e0 @wuputah README updates
wuputah authored
106 * Automatic insertion of closing quotes, parenthesis, and braces
a05b0d8 @wycats Update the README
wycats authored
107
108 ## "Project Drawer" aka NERDTree
496f4e6 @wycats Initial stab at a README
wycats authored
109
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
110 NERDTree is a file explorer plugin that provides "project drawer"
111 functionality to your vim projects. You can learn more about it with
112 :help NERDTree.
496f4e6 @wycats Initial stab at a README
wycats authored
113
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
114 **Customizations**: Janus adds a number of customizations to the core
115 NERDTree:
496f4e6 @wycats Initial stab at a README
wycats authored
116
49ed638 @tmm1 update README
tmm1 authored
117 * Use `<Leader>n` to toggle NERDTree
496f4e6 @wycats Initial stab at a README
wycats authored
118 * Ignore `*.rbc` and `*~` files
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
119 * Automatically activate NERDTree when MacVIM opens and make the
120 original buffer the active one
121 * Provide alternative :e, :cd, :rm and :touch abbreviations which also
122 refresh NERDTree when done (when NERDTree is open)
123 * When opening vim with vim /path, open the left NERDTree to that
124 directory, set the vim pwd, and clear the right buffer
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
125 * Disallow `:e`ing files into the NERDTree buffer
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
126 * In general, assume that there is a single NERDTree buffer on the left
127 and one or more editing buffers on the right
496f4e6 @wycats Initial stab at a README
wycats authored
128
129 ## Ack.vim
130
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
131 Ack.vim uses ack to search inside the current directory for a pattern.
132 You can learn more about it with :help Ack
496f4e6 @wycats Initial stab at a README
wycats authored
133
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
134 **Customizations**: Janus rebinds command-shift-f (`<D-F>`) to bring up
135 `:Ack `.
496f4e6 @wycats Initial stab at a README
wycats authored
136
ba58f5e @benburkert Readme documentation.
benburkert authored
137 ## Align
138
139 Align lets you align statements on their equal signs, make comment
140 boxes, align comments, align declarations, etc.
141
142 * `:5,10Align =>` to align lines 5-10 on `=>`'s
143
496f4e6 @wycats Initial stab at a README
wycats authored
144 ## Command-T
145
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
146 Command-T provides a mechanism for searching for a file inside the
147 current working directory. It behaves similarly to command-t in
148 Textmate.
496f4e6 @wycats Initial stab at a README
wycats authored
149
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
150 **Customizations**: Janus rebinds command-t (`<D-t>`) to bring up this
151 plugin. It defaults to `<Leader>t`.
496f4e6 @wycats Initial stab at a README
wycats authored
152
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
153 ## ConqueTerm
154
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
155 ConqueTerm embeds a basic terminal inside a vim buffer. The terminal has
156 an insert mode in which you can type commands, tab complete and use the
157 terminal like normal. You can also escape out of insert mode to use
158 other vim commands on the buffer, like yank and paste.
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
159
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
160 **Customizations**: Janus binds command-e (`<D-e>`) to bring up
161 `:ConqueTerm bash --login` in the current buffer.
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
162
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
163 **Note**: To get colors working, you might have to `export TERM=xterm`
164 and use `ls -G` or `gls --color`
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
165
496f4e6 @wycats Initial stab at a README
wycats authored
166 ## indent\_object
167
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
168 Indent object creates a "text object" that is relative to the current
169 ident. Text objects work inside of visual mode, and with `c` (change),
170 `d` (delete) and `y` (yank). For instance, try going into a method in
171 normal mode, and type `v ii`. Then repeat `ii`.
496f4e6 @wycats Initial stab at a README
wycats authored
172
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
173 **Note**: indent\_object seems a bit busted. It would also be nice if
174 there was a text object for Ruby `class` and `def` blocks.
a05b0d8 @wycats Update the README
wycats authored
175
176 ## surround
177
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
178 Surround allows you to modify "surroundings" around the current text.
179 For instance, if the cursor was inside `"foo bar"`, you could type
180 `cs"'` to convert the text to `'foo bar'`.
a05b0d8 @wycats Update the README
wycats authored
181
182 There's a lot more; check it out at `:help surround`
183
be7bac7 @wuputah add NERDCommenter, bind to Command-/
wuputah authored
184 ## NERDCommenter
185
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
186 NERDCommenter allows you to wrangle your code comments, regardless of
187 filetype. View `help :NERDCommenter` for all the details.
be7bac7 @wuputah add NERDCommenter, bind to Command-/
wuputah authored
188
189 **Customizations**: Janus binds command-/ (`<D-/>`) to toggle comments.
190
49ed638 @tmm1 update README
tmm1 authored
191 ## SuperTab
192
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
193 In insert mode, start typing something and hit `<TAB>` to tab-complete
194 based on the current context.
49ed638 @tmm1 update README
tmm1 authored
195
b5d6487 @tmm1 readme blurb about using ctags
tmm1 authored
196 ## ctags
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
197
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
198 Janus includes the TagList plugin, which binds `:Tlist` to an overview
199 panel that lists all ctags for easy navigation.
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
200
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
201 **Customizations**: Janus binds `<Leader>rt` to the ctags command to
202 update tags.
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
203
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
204 **Note**: For full language support, run `brew install ctags` to install
205 exuberant-ctags.
b5d6487 @tmm1 readme blurb about using ctags
tmm1 authored
206
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
207 **Tip**: Check out `:help ctags` for information about VIM's built-in
208 ctag support. Tag navigation creates a stack which can traversed via
209 `Ctrl-]` (to find the source of a token) and `Ctrl-T` (to jump back up
210 one level).
b5d6487 @tmm1 readme blurb about using ctags
tmm1 authored
211
a05b0d8 @wycats Update the README
wycats authored
212 ## Git Support (Fugitive)
213
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
214 Fugitive adds pervasive git support to git directories in vim. For more
215 information, use `:help fugitive`
a05b0d8 @wycats Update the README
wycats authored
216
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
217 Use `:Gstatus` to view `git status` and type `-` on any file to stage or
218 unstage it. Type `p` on a file to enter `git add -p` and stage specific
219 hunks in the file.
23eb571 @tmm1 Few notes about fugitive and color schemes in README
tmm1 authored
220
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
221 Use `:Gdiff` on an open file to see what changes have been made to that
222 file
23eb571 @tmm1 Few notes about fugitive and color schemes in README
tmm1 authored
223
f936138 @tmm1 ZoomWin readme + <Leader>z mapping
tmm1 authored
224 ## ZoomWin
225
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
226 When working with split windows, ZoomWin lets you zoom into a window and
227 out again using `Ctrl-W o`
f936138 @tmm1 ZoomWin readme + <Leader>z mapping
tmm1 authored
228
229 **Customizations**: Janus binds `<Leader>z` to `:ZoomWin`
230
a05b0d8 @wycats Update the README
wycats authored
231 ## Markdown Preview
232
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
233 Markdown preview takes the current buffer, converts the Markdown to
234 HTML, and opens it in your default browser.
a05b0d8 @wycats Update the README
wycats authored
235
49ed638 @tmm1 update README
tmm1 authored
236 **Customizations**: Janus binds `<Leader>p` to this plugin.
a05b0d8 @wycats Update the README
wycats authored
237
238 ## Additional Syntaxes
239
240 Janus ships with a few additional syntaxes:
241
242 * Markdown (bound to \*.markdown, \*.md, and \*.mk)
243 * Mustache (bound to \*.mustache)
244 * Haml (bound to \*.haml)
245 * Sass (bound to \*.sass)
246 * SCSS (bound to \*.scss)
247 * An improved JavaScript syntax (bound to \*.js)
248 * Map Gemfile, Rakefile and Thorfile to Ruby
028d8e0 @wuputah README updates
wuputah authored
249 * Git commits (set your `EDITOR` to `mvim -f`)
23eb571 @tmm1 Few notes about fugitive and color schemes in README
tmm1 authored
250
251 ## Color schemes
252
3f83d58 @wuputah reformat README to match new Markdown settings
wuputah authored
253 Janus includes the vim color sampler pack, which includes [over 100
254 popular color themes](http://www.vi-improved.org/color_sampler_pack/):
23eb571 @tmm1 Few notes about fugitive and color schemes in README
tmm1 authored
255
a41d409 @tmm1 include the vim Color Sampler Pack (http://www.vim.org/scripts/script.ph...
tmm1 authored
256 * jellybeans
257 * matrix
258 * railscasts2
259 * tango
260 * vibrantink
23eb571 @tmm1 Few notes about fugitive and color schemes in README
tmm1 authored
261 * vividchalk
a41d409 @tmm1 include the vim Color Sampler Pack (http://www.vim.org/scripts/script.ph...
tmm1 authored
262 * wombat
263 * xoria256
23eb571 @tmm1 Few notes about fugitive and color schemes in README
tmm1 authored
264
a41d409 @tmm1 include the vim Color Sampler Pack (http://www.vim.org/scripts/script.ph...
tmm1 authored
265 Use `:color vibrantink` to switch to a color scheme.
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
266
267 Janus also has a few customized versions of popular themes:
268
269 * jellybeans+
af82793 @tmm1 molokai theme
tmm1 authored
270 * molokai
33ef39c @tmm1 update README w/ info about conque, taglist and custom themes
tmm1 authored
271 * railscasts+
272
Something went wrong with that request. Please try again.