From 9e067addadc17d2ff9263ab41fdbeba05e296bc7 Mon Sep 17 00:00:00 2001 From: Alex Vear Date: Sun, 22 Sep 2019 22:15:28 +0100 Subject: [PATCH] Improve Vim start-up time and allow buffer specific state keywords --- {plugin => autoload}/org.vim | 8 ++------ doc/org.txt | 5 ++++- syntax/org.vim | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) rename {plugin => autoload}/org.vim (64%) diff --git a/plugin/org.vim b/autoload/org.vim similarity index 64% rename from plugin/org.vim rename to autoload/org.vim index f72a3d4..3bcda28 100644 --- a/plugin/org.vim +++ b/autoload/org.vim @@ -1,8 +1,8 @@ -" Set default configuration options for org.vim +" Helper functions for org.vim " " Maintainer: Alex Vear " License: Vim (see `:help license`) -" Location: plugin/org.vim +" Location: autoload/org.vim " Website: https://github.com/axvr/org.vim " Last Change: 2019-09-22 @@ -10,7 +10,3 @@ function org#option(name, default) return get(b:, a:name, get(g:, a:name, a:default)) endfunction - -if !exists('g:org_state_keywords') - let g:org_state_keywords = ['TODO', 'NEXT', 'DONE'] -endif diff --git a/doc/org.txt b/doc/org.txt index 0f4cdf8..93c90cf 100644 --- a/doc/org.txt +++ b/doc/org.txt @@ -36,7 +36,7 @@ WIP. ============================================================================== 4. CONFIGURATION *org-configuration* - *'g:org_state_keywords'* + *'b:org_state_keywords'* *'g:org_state_keywords'* Value: list of strings~ Default: ['TODO', 'NEXT', 'DONE']~ @@ -47,6 +47,9 @@ strings you would like to use. < Note: state keywords are case sensitive. +State keywords can be set on specific buffers by using |'b:org_state_keywords'| +rather than |'g:org_state_keywords'|. + ------------------------------------------------------------------------------ *'b:org_conceal_links'* *'g:org_conceal_links'* Value: numeric~ diff --git a/syntax/org.vim b/syntax/org.vim index cf86059..f75ebe9 100644 --- a/syntax/org.vim +++ b/syntax/org.vim @@ -74,7 +74,7 @@ syntax match orgHeading5 /^\s*\*\{5}\s\+.*$/ keepend contains=@Spell,orgTag,orgT syntax match orgHeading6 /^\s*\*\{6,}\s\+.*$/ keepend contains=@Spell,orgTag,orgTodo syntax match orgTag /:\w\{-}:/ contained contains=orgTag -exec 'syntax keyword orgTodo contained ' . join(g:org_state_keywords, ' ') +exec 'syntax keyword orgTodo contained ' . join(org#option('org_state_keywords', ['TODO', 'NEXT', 'DONE']), ' ') hi def link orgHeading1 Title hi def link orgHeading2 orgHeading1