From 261b6cdce64d62d6dce51362ce79ccae04f1f4c7 Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Wed, 22 Apr 2026 12:52:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20UI=20visibility=20=E2=80=94=20sidebar?= =?UTF-8?q?=20toggle,=20enriched=20statusline,=20toggle=20feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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" --- README.md | 4 ++-- modules/navigation.vim | 29 ++++++++++++----------------- modules/ui.vim | 9 +++++---- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 3fafdcf..24be6be 100644 --- a/README.md +++ b/README.md @@ -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) | diff --git a/modules/navigation.vim b/modules/navigation.vim index a1fecd5..caa710f 100644 --- a/modules/navigation.vim +++ b/modules/navigation.vim @@ -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 - let l:cur = winnr() - execute l:win . 'wincmd w' - close - if l:cur > l:win - execute (l:cur - 1) . 'wincmd w' - endif - unlet t:netrw_sidebar_buf - return + if getbufvar(winbufnr(1), '&filetype') ==# 'netrw' && getwinvar(1, '&winfixwidth') + let l:cur = winnr() + 1wincmd w + close + if l:cur > 1 + execute (l:cur - 1) . 'wincmd w' endif - unlet t:netrw_sidebar_buf + return 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 e :call ToggleSidebar() diff --git a/modules/ui.vim b/modules/ui.vim index 62d44ca..a313d1f 100644 --- a/modules/ui.vim +++ b/modules/ui.vim @@ -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