Skip to content
sbeckeriv edited this page Jan 13, 2012 · 16 revisions

Customization

~/.vimrc.before

This file is sourced before any other file or plugin. Janus core is loaded before this script, so you get access to all the functions defined in janus.vim.

This is perfect for setting things like the mapleader. Because any mappings using the <leader> keywords that is parsed before changing the mapleader, the mapleader won't have any effect on them.

~/.vimrc.after

~/.vimrc.after is loaded after Janus but before other plugins are loaded. This allows you to override anything set by Janus or any plugin.

This is useful for re-mapping some of the bindings to your liking, setting the colorscheme, changing the encoding or the expandtab, ect.

Adding a new plugin, color-scheme, ...

If you would like to add a new plugin, color scheme, or anything else, you can add it as a plugin to a ~/.janus folder. This custom group will be loaded before any other group, except of course the core group. This will ensure that your version of any already-installed plugin will be loaded instead. If you have a new version (or another fork) of a plugin, just add it to your ~/.janus folder and it will be loaded first.

Keeping the ~/.janus folder separate from the janus checkout in .vim lets you manage this folder of your own customizations separately, making it easier to duplicate your setup on multiple machines.

Even if not every vim-script hosted on vim.org has a git repository (by the author or a mirror), you can easily get a git repository for it using Vim-scripts Github mirror.

Disabling a plugin

Janus makes it easy to disable any included plugin, color-scheme, lang etc. Disabling a plug-in is done only within your ~/.vimrc.before file using the janus#disable_plugin() method. This does not work in ~/.gvimrc.before. This methods takes two arguments: the plugin name and optionally the reason for disabling the plugin. If reason is given, all bindings that Janus binds to the plugin will still be bind but the action will just be an echo that the plugin is disabled. For example:

Janus adds the binding <C-t> or <D-t> on MacVim to open the Command-t plugin which requires Vim built with ruby support. If your Vim is not built with ruby support, your Vim will not throw errors about it because Janus will disable the plugin automatically. However, if you try <C-t> or <D-t> (you might expect that nothing happens but..) the following message appears in the command-line area:

The plugin command-t is disabled for the following reason: Vim is compiled without ruby support.

Here's the signature of the janus#disable_plugin function. You might notice in the source code that it supports specifying the group as well, but since this feature is not working yet, please ignore it.

" Disable a plugin
"
" @param [String] The plugin name
" @param [String] The reason why it is disabled
" @return [Bool]
function! janus#disable_plugin(...)
endfunction

Disabling a plugin in ~/.vimrc.before example:

" Disable command-t because I don't like it, but keep the bindings to remind me
call janus#disable_plugin('command-t', "I don't like it")

" Disable Hammer because it doesn't work and remove the bindings
call janus#disable_plugin('hammer')
Clone this wiki locally