Coder Social home page Coder Social logo

vim-indent-guides's Introduction

Indent Guides

Indent Guides is a plugin for visually displaying indent levels in Vim.

Features:

  • Can detect both tab and space indent styles.
  • Automatically inspects your colorscheme and picks appropriate colors (gVim only).
  • Will highlight indent levels with alternating colors.
  • Full support for gVim and basic support for Terminal Vim.
  • Seems to work on Windows gVim 7.3 (haven't done any extensive tests though).
  • Customizable size for indent guides, eg. skinny guides (soft-tabs only).
  • Customizable start indent level.
  • NEW: Highlight support for files with a mixture of tab and space indent styles.

Requirements

  • Vim 7.2+

Installation

To install the plugin just copy autoload, plugin, doc directories into your .vim directory.

Alternatively if you have Pathogen installed, just clone this repo into a subdirectory of your .vim/bundle directory like so:

cd ~/.vim/bundle
git clone git://github.com/nathanaelkane/vim-indent-guides.git

Usage

The default mapping to toggle the plugin is <Leader>ig

gVim

This plugin should work with gVim out of the box, no configuration needed. It will automatically inspect your colorscheme and pick appropriate colors.

Setting custom indent colors

Here's an example of how to define custom colors instead of using the ones the plugin automatically generates for you. Add this to your .vimrc file:

let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd  guibg=red   ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4

Alternatively you can add the following lines to your colorscheme file.

hi IndentGuidesOdd  guibg=red   ctermbg=3
hi IndentGuidesEven guibg=green ctermbg=4

Terminal Vim

At the moment Terminal Vim only has basic support. This means is that colors won't be automatically calculated based on your colorscheme. Instead, some preset colors are used depending on whether background is set to dark or light.

When set background=dark is used, the following highlight colors will be defined:

hi IndentGuidesOdd  ctermbg=black
hi IndentGuidesEven ctermbg=darkgrey

Alternatively, when set background=light is used, the following highlight colors will be defined:

hi IndentGuidesOdd  ctermbg=white
hi IndentGuidesEven ctermbg=lightgrey

If for some reason it's incorrectly defining light highlight colors instead of dark ones or vice versa, the first thing you should check is that the background value is being set correctly for your colorscheme. Sometimes it's best to manually set the background value in your .vimrc, for example:

colorscheme desert256
set background=dark

Alternatively you can manually setup the highlight colors yourself, see :help indent_guides_auto_colors for an example.

Help

:help indent-guides

Screenshots

vim-indent-guides's People

Contributors

acx0 avatar dersaidin avatar graywh avatar jhogendorn avatar leonardehrenfried avatar nathanaelkane avatar noscript avatar ryansouza avatar suy avatar timoxley avatar wilywampa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.