Delete old indent_guides copy
This commit is contained in:
parent
a87649c9bd
commit
c14c197c93
|
@ -1,243 +0,0 @@
|
|||
" Author: Nate Kane <nathanaelkane AT gmail DOT com>
|
||||
" Homepage: http://github.com/nathanaelkane/vim-indent-guides
|
||||
|
||||
"
|
||||
" Toggles the indent guides on and off.
|
||||
"
|
||||
function! indent_guides#toggle()
|
||||
call indent_guides#init_matches()
|
||||
|
||||
if empty(w:indent_guides_matches)
|
||||
call indent_guides#enable()
|
||||
else
|
||||
call indent_guides#disable()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Called from autocmds, keeps indent guides enabled or disabled when entering
|
||||
" other buffers and windows.
|
||||
"
|
||||
function! indent_guides#process_autocmds()
|
||||
if g:indent_guides_autocmds_enabled
|
||||
call indent_guides#enable()
|
||||
else
|
||||
call indent_guides#disable()
|
||||
end
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Enables the indent guides for the current buffer and any other buffer upon
|
||||
" entering it.
|
||||
"
|
||||
function! indent_guides#enable()
|
||||
let g:indent_guides_autocmds_enabled = 1
|
||||
|
||||
call indent_guides#init_script_vars()
|
||||
call indent_guides#highlight_colors()
|
||||
call indent_guides#clear_matches()
|
||||
|
||||
" loop through each indent level and define a highlight pattern
|
||||
" will automagically figure out whether to use tabs or spaces
|
||||
for l:level in range(s:start_level, s:indent_levels)
|
||||
let l:group = 'IndentGuides' . ((l:level % 2 == 0) ? 'Even' : 'Odd')
|
||||
let l:pattern = '^\s\{' . (l:level * s:indent_size - s:indent_size) . '\}\zs'
|
||||
let l:pattern .= '\s\{' . s:guide_size . '\}'
|
||||
let l:pattern .= '\ze'
|
||||
|
||||
" define the higlight pattern and add to list
|
||||
call add(w:indent_guides_matches, matchadd(l:group, l:pattern))
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Disables the indent guides for the current buffer and any other buffer upon
|
||||
" entering it.
|
||||
"
|
||||
function! indent_guides#disable()
|
||||
let g:indent_guides_autocmds_enabled = 0
|
||||
call indent_guides#clear_matches()
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Clear all highlight matches for the current window.
|
||||
"
|
||||
function! indent_guides#clear_matches()
|
||||
call indent_guides#init_matches()
|
||||
if !empty(w:indent_guides_matches)
|
||||
let l:index = 0
|
||||
for l:match_id in w:indent_guides_matches
|
||||
call matchdelete(l:match_id)
|
||||
call remove(w:indent_guides_matches, l:index)
|
||||
let l:index += l:index
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Automagically calculates and defines the indent highlight colors.
|
||||
"
|
||||
function! indent_guides#highlight_colors()
|
||||
if s:auto_colors
|
||||
if has('gui_running')
|
||||
call indent_guides#gui_highlight_colors()
|
||||
else
|
||||
call indent_guides#basic_highlight_colors()
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Defines some basic indent highlight colors that work for Terminal Vim and
|
||||
" gVim when colors can't be automatically calculated.
|
||||
"
|
||||
function! indent_guides#basic_highlight_colors()
|
||||
let l:cterm_colors = (&g:background == 'dark') ? ['darkgrey', 'black'] : ['lightgrey', 'white']
|
||||
let l:gui_colors = (&g:background == 'dark') ? ['grey15', 'grey30'] : ['grey70', 'grey85']
|
||||
|
||||
exe 'hi IndentGuidesEven guibg=' . l:gui_colors[0] . ' ctermbg=' . l:cterm_colors[0]
|
||||
exe 'hi IndentGuidesOdd guibg=' . l:gui_colors[1] . ' ctermbg=' . l:cterm_colors[1]
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Automagically calculates and defines the indent highlight colors for gui
|
||||
" vim.
|
||||
"
|
||||
function! indent_guides#gui_highlight_colors()
|
||||
let l:hi_normal_guibg = ''
|
||||
|
||||
" capture the backgroud color from the normal highlight
|
||||
if s:hi_normal =~ s:color_hex_bg_pat
|
||||
" hex color code is being used, eg. '#FFFFFF'
|
||||
let l:hi_normal_guibg = matchstr(s:hi_normal, s:color_hex_bg_pat)
|
||||
|
||||
elseif s:hi_normal =~ s:color_name_bg_pat
|
||||
" color name is being used, eg. 'white'
|
||||
let l:color_name = matchstr(s:hi_normal, s:color_name_bg_pat)
|
||||
let l:hi_normal_guibg = color_helper#color_name_to_hex(l:color_name)
|
||||
|
||||
else
|
||||
" background color could not be detected, default to basic colors
|
||||
call indent_guides#basic_highlight_colors()
|
||||
endif
|
||||
|
||||
if l:hi_normal_guibg =~ s:color_hex_pat
|
||||
" calculate the highlight background colors
|
||||
let l:hi_odd_bg = indent_guides#lighten_or_darken_color(l:hi_normal_guibg)
|
||||
let l:hi_even_bg = indent_guides#lighten_or_darken_color(l:hi_odd_bg)
|
||||
|
||||
" define the new highlights
|
||||
exe 'hi IndentGuidesOdd guibg=' . l:hi_odd_bg
|
||||
exe 'hi IndentGuidesEven guibg=' . l:hi_even_bg
|
||||
end
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Takes a color and darkens or lightens it depending on whether a dark or light
|
||||
" colorscheme is being used.
|
||||
"
|
||||
function! indent_guides#lighten_or_darken_color(color)
|
||||
let l:new_color = ''
|
||||
|
||||
if (&g:background == 'dark')
|
||||
let l:new_color = color_helper#hex_color_lighten(a:color, s:change_percent)
|
||||
else
|
||||
let l:new_color = color_helper#hex_color_darken (a:color, s:change_percent)
|
||||
endif
|
||||
|
||||
return l:new_color
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Define default highlights.
|
||||
"
|
||||
function! indent_guides#define_default_highlights()
|
||||
hi default clear IndentGuidesOdd
|
||||
hi default clear IndentGuidesEven
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Init the w:indent_guides_matches variable.
|
||||
"
|
||||
function! indent_guides#init_matches()
|
||||
let w:indent_guides_matches = exists('w:indent_guides_matches') ? w:indent_guides_matches : []
|
||||
endfunction
|
||||
|
||||
"
|
||||
" We need to initialize these vars every time a buffer is entered while the
|
||||
" plugin is enabled.
|
||||
"
|
||||
function! indent_guides#init_script_vars()
|
||||
let s:indent_size = indent_guides#get_indent_size()
|
||||
let s:guide_size = indent_guides#calculate_guide_size()
|
||||
let s:hi_normal = indent_guides#capture_highlight('Normal')
|
||||
|
||||
" remove 'font=<value>' from the s:hi_normal string (only seems to happen on Vim startup in Windows)
|
||||
let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+', "", "")
|
||||
|
||||
" shortcuts to the global variables - this makes the code easier to read
|
||||
let s:debug = g:indent_guides_debug
|
||||
let s:indent_levels = g:indent_guides_indent_levels
|
||||
let s:auto_colors = g:indent_guides_auto_colors
|
||||
let s:change_percent = g:indent_guides_color_change_percent / str2float("100.0")
|
||||
let s:color_hex_pat = g:indent_guides_color_hex_pattern
|
||||
let s:color_hex_bg_pat = g:indent_guides_color_hex_guibg_pattern
|
||||
let s:color_name_bg_pat = g:indent_guides_color_name_guibg_pattern
|
||||
let s:start_level = g:indent_guides_start_level
|
||||
|
||||
if s:debug
|
||||
echo 's:indent_size = ' . s:indent_size
|
||||
echo 's:guide_size = ' . s:guide_size
|
||||
echo 's:hi_normal = ' . s:hi_normal
|
||||
echo 's:indent_levels = ' . s:indent_levels
|
||||
echo 's:auto_colors = ' . s:auto_colors
|
||||
echo 's:change_percent = ' . string(s:change_percent)
|
||||
echo 's:color_hex_pat = ' . s:color_hex_pat
|
||||
echo 's:color_hex_bg_pat = ' . s:color_hex_bg_pat
|
||||
echo 's:color_name_bg_pat = ' . s:color_name_bg_pat
|
||||
echo 's:start_level = ' . s:start_level
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Calculate the indent guide size. Ensures the guide size is less than or
|
||||
" equal to the actual indent size, otherwise some weird things can occur.
|
||||
"
|
||||
" NOTE: Currently, this only works when soft-tabs are being used.
|
||||
"
|
||||
function! indent_guides#calculate_guide_size()
|
||||
let l:guide_size = g:indent_guides_guide_size
|
||||
let l:indent_size = indent_guides#get_indent_size()
|
||||
|
||||
if l:indent_size > 1 && l:guide_size >= 1
|
||||
let l:guide_size = (l:guide_size > s:indent_size) ? s:indent_size : l:guide_size
|
||||
else
|
||||
let l:guide_size = s:indent_size
|
||||
endif
|
||||
|
||||
return l:guide_size
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Gets the indent size, which depends on whether soft-tabs or hard-tabs are
|
||||
" being used.
|
||||
"
|
||||
function! indent_guides#get_indent_size()
|
||||
return (&l:expandtab == 1) ? &l:shiftwidth : 1
|
||||
endfunction
|
||||
|
||||
"
|
||||
" Captures and returns the output of highlight group definitions.
|
||||
"
|
||||
" Example: indent_guides#capture_highlight('normal')
|
||||
" Returns: 'Normal xxx guifg=#323232 guibg=#ffffff
|
||||
"
|
||||
function! indent_guides#capture_highlight(group_name)
|
||||
redir => l:output
|
||||
exe "silent hi " . a:group_name
|
||||
redir END
|
||||
|
||||
let l:output = substitute(l:output, "\n", "", "")
|
||||
return l:output
|
||||
endfunction
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
*indent_guides.txt* A plugin for visually displaying indent levels in Vim.
|
||||
|
||||
*indent-guides*
|
||||
____ __ __ ______ _ __
|
||||
/ _/____ ____/ /___ ____ / /_ / ____/__ __(_)____/ /___ _____
|
||||
/ / / __ \/ __ // _ \/ __ \/ __/ / / __ / / / / // __ // _ \/ ___/
|
||||
_/ / / / / / /_/ // __/ / / / /_ / /_/ // /_/ / // /_/ // __(__ )
|
||||
/___//_/ /_/\__,_/ \___/_/ /_/\__/ \____/ \__,_/_/ \__,_/ \___/____/
|
||||
|
||||
|
||||
Author: Nate Kane <nathanaelkane AT gmail DOT com>
|
||||
Version: 1.5 (pending release)
|
||||
Last Change: 21 Feb 2011
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *indent-guides-contents*
|
||||
|
||||
1. Introduction.......................... |indent-guides-introduction|
|
||||
2. Commands.............................. |indent-guides-commands|
|
||||
3. Options............................... |indent-guides-options|
|
||||
4. Mappings.............................. |indent-guides-mappings|
|
||||
5. Terminal Vim.......................... |indent-guides-terminal-vim|
|
||||
6. About................................. |indent-guides-about|
|
||||
7. Changelog............................. |indent-guides-changelog|
|
||||
8. License............................... |indent-guides-license|
|
||||
|
||||
==============================================================================
|
||||
1. INTRODUCTION *indent-guides-introduction*
|
||||
|
||||
Indent Guides is a plugin for visually displaying indent levels in Vim.
|
||||
|
||||
This plugin should work with gVim out of the box, no configuration needed.
|
||||
|
||||
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.
|
||||
|
||||
==============================================================================
|
||||
2. COMMANDS *indent-guides-commands*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
:IndentGuidesToggle *:IndentGuidesToggle*
|
||||
Toggles the indent guides on and off.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
:IndentGuidesEnable *:IndentGuidesEnable*
|
||||
Enables the indent guides for the current buffer and any other buffer upon
|
||||
entering it.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
:IndentGuidesDisable *:IndentGuidesDisable*
|
||||
Disables the indent guides for the current buffer and any other buffer upon
|
||||
entering it.
|
||||
|
||||
==============================================================================
|
||||
3. OPTIONS *indent-guides-options*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_indent_levels'*
|
||||
Use this option to control how many indent levels to display guides for.
|
||||
|
||||
Default: 30. Values: integer.
|
||||
>
|
||||
let g:indent_guides_indent_levels = 30
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_auto_colors'*
|
||||
Use this option to control whether or not the plugin automatically calculates
|
||||
the highlight colors. Will use the current colorscheme's background color as a
|
||||
base color.
|
||||
|
||||
Default: 1. Values: 0 or 1.
|
||||
>
|
||||
let g:indent_guides_auto_colors = 1
|
||||
<
|
||||
|
||||
If you set this option to 0, be sure to manually define some highlight colors
|
||||
in an autocmd.
|
||||
>
|
||||
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
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_color_change_percent'*
|
||||
Use this option to control the percent at which the highlight colors will be
|
||||
lightened or darkened.
|
||||
|
||||
Default: 10 (10%). Values: between 0 and 100.
|
||||
>
|
||||
let g:indent_guides_color_change_percent = 10
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_guide_size'*
|
||||
Use this option to customize the size of the indent guide. By default the
|
||||
value is set to 0, which will set the guide size to be the same as the
|
||||
|shiftwidth|. Setting this value to be larger than the |shiftwidth| is essentially
|
||||
the same as setting it to 0.
|
||||
|
||||
A common use of this setting is to create skinny indent guides, which look
|
||||
great with a |shiftwidth| of 4 or more.
|
||||
|
||||
NOTE: This option only works for soft-tabs (spaces) and not hard-tabs.
|
||||
|
||||
Default: 0. Values: between 0 and |shiftwidth|.
|
||||
>
|
||||
let g:indent_guides_guide_size = 1
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_start_level'*
|
||||
Use this option to control which indent level to start showing guides from.
|
||||
|
||||
Default: 1. Values: between 1 and g:|indent_guides_indent_levels|.
|
||||
>
|
||||
let g:indent_guides_start_level = 2
|
||||
<
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*'indent_guides_enable_on_vim_startup'*
|
||||
Use this option to control whether the plugin is enabled on Vim startup.
|
||||
|
||||
Default: 0. Values: 0 or 1.
|
||||
>
|
||||
let g:indent_guides_enable_on_vim_startup = 0
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
4. MAPPINGS *indent-guides-mappings*
|
||||
|
||||
The default mapping for toggling indent guides is <Leader>ig. You can easily
|
||||
map it to other keys. For example:
|
||||
>
|
||||
:nmap <Leader>ig :IndentGuidesToggle<CR>
|
||||
<
|
||||
|
||||
You can also map some other commands that are not mapped by default. For
|
||||
example:
|
||||
>
|
||||
:nmap <Leader>ie :IndentGuidesEnable<CR>
|
||||
:nmap <Leader>id :IndentGuidesDisable<CR>
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
5. TERMINAL VIM *indent-guides-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 IndentGuidesEven ctermbg=darkgrey
|
||||
hi IndentGuidesOdd ctermbg=black
|
||||
<
|
||||
|
||||
Alternatively, when `set background=light` is used, the following highlight
|
||||
colors will be defined:
|
||||
>
|
||||
hi IndentGuidesEven ctermbg=lightgrey
|
||||
hi IndentGuidesOdd ctermbg=white
|
||||
<
|
||||
|
||||
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
|
||||
|indent_guides_auto_colors| for an example.
|
||||
|
||||
==============================================================================
|
||||
6. ABOUT *indent-guides-about*
|
||||
|
||||
Why did I build this plugin?~
|
||||
* I believe indent guides make nested code easier to read and understand.
|
||||
* Other editors have them and it's high time Vim did.
|
||||
* None of the existing indent guide plugins on the market suited my needs.
|
||||
* I wanted to learn me some VimL.
|
||||
|
||||
Links:~
|
||||
* Github: https://github.com/nathanaelkane/vim-indent-guides
|
||||
* Bugs & Issues: https://github.com/nathanaelkane/vim-indent-guides/issues
|
||||
|
||||
Credits:~
|
||||
* Matt Wozniski (godlygeek) for letting me use the list of color names and
|
||||
hex codes from his CSApprox plugin.
|
||||
|
||||
Contact:~
|
||||
* Twitter: @nathanaelkane
|
||||
* Email: <nathanaelkane AT gmail DOT com>
|
||||
* IRC: nate- on Freenode (I usually idle in the #vim channel)
|
||||
|
||||
Bug reports, feedback, suggestions etc are welcomed.
|
||||
|
||||
==============================================================================
|
||||
7. CHANGELOG *indent-guides-changelog*
|
||||
|
||||
1.5 (pending release)~
|
||||
* Added -bar to all the :commands so they can chain with other :commands
|
||||
(thanks to graywh).
|
||||
* No longer overriding pre-defined custom highlight colors (thanks to
|
||||
graywh).
|
||||
* Using str2float to work around a float bug in some versions of Vim 7.2
|
||||
(thanks to voidus).
|
||||
|
||||
1.4~
|
||||
* Added the new plugin option g:|indent_guides_enable_on_vim_startup|.
|
||||
* Improved Windows support.
|
||||
|
||||
1.3~
|
||||
* Changed the default value of g:|indent_guides_color_change_percent| to 10.
|
||||
* Added support for gVim themes that don't specify a `hi Normal guibg`
|
||||
color.
|
||||
|
||||
1.2~
|
||||
* Customizable size for indent guides, eg. skinny guides (soft-tabs only).
|
||||
* Customizable start indent level.
|
||||
* Refactored some internal logic.
|
||||
|
||||
1.1~
|
||||
* Added basic support for Terminal Vim. See |indent-guides-terminal-vim| for
|
||||
more information.
|
||||
* Cut down on rgb to hex color conversions by adding a big dictionary of
|
||||
color names and hex codes.
|
||||
* Various bug fixes.
|
||||
|
||||
1.0~
|
||||
* First public version.
|
||||
|
||||
==============================================================================
|
||||
8. LICENSE *indent-guides-license*
|
||||
|
||||
The MIT Licence
|
||||
http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
Copyright (c) 2010-2011 Nate Kane
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
vim:tw=78:ts=2:ft=help:norl:
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
" Author: Nate Kane <nathanaelkane AT gmail DOT com>
|
||||
" Homepage: http://github.com/nathanaelkane/vim-indent-guides
|
||||
|
||||
if exists('g:loaded_indent_guides') || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_indent_guides = 1
|
||||
call indent_guides#define_default_highlights()
|
||||
|
||||
function! s:IndentGuidesToggle()
|
||||
call indent_guides#toggle()
|
||||
endfunction
|
||||
|
||||
function! s:IndentGuidesEnable()
|
||||
call indent_guides#enable()
|
||||
endfunction
|
||||
|
||||
function! s:IndentGuidesDisable()
|
||||
call indent_guides#disable()
|
||||
endfunction
|
||||
|
||||
" Commands
|
||||
command! -bar IndentGuidesToggle call s:IndentGuidesToggle()
|
||||
command! -bar IndentGuidesEnable call s:IndentGuidesEnable()
|
||||
command! -bar IndentGuidesDisable call s:IndentGuidesDisable()
|
||||
|
||||
"
|
||||
" Initializes a given variable to a given value. The variable is only
|
||||
" initialized if it does not exist prior.
|
||||
"
|
||||
function s:InitVariable(var, value)
|
||||
if !exists(a:var)
|
||||
if type(a:var) == type("")
|
||||
exec 'let ' . a:var . ' = ' . "'" . a:value . "'"
|
||||
else
|
||||
exec 'let ' . a:var . ' = ' . a:value
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Fixed global variables
|
||||
let g:indent_guides_autocmds_enabled = 0
|
||||
let g:indent_guides_color_hex_pattern = '#[0-9A-Fa-f]\{6\}'
|
||||
let g:indent_guides_color_hex_guibg_pattern = 'guibg=\zs' . g:indent_guides_color_hex_pattern . '\ze'
|
||||
let g:indent_guides_color_name_guibg_pattern = "guibg='\\?\\zs[0-9A-Za-z ]\\+\\ze'\\?"
|
||||
|
||||
" Configurable global variables
|
||||
call s:InitVariable('g:indent_guides_indent_levels', 30)
|
||||
call s:InitVariable('g:indent_guides_auto_colors', 1 )
|
||||
call s:InitVariable('g:indent_guides_color_change_percent', 10) " ie. 10%
|
||||
call s:InitVariable('g:indent_guides_guide_size', 0 )
|
||||
call s:InitVariable('g:indent_guides_start_level', 1 )
|
||||
call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0 )
|
||||
call s:InitVariable('g:indent_guides_debug', 0 )
|
||||
|
||||
" Default mapping
|
||||
nmap <Leader>ig :IndentGuidesToggle<CR>
|
||||
|
||||
" Auto commands
|
||||
augroup indent_guides
|
||||
autocmd!
|
||||
|
||||
if g:indent_guides_enable_on_vim_startup
|
||||
autocmd VimEnter * :IndentGuidesEnable
|
||||
endif
|
||||
|
||||
autocmd BufEnter,WinEnter * call indent_guides#process_autocmds()
|
||||
augroup END
|
||||
|
Loading…
Reference in New Issue