feat: UI visibility — sidebar toggle, enriched statusline, toggle feedback

- Netrw sidebar: ,e/,E toggles left-side tree (topleft + winfixwidth)
- vim . opens netrw sidebar (30 cols) + Startify dashboard
- Statusline: buffer count, PASTE/SPELL/MAX flags, LSP server, encoding
- Toggle echo: F2/F3/F4/F6/,ss/,z show new state
- README: fix empty table header in "What's in the box"
This commit is contained in:
m1ngsama 2026-04-22 12:52:31 +08:00
parent 2e37efe644
commit 261b6cdce6
3 changed files with 19 additions and 23 deletions

View file

@ -34,8 +34,8 @@ chopsticks gives you a production-ready Vim config in one command. Pure VimScrip
## What's in the box
| | |
|-|-|
| Feature | Description |
|---------|-------------|
| **LSP** | completion, go-to-def, hover, rename, code actions — pure VimScript ([vim-lsp](https://github.com/prabirshrestha/vim-lsp)) |
| **Lint + format** | [ALE](https://github.com/dense-analysis/ale) runs black, prettier, gofmt, rustfmt on save |
| **Fuzzy find** | files, buffers, grep, tags, marks, commands — [FZF](https://github.com/junegunn/fzf.vim) |

View file

@ -12,25 +12,20 @@ let g:netrw_list_hide .= ',\.pyc$,node_modules,\.git,__pycache__,\.DS_Store'
function! s:ToggleSidebar(...) abort
let l:dir = a:0 ? a:1 : getcwd()
if exists('t:netrw_sidebar_buf')
let l:win = bufwinnr(t:netrw_sidebar_buf)
if l:win != -1
if getbufvar(winbufnr(1), '&filetype') ==# 'netrw' && getwinvar(1, '&winfixwidth')
let l:cur = winnr()
execute l:win . 'wincmd w'
1wincmd w
close
if l:cur > l:win
if l:cur > 1
execute (l:cur - 1) . 'wincmd w'
endif
unlet t:netrw_sidebar_buf
return
endif
unlet t:netrw_sidebar_buf
endif
execute '1wincmd w'
execute 'Vexplore ' . fnameescape(l:dir)
vertical resize 30
let t:netrw_sidebar_buf = bufnr('%')
wincmd l
execute 'topleft vertical 30new'
execute 'Explore ' . fnameescape(l:dir)
setlocal winfixwidth
setlocal bufhidden=wipe
wincmd p
endfunction
nnoremap <silent> <leader>e :call <SID>ToggleSidebar()<CR>

View file

@ -85,15 +85,16 @@ if exists('g:plugs["vim-startify"]')
endif
let l:dir = fnameescape(argv()[0])
execute 'cd ' . l:dir
execute 'Vexplore ' . l:dir
vertical resize 30
let t:netrw_sidebar_buf = bufnr('%')
wincmd l
vertical rightbelow vnew
if exists(':Startify') == 2
Startify
else
enew
endif
wincmd h
vertical resize 30
setlocal winfixwidth
wincmd l
endfunction
if !g:is_tty