Make InitOptions take a dict as its parameter
This commit is contained in:
parent
c857f35664
commit
928ba3f380
@ -11,10 +11,12 @@
|
|||||||
let g:EasyMotion_loaded = 1
|
let g:EasyMotion_loaded = 1
|
||||||
" }}}
|
" }}}
|
||||||
" Default configuration {{{
|
" Default configuration {{{
|
||||||
function! s:InitOption(option, default) " {{{
|
function! s:InitOptions(options) " {{{
|
||||||
if ! exists('g:EasyMotion_' . a:option)
|
for [key, value] in items(a:options)
|
||||||
exec 'let g:EasyMotion_' . a:option . ' = ' . string(a:default)
|
if ! exists('g:EasyMotion_' . key)
|
||||||
|
exec 'let g:EasyMotion_' . key . ' = ' . string(value)
|
||||||
endif
|
endif
|
||||||
|
endfor
|
||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
function! s:InitHL(group, colors) " {{{
|
function! s:InitHL(group, colors) " {{{
|
||||||
let guihl = printf('guibg=%s guifg=%s gui=%s', a:colors.gui[0], a:colors.gui[1], a:colors.gui[2])
|
let guihl = printf('guibg=%s guifg=%s gui=%s', a:colors.gui[0], a:colors.gui[1], a:colors.gui[2])
|
||||||
@ -26,7 +28,7 @@
|
|||||||
endfunction " }}}
|
endfunction " }}}
|
||||||
function! s:InitMappings(motions) "{{{
|
function! s:InitMappings(motions) "{{{
|
||||||
for motion in keys(a:motions)
|
for motion in keys(a:motions)
|
||||||
call s:InitOption('mapping_' . motion, '<Leader>' . motion)
|
call s:InitOptions({ 'mapping_' . motion : '<Leader>' . motion })
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
if g:EasyMotion_do_mapping
|
if g:EasyMotion_do_mapping
|
||||||
@ -37,14 +39,16 @@
|
|||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
" Default options {{{
|
||||||
call s:InitOption('keys', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
call s:InitOptions({
|
||||||
call s:InitOption('target_hl', 'EasyMotionTarget')
|
\ 'keys' : 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
call s:InitOption('shade_hl', 'EasyMotionShade')
|
\ , 'target_hl' : 'EasyMotionTarget'
|
||||||
call s:InitOption('do_shade', 1)
|
\ , 'shade_hl' : 'EasyMotionShade'
|
||||||
call s:InitOption('do_mapping', 1)
|
\ , 'do_shade' : 1
|
||||||
|
\ , 'do_mapping' : 1
|
||||||
" Init highlighting {{{
|
\ })
|
||||||
|
" }}}
|
||||||
|
" Default highlighting {{{
|
||||||
let s:target_hl_defaults = {
|
let s:target_hl_defaults = {
|
||||||
\ 'gui' : ['NONE', '#ff0000' , 'bold']
|
\ 'gui' : ['NONE', '#ff0000' , 'bold']
|
||||||
\ , 'cterm256': ['NONE', '196' , 'bold']
|
\ , 'cterm256': ['NONE', '196' , 'bold']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user