mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-10 19:10:59 +08:00
Startup: replace vim-unimpaired (2.5ms) with 2-line blank line insertion. 29 plugins now. All [q/]q, [e/]e, [x/]x mappings were already ours. Runtime: - ALE lint_delay=200ms, echo_delay=100ms — less thrashing during edits - LSP virtual_text_delay=200ms, highlight_delay=200ms, echo_delay=100ms - Disable gitgutter default mappings (map_keys=0) — we don't use them - Merge two BufReadPre large-file autocmds into one (single getfsize) - Remove redundant filetype detection autocmds (Vim 9.2 handles natively)
46 lines
2 KiB
VimL
46 lines
2 KiB
VimL
" languages.vim — vim-go config, per-filetype autocmds
|
|
|
|
" ── vim-go (syntax only — vim-lsp handles intelligence) ─────────────────────
|
|
|
|
let g:go_gopls_enabled = 0
|
|
let g:go_code_completion_enabled = 0
|
|
let g:go_fmt_autosave = 0
|
|
let g:go_imports_autosave = 0
|
|
let g:go_highlight_types = 1
|
|
let g:go_highlight_fields = 1
|
|
let g:go_highlight_functions = 1
|
|
let g:go_highlight_function_calls = 1
|
|
|
|
" ── Filetype Detection ──────────────────────────────────────────────────────
|
|
|
|
augroup ChopstickFiletype
|
|
autocmd!
|
|
|
|
autocmd BufReadPost *
|
|
\ if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
|
|
|
autocmd FileType python
|
|
\ setlocal expandtab shiftwidth=4 tabstop=4 textwidth=88 colorcolumn=+1
|
|
autocmd FileType javascript,typescript
|
|
\ setlocal expandtab shiftwidth=2 tabstop=2 textwidth=100 colorcolumn=+1
|
|
autocmd FileType go
|
|
\ setlocal noexpandtab shiftwidth=4 tabstop=4 textwidth=120 colorcolumn=+1
|
|
autocmd FileType rust
|
|
\ setlocal expandtab shiftwidth=4 tabstop=4 textwidth=100 colorcolumn=+1
|
|
autocmd FileType c,cpp
|
|
\ setlocal expandtab shiftwidth=4 tabstop=4 textwidth=80 colorcolumn=+1
|
|
autocmd FileType html,css
|
|
\ setlocal expandtab shiftwidth=2 tabstop=2
|
|
autocmd FileType yaml
|
|
\ setlocal expandtab shiftwidth=2 tabstop=2
|
|
autocmd FileType markdown
|
|
\ setlocal wrap linebreak spell textwidth=0 colorcolumn=0 conceallevel=2
|
|
autocmd FileType sh
|
|
\ setlocal expandtab shiftwidth=2 tabstop=2 textwidth=80 colorcolumn=+1
|
|
autocmd FileType make
|
|
\ setlocal noexpandtab shiftwidth=8 tabstop=8
|
|
autocmd FileType json
|
|
\ setlocal expandtab shiftwidth=2 tabstop=2
|
|
autocmd FileType dockerfile
|
|
\ setlocal expandtab shiftwidth=2 tabstop=2
|
|
augroup END
|