Repository: carlhuda/janus Branch: master Commit: 60e6864fbd60 Files: 40 Total size: 80.4 KB Directory structure: gitextract_by6q_3ml/ ├── .gitignore ├── .gitmodules ├── README.md ├── Rakefile ├── bootstrap.sh └── janus/ ├── ruby/ │ ├── janus/ │ │ ├── errors.rb │ │ ├── gems.rb │ │ ├── github.rb │ │ ├── plugins.rb │ │ └── vim.rb │ └── janus.rb ├── submodules.yaml └── vim/ ├── colors/ │ └── tasks/ │ └── sampler-pack.rake ├── core/ │ ├── before/ │ │ └── plugin/ │ │ ├── autocmds.vim │ │ ├── filetypes.vim │ │ ├── gui_settings.vim │ │ ├── janus.vim │ │ ├── mappings.vim │ │ ├── settings.vim │ │ └── statusline.vim │ ├── janus/ │ │ ├── after/ │ │ │ └── plugin/ │ │ │ └── vimrc_after.vim │ │ └── doc/ │ │ └── janus.txt │ └── plugins.vim ├── gvimrc ├── tools/ │ ├── before/ │ │ └── plugin/ │ │ └── nerdtree.vim │ └── janus/ │ └── after/ │ └── plugin/ │ ├── NERD_commenter.vim │ ├── ack.vim │ ├── ctrlp.vim │ ├── fugitive.vim │ ├── gist.vim │ ├── gundo.vim │ ├── kwbd.vim │ ├── narrowregion.vim │ ├── nerdtree.vim │ ├── syntastic.vim │ ├── tagbar.vim │ ├── unimpaired.vim │ ├── vimwiki.vim │ └── zoomwin.vim └── vimrc ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # ViM files _backup _temp .netrwhist # Vimius file .vimius # Plugins without git-mirror watchtower.vim mustache.vim # pathogen / vundle packages bundle ================================================ FILE: .gitmodules ================================================ # Core [submodule "janus/vim/core/pathogen"] path = janus/vim/core/pathogen url = https://github.com/tpope/vim-pathogen.git # Colors [submodule "janus/vim/colors/sampler-pack"] path = janus/vim/colors/sampler-pack url = https://github.com/vim-scripts/Colour-Sampler-Pack.git [submodule "janus/vim/colors/solarized"] path = janus/vim/colors/solarized url = https://github.com/altercation/vim-colors-solarized.git [submodule "janus/vim/colors/irblack"] path = janus/vim/colors/irblack url = https://github.com/twerth/ir_black.git [submodule "janus/vim/colors/vividchalk"] path = janus/vim/colors/vividchalk url = https://github.com/tpope/vim-vividchalk.git [submodule "janus/vim/colors/molokai"] path = janus/vim/colors/molokai url = https://github.com/vim-scripts/molokai.git [submodule "janus/vim/colors/pyte"] path = janus/vim/colors/pyte url = https://github.com/vim-scripts/pyte.git [submodule "janus/vim/colors/github"] path = janus/vim/colors/github url = https://github.com/telamon/vim-color-github.git [submodule "janus/vim/colors/getafe"] path = janus/vim/colors/getafe url = https://github.com/larssmit/vim-getafe.git [submodule "janus/vim/colors/janus-colors"] path = janus/vim/colors/janus-colors url = https://github.com/TechnoGate/janus-colors.git [submodule "janus/vim/colors/vim-tomorrow-theme"] path = janus/vim/colors/vim-tomorrow-theme url = https://github.com/chriskempson/vim-tomorrow-theme.git [submodule "janus/vim/colors/base16-vim"] path = janus/vim/colors/base16-vim url = https://github.com/chriskempson/base16-vim.git [submodule "janus/vim/colors/darcula"] path = janus/vim/colors/darcula url = https://github.com/blueshirts/darcula # Langs [submodule "janus/vim/langs/rails"] path = janus/vim/langs/rails url = https://github.com/tpope/vim-rails.git [submodule "janus/vim/langs/csv"] path = janus/vim/langs/csv url = https://github.com/chrisbra/csv.vim.git [submodule "janus/vim/langs/nodejs"] path = janus/vim/langs/nodejs url = https://github.com/mmalecki/vim-node.js.git [submodule "janus/vim/langs/minitest"] path = janus/vim/langs/minitest url = https://github.com/sunaku/vim-ruby-minitest.git [submodule "janus/vim/langs/rdoc"] path = janus/vim/langs/rdoc url = https://github.com/depuracao/vim-rdoc.git [submodule "janus/vim/langs/vim-polyglot"] path = janus/vim/langs/vim-polyglot url = https://github.com/sheerun/vim-polyglot # Tools [submodule "janus/vim/tools/unimpaired"] path = janus/vim/tools/unimpaired url = https://github.com/tpope/vim-unimpaired.git [submodule "janus/vim/tools/nerdcommenter"] path = janus/vim/tools/nerdcommenter url = https://github.com/scrooloose/nerdcommenter.git [submodule "janus/vim/tools/supertab"] path = janus/vim/tools/supertab url = https://github.com/ervandew/supertab.git [submodule "janus/vim/tools/ack"] path = janus/vim/tools/ack url = https://github.com/mileszs/ack.vim.git [submodule "janus/vim/tools/fugitive"] path = janus/vim/tools/fugitive url = https://github.com/tpope/vim-fugitive.git [submodule "janus/vim/tools/gundo"] path = janus/vim/tools/gundo url = https://github.com/sjl/gundo.vim.git [submodule "janus/vim/tools/surround"] path = janus/vim/tools/surround url = https://github.com/tpope/vim-surround.git [submodule "janus/vim/tools/snipmate"] path = janus/vim/tools/snipmate url = https://github.com/garbas/vim-snipmate.git [submodule "janus/vim/tools/tlib"] path = janus/vim/tools/tlib url = https://github.com/tomtom/tlib_vim.git [submodule "janus/vim/tools/vim-addon-mw-utils"] path = janus/vim/tools/vim-addon-mw-utils url = https://github.com/MarcWeber/vim-addon-mw-utils.git [submodule "janus/vim/tools/syntastic"] path = janus/vim/tools/syntastic url = https://github.com/vim-syntastic/syntastic.git [submodule "janus/vim/tools/tagbar"] path = janus/vim/tools/tagbar url = https://github.com/majutsushi/tagbar.git [submodule "janus/vim/tools/nerdtree"] path = janus/vim/tools/nerdtree url = https://github.com/scrooloose/nerdtree.git [submodule "janus/vim/tools/indent-object"] path = janus/vim/tools/indent-object url = https://github.com/michaeljsmith/vim-indent-object.git [submodule "janus/vim/tools/endwise"] path = janus/vim/tools/endwise url = https://github.com/tpope/vim-endwise.git [submodule "janus/vim/tools/webapi"] path = janus/vim/tools/webapi url = https://github.com/mattn/webapi-vim.git [submodule "janus/vim/tools/gist"] path = janus/vim/tools/gist url = https://github.com/mattn/gist-vim.git [submodule "janus/vim/tools/vimwiki"] path = janus/vim/tools/vimwiki url = https://github.com/vim-scripts/vimwiki.git [submodule "janus/vim/tools/css-color"] path = janus/vim/tools/css-color url = https://github.com/ap/vim-css-color.git [submodule "janus/vim/tools/easymotion"] path = janus/vim/tools/easymotion url = https://github.com/Lokaltog/vim-easymotion.git [submodule "janus/vim/tools/narrowregion"] path = janus/vim/tools/narrowregion url = https://github.com/chrisbra/NrrwRgn.git [submodule "janus/vim/tools/buffergator"] path = janus/vim/tools/buffergator url = https://github.com/jeetsukumaran/vim-buffergator.git [submodule "janus/vim/tools/kwbd"] path = janus/vim/tools/kwbd url = https://github.com/rgarver/Kwbd.vim.git [submodule "janus/vim/tools/ctrlp"] path = janus/vim/tools/ctrlp url = https://github.com/ctrlpvim/ctrlp.vim.git [submodule "janus/vim/tools/vroom"] path = janus/vim/tools/vroom url = https://github.com/skalnik/vim-vroom.git [submodule "janus/vim/tools/eunuch"] path = janus/vim/tools/eunuch url = https://github.com/tpope/vim-eunuch.git [submodule "janus/vim/tools/repeat"] path = janus/vim/tools/repeat url = https://github.com/tpope/vim-repeat.git [submodule "janus/vim/tools/vim-snippets"] path = janus/vim/tools/vim-snippets url = https://github.com/honza/vim-snippets.git [submodule "janus/vim/tools/dispatch"] path = janus/vim/tools/dispatch url = https://github.com/tpope/vim-dispatch.git [submodule "janus/vim/tools/multiple-cursors"] path = janus/vim/tools/multiple-cursors url = https://github.com/terryma/vim-multiple-cursors.git [submodule "janus/vim/tools/visualstar"] path = janus/vim/tools/visualstar url = https://github.com/thinca/vim-visualstar.git [submodule "janus/vim/tools/vim-trailing-whitespace"] path = janus/vim/tools/vim-trailing-whitespace url = https://github.com/bronson/vim-trailing-whitespace.git [submodule "janus/vim/tools/vim-gitgutter"] path = janus/vim/tools/vim-gitgutter url = https://github.com/airblade/vim-gitgutter.git [submodule "janus/vim/tools/zoomwin"] path = janus/vim/tools/zoomwin url = https://github.com/sh-dude/ZoomWin.git ================================================ FILE: README.md ================================================ # Janus: Vim Distribution This is a distribution of plug-ins and mappings for Vim, Gvim and MacVim. It is designed to provide minimal working environment using the most popular plug-ins and the most common mappings. The distribution is completely customisable using a `~/.vimrc.before` and `~/.vimrc.after` Vim RC files. ## Updating to the latest version To update to the latest version of the distribution, just run `rake` inside your `~/.vim` directory. NOTE: If you ever have an error updating Janus relating to a missing commit in a submodule, please try running `rake` again before submitting an issue. ## Mailing list The mailing list is hosted at [Google Groups](http://groups.google.com/group/janus-vimius), please join it for discussion and announcements. ## Pre-requisites The distribution is designed to work with Vim >= 7.3. The distribution also requires `ack`, `ctags`, `git`, `ruby` and `rake`. For the most comfortable experience, use the GUI version of Vim. Linux users should install `gvim`, OSX users should install [MacVim](http://code.google.com/p/macvim/). The recommended way of installing MacVim is using [Homebrew](http://mxcl.github.com/homebrew/), but before installing MacVim you need to use system-wide Python (If you are using python that is): * If you're using **pythonbrew**: do `pythonbrew off` ```bash $ brew install macvim ``` If you don't use Homebrew, you can still download MacVim [here](https://github.com/b4winckler/macvim/releases). Take a look at the [Pre-requisites wiki page](https://github.com/carlhuda/janus/wiki/Pre-requisites) for more information. ## Installation To install Janus, please use our [automatic installer](https://github.com/carlhuda/janus/blob/master/bootstrap.sh) , which backs up any Vim files found in your home folder and installs Janus. ```bash $ curl -L https://bit.ly/janus-bootstrap | bash ``` ## Customization You can use `~/.gvimrc.before` and `~/.vimrc.before` for settings Janus itself uses, such as the __leader__ setting. You may also use `~/.gvimrc.after` and `~/.vimrc.after` for any additional settings; it is also a good place for overriding Janus settings, as both files will be loaded at the end of Janus. For example, to override the default color schemes: ```bash $ echo 'color desert' >> ~/.vimrc.after $ echo 'color molokai' >> ~/.gvimrc.after ``` If you want to do additional customization or add more Vim plugins, create a `~/.janus` directory and add your plugins there, either with a `git clone` or by adding submodules to your own git repository there. This directory is treated like a normal pathogen directory. For example: ```bash $ cd ~/.janus $ git clone https://github.com/vim-scripts/Rename2.git rename2 ``` Or, if you have a git repository in `~/.janus`, you can use a submodule: ```bash $ cd ~/.janus $ git submodule add https://github.com/vim-scripts/Rename2.git rename2 ``` If you would like to disable an included plug-in, you can do that with the `janus#disable_plugin()` function from inside your `~/.vimrc.before`. This function takes a plug-in name as an argument without the group. For example, if you would like to disable the NERDCommenter plug-in, you can do that with the command: ```bash $ echo "call janus#disable_plugin('nerdcommenter')" >> ~/.vimrc.before ``` **WARNING**: We've noticed over and over, that people fork Janus just to customize it. This is bad practice for several reasons and you should not do that, and here's why: - Janus is fully customisable and there's no need to change the core for using a different plugin fork or using a different mapping. - Forking means maintenance; maintenance means burden. Do not burden yourself with maintaining a fork; that's what the `~/.janus` folder is for. If you find yourself needing a customisation that is not possible with the current setup, then please open an issue or consider submitting a pull request to make it possible to continue using/improving the official repo. **WARNING**: Any **uncommited** files inside the **janus** folder will be removed the next time you run `rake` so make sure to either put them in the custom folder (`~/.janus`), or commit them. We clean the janus folder in case we replace a manually installed plugin (using rake tasks) with a submodule. For more information on how to customize Janus, you might want to take a look at the [Customization wiki page](https://github.com/carlhuda/janus/wiki/Customization). Additional you can see [Example](https://github.com/khusnetdinov/.janus) of customization. # Intro to VIM Here're some tips in case you've never used VIM before: ## Tutorials * Type `vimtutor` into a shell to go through a brief interactive tutorial inside VIM. * Watch this presentation at [VIM: Walking Without Crutches](https://vimeo.com/16458939) or read the [slides on Speaker Deck](https://speakerdeck.com/nelstrom/vim-precision-editing-at-the-speed-of-thought). * Watch the screencasts at [vimcasts.org](http://vimcasts.org/) * Watch Derek Wyatt's energetic tutorial videos at [his site](http://derekwyatt.org/vim/tutorials/) * Read wycats' perspective on learning Vim at [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/) * Read this and other answers to a question about vim at StackOverflow: [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) * Read the [Getting Started with Vim](http://www.sitepoint.com/getting-started-vim/) tutorial on SitePoint * Read the [Effective Rails Development with Vim](http://www.sitepoint.com/effective-rails-development-vim/) tutorial on SitePoint ## Modes * VIM has three modes: * insert mode- stuff you type is added to the buffer * normal mode- keys you hit are interpreted as commands * visual mode- allows you to select blocks of text * To enter insert mode, hit `i` * To exit insert mode, hit `` * To enter visual mode, hit `v` * To exit visual mode, hit `` ## Useful commands * Use `:q` to exit vim * Certain commands are prefixed with a `` key, which maps to `\` by default. You can, for example, use `let mapleader = ","` to change this to a comma. If you want this to be in effect for uses of `` in the .vimrc file, make sure to define this in `~/.vimrc.before` * Keyboard [cheat sheet](http://vim.rtorr.com/). # Features This Vim distribution includes a number of packages built by others. ## Base Customizations Janus ships with a number of basic customizations for vim: * Line numbers * Ruler (line and column numbers) * No wrap (turn off per-buffer via :set wrap) * Soft 2-space tabs, and default hard tabs to 2 spaces * Show trailing whitespace as `.` * Make searching highlighted, incremental, and case insensitive unless a capital letter is used * Always show a status line * Allow backspacing over everything (indentations, eol, and start characters) in insert mode * `` inserts the directory of the current file into a command * Automatically resize splits when resizing the Vim window (GUI only) * `ew` expands to `:e (directory of current file)/` (open in the current buffer) * `es` expands to `:sp (directory of current file)/` (open in a horizontal split) * `ev` expands to `:vsp (directory of current file)/` (open in a vertical split) * `et` expands to `:tabe (directory of current file)/` (open in a new tab) * Write a privileged file with `:SudoW` or `:SudoWrite`, it will prompt for sudo password when writing * `` toggles paste mode * `fef` formats the entire file * `u` converts the entire word to uppercase * `l` converts the entire word to lowercase * `U` converts the first char of a word to uppercase * `L` converts the first char of a word to lowercase * `cd` changes the path to the active buffer's file * `md` creates the directory of the active buffer's file (For example, when editing a new file for which the path does not exist.) * `gw` swaps the current word with the following word * `ul` underlines the current line with `=` * `tw` toggles wrap * `fc` finds the next conflict marker (tested with Git conflicted files) * Remap `` and `` to `gj` and `gk` (Wrapped text is not considered a single long line of text.) * `hs` toggles highlight search * `=` adjusts viewports to the same size (`=`) * `!` invokes kwbd plugin; it closes all open buffers in the open windows but keeps the windows open ## [Ack.vim](http://github.com/mileszs/ack.vim) Ack.vim uses ack to search inside the current directory for a pattern. You can learn more about it with :help Ack. **Customizations**: Janus rebinds command-shift-f (``) to bring up `:Ack `. ## [CtrlP](https://github.com/ctrlpvim/ctrlp.vim) Fuzzy file, buffer, mru and tag finder. Replaces [Command-T](https://github.com/wincent/Command-T) **Customizations**: For users of Command-T Janus maps CtrlP to command-t (``) ## [NERDCommenter](http://github.com/ddollar/nerdcommenter) NERDCommenter allows you to wrangle your code comments, regardless of filetype. View `:help NERDCommenter` for all the details. **Customizations**: Janus binds command-/ (``) to toggle comments. ## [NERDTree](https://github.com/scrooloose/nerdtree) NERDTree is a file explorer plugin that provides "project drawer" functionality to your vim projects. You can learn more about it with :help NERDTree. **Customizations**: Janus adds a number of customizations to the core NERDTree: * Use `n` to toggle NERDTree * Ignore compiled ruby, python, and java files * When opening vim with vim /path, open the left NERDTree to that directory, set the vim pwd, and clear the right buffer * In general, assume that there is a single NERDTree buffer on the left and one or more editing buffers on the right ## [Unimpaired](https://github.com/tpope/vim-unimpaired) This plugin provides a lot of useful mappings, here's a brief example of what it does provide: * `[b` to go to the previous buffer * `]b` to go to the next buffer * `[n` to go to the previous SCM conflict marker * `]n` to go to the next SCM conflict marker Please check [`:help unimpaired`](https://github.com/tpope/vim-unimpaired/blob/master/doc/unimpaired.txt) for a complete list ## [SuperTab](http://github.com/ervandew/supertab) In insert mode, start typing something and hit `` to tab-complete based on the current context. ## [Syntastic](https://github.com/scrooloose/syntastic/) Syntastic is a syntax checking plugin that runs files through external syntax checkers as they are saved and opened. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them. Please see [`:help syntastic`](https://github.com/vim-syntastic/syntastic/blob/master/doc/syntastic.txt) for more information. ## [Tagbar](https://github.com/majutsushi/tagbar) Tagbar is a vim plugin for browsing the tags of source code files. **Customizations**: Janus binds `rt` to toggle Tagbar. ## [SnipMate](https://github.com/garbas/vim-snipmate) SnipMate defines text snippets (a series of characters) that expand to a useful piece of code when tab is pressed. For example, in a Ruby file, def`` expands to: ```ruby def method_name end ``` After typing in the method name, press tab again to put the cursor right where you want it on the next line. [This repository](https://github.com/honza/vim-snippets/tree/master/snippets) has a full list of the Snippets that are available in Janus. ## [EasyMotion](https://github.com/Lokaltog/vim-easymotion) EasyMotion provides a much simpler way to use some motions in vim. It takes the `` out of `w` or `f{char}` by highlighting all possible choices and allowing you to press one key to jump directly to the target. When one of the available motions is triggered, all visible text preceding or following the cursor is faded, and motion targets are highlighted. EasyMotion is triggered by one of the provided mappings. check EasyMotion's [home page](https://github.com/Lokaltog/vim-easymotion) for more information. ## [NrrwRgn](https://github.com/chrisbra/NrrwRgn) Narrowing means focussing on a region and making the rest inaccessible. You simply select the region, call :NarrowRegion and the selected part will open in a new scratch buffer. The rest of the file will be protected, so you won't accidentally modify that buffer. In the new buffer, you can do a global replace, search or anything else to modify that part. When you are finished, simply write that buffer (e.g. by |:w|) and your modifications will be put in the original buffer making it accessible again. ## Git Support ([Fugitive](http://github.com/tpope/vim-fugitive)) Fugitive adds pervasive git support to git directories in vim. For more information, use `:help fugitive` Use `:Gstatus` to view `git status` and type `-` on any file to stage or unstage it. Type `p` on a file to enter `git add -p` and stage specific hunks in the file. Use `:Gdiff` on an open file to see what changes have been made to that file **customizations**: * `gb` maps to `:Gblame` * `gs` maps to `:Gstatus` * `gd` maps to `:Gdiff` * `gl` maps to `:Glog` * `gc` maps to `:Gcommit` * `gp` maps to `:Git push` ## [Git Gutter](http://github.com/airblade/vim-gitgutter) A Vim plugin which shows a git diff in the 'gutter' (sign column). It shows whether each line has been added, modified, and where lines have been removed. You can also stage and revert individual hunks. ## [ZoomWin](http://github.com/vim-scripts/ZoomWin) When working with split windows, ZoomWin lets you zoom into a window and out again using `Ctrl-W o` **Customizations**: Janus binds `zw` to `:ZoomWin` ## [JSON](https://github.com/elzr/vim-json) Better JSON and JSONP with distinct highlighting for keywords versus values, strings colored differently from numbers and booleans and double quotes concealed (disable with `let g:vim_json_syntax_conceal = 0` in `~/.vimrc.after`, folding of {...} and [...] blocks (enable with `:setlocal foldmethod=syntax`, and JSON-specific warnings highlighted in red. ## [BufferGator](https://github.com/jeetsukumaran/vim-buffergator) Buffergator is a plugin for listing, navigating between, and selecting buffers to edit. Upon invocation (using the command, `:BuffergatorOpen` or `BuffergatorToggle`, or the provided key mapping, `b`), a `catalog` of listed buffers are displayed in a separate new window split (vertical or horizontal, based on user options; default = vertical). From this "buffer catalog", a buffer can be selected and opened in an existing window, a new window split (vertical or horizontal), or a new tab page. Selected buffers can be "previewed", i.e. opened in a window or tab page, but with focus remaining in the buffer catalog. Even better, you can "walk" up and down the list of buffers shown in the catalog by using `` (or ``) / `` (or ``). These keys select the next/previous buffer in succession, respectively, opening it for preview without leaving the buffer catalog viewer. ## [Vroom](https://github.com/skalnik/vim-vroom) VRoom is a plugin inspired by [Gary Bernhardt's vim config](https://github.com/garybernhardt/dotfiles/blob/69330074b7a15c67efa4594a71fa91592f1ce4f9/.vimrc#L286-342) for running your ruby tests/specs/features. Imagine you're hacking on a Rails controller, when you switch to the test or specs for the controller, you can use `r` to run all the specs or `R` to run the closest spec, then you can jump back to the controller hack on it and use `r` to run the last spec you ran last time, so you don't need to open the test again. Then benefits of this plugin are to centralize your workflow in one window, one software to do it all, which is a huge speedup over using `tmux` or multiple terminal tabs. ## [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) Out of the box, all you need to know is a single key `Ctrl-n`. Pressing the key in Normal mode highlights the current word under the cursor in Visual mode and places a virtual cursor at the end of it. Pressing it again finds the next occurrence and places another virtual cursor at the end of the visual selection. If you select multiple lines in Visual mode, pressing the key puts a virtual cursor at every line and leaves you in Normal mode. More at [QuickStart](https://github.com/terryma/vim-multiple-cursors/blob/master/README.md#quick-start) ## [vim-trailing-whitespace](https://github.com/bronson/vim-trailing-whitespace) This plugin causes all trailing whitespace to be highlighted in red. To fix the whitespace errors, just call :FixWhitespace. By default it operates on the entire file. Pass a range (or use V to select some lines) to restrict the portion of the file that gets fixed. ## Additional Syntaxes Janus ships with a few additional syntaxes: * Markdown (bound to \*.markdown, \*.md, and \*.mk) * Markdown auto styling (disabled by setting `g:disable_markdown_autostyle` in `~/.vimrc.before` => `let g:disable_markdown_autostyle = 1`) * Mustache (bound to \*.mustache) * Haml (bound to \*.haml) * Sass (bound to \*.sass) * SCSS (bound to \*.scss) * An improved JavaScript syntax (bound to \*.js) * Javascript for any file having `nodejs` in the shebang. * Map Gemfile, Rakefile, Vagrantfile, Procfile, Thorfile, config.ru and *.rake to Ruby. * Git commits (set your `EDITOR` to `vim -f` or `mvim -f` on OSX) `$ echo "export EDITOR='vim -f'" >> ~/.bashrc`, you can also use Git global config to set this if you have EDITOR set to something else `$ git config --global core.editor 'vim -f'` # License ### This code is free to use under the terms of the MIT license. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Rakefile ================================================ ROOT_PATH = File.expand_path(File.join(File.dirname(__FILE__))) $: << File.join(ROOT_PATH, 'janus', 'ruby') require 'janus' require 'fileutils' include Janus desc "link ViM configuration files." task :link_vim_conf_files do %w[ vimrc gvimrc ].each do |file| dest = expand("~/.#{file}") unless File.exist?(dest) require 'rbconfig' source = expand("../janus/vim/#{file}", __FILE__) if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ require 'open3' dest.gsub!(?/, ?\\) source.gsub!(?/, ?\\) puts "cmd.exe /c mklink #{dest} #{source}" stdin, stdout, stderr, wait_thr = Open3.popen3('cmd.exe', "/c mklink #{dest} #{source}") wait_thr.value.exitstatus else ln_s(source, dest) end end end end namespace :dev do desc "Update submodules" task :update_submodules do sh "git submodule foreach 'git fetch origin && git reset --hard origin/master'" end # Taken from RefineryCMD # https://github.com/resolve/refinerycms/blob/master/core/lib/tasks/refinery.rake desc 'Removes trailing whitespace across the entire application.' task :whitespace do require 'rbconfig' if RbConfig::CONFIG['host_os'] =~ /linux/ sh %{find . -name '*.*rb' -o -name '*.*vim' -exec sed -i 's/\t/ /g' {} \\; -exec sed -i 's/ *$//g' {} \\; } elsif RbConfig::CONFIG['host_os'] =~ /darwin/ sh %{find . -name '*.*rb' -o -name '*.*vim' -exec sed -i '' 's/\t/ /g' {} \\; -exec sed -i '' 's/ *$//g' {} \\; } else puts "This doesn't work on systems other than OSX or Linux. Please use a custom whitespace tool for your platform '#{RbConfig::CONFIG["host_os"]}'." end end end desc "Create necessary folders." task :folders do Janus::VIM.folders.each do |folder| mkdir_p folder end end task :update do is_windows = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ redirect_out = is_windows ? '> NUL' : '> /dev/null' redirect_out_err = is_windows ? '> NUL 2> NUL' : '&> /dev/null' puts "Cleaning the janus folder" `git clean -xdf -- janus #{redirect_out_err}` `git ls-files --exclude-standard --others -- janus`.split("\n").each do |untracked| FileUtils.rm_rf File.expand_path(untracked.chomp, File.dirname(__FILE__)) end puts "Pulling latest changes" `git pull #{redirect_out}` puts "Cleaning the janus folder" `git clean -xdf -- janus #{redirect_out_err}` `git ls-files --exclude-standard --others -- janus`.split("\n").each do |untracked| FileUtils.rm_rf File.expand_path(untracked.chomp, File.dirname(__FILE__)) end puts "Synchronising submodules urls" `git submodule sync #{redirect_out}` puts "Updating the submodules" `git submodule update --init #{redirect_out}` end task :install => [:folders, :link_vim_conf_files] do # Dummy task, real work is done with the hooks. end desc "Install or Update Janus." task :default do sh "rake update" sh "rake install" end ================================================ FILE: bootstrap.sh ================================================ #!/bin/bash function die() { echo "${@}" exit 1 } function backup_previous_install() { # Add .old to any existing Vim file in the home directory for filepath in "${HOME}/.vim" "${HOME}/.vimrc" "${HOME}/.gvimrc"; do if [ -e $filepath ]; then mv "${filepath}" "${filepath}.old" || die "Could not move ${filepath} to ${filepath}.old" echo "${filepath} has been renamed to ${filepath}.old" fi done } function clone_janus() { # Clone Janus into .vim git clone --recursive https://github.com/carlhuda/janus.git "${HOME}/.vim" \ || die "Could not clone the repository to ${HOME}/.vim" } function run_rake() { # Run rake inside .vim pushd "${HOME}/.vim" || die "Could not go into the ${HOME}/.vim" rake || die "Rake failed." popd } function main() { if [ ! -e "${HOME}/.vim/janus" -o "$1" == "--force" ]; then backup_previous_install clone_janus fi run_rake } main $1 ================================================ FILE: janus/ruby/janus/errors.rb ================================================ module Janus # Errors JanusError = Class.new Exception BlockNotGivenError = Class.new JanusError RubyGemsNotFoundError = Class.new JanusError end ================================================ FILE: janus/ruby/janus/gems.rb ================================================ module Janus # Find an installed gem # # @param [String] The gem name to search for # @param [Mixed] The gem requirements # @return [Array] The found gems def find_gem(gem_name, *requirements) begin require 'rubygems' if Gem.const_defined?(:Specification) && Gem::Specification.respond_to?(:find_all_by_name) Gem::Specification.find_all_by_name(gem_name, *requirements) elsif Gem.respond_to?(:source_index) Gem.source_index.find_name(gem_name, *requirements) else Gem.cache.find_name(gem_name, *requirements) end rescue LoadError raise RubyGemsNotFoundError end end # Install a gem # # @param [String] The gem name def install_gem(gem_name) require 'rubygems' # Install the gem only if it can't be found if find_gem(gem_name).length == 0 # XXX: We should not run sudo if we do not need to! sudo "gem install #{gem_name}" end rescue RubyGemsNotFoundError puts "Could not install the gem #{gem_name}, please do so manually." puts "sudo gem install #{gem_name}" end end ================================================ FILE: janus/ruby/janus/github.rb ================================================ module Janus # Return a fully-qualified url to the raw page of a file stores inside # a repository on github # # @param [String] Path # @return [String] URL def github_raw(path) "https://raw.github.com/#{path}" end end ================================================ FILE: janus/ruby/janus/plugins.rb ================================================ require 'rake' require 'open-uri' module Janus include Rake::DSL if defined?(Rake::DSL) def self.included(base) # Load all plugin installation tasks Dir["#{vim_path}/*/tasks/**.rake"].each do |f| base.send :import, f end end # Install a plugin # # @param [String] The group the plugin belongs to # @param [String] The plugin name # @param [&block] The installation block def install_vim_plugin(group, name, &block) raise Janus::BlockNotGivenError unless block_given? define_install_plugin_tasks(group, name, &block) end # Post Install a plugin # # @param [String] The group the plugin belongs to # @param [String] The plugin name # @param [&block] The installation block def postinstall_vim_plugin(group, name, &block) raise Janus::BlockNotGivenError unless block_given? define_postinstall_plugin_tasks(group, name, &block) end # Download and save file # # @param [String] url # @param [String] path def download_and_save_file(url, path) options = {} proxy = ENV['http_proxy'] || ENV['HTTP_PROXY'] if proxy uri = URI.parse(proxy) proxy_host = uri.scheme + "://" + uri.host + ":" + uri.port.to_s proxy_user, proxy_pass = uri.userinfo.split(/:/) if uri.userinfo options[:proxy_http_basic_authentication] = [proxy_host,proxy_user,proxy_pass] end open_and_save_file(path, open(url, options).read) end # Open and save file # # @param [String] path # @param [Value] What to write in the file # @param [&block] def open_and_save_file(path, value = nil, &block) # Make sure the directory up to the folder exists mkdir_p File.dirname(path) # Open the file and use either the block or the value to write the # file File.open path, 'w' do |f| if block_given? f.write(yield) else f.write(value) end end end protected # Define tasks for installing a plugin # # @param [String] The group the plugin belongs to # @param [String] The plugin name # @param [&block] The installation block def define_install_plugin_tasks(group, name, &block) # Create a namespace for the plugin namespace(name) do # Define the plugin installation task desc "Install #{name} plugin." task :install do puts puts "*" * 40 puts "*#{"Installing #{name}".center(38)}*" puts "*" * 40 puts yield(Dir["#{vim_path}/#{group}/#{name}/**"].any?) end end # Hook the plugin's install task to the global install task task :install => "#{name}:install" end # Define tasks for post installing a plugin # # @param [String] The group the plugin belongs to # @param [String] The plugin name # @param [&block] The installation block def define_postinstall_plugin_tasks(group, name, &block) # Create a namespace for the plugin namespace(name) do # Define the plugin installation task desc "Post Install #{name} plugin." task :post_install do puts puts "*" * 40 puts "*#{"Post Installing #{name}".center(38)}*" puts "*" * 40 puts yield(Dir["#{vim_path}/#{group}/#{name}/**"].any?) end end # Hook the plugin's install task to the global install task task :install => "#{name}:post_install" end end ================================================ FILE: janus/ruby/janus/vim.rb ================================================ module Janus module VIM extend self # Folders def folders %w[ _backup _temp ] end end end ================================================ FILE: janus/ruby/janus.rb ================================================ module Janus # Return the root path # # @return [String] The absolute path to Janus repository def root_path ROOT_PATH end # Return Janus path # # @return [String] The absolute path to Janus distribution def janus_path File.join ROOT_PATH, 'janus' end # Return the vim's path # # @return [String] The absolute path to ViM files def vim_path File.join janus_path, 'vim' end # Return the ruby's path # # @return [String] The absolute path to Ruby files def ruby_path File.join janus_path, 'ruby' end # Expand the path of a given file # # @param [Array] args # @return [String] The expanded path to the given file. def expand(*args) File.expand_path(*args) end # Execute a command under root # # @param [String]* commands to run def sudo(*args) if ENV["USER"] != "root" command = "sudo #{args.join(" ")}" puts "Please enter your password (if requested) for executing the command '#{command}'" else command = args.join(" ") end exec command end end require 'janus/errors' require 'janus/vim' require 'janus/gems' require 'janus/github' require 'janus/plugins' ================================================ FILE: janus/submodules.yaml ================================================ --- # Submodules # # Each submodule is defined by a name, the name should be the same as the # folder name. # # Each submodule has the following attributes: # # Optional: # +description+: The description of the submodule # +path+: Override path defaulted to janus/vim/{group}/{name} # +categories+: The categories for which this plugin belongs to # +dependencies+: An array of submodules name on which this submodule depends on submodules: # Core plugins # # Core plugins are installed by default, removal of core plugins is disabled # We should keep this list as small as possible core: pathogen: # Colors # colors: base16-vim: darcula: getafe: github: irblack: molokai: pyte: sampler-pack: solarized: vim-tomorrow-theme: vividchalk: janus-colors: dependencies: - sampler-pack # Langs # langs: csv: categories: - csv - syntax minitest: nodejs: rails: rdoc: vim-polyglot: # Tools # tools: ack: buffergator: css-color: ctrlp: dispatch: easymotion: endwise: fugitive: webapi: gist: dependencies: - webapi gundo: indent-object: kwbd: eunuch: narrowregion: nerdcommenter: nerdtree: repeat: snipmate: dependencies: - vim-addon-mw-utils - tlib vim-snippets: dependencies: - snipmate supertab: surround: syntastic: tagbar: tlib: unimpaired: vim-addon-mw-utils: vim-trailing-whitespace: vimwiki: zoomwin: vroom: multiple-cursors: visualstar: ================================================ FILE: janus/vim/colors/tasks/sampler-pack.rake ================================================ postinstall_vim_plugin 'colors', 'sampler-pack' do |module_loaded| if module_loaded FileUtils.rm_rf 'janus/vim/colors/sampler-pack/colors/solarized.vim' end end ================================================ FILE: janus/vim/core/before/plugin/autocmds.vim ================================================ if has("autocmd") if exists("g:autosave_on_blur") au FocusLost * silent! wall endif endif ================================================ FILE: janus/vim/core/before/plugin/filetypes.vim ================================================ "" "" File types "" filetype plugin indent on " Turn on filetype plugins (:help filetype-plugin) if has("autocmd") " In Makefiles, use real tabs, not tabs expanded to spaces au FileType make setlocal noexpandtab " This actually might be confusing, but the plugin +ruby+ already does " this, so we want to do it only if the plugin +ruby+ is disabled for " some reason if janus#is_plugin_disabled("ruby") " Set the Ruby filetype for a number of common Ruby files without .rb au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,Procfile,Guardfile,config.ru,*.rake} set ft=ruby endif " Make sure all mardown files have the correct filetype set and setup wrapping au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} setf markdown if !exists("g:disable_markdown_autostyle") au FileType markdown setlocal wrap linebreak textwidth=72 nolist endif " make Python follow PEP8 for whitespace ( http://www.python.org/dev/peps/pep-0008/ ) au FileType python setlocal tabstop=4 shiftwidth=4 " Remember last location in file, but not for commit messages. " see :help last-position-jump au BufReadPost * if &filetype !~ '^git\c' && line("'\"") > 0 && line("'\"") <= line("$") \| exe "normal! g`\"" | endif endif ================================================ FILE: janus/vim/core/before/plugin/gui_settings.vim ================================================ if has("gui_running") if has("autocmd") " Automatically resize splits when resizing MacVim window autocmd VimResized * wincmd = endif endif ================================================ FILE: janus/vim/core/before/plugin/janus.vim ================================================ "" "" Janus main functions "" " Return a path separator on the current OS " Taken from pathogen " " @return [String] The separator / or \ function! janus#separator() return !exists("+shellslash") || &shellslash ? '/' : '\' endfunction " Return the expanded path " " @param [String] path " @return [String] Absolute path function! janus#expand_path(path) return expand(a:path) endfunction " Return a resolved path " " @param [String] path " @return resolved path function! janus#resolve_path(path) return resolve(janus#expand_path(a:path)) endfunction " Return the dirname of a path " " @param [String] path " @return [String] The dirname of the path given in the param function! janus#dirname(path) return fnamemodify(janus#resolve_path(a:path), ":h") endfunction " Return the basename of a path " " @param [String] path " @return [String] The basename of the path given in the param function! janus#basename(path) return fnamemodify(janus#resolve_path(a:path), ":t") endfunction " Return the group name " " @param [String] The group path " @return [String] The group name function! janus#group_name(path) return janus#basename(a:path) endfunction " Return the group path " " @param [String] The group name " @return [String] The group path function! janus#group_path(name) for group in g:janus_loaded_groups if janus#group_name(group) == a:name return group endif endfor endfunction " Find vim files inside a folder " " @param [String] The path to a folder " @return [List] List of files. function! janus#vim_files(folder) let files = [] let pattern = janus#resolve_path(a:folder) . janus#separator() . "*" " Add all found vim files for file in split(glob(pattern), "\n") if isdirectory(file) call extend(files, janus#vim_files(file)) elseif (file =~ "\.vim$") call add(files, file) endif endfor return files endfunction " Add a group of plug-ins to Pathogen " " @param [String] The plugin name " @param [String] (Optional) the base path of the group function! janus#add_group(name, ...) if !exists("g:janus_loaded_groups") let g:janus_loaded_groups = [] endif " Loaded group array will contain full path to group let base_path = exists("a:1") ? a:1 : g:janus_vim_path call add(g:janus_loaded_groups, base_path . janus#separator() . a:name) endfunction " Prepends custom plugins first so they will end up last after pathogen loads " other janus groups function! janus#load_custom_before(path) if isdirectory(g:janus_custom_path) let rtp = pathogen#split(&rtp) let custom = filter(pathogen#glob_directories(a:path), '!pathogen#is_disabled(v:val)') let &rtp = pathogen#join(pathogen#uniq(custom + rtp)) endif endfunction " Append custom plugins 'after' directories to rtp function! janus#load_custom_after() if isdirectory(g:janus_custom_path) let rtp = pathogen#split(&rtp) let custom_path = g:janus_custom_path . janus#separator() . "*" . janus#separator() . "after" let custom_after = filter(pathogen#glob_directories(custom_path), '!pathogen#is_disabled(v:val[0:-7])') let &rtp = pathogen#join(pathogen#uniq(rtp + custom_after)) " Add the custom group to the list of loaded groups call janus#add_group(".janus", expand("~")) endif endfunction " Load/wrap core around the rtp function! janus#load_core() " pathogen#infect will prepend core's 'before' and append 'janus/after' to " the rtp call janus#add_group("core") let core = g:janus_vim_path . janus#separator() . "core" call pathogen#infect(core . janus#separator() . '{}') endfunction " Load pathogen groups function! janus#load_pathogen() if !exists("g:loaded_pathogen") " Source Pathogen exe 'source ' . g:janus_vim_path . '/core/pathogen/autoload/pathogen.vim' endif " Add custom plugins before bundled groups call janus#load_custom_before(g:janus_custom_path . janus#separator() . "*") for group in g:janus_loaded_groups call pathogen#infect(group . janus#separator() . '{}') endfor " Add custom plugins to override bundled groups call janus#load_custom_before(g:janus_custom_path . ".before" . janus#separator() . "*") " Add custom 'after' directories to rtp and then load the core call janus#load_custom_after() call janus#load_core() call pathogen#helptags() endfunction " Which group contains a plugin ? " " @param [String] The plugin name " @return [String] The group name (not an absolute path) function! janus#which_group(name) if !exists("g:janus_loaded_groups") return "" endif for group in g:janus_loaded_groups if isdirectory(janus#plugin_path(group, a:name)) return janus#group_name(group) endif endfor endfunction " Disable a plugin " " @param [String] The group the plugin belongs to, will be determined if " no group were given. " @param [String] The plugin name " @param [String] The reason why it is disabled " @return [Bool] function! janus#disable_plugin(...) if a:0 < 1 || a:0 > 3 throw "The arguments to janus#disable_plugin() should be [group], , [reason]" elseif a:0 == 1 let group = -1 let name = a:1 let reason = -1 elseif a:0 == 2 let group = -1 let name = a:1 let reason = a:2 elseif a:0 == 3 let group = a:1 let name = a:2 let reason = a:3 endif " Verify the existance of the global variables if !exists("g:pathogen_disabled") let g:pathogen_disabled = [] endif if !exists("g:janus_disabled_plugins") let g:janus_disabled_plugins = {} endif " Fetch the group if necessary if group == -1 let group = janus#which_group(name) endif " Check if we need to add it if has_key(g:janus_disabled_plugins, name) && g:janus_disabled_plugins[name]['group'] == group " Just update the reason if necessary. if reason != "No reason given." && g:janus_disabled_plugins[name]['reason'] == -1 let g:janus_disabled_plugins[name]['reason'] = reason endif return 0 endif " Find the plugin path let plugin_path = janus#plugin_path(group, name) " Add it to janus_disabled_plugins let g:janus_disabled_plugins[name] = {'group': group, 'path': plugin_path, 'reason': reason} " Add it to pathogen_disabled call add(g:pathogen_disabled, name) endfunction " Return the plugin path " " @param [String] The group the plugin belongs to, will be determined if " no group were given. " @param [String] The plugin name " @return [String] The plugin path relative to g:janus_vim_path function! janus#plugin_path(...) if a:0 < 1 || a:0 > 2 throw "The arguments to janus#plugin_path() should be [group], " elseif a:0 == 1 let name = a:1 let group = janus#which_group(name) else let group = a:1 let name = a:2 endif return janus#group_path(group) . janus#separator() . name endfunction " Is modules loaded? " " @param [String] The plugin name " @return [Boolean] function! janus#is_module_loaded(name) return len(janus#vim_files(janus#plugin_path(a:name))) > 0 endfunction " Is plugin disabled? " " @param [String] The plugin name function! janus#is_plugin_disabled(name) if !exists("g:janus_disabled_plugins") return 0 endif return has_key(g:janus_disabled_plugins, a:name) endfunction " Is plugin enabled? " " @param [String] The plugin name " @return [Boolean] function! janus#is_plugin_enabled(name) return janus#is_module_loaded(a:name) && !janus#is_plugin_disabled(a:name) endfunction " Mapping function " " @param [String] The plugin name " @param [String] The mapping command (map, vmap, nmap or imap) " @param [String] The mapping keys " @param [String]* The mapping action function! janus#add_mapping(name, mapping_command, mapping_keys, ...) if len(a:000) < 1 throw "The arguments to janus#add_mapping() should be [mapping_action]*" endif if janus#is_plugin_enabled(a:name) let mapping_command = join(a:000) else if !janus#is_module_loaded(a:name) let reason = "Module is not loaded" elseif g:janus_disabled_plugins[a:name]['reason'] == -1 return 0 else let reason = g:janus_disabled_plugins[a:name]['reason'] endif let mapping_command = ":echo 'The plugin " . a:name . " is disabled for the following reason: " . reason . ".'" endif let mapping_list = [a:mapping_command, a:mapping_keys, mapping_command] exe join(mapping_list) endfunction ================================================ FILE: janus/vim/core/before/plugin/mappings.vim ================================================ "" "" General Mappings (Normal, Visual, Operator-pending) "" " Toggle paste mode nmap :set invpaste:set paste? imap :set invpaste:set paste? " format the entire file nnoremap fef :normal! gg=G`` " upper/lower word nmap u mQviwU`Q nmap l mQviwu`Q " upper/lower first char of word nmap U mQgewvU`Q nmap L mQgewvu`Q " cd to the directory containing the file in the buffer nmap cd :lcd %:h " Create the directory containing the file in the buffer nmap md :!mkdir -p %:p:h " Some helpers to edit mode " http://vimcasts.org/e/14 nmap ew :e =expand('%:h').'/' nmap es :sp =expand('%:h').'/' nmap ev :vsp =expand('%:h').'/' nmap et :tabe =expand('%:h').'/' " Swap two words nmap gw :s/\(\%#\w\+\)\(\_W\+\)\(\w\+\)/\3\2\1/`' " Underline the current line with '=' nmap ul :t.Vr= " set text wrapping toggles nmap tw :set invwrap:set wrap? " find merge conflict markers nmap fc /\v^[<=>]{7}( .*\|$) " Map the arrow keys to be based on display lines, not physical lines map gj map gk " Toggle hlsearch with hs nmap hs :set hlsearch! hlsearch? " Adjust viewports to the same size map = = if has("gui_macvim") && has("gui_running") " Map command-[ and command-] to indenting or outdenting " while keeping the original selection in visual mode vmap >gv vmap >> nmap << omap >> omap << imap >>i imap < [e nmap ]e nmap [e nmap ]e " Bubble multiple lines vmap [egv vmap ]egv vmap [egv vmap ]egv " Map Command-# to switch tabs map 0gt imap 0gt map 1gt imap 1gt map 2gt imap 2gt map 3gt imap 3gt map 4gt imap 4gt map 5gt imap 5gt map 6gt imap 6gt map 7gt imap 7gt map 8gt imap 8gt map 9gt imap 9gt else " Map command-[ and command-] to indenting or outdenting " while keeping the original selection in visual mode vmap >gv vmap >> nmap << omap >> omap << imap >>i imap < [e nmap ]e nmap [e nmap ]e " Bubble multiple lines vmap [egv vmap ]egv vmap [egv vmap ]egv " Make shift-insert work like in Xterm map map! " Map Control-# to switch tabs map 0gt imap 0gt map 1gt imap 1gt map 2gt imap 2gt map 3gt imap 3gt map 4gt imap 4gt map 5gt imap 5gt map 6gt imap 6gt map 7gt imap 7gt map 8gt imap 8gt map 9gt imap 9gt endif "" "" Command-Line Mappings "" " After whitespace, insert the current directory into a command-line path cnoremap getcmdline()[getcmdpos()-2] ==# ' ' ? expand('%:p:h') : "\" ================================================ FILE: janus/vim/core/before/plugin/settings.vim ================================================ "" "" Basic Setup "" if has('vim_starting') && !has('nvim') && &compatible set nocompatible " Be iMproved endif set number " Show line numbers set ruler " Show line and column number syntax enable " Turn on syntax highlighting allowing local overrides " Neovim disallow changing 'enconding' option after initialization " see https://github.com/neovim/neovim/pull/2929 for more details if !has('nvim') set encoding=utf-8 " Set default encoding to UTF-8 endif "" "" Whitespace "" set nowrap " don't wrap lines set tabstop=2 " a tab is two spaces set shiftwidth=2 " an autoindent (with <<) is two spaces set expandtab " use spaces, not tabs set list " Show invisible characters set backspace=indent,eol,start " backspace through everything in insert mode if exists("g:enable_mvim_shift_arrow") let macvim_hig_shift_movement = 1 " mvim shift-arrow-keys endif " List chars set listchars="" " Reset the listchars set listchars=tab:\ \ " a tab should display as " ", trailing whitespace as "." set listchars+=trail:. " show trailing spaces as dots set listchars+=extends:> " The character to show in the last column when wrap is " off and the line continues beyond the right of the screen set listchars+=precedes:< " The character to show in the last column when wrap is " off and the line continues beyond the left of the screen "" "" Searching "" set hlsearch " highlight matches set incsearch " incremental searching set ignorecase " searches are case insensitive... set smartcase " ... unless they contain at least one capital letter "" "" Wild settings "" " TODO: Investigate the precise meaning of these settings " set wildmode=list:longest,list:full " Disable output and VCS files set wildignore+=*.o,*.out,*.obj,.git,*.rbc,*.rbo,*.class,.svn,*.gem " Disable archive files set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz " Ignore bundler and sass cache set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/* " Ignore librarian-chef, vagrant, test-kitchen and Berkshelf cache set wildignore+=*/tmp/librarian/*,*/.vagrant/*,*/.kitchen/*,*/vendor/cookbooks/* " Ignore rails temporary asset caches set wildignore+=*/tmp/cache/assets/*/sprockets/*,*/tmp/cache/assets/*/sass/* " Disable temp and backup files set wildignore+=*.swp,*~,._* "" "" Backup and swap files "" set backupdir^=~/.vim/_backup// " where to put backup files. set directory^=~/.vim/_temp// " where to put swap files. ================================================ FILE: janus/vim/core/before/plugin/statusline.vim ================================================ if has("statusline") && !&cp set laststatus=2 " always show the status bar " Start the status line set statusline=%f\ %m\ %r set statusline+=Line:%l/%L[%p%%] set statusline+=Col:%v set statusline+=Buf:#%n set statusline+=[%b][0x%B] endif ================================================ FILE: janus/vim/core/janus/after/plugin/vimrc_after.vim ================================================ " Customization " " This loads after the janus plugins so that janus-specific plugin mappings can " be overwritten. if filereadable(expand("~/.vimrc.after")) source ~/.vimrc.after endif ================================================ FILE: janus/vim/core/janus/doc/janus.txt ================================================ *janus.txt* Janus vim Distribution *janus* CONTENTS *janus-contents* Introduction |janus-intro| Mailing list |janus-mailing-list| Installation |janus-installation| Customization |janus-customization| Updating |janus-updating| Intro to vim |janus-vim-intro| Janus features |janus-features| Base customizations |janus-features-base-customizations| Ack |janus-features-ack| CtrlP |janus-features-ctrlp| NERDCommenter |janus-features-nerdcommenter| NERDTree |janus-features-nerdtree| SuperTab |janus-features-supertab| Syntastic |janus-features-syntastic| Tagbar |janus-features-tagbar| EasyMotion |janus-features-easymotion| NrrwRgn |janus-features-nrrwrgn| git |janus-features-git| ZoomWin |janus-features-zoomwin| BufferGator |janus-features-buffergator| Additional syntaxes |janus-features-syntaxes| Rakefile |janus-rakefile| License |janus-license| INTRODUCTION *janus-intro* This is a distribution of plug-ins and mappings for Vim, Gvim and MacVim. It is designed to provide minimal working environment using the most popular plug-ins and the most common mappings. The distribution is completely customisable using a `~/.vimrc.before` and `~/.vimrc.after` Vim RC files. MAILING LIST *janus-mailing-list* The mailing list is hosted at [Google Groups](http://groups.google.com/group/janus-vimius), please join it for discussion and announcements. PRE-REQUISITES *janus-pre-requisites* The distribution is designed to work with Vim >= 7.3. The distribution also require `ack`, `pep8`, `ctags`, `ruby` and `rake`, for the most comfortable experience, use the GUI version of Vim. Linux users should install `gvim`, OSX users should install [MacVim](http://code.google.com/p/macvim/), the recommanded way of installating MacVim is using [Homebrew](http://mxcl.github.com/homebrew/), but before installing MacVim you need to use system-wide ruby, if you're using **rvm** `rvm use system` switches to system ruby, if you're using **rbenv** `rbenv shell system` switches to system ruby. ```bash $ brew install macvim ``` If you don't use Homebrew, you can still download it [here](https://github.com/b4winckler/macvim/downloads). Take a look at the [Pre-requisites wiki page](https://github.com/carlhuda/janus/wiki/Pre-requisites) for more information. INSTALLATION *janus-installation* To install Janus, please use our [automatic installer](https://github.com/carlhuda/janus/blob/master/bootstrap.sh) , which backups up any Vim files found in your home folder and installs Janus. ```bash $ curl -L http://bit.ly/janus-bootstrap | bash ``` CUSTOMIZATION *janus-customization* You can use `~/.gvimrc.before` and `~/.vimrc.before` for settings Janus, like the __leader__ setting, you may also use `~/.gvimrc.after` and `~/.vimrc.after` for any additional settings; it is also a good place for overriding Janus settings as both files will be loaded at the end of Janus. For example, to override the default color schemes: ```bash $ echo 'color desert' >> ~/.vimrc.after $ echo 'color molokai' >> ~/.gvimrc.after ``` If you want to do additional customization or add more Vim plugins, create a `~/.janus` directory and add your plugins there, either with a `git clone` or by adding submodules to your own git repository there. This directory is treated like a normal pathogen directory. For example: ```bash $ cd ~/.janus $ git checkout git://github.com/vim-scripts/Rename2.git rename2 ``` Or, if you have a git repository in `~/.janus`, you can use a submodule: ```bash $ cd ~/.janus $ git submodule add git://github.com/vim-scripts/Rename2.git rename2 ``` If you would like to disable an included plug-in, you can do that with the `janus#disable_plugin()` function from inside your `~/.vimrc.before`, this function takes a plug-in name as an argument without the group, for example, if you would like to disable the NERDCommenter plug-in, you can do that with the command: ```bash $ echo "call janus#disable_plugin('nerdcommenter')" >> ~/.vimrc.before ``` **WARNING**: We've noticed over and over, that people fork Janus just to customize it, this is bad practice for several reasons and you should not do that, here's why: - Janus is fully customisable and there's no need to change the core for using a different plugin fork or using a different mapping. - Forking means maintenance, maintenance means burden, do not burden yourself with maintaining a fork, that's what the `~/.janus` folder is for. if you find yourself needing a customisation that is not possible with the current setup, then please open an issue or submit a pull request to make it possible to do so without having a fork. **WARNING**: Any **uncommited** file inside the **janus** folder will be removed the next time you run `rake` so make sure to either put them in the custom folder (`~/.janus`), or commit them. We clean the janus folder in case we replace a manually installed plugin (using rake tasks) with a submodule. For more information on how to customize Janus, you might want to take a look at the [Customization wiki page](https://github.com/carlhuda/janus/wiki/Customization). UPDATING TO THE LATEST VERSION *janus-updating* To update to the latest version of the distribution, just run `rake` again inside your `~/.vim` directory. NOTE: If you even had an error updating Janus, problem related to a missing commit in a submodule, please try running `rake` again before submitting an issue. INTRO TO VIM *janus-vim-intro* Here's some tips if you've never used VIM before: TUTORIALS *janus-vim-tutorials* * Type `vimtutor` into a shell to go through a brief interactive tutorial inside VIM. * Read the slides at [VIM: Walking Without Crutches](http://walking-without-crutches.heroku.com/#1). * Watch the screencasts at [vimcasts.org](http://vimcasts.org/) * Watch Derek Wyatt's energetic tutorial videos at [his site](http://www.derekwyatt.org/vim/vim-tutorial-videos/) * Read wycats' perspective on learning vim at [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/) * Read this and other answers to a question about vim at StackOverflow: [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) MODES *janus-vim-modes* * VIM has two modes: * insert mode- stuff you type is added to the buffer * normal mode- keys you hit are interpretted as commands * To enter insert mode, hit `i` * To exit insert mode, hit `` USEFUL COMMANDS *janus-vim-useful-commands* * Use `:q` to exit vim * Certain commands are prefixed with a `` key, which maps to `\` by default. Use `let mapleader = ","` to change this. If you want this to be in effect for uses of in your .vimrc, make sure to define this in the `~/.vimrc.pre` * Keyboard [cheat sheet](http://walking-without-crutches.heroku.com/image/images/vi-vim-cheat-sheet.png). * Mapped key combinations using the command key (``) are only available in macvim. JANUS FEATURES *janus-features* This vim distribution includes a number of packages built by others. ## Base Customizations *janus-features-base-customizations* Janus ships with a number of basic customizations for vim: * Line numbers * Ruler (line and column numbers) * No wrap (turn off per-buffer via set :wrap) * Soft 2-space tabs, and default hard tabs to 2 spaces * Show tailing whitespace as `.` * Make searching highlighted, incremental, and case insensitive unless a capital letter is used * Always show a status line * Allow backspacing over everything (indentations, eol, and start characters) in insert mode * `` inserts the directory of the current file into a command * Automatically resize splits when resizing the Vim window (GUI only) * `ew` expands to `:e (directory of current file)/` (open in the current buffer) * `es` expands to `:sp (directory of current file)/` (open in an horizontal split) * `ev` expands to `:vsp (directory of current file)/` (open in an vertical split) * `et` expands to `:tabe (directory of current file)/` (open in an new tab) * `:w!!` expands to `%!sudo tee > /dev/null %` Write to the current file using sudo (if you forgot to run it with sudo), it will prompt for sudo password when writing. * `` Toggles paste mode * `fef` format the entire file * `u` Convert the entire word to uppercace. * `l` Convert the entire word to lowercase. * `U` Convert the first char of a word to uppercase. * `L` Convert the first char of a word to lowercase. * `cd` Change the path to the currently active buffer's file. * `md` Make the directory of the currently active buffer's file (for example when editing a new file for which the path does not exist.) * `gw` Swap the current word with the one next to it. * `ul` Underline the current line with `=` * `tw` Toggle wrap * `fc` Finds the next conflict marker (Tested with Git conflicted files). * Remap `` and `` to `gj` and `gk` (Wrapped text is not considered a one-long-line of text. * `hs` Toggle highlight search. * `=` Adjust viewports to the same size (`=`) * `!` Invokes kwbd plugin, it closes all open buffers in the open windows but keeps the windows open. ## [Ack.vim](http://github.com/mileszs/ack.vim) *janus-features-ack* Ack.vim uses ack to search inside the current directory for a pattern. You can learn more about it with :help Ack **Customizations**: Janus rebinds command-shift-f (``) to bring up `:Ack `. ## [CtrlP](https://github.com/kien/ctrlp.vim) *janus-features-ctrlp* Fuzzy file, buffer, mru and tag finder. Replaces [Command-T](https://github.com/wincent/Command-T) **Customizations**: For users of Command-T Janus maps CtrlP to command-t (``) ## [NERDCommenter](http://github.com/ddollar/nerdcommenter) *janus-features-nerdcommenter* NERDCommenter allows you to wrangle your code comments, regardless of filetype. View `:help NERDCommenter` for all the details. **Customizations**: Janus binds command-/ (``) to toggle comments. ## [NERDTree](https://github.com/scrooloose/nerdtree) *janus-features-nerdtree* NERDTree is a file explorer plugin that provides "project drawer" functionality to your vim projects. You can learn more about it with :help NERDTree. **Customizations**: Janus adds a number of customizations to the core NERDTree: * Use `n` to toggle NERDTree * Ignore compiled ruby, python, and java files * When opening vim with vim /path, open the left NERDTree to that directory, set the vim pwd, and clear the right buffer * In general, assume that there is a single NERDTree buffer on the left and one or more editing buffers on the right ## [SuperTab](http://github.com/ervandew/supertab) *janus-features-supertab* In insert mode, start typing something and hit `` to tab-complete based on the current context. ## [Syntastic](https://github.com/vim-syntastic/syntastic) *janus-features-syntastic* Syntastic is a syntax checking plugin that runs files through external syntax checkers as they are saved and opened. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them. See `:help syntastic` for details. **Customizations**: Janus adds a number of customizations to Syntastic: * Set Syntastic to passive mode by default (use `:SyntasticToggleMode` to toggle modes) * Enable the statusline flag * Always fill in location lists * Open and close error windows automatically * Enable syntax checks when opening files * Disable syntax checks when quitting Vim with `:wq`, `:x`, and `:ZZ` * Changes symbols for signs placed in the gutter margins. ## [Tagbar](https://github.com/majutsushi/tagbar) *janus-features-tagbar* Tagbar is a vim plugin for browsing the tags of source code files. **Customizations**: Janus binds `rt` to toggle Tagbar. ## [EasyMotion](https://github.com/Lokaltog/vim-easymotion) *janus-features-easymotion* EasyMotion provides a much simpler way to use some motions in vim. It takes the out of w or f{char} by highlighting all possible choices and allowing you to press one key to jump directly to the target. When one of the available motions is triggered, all visible text preceding or following the cursor is faded, and motion targets are highlighted. EasyMotion is triggered by one of the provided mappings. check EasyMotion's [home page](https://github.com/Lokaltog/vim-easymotion) for more information. ## [NrrwRgn](https://github.com/chrisbra/NrrwRgn) *janus-features-nrrwrgn* Narrowing means focussing on a region and making the rest inaccessible. You simply select the region, call :NarrowRegion and the selected part will open in a new scratch buffer. The rest of the file will be protected, so you won't accidentally modify that buffer. In the new buffer, you can do a global replace, search or anything else to modify that part. When you are finished, simply write that buffer (e.g. by |:w|) and your modifications will be put in the original buffer making it accessible again. ## Git Support ([Fugitive](http://github.com/tpope/vim-fugitive)) *janus-features-git* Fugitive adds pervasive git support to git directories in vim. For more information, use `:help fugitive` Use `:Gstatus` to view `git status` and type `-` on any file to stage or unstage it. Type `p` on a file to enter `git add -p` and stage specific hunks in the file. Use `:Gdiff` on an open file to see what changes have been made to that file **customizations**: * `gb` maps to `:Gblame` * `gs` maps to `:Gstatus` * `gd` maps to `:Gdiff` * `gl` maps to `:Glog` * `gc` maps to `:Gcommit` * `gp` maps to `:Git push` ## [ZoomWin](http://github.com/vim-scripts/ZoomWin) *janus-features-zoomwin* When working with split windows, ZoomWin lets you zoom into a window and out again using `Ctrl-W o` **Customizations**: Janus binds `zw` to `:ZoomWin` ## [BufferGator](https://github.com/jeetsukumaran/vim-buffergator) *janus-features-buffergator* Buffergator is a plugin for listing, navigating between, and selecting buffers to edit. Upon invocation (using the command, `:BuffergatorOpen` or `BuffergatorToggle`, or the provided key mapping, `b`), a `catalog` of listed buffers are displayed in a separate new window split (vertical or horizontal, based on user options; default = vertical). From this "buffer catalog", a buffer can be selected and opened in an existing window, a new window split (vertical or horizontal), or a new tab page. Selected buffers can be "previewed", i.e. opened in a window or tab page, but with focus remaining in the buffer catalog. Even better, you can "walk" up and down the list of buffers shown in the catalog by using `` (or ``) / `` (or ``). These keys select the next/previous buffer in succession, respectively, opening it for preview without leaving the buffer catalog viewer. ## [Vroom](https://github.com/skalnik/vim-vroom) *janus=features-vroom* VRoom is a plugin inspired by [Gary Bernhardt's vim config](https://github.com/garybernhardt/dotfiles/blob/69330074b7a15c67efa4594a71fa91592f1ce4f9/.vimrc#L286-342) for running your ruby tests/specs/features. Imagine you're hacking on a Rails controller, when you switch to the test or specs for the controller, you can use `r` to run all the specs or `R` to run the closest spec, then you can jump back to the controller hack on it and use `r` to run the last spec you ran last time, so you don't need to open the test again. Then benefits of this plugin are to centralize your workflow in one window, one software to do it all, which is a huge speedup over using `tmux` or multiple terminal tabs. ## Additional Syntaxes *janus-features-syntaxes* Janus ships with a few additional syntaxes: * Markdown (bound to \*.markdown, \*.md, and \*.mk) * Mustache (bound to \*.mustache) * Haml (bound to \*.haml) * Sass (bound to \*.sass) * SCSS (bound to \*.scss) * An improved JavaScript syntax (bound to \*.js) * Javascript for any file having `nodejs` in the shebang. * Map Gemfile, Rakefile, Vagrantfile, Procfile, Thorfile, config.ru and *.rake to Ruby. * Git commits (set your `EDITOR` to `vim -f` or `mvim -f` on OSX) `$ echo "export EDITOR='vim -f'" >> ~/.bashrc`, you can also use Git global config to set this if you have EDITOR set to something else `$ git config --global core.editor 'vim -f'` ## Rakefile *janus-rakefile* If you're looking for the old janus distribution controlled by a Rakefile then please head over to the [rakefile branch](https://github.com/carlhuda/janus/tree/rakefile) but please note that the rakefile branch will not be maintained. ## License *janus-license* ### This code is free to use under the terms of the MIT license. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ vim:tw=78:ft=help: ================================================ FILE: janus/vim/core/plugins.vim ================================================ " Variables let s:no_python_support = "Vim is compiled without python support" let s:no_ruby_support = "Vim is compiled without ruby support" " Plugins that requires python support if has("python3") let g:gundo_prefer_python3 = 1 elseif !has("python") call janus#disable_plugin("gundo", s:no_python_support) endif " Plugins that requires ruby support if !has("ruby") call janus#disable_plugin("ruby", s:no_ruby_support) endif " Ack requires ack command if executable("ack") " use default config elseif executable("ack-grep") let g:ackprg="ack-grep -H --nocolor --nogroup --column" elseif executable("ag") let g:ackprg="ag --nocolor --nogroup --column" else call janus#disable_plugin("ack", "The ack program is not installed") endif " Gist-vim requires curl if !executable("curl") call janus#disable_plugin("gist", "The curl program is not installed") endif " Tagbar requires ctags if !executable("ctags") call janus#disable_plugin("tagbar", "The ctags program is not installed") endif " nodejs does not protect itself " See #336 if exists("*DetectNode") call janus#disable_plugin("nodejs", "Nodejs already exists on your system.") endif ================================================ FILE: janus/vim/gvimrc ================================================ if filereadable(expand("~/.gvimrc.before")) source ~/.gvimrc.before endif " CtrlP OS-X Menu remapping if janus#is_plugin_enabled('ctrlp') && has("gui_macvim") macmenu &File.New\ Tab key= endif if filereadable(expand("~/.gvimrc.after")) source ~/.gvimrc.after endif ================================================ FILE: janus/vim/tools/before/plugin/nerdtree.vim ================================================ if !janus#is_plugin_disabled("nerdtree") let NERDTreeHijackNetrw = 0 endif ================================================ FILE: janus/vim/tools/janus/after/plugin/NERD_commenter.vim ================================================ " NERDCommenter mappings if has("gui_macvim") && has("gui_running") call janus#add_mapping('nerdcommenter', 'map', '', 'NERDCommenterToggle') call janus#add_mapping('nerdcommenter', 'imap', '', 'NERDCommenterTogglei') else call janus#add_mapping('nerdcommenter', 'map', '/', 'NERDCommenterToggle') endif ================================================ FILE: janus/vim/tools/janus/after/plugin/ack.vim ================================================ if has("gui_macvim") && has("gui_running") " Command-Shift-F on OSX call janus#add_mapping('ack', 'map', '', ':Ack') else " Define to a dummy value to see if it would set as well. map :dummy if maparg("") == ":dummy" " f on systems where == call janus#add_mapping('ack', 'map', 'f', ':Ack') else " if we can still map to call janus#add_mapping('ack', 'map', '', ':Ack') endif map endif ================================================ FILE: janus/vim/tools/janus/after/plugin/ctrlp.vim ================================================ if janus#is_plugin_enabled("ctrlp") let g:ctrlp_map = '' let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$|bower_components|node_modules', \ 'file': '\.pyc$\|\.pyo$\|\.rbc$|\.rbo$\|\.class$\|\.o$\|\~$\', \ } endif if has("gui_macvim") && has("gui_running") call janus#add_mapping('ctrlp', 'map', '', ':CtrlP') call janus#add_mapping('ctrlp', 'imap', '', ':CtrlP') endif ================================================ FILE: janus/vim/tools/janus/after/plugin/fugitive.vim ================================================ " Janus mappings call janus#add_mapping('fugitive', 'nmap', 'gb', ':Gblame') call janus#add_mapping('fugitive', 'nmap', 'gs', ':Gstatus') call janus#add_mapping('fugitive', 'nmap', 'gd', ':Gdiff') call janus#add_mapping('fugitive', 'nmap', 'gl', ':Glog') call janus#add_mapping('fugitive', 'nmap', 'gc', ':Gcommit') call janus#add_mapping('fugitive', 'nmap', 'gp', ':Git push') ================================================ FILE: janus/vim/tools/janus/after/plugin/gist.vim ================================================ if janus#is_plugin_enabled('gist') if executable("pbcopy") " The copy command let g:gist_clip_command = 'pbcopy' elseif executable("xclip") " The copy command let g:gist_clip_command = 'xclip -selection clipboard' elseif executable("putclip") " The copy command let g:gist_clip_command = 'putclip' end " detect filetype if vim failed auto-detection. let g:gist_detect_filetype = 1 endif ================================================ FILE: janus/vim/tools/janus/after/plugin/gundo.vim ================================================ " Toggle Gundo call janus#add_mapping('gundo', 'nmap', '', ':GundoToggle') call janus#add_mapping('gundo', 'imap', '', ':GundoToggle') ================================================ FILE: janus/vim/tools/janus/after/plugin/kwbd.vim ================================================ call janus#add_mapping('kwbd', 'nmap', '!', 'Kwbd') ================================================ FILE: janus/vim/tools/janus/after/plugin/narrowregion.vim ================================================ if janus#is_plugin_enabled("narrowregion") " Change default key mapping in order to eliminate delay related with " NERDTree using the same starting sequence n silent! nunmap nr call janus#add_mapping('narrowregion', 'map', 'rn', ':NarrowRegion') endif ================================================ FILE: janus/vim/tools/janus/after/plugin/nerdtree.vim ================================================ if janus#is_plugin_enabled("nerdtree") let NERDTreeIgnore=['\.pyc$', '\.pyo$', '\.rbc$', '\.rbo$', '\.class$', '\.o$', '\~$'] " Default mapping, n call janus#add_mapping('nerdtree', 'map', 'n', ':NERDTreeToggle:NERDTreeMirror') augroup AuNERDTreeCmd autocmd AuNERDTreeCmd VimEnter * call s:CdIfDirectory(expand("")) autocmd AuNERDTreeCmd FocusGained * call s:UpdateNERDTree() " If the parameter is a directory, cd into it function s:CdIfDirectory(directory) let explicitDirectory = isdirectory(a:directory) let directory = explicitDirectory || empty(a:directory) if explicitDirectory exe "cd " . fnameescape(a:directory) endif " Allows reading from stdin " ex: git diff | mvim -R - if strlen(a:directory) == 0 return endif if directory NERDTree wincmd p bd endif if explicitDirectory wincmd p endif endfunction " NERDTree utility function function s:UpdateNERDTree(...) let stay = 0 if(exists("a:1")) let stay = a:1 end if exists("t:NERDTreeBufName") let nr = bufwinnr(t:NERDTreeBufName) if nr != -1 exe nr . "wincmd w" exe substitute(mapcheck("R"), "", "", "") if !stay wincmd p end endif endif endfunction endif ================================================ FILE: janus/vim/tools/janus/after/plugin/syntastic.vim ================================================ if janus#is_plugin_enabled('syntastic') if globpath(&runtimepath, 'plugin/airline.vim', 1) ==# '' && globpath(&runtimepath, 'plugin/lightline.vim', 1) ==# '' && globpath(&runtimepath, 'plugin/powerline.vim', 1) ==# '' set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* endif let g:syntastic_mode_map = {'mode': 'passive'} let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 let g:syntastic_warning_symbol = 'W>' let g:syntastic_error_symbol = 'E>' let g:syntastic_style_warning_symbol = 'W}' let g:syntastic_style_error_symbol = 'E}' let g:syntastic_stl_format = '[%E{E:%e(#%fe)}%B{,}%W{W:%w(#%fw)}]' endif ================================================ FILE: janus/vim/tools/janus/after/plugin/tagbar.vim ================================================ " Tagbar mappings. call janus#add_mapping('tagbar', 'map', 'rt', ':TagbarToggle') ================================================ FILE: janus/vim/tools/janus/after/plugin/unimpaired.vim ================================================ " Normal Mode: Bubble single lines call janus#add_mapping('unimpaired', 'nmap', '', '[e') call janus#add_mapping('unimpaired', 'nmap', '', ']e') " Visual Mode: Bubble multiple lines call janus#add_mapping('unimpaired', 'vmap', '', '[egv') call janus#add_mapping('unimpaired', 'vmap', '', ']egv') ================================================ FILE: janus/vim/tools/janus/after/plugin/vimwiki.vim ================================================ if janus#is_plugin_enabled("vimwiki") let g:vimwiki_ext2syntax = {} endif ================================================ FILE: janus/vim/tools/janus/after/plugin/zoomwin.vim ================================================ " Map to ZoomWin call janus#add_mapping('zoomwin', 'map', 'zw', ':ZoomWin') ================================================ FILE: janus/vim/vimrc ================================================ "" "" Janus setup "" " Define paths if has('win32') || has('win64') || has('win32unix') let g:janus_path = escape(expand("~/.vim/janus/vim"), ' ') let g:janus_vim_path = escape(expand("~/.vim/janus/vim"), ' ') else let g:janus_path = escape(fnamemodify(resolve(expand(":p")), ":h"), ' ') let g:janus_vim_path = escape(fnamemodify(resolve(expand(":p" . "vim")), ":h"), ' ') endif let g:janus_custom_path = expand("~/.janus") " Source janus's core exe 'source ' . g:janus_vim_path . '/core/before/plugin/janus.vim' " You should note that groups will be processed by Pathogen in reverse " order they were added. call janus#add_group("tools") call janus#add_group("langs") call janus#add_group("colors") "" "" Customisations "" if filereadable(expand("~/.vimrc.before")) source ~/.vimrc.before endif " Disable plugins prior to loading pathogen exe 'source ' . g:janus_vim_path . '/core/plugins.vim' "" "" Pathogen setup "" " Load all groups, custom dir, and janus core call janus#load_pathogen() " .vimrc.after is loaded after the plugins have loaded