2010-12-07 04:41:05 -05:00
|
|
|
" Author: Nate Kane <nathanaelkane AT gmail DOT com>
|
|
|
|
" Homepage: http://github.com/nathanaelkane/vim-indent-guides
|
|
|
|
|
2010-12-11 07:59:10 -05:00
|
|
|
if exists('g:loaded_indent_guides') || &cp
|
|
|
|
finish
|
|
|
|
endif
|
2010-12-11 22:08:40 -05:00
|
|
|
|
|
|
|
if !has('gui_running')
|
|
|
|
echoerr "The Indent Guides plugin requires gvim to work correctly."
|
|
|
|
finish
|
|
|
|
end
|
|
|
|
|
2010-12-11 07:59:10 -05:00
|
|
|
let g:loaded_indent_guides = 1
|
|
|
|
|
2010-12-07 04:41:05 -05:00
|
|
|
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! IndentGuidesToggle call s:IndentGuidesToggle()
|
|
|
|
command! IndentGuidesEnable call s:IndentGuidesEnable()
|
|
|
|
command! IndentGuidesDisable call s:IndentGuidesDisable()
|
|
|
|
|
|
|
|
" Default options
|
2010-12-07 07:37:12 -05:00
|
|
|
let g:indent_guides_indent_levels =
|
|
|
|
\ exists('g:indent_guides_indent_levels') ?
|
2010-12-11 08:12:41 -05:00
|
|
|
\ g:indent_guides_indent_levels : 30
|
2010-12-07 07:37:12 -05:00
|
|
|
|
|
|
|
let g:indent_guides_auto_colors =
|
|
|
|
\ exists('g:indent_guides_auto_colors') ?
|
|
|
|
\ g:indent_guides_auto_colors : 1
|
|
|
|
|
2010-12-10 08:19:39 -05:00
|
|
|
let g:indent_guides_color_change_percent =
|
|
|
|
\ exists('g:indent_guides_color_change_percent') ?
|
|
|
|
\ g:indent_guides_color_change_percent : 0.05
|
2010-12-07 08:02:48 -05:00
|
|
|
|
|
|
|
let g:indent_guides_debug =
|
|
|
|
\ exists('g:indent_guides_debug') ?
|
|
|
|
\ g:indent_guides_debug : 0
|
2010-12-07 04:41:05 -05:00
|
|
|
|
2010-12-09 07:45:09 -05:00
|
|
|
let g:indent_guides_autocmds_enabled = 0
|
|
|
|
|
|
|
|
"
|
|
|
|
" Regex pattern for a hex color.
|
|
|
|
"
|
|
|
|
" Example matches:
|
|
|
|
" - '#123ABC'
|
|
|
|
" - '#ffffff'
|
|
|
|
" - '#000000'
|
|
|
|
"
|
|
|
|
let g:indent_guides_hex_color_pattern = '#[0-9A-Fa-f]\{6\}'
|
|
|
|
|
2010-12-07 04:41:05 -05:00
|
|
|
" Default mapping
|
|
|
|
nmap <Leader>ig :IndentGuidesToggle<CR>
|
|
|
|
|
2010-12-09 07:45:09 -05:00
|
|
|
" Auto commands
|
|
|
|
augroup indent_guides
|
|
|
|
autocmd!
|
|
|
|
autocmd BufEnter,WinEnter * call indent_guides#process_autocmds()
|
|
|
|
augroup END
|
|
|
|
|