|
1 | 1 | " Vim file type plug-in
|
2 | 2 | " Author: Peter Odding <peter@peterodding.com>
|
3 |
| -" Last Change: December 1, 2011 |
| 3 | +" Last Change: May 5, 2013 |
4 | 4 | " URL: http://peterodding.com/code/vim/notes/
|
5 | 5 |
|
6 | 6 | if exists('b:did_ftplugin')
|
@@ -91,25 +91,29 @@ endif
|
91 | 91 | inoremap <buffer> *** <C-o>:call xolox#notes#insert_ruler()<CR>
|
92 | 92 | let b:undo_ftplugin .= ' | execute "iunmap <buffer> ***"'
|
93 | 93 |
|
94 |
| -" Indent list items using <Tab> and <Shift-Tab>. {{{1 |
95 |
| -inoremap <buffer> <silent> <Tab> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR> |
96 |
| -snoremap <buffer> <silent> <Tab> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv |
97 |
| -let b:undo_ftplugin .= ' | execute "iunmap <buffer> <Tab>"' |
98 |
| -let b:undo_ftplugin .= ' | execute "sunmap <buffer> <Tab>"' |
99 |
| -inoremap <buffer> <silent> <S-Tab> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR> |
100 |
| -snoremap <buffer> <silent> <S-Tab> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv |
101 |
| -let b:undo_ftplugin .= ' | execute "iunmap <buffer> <S-Tab>"' |
102 |
| -let b:undo_ftplugin .= ' | execute "sunmap <buffer> <S-Tab>"' |
103 |
| - |
104 |
| -" Indent list items using <Alt-Left> and <Alt-Right>. {{{1 |
105 |
| -inoremap <buffer> <silent> <A-Right> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR> |
106 |
| -snoremap <buffer> <silent> <A-Right> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv |
107 |
| -let b:undo_ftplugin .= ' | execute "iunmap <buffer> <A-Right>"' |
108 |
| -let b:undo_ftplugin .= ' | execute "sunmap <buffer> <A-Right>"' |
109 |
| -inoremap <buffer> <silent> <A-Left> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR> |
110 |
| -snoremap <buffer> <silent> <A-Left> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv |
111 |
| -let b:undo_ftplugin .= ' | execute "iunmap <buffer> <A-Left>"' |
112 |
| -let b:undo_ftplugin .= ' | execute "sunmap <buffer> <A-Left>"' |
| 94 | +" Indent list items using <Tab> and <Shift-Tab>? {{{1 |
| 95 | +if g:notes_tab_indents |
| 96 | + inoremap <buffer> <silent> <Tab> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR> |
| 97 | + snoremap <buffer> <silent> <Tab> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv |
| 98 | + let b:undo_ftplugin .= ' | execute "iunmap <buffer> <Tab>"' |
| 99 | + let b:undo_ftplugin .= ' | execute "sunmap <buffer> <Tab>"' |
| 100 | + inoremap <buffer> <silent> <S-Tab> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR> |
| 101 | + snoremap <buffer> <silent> <S-Tab> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv |
| 102 | + let b:undo_ftplugin .= ' | execute "iunmap <buffer> <S-Tab>"' |
| 103 | + let b:undo_ftplugin .= ' | execute "sunmap <buffer> <S-Tab>"' |
| 104 | +endif |
| 105 | + |
| 106 | +" Indent list items using <Alt-Left> and <Alt-Right>? {{{1 |
| 107 | +if g:notes_alt_indents |
| 108 | + inoremap <buffer> <silent> <A-Right> <C-o>:call xolox#notes#indent_list(1, line('.'), line('.'))<CR> |
| 109 | + snoremap <buffer> <silent> <A-Right> <C-o>:<C-u>call xolox#notes#indent_list(1, line("'<"), line("'>"))<CR><C-o>gv |
| 110 | + let b:undo_ftplugin .= ' | execute "iunmap <buffer> <A-Right>"' |
| 111 | + let b:undo_ftplugin .= ' | execute "sunmap <buffer> <A-Right>"' |
| 112 | + inoremap <buffer> <silent> <A-Left> <C-o>:call xolox#notes#indent_list(-1, line('.'), line('.'))<CR> |
| 113 | + snoremap <buffer> <silent> <A-Left> <C-o>:<C-u>call xolox#notes#indent_list(-1, line("'<"), line("'>"))<CR><C-o>gv |
| 114 | + let b:undo_ftplugin .= ' | execute "iunmap <buffer> <A-Left>"' |
| 115 | + let b:undo_ftplugin .= ' | execute "sunmap <buffer> <A-Left>"' |
| 116 | +endif |
113 | 117 |
|
114 | 118 | " Automatically remove empty list items on Enter. {{{1
|
115 | 119 | inoremap <buffer> <silent> <expr> <CR> xolox#notes#cleanup_list()
|
|
0 commit comments