All Projects → caglartoklu → Ftcolor.vim

caglartoklu / Ftcolor.vim

Licence: bsd-2-clause
Switches colorschemes according to the file type.

Labels

Projects that are alternatives of or similar to Ftcolor.vim

Vim Jade
Vim syntax highlighting for the Jade templating engine.
Stars: ✭ 21 (-38.24%)
Mutual labels:  viml
Vim Yankring
Mirror of yankring.vim
Stars: ✭ 28 (-17.65%)
Mutual labels:  viml
Codeschool Vim Theme
codeschool vim theme
Stars: ✭ 32 (-5.88%)
Mutual labels:  viml
Vim Sol
On the Path of Illumination ! :)
Stars: ✭ 27 (-20.59%)
Mutual labels:  viml
Vim Dragvisuals
Vim global plugin for dragging virtual blocks
Stars: ✭ 28 (-17.65%)
Mutual labels:  viml
Php Vim
make vim as a php ide
Stars: ✭ 30 (-11.76%)
Mutual labels:  viml
Vim Composer
Composer in Vim
Stars: ✭ 21 (-38.24%)
Mutual labels:  viml
Cscope maps
cscope keyboard mappings for VIM
Stars: ✭ 33 (-2.94%)
Mutual labels:  viml
Linters.vim
Automatically run linters over your code as you write it
Stars: ✭ 28 (-17.65%)
Mutual labels:  viml
Vimix
Vimux with Elixir Mix Integration
Stars: ✭ 32 (-5.88%)
Mutual labels:  viml
Vim Monokai Refined
Port of Monokai Refined for TextMate/Sublime Text, using sickill's Coloration converter
Stars: ✭ 27 (-20.59%)
Mutual labels:  viml
Cmdalias.vim
Create aliases for Vim commands.
Stars: ✭ 27 (-20.59%)
Mutual labels:  viml
Dotfiles
Some of my configuration.
Stars: ✭ 31 (-8.82%)
Mutual labels:  viml
Vim Refact
Some refactoring stuff for Vim
Stars: ✭ 21 (-38.24%)
Mutual labels:  viml
Vim Readline
Readline bindings for Insert Mode
Stars: ✭ 33 (-2.94%)
Mutual labels:  viml
Vim Notebook
Vim plugin to annotate text, source code, etc
Stars: ✭ 21 (-38.24%)
Mutual labels:  viml
Vim Llvmcov
The llvm-cov tool shows code coverage information for programs that are instrumented to emit profile data.
Stars: ✭ 30 (-11.76%)
Mutual labels:  viml
Tskeleton vim
File Templates and Code Skeletons/Snippets for VIM
Stars: ✭ 33 (-2.94%)
Mutual labels:  viml
Vim Fuzzysearch
Fuzzy pattern building, in any buffer
Stars: ✭ 33 (-2.94%)
Mutual labels:  viml
Vim Hl Var
Stars: ✭ 32 (-5.88%)
Mutual labels:  viml

ftcolor.vim

Switches colorschemes according to the file type.

Home page: https://github.com/caglartoklu/ftcolor.vim

Vim.org page: http://www.vim.org/scripts/script.php?script_id=5028

If you are in a position to work on more than one file type in a project (or several projects), this plugin could be useful: With this plugin, it is possible to map a file type to a color scheme. It can mimic the color schemes of well known development environment colors to comply with your habits.

Changelog

Please follow the commit log for the full list.

  • 0.0.2, 2014-11-19
    • New: Run a custom command after the colorscheme is set, thanks to https://github.com/aliou.
    • Fix: Added support for help/utility/readonly buffers, so the colorscheme will be stable when such a buffer is opened.
  • 0.0.1, 2014-10-05
    • First version.

Installation

For Vundle users:

Plugin 'caglartoklu/ftcolor.vim'

For Pathogen users:

cd ~/.vim/bundle
git clone git://github.com/caglartoklu/ftcolor.vim

For all other users, simply drop the ftcolor.vim file to your plugin directory.

Requirements

  • Vim (no +Python required)
  • Various color schemes of your choice. See the section Color Schemes for references to some color schemes used in the samples.

Usage

The plugin is automatic. It will automatically run for each buffer after it has been configured for chosen file types. The following animation shows a few buffer changes:

ftcolor_demo_20141005.gif

To determine the file type of a buffer, type one of the following:

:echo &filetype
:echo &ft

Configuration

g:ftcolor_plugin_enabled

Enable/disable plugin. The default is:

let g:ftcolor_plugin_enabled = 1

g:ftcolor_custom_command

After setting the color, run this command. It is not defined by default, but you can use it like this:

let g:ftcolor_custom_command = 'AirlineRefresh'

g:ftcolor_redraw

After setting the color, redraw the screen. The default is:

let g:ftcolor_redraw = 1

g:ftcolor_default_color_scheme

If there is mapping for a file type, this color will be used. For this setting, you can set a colorscheme you like most. The default is:

let g:ftcolor_default_color_scheme = 'default'

g:ftcolor_color_mappings

These are the keys you need to set to use the plugin. The default is empty, and it needs to be filled:

let g:ftcolor_color_mappings = {}

After defining it, each file type must be defined separetely:

The format is

let g:ftcolor_color_mappings.<file-type-here> = 'color-scheme-here'

Such as one of the following:

let g:ftcolor_color_mappings.java = 'eclipse'
let g:ftcolor_color_mappings.java = ['eclipse']

You can also define whether the background is dark or light, as in the following sample:

let g:ftcolor_color_mappings.java = ['eclipse', 'light']

Example configuration snippet for .vimrc

let g:ftcolor_redraw = 1
let g:ftcolor_default_color_scheme = ['molokai']
let g:ftcolor_color_mappings = {}
let g:ftcolor_color_mappings.basic = ['ibmedit']
let g:ftcolor_color_mappings.vb = ['ibmedit']
let g:ftcolor_color_mappings.pas = 'borland'
let g:ftcolor_color_mappings.java = ['eclipse', 'light']
let g:ftcolor_color_mappings.cs = ['blueshift']
let g:ftcolor_color_mappings.vimwiki = ['molokai']
let g:ftcolor_color_mappings.python = ['django']

Color Schemes

The following is a list for the color schemes used in the samples in this document.

The Vundle code snippet for the corresponding files are:

Plugin 'tomasr/molokai'
Plugin 'vim-scripts/ibmedit.vim'
Plugin 'vim-scripts/borland.vim'
Plugin 'vim-scripts/eclipse.vim'
Plugin 'vim-scripts/Blueshift'
Plugin 'django.vim--Ronacher'

For more, there are lots of (read: 428) color schemes with previews here: https://code.google.com/p/vimcolorschemetest/

For even more, see the full list of color scheme scripts on vim.org

License

Licensed with 2-clause license ("Simplified BSD License" or "FreeBSD License"). See the LICENSE file.

Legal

All trademarks and registered trademarks are the property of their respective owners. The color schemes referenced in this document are not part of the ftcolor.vim plugin. See their individual licenses if necessary.

Contact Info

You can find me on Google+

Feel free to send bug reports, or ask questions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].