Skip to content

Commit eb85af7

Browse files
committed
Adds title toggle for simple todos
1 parent 0552912 commit eb85af7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

vim/unpublished/simple-todo-list/ftplugin/simple-todo-list.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,21 @@ function! ToggleTodoDoneAndLogged()
7070
call ToggleTodoLogged()
7171
endfunction
7272

73+
function! ToggleSectionTitle()
74+
let regionName = synIDattr(synID(line("."), col("."), 0), "name")
75+
if regionName == "simpleTodoTitle"
76+
normal! jddk
77+
else
78+
normal! yypVr-k
79+
endif
80+
endfunction
81+
7382
nnoremap <buffer> <silent> <Leader>m :call ToggleTodoDone()<CR>
7483
nnoremap <buffer> <silent> <Leader>l :call ToggleTodoLogged()<CR>
7584
nnoremap <buffer> <silent> <Leader>d :call ToggleTodoDoneAndLogged()<CR>
7685
86+
nnoremap <buffer> <silent> <Leader>T :call ToggleSectionTitle()<CR>
87+
7788
nnoremap <buffer> <C-n> /^----<CR><CR>
7889
nnoremap <buffer> <C-p> ?^----<CR>n<CR>
7990

0 commit comments

Comments
 (0)