From 49638180d40c753cb91905d47830ee0db10b47fd Mon Sep 17 00:00:00 2001 From: Reed Esau Date: Mon, 30 Dec 2013 22:13:40 -0700 Subject: [PATCH] customlist support for Thematic command --- plugin/thematic.vim | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/plugin/thematic.vim b/plugin/thematic.vim index 09c083b..49b00eb 100644 --- a/plugin/thematic.vim +++ b/plugin/thematic.vim @@ -15,14 +15,14 @@ set cpo&vim let g:thematic#theme_name = '' -" Preserve original settings +" Preserve original settings let g:thematic#original = { \ 'laststatus': &laststatus, \ 'ruler': &ruler, \ } -" Defaults +" Defaults if !exists('g:thematic#defaults') let g:thematic#defaults = {} endif @@ -41,16 +41,25 @@ if !exists('g:thematic#themes') \ } endif -" Commands +function! chooseTheme(ArgLead, CmdLine, CursorPos) + return sort(keys(g:thematic#themes)) +endfunction + +" Commands + +" Thematic {theme_name} +command -nargs=1 + \ -complete=customlist,chooseTheme + \ Thematic + \ call thematic#init() command -nargs=0 ThematicFirst call thematic#init('#first') command -nargs=0 ThematicNext call thematic#init('#next') command -nargs=0 ThematicPrevious call thematic#init('#previous') command -nargs=0 ThematicRandom call thematic#init('#random') command -nargs=0 ThematicOriginal call thematic#init('#original') -command -nargs=1 Thematic call thematic#init() -" Plugin mappings +" Plugin mappings noremap ThematicNarrow :ThematicNarrow noremap ThematicWiden :ThematicWiden