Skip to content
This repository
Browse code

Merge pull request #331 from msabramo/janus-help

Add a vim help file for Janus: janus.txt
  • Loading branch information...
commit 9a1973e580c75cec28f09471a11e55a8d3e2bc9f 2 parents 449eda5 + 6335357
Wael M. Nasreddine eMxyzptlk authored

Showing 1 changed file with 381 additions and 0 deletions. Show diff stats Hide diff stats

  1. +381 0 janus.txt
381 janus.txt
... ... @@ -0,0 +1,381 @@
  1 +*janus.txt* Janus: Carlhuda's vim Distribution *janus*
  2 +
  3 +CONTENTS *janus-contents*
  4 +
  5 + Introduction |janus-intro|
  6 + Mailing list |janus-mailing-list|
  7 + Installation |janus-installation|
  8 + Customization |janus-customization|
  9 + Updating |janus-updating|
  10 + Intro to vim |janus-vim-intro|
  11 + Janus features |janus-features|
  12 + Base customizations |janus-features-base-customizations|
  13 + NERDTree |janus-features-nerdtree|
  14 + Ack |janus-features-ack|
  15 + Align |janus-features-align|
  16 + Command-T |janus-features-command-t|
  17 + ConqueTerm |janus-features-conqueterm|
  18 + indent-object |janus-features-indent-object|
  19 + surround |janus-features-surround|
  20 + NERDCommenter |janus-features-nerdcommenter|
  21 + SuperTab |janus-features-supertab|
  22 + ctags |janus-features-ctags|
  23 + git |janus-features-git|
  24 + gist |janus-features-gist|
  25 + ZoomWin |janus-features-zoomwin|
  26 + Additional syntaxes |janus-features-syntaxes|
  27 + Color schemes |janus-features-colorschemes|
  28 +
  29 +
  30 +INTRODUCTION *janus-intro*
  31 +
  32 +This is a basic distribution of vim plugins and tools intended to be run
  33 +on top of the latest MacVIM snapshot.
  34 +
  35 +We (Carl and Yehuda) both use this distribution for our own use, and
  36 +welcome patches and contributions to help make it an effective way to
  37 +get started with vim and then use it productively for years to come.
  38 +
  39 +At present, we are still learning to use vim ourselves, so you should
  40 +anticipate a period of rapid development while we get a handle on the
  41 +best tools for the job. So far, we have mostly integrated existing
  42 +plugins and tools, and we anticipate to continue doing so while also
  43 +writing our own plugins as appropriate.
  44 +
  45 +In general, you can expect that the tools we use work well together and
  46 +that we have given careful thought to the experience of using MacVIM
  47 +with the tools in question. If you run into an issue using it, please
  48 +report an issue to the issue tracker.
  49 +
  50 +
  51 +MAILING LIST *janus-mailing-list*
  52 +
  53 +The mailing list is hosted at [Google
  54 +Groups](http://groups.google.com/group/janus-vimius), please join it for
  55 +discussion and announcements.
  56 +
  57 +
  58 +INSTALLATION *janus-installation*
  59 +
  60 +0. `for i in ~/.vim ~/.vimrc ~/.gvimrc; do [ -e $i ] && mv $i $i.old;
  61 + done`
  62 +1. `git clone git://github.com/carlhuda/janus.git ~/.vim`
  63 +2. `cd ~/.vim`
  64 +3. `rake`
  65 +
  66 +or
  67 +
  68 + `curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh`
  69 +
  70 +Note that MacVim and Janus must be compiled using the same version of
  71 +Ruby. This may cause problems for users of RVM or rbenv. To solve,
  72 +execute:
  73 +
  74 + rvm system
  75 + brew uninstall macvim
  76 + brew install macvim
  77 + curl https://raw.github.com/carlhuda/janus/master/bootstrap.sh -o - | sh
  78 + rvm default
  79 +
  80 +or
  81 +
  82 +If you use [Babushka](http://babushka.me) you can using the following script to install Janus
  83 +along with MacVim (will also setup mvim on your path)
  84 +
  85 + `babushka joshholt:janus`
  86 +
  87 +
  88 +CUSTOMIZATION *janus-customization*
  89 +
  90 +Create `~/.vimrc.local` and `~/.gvimrc.local` for any local customizations.
  91 +
  92 +For example, to override the default color schemes:
  93 +
  94 + echo color desert > ~/.vimrc.local
  95 + echo color molokai > ~/.gvimrc.local
  96 +
  97 +Create `~/.vimrc.pre` for any customizations that need to be run before
  98 +the loading of ~/.vimrc, e.g. changing of `<Leader>`.
  99 +
  100 +If you want to add additional Vim plugins you can do so by adding a
  101 +`~/.janus.rake` like so:
  102 +
  103 + vim_plugin_task "zencoding", "git://github.com/mattn/zencoding-vim.git"
  104 + vim_plugin_task "minibufexpl", "git://github.com/fholgado/minibufexpl.vim.git"
  105 +
  106 +Plugins hosted at [vim.org](http://www.vim.org/scripts) use a unique URL for each
  107 +version. If you want `~/.janus.rake` to point to a plugin hosted there, use the GitHub
  108 +mirror at [https://github.com/vim-scripts](https://github.com/vim-scripts)
  109 +to automatically point to the latest version:
  110 +
  111 + vim_plugin_task "bufexplorer", "git://github.com/vim-scripts/bufexplorer.zip.git"
  112 +
  113 +If you do not wish to use one of the plugins Janus provides out of the
  114 +box you can have it skipped using the `skip_vim_plugin` method in
  115 +`~/.janus.rake`:
  116 +
  117 + skip_vim_plugin "color-sampler"
  118 +
  119 +**Note**: Skipping the plugin will only apply to installation. It won't
  120 +remove configurations or mappings Janus might have added for it.
  121 +
  122 +
  123 +UPDATING TO THE LATEST VERSION *janus-updating*
  124 +
  125 +To update to the latest version of the distribution, just run `rake`
  126 +again inside your `~/.vim` directory.
  127 +
  128 +
  129 +INTRO TO VIM *janus-vim-intro*
  130 +
  131 +Here's some tips if you've never used VIM before:
  132 +
  133 +
  134 +TUTORIALS *janus-vim-tutorials*
  135 +
  136 +* Type `vimtutor` into a shell to go through a brief interactive
  137 + tutorial inside VIM.
  138 +* Read the slides at [VIM: Walking Without Crutches](http://walking-without-crutches.heroku.com/#1).
  139 +* Watch the screencasts at [vimcasts.org](http://vimcasts.org/)
  140 +* Watch Derek Wyatt's energetic tutorial videos at [his site](http://www.derekwyatt.org/vim/vim-tutorial-videos/)
  141 +* Read wycats' perspective on learning vim at
  142 + [Everyone who tried to convince me to use vim was wrong](http://yehudakatz.com/2010/07/29/everyone-who-tried-to-convince-me-to-use-vim-was-wrong/)
  143 +* Read this and other answers to a question about vim at StackOverflow:
  144 + [Your problem with Vim is that you don't grok vi](http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118)
  145 +
  146 +
  147 +MODES *janus-vim-modes*
  148 +
  149 +* VIM has two modes:
  150 + * insert mode- stuff you type is added to the buffer
  151 + * normal mode- keys you hit are interpretted as commands
  152 +* To enter insert mode, hit `i`
  153 +* To exit insert mode, hit `<ESC>`
  154 +
  155 +
  156 +USEFUL COMMANDS *janus-vim-useful-commands*
  157 +
  158 +* Use `:q` to exit vim
  159 +* Certain commands are prefixed with a `<Leader>` key, which maps to `\`
  160 + by default. Use `let mapleader = ","` to change this. If you want this
  161 + to be in effect for uses of <Leader> in your .vimrc, make sure to define
  162 + this in the `~/.vimrc.pre`
  163 +* Keyboard [cheat sheet](http://walking-without-crutches.heroku.com/image/images/vi-vim-cheat-sheet.png).
  164 +* Mapped key combinations using the command key (`<D-something>`) are only
  165 + available in macvim.
  166 +
  167 +
  168 +JANUS FEATURES *janus-features*
  169 +
  170 +This vim distribution includes a number of packages built by others.
  171 +
  172 +
  173 +## Base Customizations *janus-features-base-customizations*
  174 +
  175 +Janus ships with a number of basic customizations for vim:
  176 +
  177 +* Line numbers
  178 +* Ruler (line and column numbers)
  179 +* No wrap (turn off per-buffer via set :wrap)
  180 +* Soft 2-space tabs, and default hard tabs to 2 spaces
  181 +* Show tailing whitespace as `.`
  182 +* Make searching highlighted, incremental, and case insensitive unless a
  183 + capital letter is used
  184 +* Always show a status line
  185 +* Allow backspacing over everything (identations, eol, and start
  186 + characters) in insert mode
  187 +* `<Leader>e` expands to `:e {directory of current file}/` (open in the
  188 + current buffer)
  189 +* `<Leader>te` expands to `:te {directory of current file}/` (open in a
  190 + new MacVIM tab)
  191 +* `<C-P>` inserts the directory of the current file into a command
  192 +* Automatically resize splits when resizing the MacVim window
  193 +
  194 +
  195 +## "Project Drawer" aka [NERDTree](http://github.com/wycats/nerdtree) *janus-features-nerdtree*
  196 +
  197 +NERDTree is a file explorer plugin that provides "project drawer"
  198 +functionality to your vim projects. You can learn more about it with
  199 +:help NERDTree.
  200 +
  201 +**Customizations**: Janus adds a number of customizations to the core
  202 +NERDTree:
  203 +
  204 +* Use `<Leader>n` to toggle NERDTree
  205 +* Ignore `*.rbc` and `*~` files
  206 +* Automatically activate NERDTree when MacVIM opens and make the
  207 + original buffer the active one
  208 +* Provide alternative :e, :cd, :rm and :touch abbreviations which also
  209 + refresh NERDTree when done (when NERDTree is open)
  210 +* When opening vim with vim /path, open the left NERDTree to that
  211 + directory, set the vim pwd, and clear the right buffer
  212 +* Disallow `:e`ing files into the NERDTree buffer
  213 +* In general, assume that there is a single NERDTree buffer on the left
  214 + and one or more editing buffers on the right
  215 +
  216 +
  217 +## [Ack.vim](http://github.com/mileszs/ack.vim) *janus-features-ack*
  218 +
  219 +Ack.vim uses ack to search inside the current directory for a pattern.
  220 +You can learn more about it with :help Ack
  221 +
  222 +**Customizations**: Janus rebinds command-shift-f (`<D-F>`) to bring up
  223 +`:Ack `. [Ctrl-Shift-F (`<C-F>`) for GVim.]
  224 +
  225 +
  226 +## [Align](http://github.com/tsaleh/vim-align) *janus-features-align*
  227 +
  228 +Align lets you align statements on their equal signs, make comment
  229 +boxes, align comments, align declarations, etc.
  230 +
  231 +* `:5,10Align =>` to align lines 5-10 on `=>`'s
  232 +
  233 +
  234 +## [Command-T](https://wincent.com/products/command-t) *janus-features-command-t*
  235 +
  236 +Command-T provides a mechanism for searching for a file inside the
  237 +current working directory. It behaves similarly to command-t in
  238 +Textmate.
  239 +
  240 +**Customizations**: Janus rebinds command-t (`<D-t>`) to bring up this
  241 +plugin. [Ctrl-t (`<C-t>`) for GVim.] It defaults to `<Leader>t`.
  242 +
  243 +
  244 +## [ConqueTerm](http://code.google.com/p/conque/) *janus-features-conqueterm*
  245 +
  246 +ConqueTerm embeds a basic terminal inside a vim buffer. The terminal has
  247 +an insert mode in which you can type commands, tab complete and use the
  248 +terminal like normal. You can also escape out of insert mode to use
  249 +other vim commands on the buffer, like yank and paste.
  250 +
  251 +**Customizations**: Janus binds command-e (`<D-e>`) to bring up
  252 +`:ConqueTerm bash --login` in the current buffer. [Ctrl-e (`C-e`) for
  253 +GVim.]
  254 +
  255 +**Note**: To get colors working, you might have to `export TERM=xterm`
  256 +and use `ls -G` or `gls --color`
  257 +
  258 +
  259 +## [indent\_object](http://github.com/michaeljsmith/vim-indent-object) *janus-features-indent-object*
  260 +
  261 +Indent object creates a "text object" that is relative to the current
  262 +ident. Text objects work inside of visual mode, and with `c` (change),
  263 +`d` (delete) and `y` (yank). For instance, try going into a method in
  264 +normal mode, and type `v ii`. Then repeat `ii`.
  265 +
  266 +**Note**: indent\_object seems a bit busted. It would also be nice if
  267 +there was a text object for Ruby `class` and `def` blocks.
  268 +
  269 +
  270 +## [surround](http://github.com/tpope/vim-surround) *janus-features-surround*
  271 +
  272 +Surround allows you to modify "surroundings" around the current text.
  273 +For instance, if the cursor was inside `"foo bar"`, you could type
  274 +`cs"'` to convert the text to `'foo bar'`.
  275 +
  276 +There's a lot more; check it out at `:help surround`
  277 +
  278 +
  279 +## [NERDCommenter](http://github.com/ddollar/nerdcommenter) *janus-features-nerdcommenter*
  280 +
  281 +NERDCommenter allows you to wrangle your code comments, regardless of
  282 +filetype. View `:help NERDCommenter` for all the details.
  283 +
  284 +**Customizations**: Janus binds command-/ (`<D-/>`) to toggle comments.
  285 +
  286 +
  287 +## [SuperTab](http://github.com/ervandew/supertab) *janus-features-supertab*
  288 +
  289 +In insert mode, start typing something and hit `<TAB>` to tab-complete
  290 +based on the current context.
  291 +
  292 +
  293 +## ctags *janus-features-ctags*
  294 +
  295 +Janus includes the [TagList](http://github.com/vim-scripts/taglist.vim)
  296 +plugin, which binds `:Tlist` to an overview panel that lists all ctags
  297 +for easy navigation.
  298 +
  299 +**Customizations**: Janus binds `<Leader>rt` to the ctags command to
  300 +update tags.
  301 +
  302 +**Note**: For full language support, run `brew install ctags` to install
  303 +exuberant-ctags.
  304 +
  305 +**Tip**: Check out `:help ctags` for information about VIM's built-in
  306 +ctag support. Tag navigation creates a stack which can traversed via
  307 +`Ctrl-]` (to find the source of a token) and `Ctrl-T` (to jump back up
  308 +one level).
  309 +
  310 +
  311 +## Git Support ([Fugitive](http://github.com/tpope/vim-fugitive)) *janus-features-git*
  312 +
  313 +Fugitive adds pervasive git support to git directories in vim. For more
  314 +information, use `:help fugitive`
  315 +
  316 +Use `:Gstatus` to view `git status` and type `-` on any file to stage or
  317 +unstage it. Type `p` on a file to enter `git add -p` and stage specific
  318 +hunks in the file.
  319 +
  320 +Use `:Gdiff` on an open file to see what changes have been made to that
  321 +file
  322 +
  323 +
  324 +## [Gist-vim](http://github.com/mattn/gist-vim) *janus-features-gist*
  325 +
  326 +Nice [gist integration](https://github.com/mattn/gist-vim) by mattn.
  327 +Requires exporting your `GITHUB_TOKEN` and `GITHUB_USER` as environment
  328 +variables or setup your [GitHub token config](http://help.github.com/git-email-settings/).
  329 +
  330 +Try `:Gist`, `:Gist -p` and visual blocks.
  331 +
  332 +
  333 +## [ZoomWin](http://github.com/vim-scripts/ZoomWin) *janus-features-zoomwin*
  334 +
  335 +When working with split windows, ZoomWin lets you zoom into a window and
  336 +out again using `Ctrl-W o`
  337 +
  338 +**Customizations**: Janus binds `<Leader><Leader>` to `:ZoomWin`
  339 +
  340 +
  341 +## Additional Syntaxes *janus-features-syntaxes*
  342 +
  343 +Janus ships with a few additional syntaxes:
  344 +
  345 +* Markdown (bound to \*.markdown, \*.md, and \*.mk)
  346 +* Mustache (bound to \*.mustache)
  347 +* Arduino (bound to \*.pde)
  348 +* Haml (bound to \*.haml)
  349 +* Sass (bound to \*.sass)
  350 +* SCSS (bound to \*.scss)
  351 +* An improved JavaScript syntax (bound to \*.js)
  352 +* Map Gemfile, Rakefile, Vagrantfile and Thorfile to Ruby
  353 +* Git commits (set your `EDITOR` to `mvim -f`)
  354 +
  355 +
  356 +## Color schemes *janus-features-colorschemes*
  357 +
  358 +Janus includes the vim color sampler pack, which includes [over 100
  359 +popular color themes](http://www.vi-improved.org/color_sampler_pack/):
  360 +
  361 +* jellybeans
  362 +* matrix
  363 +* railscasts2
  364 +* tango
  365 +* vibrantink
  366 +* vividchalk
  367 +* wombat
  368 +* xoria256
  369 +
  370 +Use `:color vibrantink` to switch to a color scheme.
  371 +
  372 +Janus also has a few customized versions of popular themes:
  373 +
  374 +* jellybeans+
  375 +* molokai
  376 +* railscasts+
  377 +* vwilight
  378 +
  379 +
  380 +------------------------------------------------------------------------------
  381 +vim:tw=78:ft=help:

0 comments on commit 9a1973e

Please sign in to comment.
Something went wrong with that request. Please try again.