mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-10 19:10:59 +08:00
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:
parent
2e37efe644
commit
261b6cdce6
3 changed files with 19 additions and 23 deletions
|
|
@ -34,8 +34,8 @@ chopsticks gives you a production-ready Vim config in one command. Pure VimScrip
|
||||||
|
|
||||||
## What's in the box
|
## 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)) |
|
| **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 |
|
| **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) |
|
| **Fuzzy find** | files, buffers, grep, tags, marks, commands — [FZF](https://github.com/junegunn/fzf.vim) |
|
||||||
|
|
|
||||||
|
|
@ -12,25 +12,20 @@ let g:netrw_list_hide .= ',\.pyc$,node_modules,\.git,__pycache__,\.DS_Store'
|
||||||
|
|
||||||
function! s:ToggleSidebar(...) abort
|
function! s:ToggleSidebar(...) abort
|
||||||
let l:dir = a:0 ? a:1 : getcwd()
|
let l:dir = a:0 ? a:1 : getcwd()
|
||||||
if exists('t:netrw_sidebar_buf')
|
if getbufvar(winbufnr(1), '&filetype') ==# 'netrw' && getwinvar(1, '&winfixwidth')
|
||||||
let l:win = bufwinnr(t:netrw_sidebar_buf)
|
let l:cur = winnr()
|
||||||
if l:win != -1
|
1wincmd w
|
||||||
let l:cur = winnr()
|
close
|
||||||
execute l:win . 'wincmd w'
|
if l:cur > 1
|
||||||
close
|
execute (l:cur - 1) . 'wincmd w'
|
||||||
if l:cur > l:win
|
|
||||||
execute (l:cur - 1) . 'wincmd w'
|
|
||||||
endif
|
|
||||||
unlet t:netrw_sidebar_buf
|
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
unlet t:netrw_sidebar_buf
|
return
|
||||||
endif
|
endif
|
||||||
execute '1wincmd w'
|
execute 'topleft vertical 30new'
|
||||||
execute 'Vexplore ' . fnameescape(l:dir)
|
execute 'Explore ' . fnameescape(l:dir)
|
||||||
vertical resize 30
|
setlocal winfixwidth
|
||||||
let t:netrw_sidebar_buf = bufnr('%')
|
setlocal bufhidden=wipe
|
||||||
wincmd l
|
wincmd p
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
nnoremap <silent> <leader>e :call <SID>ToggleSidebar()<CR>
|
nnoremap <silent> <leader>e :call <SID>ToggleSidebar()<CR>
|
||||||
|
|
|
||||||
|
|
@ -85,15 +85,16 @@ if exists('g:plugs["vim-startify"]')
|
||||||
endif
|
endif
|
||||||
let l:dir = fnameescape(argv()[0])
|
let l:dir = fnameescape(argv()[0])
|
||||||
execute 'cd ' . l:dir
|
execute 'cd ' . l:dir
|
||||||
execute 'Vexplore ' . l:dir
|
vertical rightbelow vnew
|
||||||
vertical resize 30
|
|
||||||
let t:netrw_sidebar_buf = bufnr('%')
|
|
||||||
wincmd l
|
|
||||||
if exists(':Startify') == 2
|
if exists(':Startify') == 2
|
||||||
Startify
|
Startify
|
||||||
else
|
else
|
||||||
enew
|
enew
|
||||||
endif
|
endif
|
||||||
|
wincmd h
|
||||||
|
vertical resize 30
|
||||||
|
setlocal winfixwidth
|
||||||
|
wincmd l
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
if !g:is_tty
|
if !g:is_tty
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue