Allow configuring TODO state keywords

This commit is contained in:
Alex Vear
2019-02-25 21:12:17 +00:00
parent c25e89e1e6
commit 6c1bd97a04
3 changed files with 40 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
*org.txt* A minimal Org-mode package providing only the necessities.
*org.txt* A minimal Org-mode package providing only the necessities.
Org.vim Manual by Alex Vear~
@@ -12,7 +12,7 @@ Welcome to the org.vim user manual. *org* *org.vim* *vim-o
4. Configuration .............................. |org-configuration|
==============================================================================
1. INTRODUCTION *org-intro*
1. INTRODUCTION *org-intro*
Org.vim is a minimal Org-mode package for Vim. It provides only the absolute
necessities (e.g. syntax highlighting and folding) at a high standard.
@@ -33,6 +33,18 @@ WIP.
==============================================================================
4. CONFIGURATION *org-configuration*
*'g:org_state_keywords'*
Value: list of strings~
Default: ['TODO', 'NEXT', 'DONE']~
To change the default state keywords set this variable to contain a list of
strings you would like to use.
>
let g:org_state_keywords = ['TODO', 'WAIT', 'DOING', 'DONE', 'CANCELED']
<
Note: state keywords are case sensitive.
------------------------------------------------------------------------------
*'g:org_use_italics'*
Value: numeric~
Default: 0~
@@ -47,5 +59,17 @@ To enable this feature place the following line in your vimrc:
>
let g:org_use_italics = 1
<
------------------------------------------------------------------------------
*'g:org_highlight_table_background'*
Value: numeric~
Default: 1~
This option allows you to disable the highlighting of table backgrounds, as
the default may not look great with your chosen `colorscheme`.
To disable this feature place the following line in your vimrc:
>
let g:org_highlight_table_background = 0
<
------------------------------------------------------------------------------
vim:et:ts=8:sts=4:sw=4:tw=78:ft=help:norl:

9
plugin/org.vim Normal file
View File

@@ -0,0 +1,9 @@
" =============================================================
" Description: Set default config options for org.vim
" Author: Alex Vear (axvr) <av@axvr.io>
" Licence: ISC (2019)
" =============================================================
if !exists('g:org_state_keywords')
let g:org_state_keywords = ['TODO', 'NEXT', 'DONE']
endif

View File

@@ -67,8 +67,8 @@ syntax match orgHeading4 /^\s*\*\{4}\s\+.*$/ keepend contains=@Spell,orgTag,orgT
syntax match orgHeading5 /^\s*\*\{5}\s\+.*$/ keepend contains=@Spell,orgTag,orgTodo
syntax match orgHeading6 /^\s*\*\{6}\s\+.*$/ keepend contains=@Spell,orgTag,orgTodo
syntax match orgTag /:\w\{-}:/ contained contains=orgTag
" TODO make these words configurable
syntax keyword orgTodo contained TODO NEXT DONE
exec 'syntax keyword orgTodo contained ' . join(g:org_state_keywords, ' ')
highlight def link orgHeading1 htmlH1
highlight def link orgHeading2 htmlH2
@@ -95,7 +95,9 @@ highlight def link orgHyperlink Underlined
" Tables
syntax match orgTable /^|.*$/ contains=@Spell,orgBold,orgItalic,orgUnderline,orgVerbatim,orgCode
highlight def link orgTable ColorColumn
if get(g:, 'org_hightlight_table_background', 1)
highlight def link orgTable ColorColumn
endif
let b:current_syntax = 'org'