diff --git a/autoload/vimwiki/vars.vim b/autoload/vimwiki/vars.vim index 03a5aa8..faed1e9 100644 --- a/autoload/vimwiki/vars.vim +++ b/autoload/vimwiki/vars.vim @@ -166,8 +166,8 @@ function! s:get_default_global() abort \ 'key_mappings': {'type': type({}), 'default': \ { \ 'all_maps': 1, 'global': 1, 'headers': 1, 'text_objs': 1, - \ 'table_format': 1, 'table_mappings': 1, 'lists': 1, 'links': 1, - \ 'html': 1, 'mouse': 0, + \ 'table_format': 1, 'table_mappings': 1, 'lists': 1, 'lists_return': 1, + \ 'links': 1, 'html': 1, 'mouse': 0, \ }}, \ 'links_header': {'type': type(''), 'default': 'Generated Links', 'min_length': 1}, \ 'links_header_level': {'type': type(0), 'default': 1, 'min': 1, 'max': 6}, diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index cfa7587..2834737 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -535,20 +535,23 @@ if str2nr(vimwiki#vars#get_global('key_mappings').lists) call vimwiki#u#map_key('n', 'o', 'VimwikiListo') call vimwiki#u#map_key('n', 'O', 'VimwikiListO') - " Handle case of existing VimwikiReturn mappings outside the definition - " Note: Avoid interfering with popup/completion menu if it's active (#813) - if maparg('', 'i') !~# '.*VimwikiReturn*.' - if has('patch-7.3.489') - " expand iabbrev on enter - inoremap pumvisible() ? '' : ':VimwikiReturn 1 5' - else - inoremap pumvisible() ? '' : ':VimwikiReturn 1 5' + " Set lists_return to 0, if you don't want mapped to VimwikiReturn + if str2nr(vimwiki#vars#get_global('key_mappings').lists_return) + " Handle case of existing VimwikiReturn mappings outside the definition + " Note: Avoid interfering with popup/completion menu if it's active (#813) + if maparg('', 'i') !~# '.*VimwikiReturn*.' + if has('patch-7.3.489') + " expand iabbrev on enter + inoremap pumvisible() ? '' : ':VimwikiReturn 1 5' + else + inoremap pumvisible() ? '' : ':VimwikiReturn 1 5' + endif + endif + if maparg('', 'i') !~# '.*VimwikiReturn*.' + inoremap pumvisible() ? '' : ':VimwikiReturn 2 2' endif endif - if maparg('', 'i') !~# '.*VimwikiReturn*.' - inoremap pumvisible() ? '' : ':VimwikiReturn 2 2' - endif - + " change symbol for bulleted lists for s:char in vimwiki#vars#get_syntaxlocal('bullet_types') if !hasmapto(':VimwikiChangeSymbolTo '.s:char.'')