Make Startify a scratch buffer again

This commit is contained in:
Marco Hinz 2013-07-25 13:53:34 +02:00
parent 77a14e70a8
commit 53019cc309
3 changed files with 13 additions and 7 deletions

View file

@ -29,11 +29,17 @@ function! startify#insane_in_the_membrane() abort
endfor
endif
setlocal nonumber noswapfile nolist bufhidden=wipe statusline=\
enew
setfiletype startify
silent file startify
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
setlocal nonumber nolist statusline=\ %t
if (v:version >= 703)
setlocal norelativenumber
endif
setfiletype startify
let s:offset_header = 0
@ -78,7 +84,7 @@ function! startify#insane_in_the_membrane() abort
nnoremap <buffer> <cr> :call <SID>open_buffers(expand('<cword>'))<cr>
nnoremap <buffer> <2-LeftMouse> :execute 'normal '. matchstr(getline('.'), '\w\+')<cr>
nnoremap <buffer><silent> q
\ :if (len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) > 1) <bar>
\ :if len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) <bar>
\ bd <bar>
\ else <bar>
\ quit <bar>

View file

@ -19,6 +19,6 @@ augroup END
command! -nargs=? -bar -complete=customlist,startify#session_list SSave call startify#session_save(<f-args>)
command! -nargs=? -bar -complete=customlist,startify#session_list SLoad call startify#session_load(<f-args>)
command! -nargs=? -bar -complete=customlist,startify#session_list SDelete call startify#session_delete(<f-args>)
command! -nargs=0 -bar Startify enew | call startify#insane_in_the_membrane()
command! -nargs=0 -bar Startify call startify#insane_in_the_membrane()
" vim: et sw=2 sts=2

View file

@ -21,9 +21,9 @@ if exists('g:startify_custom_header')
execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_custom_header) + 2) .'l/'
endif
highlight link StartifyHeader Normal
highlight link StartifyBracket Delimiter
highlight link StartifyNumber Number
highlight default link StartifyHeader Normal
highlight default link StartifyBracket Delimiter
highlight default link StartifyNumber Number
let b:current_syntax = 'startify'