From 8721af3ceaeb359d69bd876c3f8e1bb254423ced Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Mon, 5 Nov 2018 20:20:15 +0100 Subject: [PATCH] Assume at least Vim 7.4 7.4 was released at 10 Aug 2013. --- autoload/startify.vim | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/autoload/startify.vim b/autoload/startify.vim index 6e3d69d..61bf797 100644 --- a/autoload/startify.vim +++ b/autoload/startify.vim @@ -10,7 +10,6 @@ endif let g:autoloaded_startify = 1 " Init: values {{{1 -let s:nowait = v:version >= 704 || (v:version == 703 && has('patch1261')) ? '' : '' let s:numfiles = get(g:, 'startify_files_number', 10) let s:show_special = get(g:, 'startify_enable_special', 1) let s:relative_path = get(g:, 'startify_relative_path') ? ':~:.' : ':p:~' @@ -158,11 +157,7 @@ function! startify#insane_in_the_membrane() abort endif if exists('#User#Startified') - if v:version > 703 || v:version == 703 && has('patch442') - doautocmd User Startified - else - doautocmd User Startified - endif + doautocmd User Startified endif endfunction @@ -803,15 +798,15 @@ endfunction " Function: s:set_mappings {{{1 function! s:set_mappings() abort - execute "nnoremap ". s:nowait ." i :enew startinsert" - execute "nnoremap ". s:nowait ." :enew startinsert" - execute "nnoremap ". s:nowait ." b :call set_mark('B')" - execute "nnoremap ". s:nowait ." s :call set_mark('S')" - execute "nnoremap ". s:nowait ." t :call set_mark('T')" - execute "nnoremap ". s:nowait ." v :call set_mark('V')" - execute "nnoremap ". s:nowait ." :call startify#open_buffers()" - execute "nnoremap ". s:nowait ." <2-LeftMouse> :call startify#open_buffers()" - execute "nnoremap ". s:nowait ." :enew execute 'normal! \"'.(v:register=='\"'?'*':v:register).'gp'" + 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() + nnoremap :enew execute 'normal! "'.(v:register=='"'?'*':v:register).'gp' " Without these mappings n/N wouldn't work properly, since autocmds always " force the cursor back on the index. @@ -823,7 +818,7 @@ function! s:set_mappings() abort endfunction for entry in sort(values(b:startify.entries), 's:compare_by_index') - execute 'nnoremap '. s:nowait entry.index + execute 'nnoremap ' entry.index \ ':call startify#open_buffers('. string(entry.line) .')' endfor endfunction