ux: dashboard-style startup — fullscreen Startify, m1ngsama header

- Remove NERDTree auto-open on bare `vim` — Startify now renders
  fullscreen like neovim's snacks dashboard (use Ctrl+n for tree)
- `vim .` keeps NERDTree left + Startify right (directory workflow)
- Replace minimal text header with centered m1ngsama ASCII block art
  (mirrors neovim config aesthetic)
- Center art and info subheader dynamically based on window width
- Add startify_padding_left = 4 for list item breathing room
- Reorder lists: Sessions → Recent Files → Current Dir → Bookmarks
This commit is contained in:
m1ngsama 2026-03-29 19:54:44 +08:00
parent 3236155b84
commit 9442aa0499

48
.vimrc
View file

@ -468,12 +468,8 @@ if !g:is_tty
\ wincmd p | \ wincmd p |
\ if exists(':Startify') == 2 | Startify | else | enew | endif | \ if exists(':Startify') == 2 | Startify | else | enew | endif |
\ endif \ endif
" vim (no args) → Startify renders first; open NERDTree alongside it " vim (no args) → Startify fullscreen dashboard, no auto NERDTree
autocmd User Startified " Use Ctrl+n to open NERDTree when needed
\ if argc() == 0 && !exists('s:std_in') |
\ NERDTree |
\ wincmd p |
\ endif
augroup END augroup END
endif endif
@ -1247,8 +1243,24 @@ endif
" ============================================================================ " ============================================================================
if exists('g:plugs["vim-startify"]') if exists('g:plugs["vim-startify"]')
" Dynamic header: config name, vim version, current dir, git branch, key tips " Centered dashboard header — matches neovim startup aesthetic
function! StartifyHeader() abort function! StartifyHeader() abort
let l:art = [
\ '███╗ ███╗ ██╗███╗ ██╗ ██████╗ ███████╗ █████╗ ███╗ ███╗ █████╗ ',
\ '████╗ ████║███║████╗ ██║██╔════╝ ██╔════╝██╔══██╗████╗ ████║██╔══██╗',
\ '██╔████╔██║╚██║██╔██╗ ██║██║ ███╗███████╗███████║██╔████╔██║███████║ ',
\ '██║╚██╔╝██║ ██║██║╚██╗██║██║ ██║╚════██║██╔══██║██║╚██╔╝██║██╔══██║',
\ '██║ ╚═╝ ██║ ██║██║ ╚████║╚██████╔╝███████║██║ ██║██║ ╚═╝ ██║██║ ██║',
\ '╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝',
\ ]
let l:art_w = 71
let l:pad = max([0, (winwidth(0) - l:art_w) / 2])
let l:indent = repeat(' ', l:pad)
let l:lines = []
for l:line in l:art
call add(l:lines, l:indent . l:line)
endfor
" Info subheader: vim version + cwd + git branch
let l:ver = 'Vim ' . (v:version / 100) . '.' . printf('%02d', v:version % 100) let l:ver = 'Vim ' . (v:version / 100) . '.' . printf('%02d', v:version % 100)
let l:cwd = fnamemodify(getcwd(), ':t') let l:cwd = fnamemodify(getcwd(), ':t')
let l:git = '' let l:git = ''
@ -1259,19 +1271,20 @@ if exists('g:plugs["vim-startify"]')
let l:git = ' [' . substitute(l:branch, '\n\+$', '', '') . ']' let l:git = ' [' . substitute(l:branch, '\n\+$', '', '') . ']'
endif endif
endif endif
return [ let l:info = l:ver . ' ' . l:cwd . l:git
\ ' chopsticks | ' . l:ver . ' | ' . l:cwd . l:git, let l:info_pad = max([0, (winwidth(0) - len(l:info)) / 2])
\ ' , = leader | , + pause = key hints | Ctrl-p = files | ,rg = search', call add(l:lines, '')
\ '', call add(l:lines, repeat(' ', l:info_pad) . l:info)
\ ] call add(l:lines, '')
return l:lines
endfunction endfunction
let g:startify_custom_header = 'StartifyHeader()' let g:startify_custom_header = 'StartifyHeader()'
" Sessions first: restores full project state; dir + recent files below " Sessions first, then recent files — mirrors dashboard plugin ordering
let g:startify_lists = [ let g:startify_lists = [
\ { 'type': 'sessions', 'header': [' Sessions'] }, \ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'dir', 'header': [' Directory: ' . getcwd()] },
\ { 'type': 'files', 'header': [' Recent Files'] }, \ { 'type': 'files', 'header': [' Recent Files'] },
\ { 'type': 'dir', 'header': [' Current Dir'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] }, \ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ ] \ ]
@ -1289,8 +1302,11 @@ if exists('g:plugs["vim-startify"]')
let g:startify_fortune_use_unicode = 0 " ASCII only (KISS) let g:startify_fortune_use_unicode = 0 " ASCII only (KISS)
let g:startify_enable_special = 0 " Hide <empty> / <quit> clutter let g:startify_enable_special = 0 " Hide <empty> / <quit> clutter
" Limit recent files shown " Show more recent files
let g:startify_files_number = 10 let g:startify_files_number = 8
" Left padding for list items (gives visual breathing room)
let g:startify_padding_left = 4
" Required for NERDTree compatibility (prevents buftype conflicts) " Required for NERDTree compatibility (prevents buftype conflicts)
augroup ChopstickStartify augroup ChopstickStartify