Yggdroot/indentLine là dự án Vim Script với 4.1k sao trong nhóm Developer Tools. A vim plugin to display the indention levels with thin vertical lines
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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:
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
(see below how to disable conceal for JSON without disabling indentLine).
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.
Disabling conceal for JSON and Markdown without disabling indentLine plugin
Even though this plugin requires conceal to be enabled for it to work, it is
possible to disable conceal for JSON and Markdown files and still get the
indentLine plugin to show indent lines for those files.
Builtin json.vim
and markdown.vim
syntax allow disabling conceal by setting the following vars:
JSON
let g:vim_json_conceal=0
Markdown
let g:markdown_syntax_conceal=0
If you use other syntax plugins for those file types, you will need to check
their docs, as they may use different vars or have different ways to configure
this.
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:
Download and install FontForge.
Locate and open your terminal/gVim font.
Open the font in FontForge, choose Goto from the View menu and select Private Use Area from the drop down box.
In the private use area, locate a blank spot for the glyph. Make a note of the code, e.g. U+E0A3.
Double-click the selected code point to open the font drawing tool.
From the File menu, select Import... and locate the indentLine-dotted-guide.eps file.
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).
Yggdroot/indentLine thuộc nhóm Developer Tools trên TopGit, cùng 3 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về Yggdroot/indentLine ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/Yggdroot/indentLine là nguồn chính thức.
Yggdroot/indentLine có bao nhiêu sao?
Yggdroot/indentLine có 4.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/Yggdroot/indentLine. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
Yggdroot/indentLine có phải mã nguồn mở không?
Có — Yggdroot/indentLine phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/Yggdroot/indentLine.
Yggdroot/indentLine có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho Yggdroot/indentLine. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
Yggdroot/indentLine là gì?
Yggdroot/indentLine (Yggdroot/indentLine) là dự án Vim Script trên GitHub. Theo mô tả gốc: A vim plugin to display the indention levels with thin vertical lines
Yggdroot/indentLine so với các dự án Developer Tools khác thế nào?
Yggdroot/indentLine được TopGit xếp vào nhóm Developer Tools, với 4.1k sao GitHub và viết bằng Vim Script. Xem trang chủ đề Developer Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc indentLine có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về indentLine.