mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-07 20:54:26 +08:00
Merge pull request #4 from NagatoPain/develop
change indentline somethings
This commit is contained in:
12
README.md
12
README.md
@@ -1,3 +1,8 @@
|
||||
NOTE
|
||||
====
|
||||
This is an improve version of original plugin.
|
||||
The original version plugin is at here https://github.com/Yggdroot/indentLine.git
|
||||
|
||||
indentLine
|
||||
==========
|
||||
|
||||
@@ -17,9 +22,10 @@ For gvim, hi Conceal guifg=(color you like) guibg=NONE
|
||||
|
||||
For vim, hi Conceal ctermfg=(color you like) ctermbg=NONE
|
||||
|
||||
You can change indentline char by youself.
|
||||
change this variable:
|
||||
|
||||
## Screenshots
|
||||
<img src="http://i.imgur.com/WQqhH.jpg" width="600" height="400" alt="" />
|
||||
<img src="http://i.imgur.com/zhV1v.jpg" width="600" height="400" alt="" />
|
||||
<img src="http://i.imgur.com/cENlq.jpg" width="600" height="400" alt="" />
|
||||
<img src="http://i.imgur.com/Ge4nJ.png" width="800" height="600" alt="" />
|
||||
|
||||
|
||||
|
||||
54
after/plugin/indentLine.vim
Normal file
54
after/plugin/indentLine.vim
Normal file
@@ -0,0 +1,54 @@
|
||||
" Script Name: indentLine.vim
|
||||
" Version: 1.0.1
|
||||
" Last Change: Dec 3, 2012
|
||||
" Author: Yggdroot <archofortune@gmail.com>
|
||||
"
|
||||
" Description: To show the indent line
|
||||
|
||||
if !has("conceal") || exists("g:loaded_indentLine")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_indentLine = 1
|
||||
if !exists("g:indentLine_char")
|
||||
" | ┆ │
|
||||
let g:indentLine_char = "┆"
|
||||
endif
|
||||
if !exists("g:indentLine_color_term")
|
||||
if &bg =~? "light"
|
||||
let g:indentLine_color_term = 238
|
||||
else
|
||||
let g:indentLine_color_term = 039
|
||||
endif
|
||||
endif
|
||||
if !exists("g:indentLine_color_gui")
|
||||
if &bg =~? "light"
|
||||
let g:indentLine_color_gui = "Grey"
|
||||
else
|
||||
let g:indentLine_color_gui = "Grey40"
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists("g:indentLine_indentLevel")
|
||||
let g:indentLine_indentLevel = 10
|
||||
endif
|
||||
|
||||
set conceallevel=1
|
||||
set concealcursor=inc
|
||||
|
||||
function! <SID>InitColor()
|
||||
exec "hi Conceal ctermfg=" . g:indentLine_color_term . " ctermbg=NONE cterm=bold" .
|
||||
\ " guifg=" . g:indentLine_color_gui . " guibg=NONE"
|
||||
endfunction
|
||||
|
||||
function! <SID>SetIndentLine()
|
||||
let space = &l:shiftwidth
|
||||
for i in range(space+1, space * g:indentLine_indentLevel + 1, space)
|
||||
exec 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=' . g:indentLine_char
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
autocmd BufRead * call <SID>SetIndentLine()
|
||||
autocmd BufRead,ColorScheme * call <SID>InitColor()
|
||||
|
||||
|
||||
" vim:et:ts=4:sw=4:fdm=marker:fmr={{{,}}}
|
||||
47
doc/indentLine.txt
Normal file
47
doc/indentLine.txt
Normal file
@@ -0,0 +1,47 @@
|
||||
*indentLine.txt* Show vertical lines for indent with conceal feature
|
||||
|
||||
CONTENTS *indentLine-contents*
|
||||
Introduction |indentLine-introduction|
|
||||
Config |indentLine-config|
|
||||
FAQ |indentLine-faq|
|
||||
Changelog |indentLine-changelog|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *indentLine-introduction*
|
||||
|
||||
==============================================================================
|
||||
CONFIG *indentLine-config*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
VARIABLES *indentLine-variables*
|
||||
|
||||
g:loaded_indentLine *g:loaded_indentLine*
|
||||
Whether load indentLine plugin.
|
||||
Default value is 0.
|
||||
|
||||
g:indentLine_char *g:indentLine_char*
|
||||
Specify a character to be used as indent line.
|
||||
You also can use other characters:
|
||||
| ┆ │
|
||||
Default value is "┆".
|
||||
|
||||
g:indentLine_color_term *g:indentLine_color_term*
|
||||
Specify terminal vim indent line color.
|
||||
Default value is 238.
|
||||
|
||||
g:indentLine_color_gui *g:indentLine_color_gui*
|
||||
Specify GUI vim indent line color.
|
||||
Default value is "Grey".
|
||||
|
||||
g:indentLine_indentLevel *g:indentLine_indentLevel*
|
||||
Specify how much indent level do you want to use for
|
||||
indentLine. Most program will not has bigger indent level than
|
||||
10.
|
||||
Default value is 10.
|
||||
|
||||
|
||||
==============================================================================
|
||||
FAQ *indentLine-faq*
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0
|
||||
@@ -1,31 +0,0 @@
|
||||
" Script Name: indentLine.vim
|
||||
" Version: 1.0.1
|
||||
" Last Change: Dec 3, 2012
|
||||
" Author: Yggdroot <archofortune@gmail.com>
|
||||
"
|
||||
" Description: To show the indent line
|
||||
|
||||
if !has("conceal") || exists("g:loaded_indentLine")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_indentLine = 1
|
||||
|
||||
set conceallevel=2
|
||||
set concealcursor=inc
|
||||
|
||||
function! <SID>InitColor()
|
||||
if &bg == 'light'
|
||||
hi Conceal ctermfg=7 ctermbg=NONE guifg=Grey guibg=NONE
|
||||
else
|
||||
hi Conceal ctermfg=8 ctermbg=NONE guifg=Grey40 guibg=NONE
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! <SID>SetIndentLine()
|
||||
for i in range(&shiftwidth+1, 100, &shiftwidth)
|
||||
exe 'syn match IndentLine /\(^\s\+\)\@<=\%'.i.'v / containedin=ALL conceal cchar=|'
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
autocmd BufRead * call <SID>SetIndentLine()
|
||||
autocmd BufRead,ColorScheme * call <SID>InitColor()
|
||||
Reference in New Issue
Block a user