mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-10 19:10:59 +08:00
perf: 39ms → 23ms startup (40% faster)
- Guard against double-sourcing when exrc loads CWD .vimrc (saves ~8ms) - Lazy-load EasyMotion, undotree, previm, goyo, limelight (on-demand) - Lazy-load language syntax plugins (for: filetype) - Enable lsp_settings_lazyload (defer server init to VimEnter) - Skip unused built-in plugins (2html, gzip, tar, zip, vimball, etc.) - Remove redundant filetype/syntax calls (plug#end already enables them) - Add shortmess+=I to skip intro screen
This commit is contained in:
parent
fa59d5be8f
commit
f0d4431eef
5 changed files with 27 additions and 33 deletions
20
.vimrc
20
.vimrc
|
|
@ -1,21 +1,5 @@
|
|||
" ============================================================================
|
||||
" chopsticks — vim configuration
|
||||
" Philosophy: flowing writing on any machine. No Node.js. Solarized palette.
|
||||
" ============================================================================
|
||||
"
|
||||
" Modular layout — each file in modules/ is self-contained:
|
||||
" env.vim Environment detection (TTY, truecolor)
|
||||
" plugins.vim vim-plug bootstrap + all 30 plugin declarations
|
||||
" core.vim General settings, keymaps, performance, indentation
|
||||
" ui.vim Colorscheme, statusline, startify, indentline
|
||||
" editing.vim EasyMotion, yank highlight, search auto-clear
|
||||
" navigation.vim FZF, netrw, window management, terminal
|
||||
" lsp.vim vim-lsp + asyncomplete configuration
|
||||
" lint.vim ALE linting and format-on-save
|
||||
" git.vim Fugitive, GitGutter, conflict navigation
|
||||
" writing.vim Markdown, previm, goyo + limelight zen mode
|
||||
" languages.vim vim-go config, per-filetype settings
|
||||
" tools.vim Cheat sheet, run file, sudo save, helpers
|
||||
if exists('g:chopsticks_loaded') | finish | endif
|
||||
let g:chopsticks_loaded = 1
|
||||
|
||||
let g:chopsticks_dir = fnamemodify(resolve(expand('<sfile>')), ':h')
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
" core.vim — general settings, basic keymaps, performance, indentation
|
||||
|
||||
filetype on
|
||||
filetype plugin on
|
||||
filetype indent on
|
||||
syntax on
|
||||
" filetype/syntax already enabled by plug#end() in plugins.vim
|
||||
|
||||
set number
|
||||
set relativenumber
|
||||
|
|
@ -186,7 +182,7 @@ set ttyfast
|
|||
set lazyredraw
|
||||
set complete-=i
|
||||
set updatetime=300
|
||||
set shortmess+=c
|
||||
set shortmess+=cI
|
||||
|
||||
if g:is_tty
|
||||
set signcolumn=auto
|
||||
|
|
|
|||
|
|
@ -5,3 +5,15 @@ set nocompatible
|
|||
let g:is_tty = empty($TERM) || $TERM ==# 'dumb' || $TERM =~# 'linux'
|
||||
\ || $TERM =~# 'screen' || &term =~# 'builtin'
|
||||
let g:has_true_color = ($COLORTERM ==# 'truecolor' || $COLORTERM ==# '24bit')
|
||||
|
||||
" Skip built-in plugins we never use
|
||||
let g:loaded_2html_plugin = 1
|
||||
let g:loaded_getscriptPlugin = 1
|
||||
let g:loaded_gzip = 1
|
||||
let g:loaded_logipat = 1
|
||||
let g:loaded_rrhelper = 1
|
||||
let g:loaded_tarPlugin = 1
|
||||
let g:loaded_vimballPlugin = 1
|
||||
let g:loaded_zipPlugin = 1
|
||||
let g:loaded_tutor_mode_plugin = 1
|
||||
let g:loaded_spellfile_plugin = 1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
" lsp.vim — vim-lsp settings, asyncomplete, LSP buffer keymaps
|
||||
|
||||
let g:lsp_settings_lazyload = 1
|
||||
|
||||
let g:lsp_settings_filetype_python = ['pylsp']
|
||||
let g:lsp_settings_filetype_go = ['gopls']
|
||||
let g:lsp_settings_filetype_rust = ['rust-analyzer']
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ Plug 'tpope/vim-unimpaired'
|
|||
Plug 'tpope/vim-sleuth'
|
||||
Plug 'wellle/targets.vim'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
Plug 'easymotion/vim-easymotion', { 'on': '<Plug>(easymotion' }
|
||||
|
||||
" ── Linting & Formatting ────────────────────────────────────────────────────
|
||||
Plug 'dense-analysis/ale'
|
||||
|
|
@ -40,18 +40,18 @@ Plug 'prabirshrestha/asyncomplete.vim'
|
|||
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||
|
||||
" ── Language Syntax ──────────────────────────────────────────────────────────
|
||||
Plug 'pangloss/vim-javascript'
|
||||
Plug 'HerringtonDarkholme/yats.vim'
|
||||
Plug 'preservim/vim-markdown'
|
||||
Plug 'fatih/vim-go'
|
||||
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
|
||||
Plug 'HerringtonDarkholme/yats.vim', { 'for': ['typescript', 'typescript.tsx'] }
|
||||
Plug 'preservim/vim-markdown', { 'for': 'markdown' }
|
||||
Plug 'fatih/vim-go', { 'for': 'go' }
|
||||
|
||||
" ── Markdown Preview & Writing ───────────────────────────────────────────────
|
||||
Plug 'previm/previm'
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'junegunn/limelight.vim'
|
||||
Plug 'previm/previm', { 'on': 'PrevimOpen' }
|
||||
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' }
|
||||
Plug 'junegunn/limelight.vim', { 'on': ['Limelight', 'Limelight!'] }
|
||||
|
||||
" ── UI ───────────────────────────────────────────────────────────────────────
|
||||
Plug 'mbbill/undotree'
|
||||
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
|
||||
Plug 'mhinz/vim-startify'
|
||||
Plug 'lifepillar/vim-solarized8'
|
||||
if !g:is_tty
|
||||
|
|
|
|||
Loading…
Reference in a new issue