diff --git a/autoload/startify.vim b/autoload/startify.vim index 433c98c..6d220fe 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -10,9 +10,10 @@ endif let g:autoloaded_startify = 1 " Init: values {{{1 +let s:nowait_string = v:version >= 704 || (v:version == 703 && has('patch1261')) ? '' : '' +let s:nowait = get(g:, 'startify_mapping_nowait') ? s:nowait_string : '' let s:numfiles = get(g:, 'startify_files_number', 10) let s:show_special = get(g:, 'startify_enable_special', 1) -let s:nowait = get(g:, 'startify_mapping_nowait') ? '' : '' let s:delete_buffers = get(g:, 'startify_session_delete_buffers') let s:relative_path = get(g:, 'startify_relative_path') ? ':.:~' : ':p:~' let s:session_dir = resolve(expand(get(g:, 'startify_session_dir', @@ -76,7 +77,7 @@ function! startify#insane_in_the_membrane() abort if s:show_special call append('$', [' [e] ', '']) endif - call s:register(line('$')-1, 'e', 'special', 'enew', '', '') + call s:register(line('$')-1, 'e', 'special', 'enew', '', s:nowait_string) let s:entry_number = 0 if filereadable('Session.vim') @@ -119,10 +120,10 @@ function! startify#insane_in_the_membrane() abort if s:show_special call append('$', ['', ' [q] ']) - call s:register(line('$'), 'q', 'special', 'call s:close()', '', '') + call s:register(line('$'), 'q', 'special', 'call s:close()', '', s:nowait_string) else " Don't overwrite the last regular entry, thus +1 - call s:register(line('$')+1, 'q', 'special', 'call s:close()', '', '') + call s:register(line('$')+1, 'q', 'special', 'call s:close()', '', s:nowait_string) endif " compute first line offset @@ -611,14 +612,14 @@ endfunction " Function: s:set_mappings {{{1 function! s:set_mappings() abort - nnoremap i :enew startinsert - nnoremap :enew startinsert - nnoremap b :call set_mark('B') - nnoremap s :call set_mark('S') - nnoremap t :call set_mark('T') - nnoremap v :call set_mark('V') - nnoremap :call startify#open_buffers() - nnoremap <2-LeftMouse> :call startify#open_buffers() + execute "nnoremap ". s:nowait_string ." i :enew startinsert" + execute "nnoremap ". s:nowait_string ." :enew startinsert" + execute "nnoremap ". s:nowait_string ." b :call set_mark('B')" + execute "nnoremap ". s:nowait_string ." s :call set_mark('S')" + execute "nnoremap ". s:nowait_string ." t :call set_mark('T')" + execute "nnoremap ". s:nowait_string ." v :call set_mark('V')" + execute "nnoremap ". s:nowait_string ." :call startify#open_buffers()" + execute "nnoremap ". s:nowait_string ." <2-LeftMouse> :call startify#open_buffers()" for k in keys(s:entries) execute 'nnoremap '. s:entries[k].nowait s:entries[k].index diff --git a/doc/startify.txt b/doc/startify.txt index f78d2da..c5b8120 100644 --- a/doc/startify.txt +++ b/doc/startify.txt @@ -483,6 +483,8 @@ will be opened right way. Only use this when you know what you're doing. +NOTE: This option needs at least Vim 7.3.1261. It gets ignored otherwise. + ============================================================================== AUTOCMD *startify-autocmd*