All Projects → Yggdroot → Indentline

Yggdroot / Indentline

Licence: mit
A vim plugin to display the indention levels with thin vertical lines

Programming Languages

Vim Script
2826 projects
PostScript
262 projects

Projects that are alternatives of or similar to Indentline

Textbeat
🎹 plaintext music sequencer and midi shell, with vim playback 🥁
Stars: ✭ 274 (-92.56%)
Mutual labels:  vim-plugin
Spaceduck
🚀 🦆 An intergalactic space theme for Vim, Terminal, and more!
Stars: ✭ 177 (-95.19%)
Mutual labels:  vim-plugin
Zeavim.vim
Zeal for Vim
Stars: ✭ 320 (-91.31%)
Mutual labels:  vim-plugin
Eleline.vim
🌿 Another elegant statusline for vim
Stars: ✭ 283 (-92.31%)
Mutual labels:  vim-plugin
Mkdx
A vim plugin that adds some nice extra's for working with markdown documents
Stars: ✭ 295 (-91.99%)
Mutual labels:  vim-plugin
Dashboard Nvim
vim dashboard
Stars: ✭ 294 (-92.01%)
Mutual labels:  vim-plugin
Vim Cool
A very simple plugin that makes hlsearch more useful.
Stars: ✭ 268 (-92.72%)
Mutual labels:  vim-plugin
Pear Tree
A Vim auto-pair plugin that supports multi-character pairs, intelligent matching, and more
Stars: ✭ 327 (-91.12%)
Mutual labels:  vim-plugin
Vim Repl
Best REPL environment for Vim
Stars: ✭ 296 (-91.96%)
Mutual labels:  vim-plugin
Languageclient Neovim
Language Server Protocol (LSP) support for vim and neovim.
Stars: ✭ 3,352 (-8.94%)
Mutual labels:  vim-plugin
Gen tags.vim
Async plugin for vim and neovim to ease the use of ctags/gtags
Stars: ✭ 288 (-92.18%)
Mutual labels:  vim-plugin
Blamer.nvim
A git blame plugin for neovim inspired by VS Code's GitLens plugin
Stars: ✭ 283 (-92.31%)
Mutual labels:  vim-plugin
Vim Buffet
IDE-like Vim tabline
Stars: ✭ 304 (-91.74%)
Mutual labels:  vim-plugin
Vim Monokai Tasty
VIM Colour scheme
Stars: ✭ 279 (-92.42%)
Mutual labels:  vim-plugin
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (-91.2%)
Mutual labels:  vim-plugin
Vim Wintabs
Modern buffer manager for Vim
Stars: ✭ 268 (-92.72%)
Mutual labels:  vim-plugin
Vimtex
VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
Stars: ✭ 3,609 (-1.96%)
Mutual labels:  vim-plugin
Vim Template
Simple templates plugin for Vim
Stars: ✭ 328 (-91.09%)
Mutual labels:  vim-plugin
Vim Crystal
Vim filetype and tools support for Crystal language.
Stars: ✭ 326 (-91.14%)
Mutual labels:  vim-plugin
Vim Interestingwords
☀️ A vim plugin for highlighting and navigating through different words in a buffer.
Stars: ✭ 305 (-91.71%)
Mutual labels:  vim-plugin

indentLine

This plugin is used for displaying thin vertical lines at each indentation level for code indented with spaces. For code indented with tabs I think there is no need to support it, because you can use :set list lcs=tab:\|\ (here is a space).

Requirements

This plugin takes advantage of the newly provided conceal feature in Vim 7.3, so this plugin will not work with lower versions of Vim.

MacOS users: The copy of Vim provided in MacOS may not have the conceal feature enabled (check with echo has('conceal')), which will prevent the plugin from loading. To fix this, we recommend using the homebrew version of Vim.

Installation

If you are using VIM version 8 or higher you can use its built-in package management; see :help packages for more information. Just run these commands in your terminal:

git clone https://github.com/Yggdroot/indentLine.git ~/.vim/pack/vendor/start/indentLine
vim -u NONE -c "helptags  ~/.vim/pack/vendor/start/indentLine/doc" -c "q"

Otherwise, these are some of the other options:

  • To install the plugin just put the plugin files in your ~/.vim (Linux) or ~/vimfiles (Windows).

  • If you use a plugin manager you can put the whole directory into your ~/.vim/bundle/ directory (Pathogen) or add the line Plugin 'Yggdroot/indentLine' to your .vimrc (Vundle).

Customization

To apply customization, apply the variable definitions to your .vimrc file.

Change Character Color

indentLine will overwrite 'conceal' color with grey by default. If you want to highlight conceal color with your colorscheme, disable by:

let g:indentLine_setColors = 0

Or you can use the same colors as another highlight group. To use the same colors that are used for tab indents, use the 'SpecialKey' group:

let g:indentLine_defaultGroup = 'SpecialKey'

Or you can customize conceal color by:

" Vim
let g:indentLine_color_term = 239

" GVim
let g:indentLine_color_gui = '#A4E57E'

" none X terminal
let g:indentLine_color_tty_light = 7 " (default: 4)
let g:indentLine_color_dark = 1 " (default: 2)

" Background (Vim, GVim)
let g:indentLine_bgcolor_term = 202
let g:indentLine_bgcolor_gui = '#FF5F00'

Change Indent Char

Vim and GVim

let g:indentLine_char = 'c'

where 'c' can be any ASCII character. You can also use one of ¦, , , , or to display more beautiful lines. However, these characters will only work with files whose encoding is UTF-8.

or

let g:indentLine_char_list = ['|', '¦', '', '']

each indent level has a distinct character.

Change Conceal Behaviour

This plugin enables the Vim conceal feature which automatically hides stretches of text based on syntax highlighting. This setting will apply to all syntax items.

For example, users utilizing the built in json.vim syntax file will no longer see quotation marks in their JSON files.

indentLine will overwrite your "concealcursor" and "conceallevel" with default value:

let g:indentLine_concealcursor = 'inc'
let g:indentLine_conceallevel = 2

You can customize these settings, but the plugin will not function if conceallevel is not set to 1 or 2.

If you want to keep your conceal setting, put this line to your vim dotfile:

let g:indentLine_setConceal = 0

See the VIM Reference Manual for more information on the conceal feature.

Disable by default

let g:indentLine_enabled = 0

Commands

:IndentLinesToggle toggles lines on and off.

Font patching

If you find all the standard unicode and ASCII characters too obtrusive, you might consider patching your font with the indentLine-dotted-guide.eps glyph provided. FontForge makes the process amazingly simple:

  1. Download and install FontForge.
  2. Locate and open your terminal/gVim font.
  3. Open the font in FontForge, choose Goto from the View menu and select Private Use Area from the drop down box.
  4. In the private use area, locate a blank spot for the glyph. Make a note of the code, e.g. U+E0A3.
  5. Double-click the selected code point to open the font drawing tool.
  6. From the File menu, select Import... and locate the indentLine-dotted-guide.eps file.
  7. Once imported, choose File -> Generate Fonts and choose a location and file type for the new font.

Once completed, your new font will contain the more subtle dotted guide and all you have to do is set that glyph to g:indentLine_char in your .vimrc file.

Self promotion

If you think this script is helpful, follow the GitHub repository, and don't forget to vote for it on Vim.org! (vimscript #4354).

Screenshots

Vertical bars

Screenshot

Patched font

Screenshot

Leading Spaces

Screenshot

Screenshot

License

  • MIT
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].