Skip to content

Commit e4b9d34

Browse files
committed
Adds simple mappings for indentation (#19)
1 parent 1df8d51 commit e4b9d34

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

plugin/vim-todo-lists.vim

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" MIT License
22
"
3-
" Copyright (c) 2018 Alexander Serebryakov ([email protected])
3+
" Copyright (c) 2019 Alexander Serebryakov ([email protected])
44
"
55
" Permission is hereby granted, free of charge, to any person obtaining a copy
66
" of this software and associated documentation files (the "Software"), to
@@ -327,6 +327,12 @@ function! VimTodoListsSetItemMode()
327327
vnoremap <buffer> <Space> :VimTodoListsToggleItem<CR>
328328
inoremap <buffer> <CR> <CR><ESC>:VimTodoListsCreateNewItem<CR>
329329
noremap <buffer> <leader>e :silent call VimTodoListsSetNormalMode()<CR>
330+
nnoremap <buffer> <Tab> :VimTodoListsIncreaseIndent<CR>
331+
nnoremap <buffer> <S-Tab> :VimTodoListsDecreaseIndent<CR>
332+
vnoremap <buffer> <Tab> :VimTodoListsIncreaseIndent<CR>
333+
vnoremap <buffer> <S-Tab> :VimTodoListsDecreaseIndent<CR>
334+
inoremap <buffer> <Tab> <ESC>:VimTodoListsIncreaseIndent<CR>A
335+
inoremap <buffer> <S-Tab> <ESC>:VimTodoListsDecreaseIndent<CR>A
330336
endfunction
331337

332338

@@ -392,6 +398,15 @@ function! VimTodoListsToggleItem()
392398
call cursor(l:cursor_pos[1], l:cursor_pos[4])
393399
endfunction
394400

401+
" Increases the indent level
402+
function! VimTodoListsIncreaseIndent()
403+
normal! >>
404+
endfunction
405+
406+
" Decreases the indent level
407+
function! VimTodoListsDecreaseIndent()
408+
normal! <<
409+
endfunction
395410

396411
"Plugin startup code
397412
if !exists('g:vimtodolists_plugin')
@@ -415,5 +430,7 @@ if !exists('g:vimtodolists_plugin')
415430
command! VimTodoListsGoToNextItem silent call VimTodoListsGoToNextItem()
416431
command! VimTodoListsGoToPreviousItem silent call VimTodoListsGoToPreviousItem()
417432
command! -range VimTodoListsToggleItem silent <line1>,<line2>call VimTodoListsToggleItem()
433+
command! -range VimTodoListsIncreaseIndent silent <line1>,<line2>call VimTodoListsIncreaseIndent()
434+
command! -range VimTodoListsDecreaseIndent silent <line1>,<line2>call VimTodoListsDecreaseIndent()
418435
endif
419436

0 commit comments

Comments
 (0)