aboutsummaryrefslogtreecommitdiffstats
path: root/autoload/todo.vim
blob: 758d0d51485e65deb6f232f453041b634808d914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function! todo#Escalate()
	let todo = getline('.')

	" First non-whitespace character
	let col = match(todo, '\S')

	let priority = todo[col]

	if priority ==# '_'
		let todo = substitute(todo, '_', '-', '')
	elseif priority ==# '-'
		let todo = substitute(todo, '-', '!', '')
	endif

	call setline(line('.'), todo)
endfunction


function! todo#Descalate()
	let todo = getline('.')

	" First non-whitespace character
	let col = match(todo, '\S')

	let priority = todo[col]

	if priority ==# '!'
		let todo = substitute(todo, '!', '-', '')
	elseif priority ==# '-'
		let todo = substitute(todo, '-', '_', '')
	endif

	call setline(line('.'), todo)
endfunction