diff --git a/README.md b/README.md index 2a678b1..0b226ca 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ curl -fsSL https://raw.githubusercontent.com/m1ngsama/chopsticks/main/get.sh | b You SSH into a box. You need to edit code. You want LSP, fuzzy find, git integration, format-on-save — not a 20-minute setup ritual. -chopsticks gives you 30 plugins, 12 modules, and a sane config in one command. It degrades gracefully on TTY. It works the same on your MacBook and your Arch server. +chopsticks gives you 29 plugins, 12 modules, and a sane config in one command. It degrades gracefully on TTY. It works the same on your MacBook and your Arch server. ## What's in the box @@ -86,7 +86,7 @@ ALE and vim-lsp coexist cleanly (`ale_disable_lsp=1`). ALE handles linting + for ├── .vimrc thin loader ├── modules/ │ ├── env.vim TTY detection, truecolor -│ ├── plugins.vim vim-plug + 30 plugins +│ ├── plugins.vim vim-plug + 29 plugins │ ├── core.vim settings, keymaps, performance │ ├── ui.vim colorscheme, statusline, startify │ ├── editing.vim easymotion, yank highlight diff --git a/modules/editing.vim b/modules/editing.vim index e49cc52..7aee652 100644 --- a/modules/editing.vim +++ b/modules/editing.vim @@ -33,6 +33,11 @@ if exists('##TextYankPost') && has('timers') augroup END endif +" ── Blank Line Insertion (replaces vim-unimpaired) ────────────────────────── + +nnoremap [ :put! =repeat(nr2char(10), v:count1)'[ +nnoremap ] :put =repeat(nr2char(10), v:count1) + " ── Auto-Clear Search Highlight ───────────────────────────────────────────── augroup ChopstickSearchHL diff --git a/modules/git.vim b/modules/git.vim index 88077b2..9ba0e53 100644 --- a/modules/git.vim +++ b/modules/git.vim @@ -2,6 +2,7 @@ " ── GitGutter ─────────────────────────────────────────────────────────────── +let g:gitgutter_map_keys = 0 let g:gitgutter_sign_added = '+' let g:gitgutter_sign_modified = '~' let g:gitgutter_sign_removed = '-' diff --git a/modules/languages.vim b/modules/languages.vim index 89db0ba..19ee563 100644 --- a/modules/languages.vim +++ b/modules/languages.vim @@ -19,12 +19,6 @@ augroup ChopstickFiletype autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif - autocmd BufNewFile,BufRead *.json setlocal filetype=json - autocmd BufNewFile,BufRead *.md setlocal filetype=markdown - autocmd BufNewFile,BufRead *.jsx setlocal filetype=javascript.jsx - autocmd BufNewFile,BufRead *.tsx setlocal filetype=typescript.tsx - autocmd BufNewFile,BufRead Dockerfile* setlocal filetype=dockerfile - autocmd FileType python \ setlocal expandtab shiftwidth=4 tabstop=4 textwidth=88 colorcolumn=+1 autocmd FileType javascript,typescript diff --git a/modules/lint.vim b/modules/lint.vim index 681455b..2e76a7e 100644 --- a/modules/lint.vim +++ b/modules/lint.vim @@ -43,6 +43,8 @@ let g:ale_sign_warning = '!' let g:ale_lint_on_text_changed = 'normal' let g:ale_lint_on_insert_leave = 1 let g:ale_lint_on_enter = 1 +let g:ale_lint_delay = 200 +let g:ale_echo_delay = 100 if exists('g:plugs["ale"]') nnoremap [e :ALEPrevious diff --git a/modules/lsp.vim b/modules/lsp.vim index 10cefd4..301c37b 100644 --- a/modules/lsp.vim +++ b/modules/lsp.vim @@ -18,10 +18,13 @@ let g:lsp_settings_filetype_markdown = ['marksman'] let g:lsp_settings_filetype_sql = ['sqls'] let g:lsp_diagnostics_virtual_text_enabled = !g:is_tty +let g:lsp_diagnostics_virtual_text_delay = 200 let g:lsp_diagnostics_highlights_enabled = !g:is_tty let g:lsp_document_highlight_enabled = !g:is_tty +let g:lsp_document_highlight_delay = 200 let g:lsp_signs_enabled = 1 let g:lsp_diagnostics_echo_cursor = 1 +let g:lsp_diagnostics_echo_delay = 100 let g:lsp_completion_documentation_enabled = 1 let g:lsp_signs_error = {'text': 'X'} diff --git a/modules/plugins.vim b/modules/plugins.vim index 9fda575..9c066b2 100644 --- a/modules/plugins.vim +++ b/modules/plugins.vim @@ -24,7 +24,10 @@ Plug 'airblade/vim-gitgutter' Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'tpope/vim-repeat' -Plug 'tpope/vim-unimpaired' +" tpope/vim-unimpaired removed: 2.5ms startup cost, we define our own +" [q/]q (quickfix), [e/]e (ALE), [x/]x (conflict) — unimpaired's [b/]b +" is covered by ,h/,l. Blank line insertion ([) added below. + Plug 'tpope/vim-sleuth' Plug 'wellle/targets.vim' Plug 'jiangmiao/auto-pairs' diff --git a/modules/tools.vim b/modules/tools.vim index dd829ef..07c56a5 100644 --- a/modules/tools.vim +++ b/modules/tools.vim @@ -86,43 +86,31 @@ augroup BWCCreateDir \ endif augroup END -" ── Large File Handling (>10 MB) ──────────────────────────────────────────── +" ── Large File Handling ────────────────────────────────────────────────────── let g:LargeFile = 1024 * 1024 * 10 -augroup LargeFile +let s:tty_large = g:is_tty ? 512000 : g:LargeFile + +augroup ChopstickLargeFile autocmd! autocmd BufReadPre * \ if !empty(expand('')) | - \ let f = getfsize(expand('')) | - \ if f > g:LargeFile || f == -2 | call LargeFileSettings() | endif | + \ let s:fsize = getfsize(expand('')) | + \ if s:fsize > g:LargeFile || s:fsize == -2 | + \ setlocal bufhidden=unload undolevels=-1 noswapfile syntax= | + \ let b:ale_enabled = 0 | + \ elseif g:is_tty && s:fsize > s:tty_large | + \ setlocal syntax= | + \ endif | \ endif augroup END -function! LargeFileSettings() - setlocal bufhidden=unload - setlocal undolevels=-1 - setlocal noswapfile - setlocal syntax= - let b:ale_enabled = 0 - echo "Large file (>10 MB): syntax, undo, and linting disabled." -endfunction - -if g:is_tty - augroup ChopstickTTYLargeFile +if g:is_tty && !exists("g:tty_message_shown") + augroup TTYMessage autocmd! - autocmd BufReadPre * - \ if !empty(expand('')) && getfsize(expand('')) > 512000 | - \ setlocal syntax= | - \ endif + autocmd VimEnter * echom "TTY mode — visual features disabled" augroup END - - if !exists("g:tty_message_shown") - augroup TTYMessage - autocmd! - autocmd VimEnter * echom "TTY mode — visual features disabled" - augroup END - let g:tty_message_shown = 1 - endif + let g:tty_message_shown = 1 endif " ── Run Current File (,cr) ──────────────────────────────────────────────────