mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-10 19:10:59 +08:00
Replace the monolithic 1268-line .vimrc with a thin loader that sources 12 modules under modules/ (env, plugins, core, ui, editing, navigation, lsp, lint, git, writing, languages, tools). Each module is independently readable and can be toggled by commenting one line. Add interactive tutorial (tutor/chopsticks.tutor) with 10 lessons covering all features. Users can run :ChopsticksLearn to start.
41 lines
1.8 KiB
VimL
41 lines
1.8 KiB
VimL
" editing.vim — EasyMotion, yank highlight, search auto-clear, undotree
|
|
|
|
" ── EasyMotion ──────────────────────────────────────────────────────────────
|
|
|
|
let g:EasyMotion_do_mapping = 0
|
|
let g:EasyMotion_smartcase = 1
|
|
|
|
if exists('g:plugs["vim-easymotion"]')
|
|
nmap s <Plug>(easymotion-overwin-f2)
|
|
nmap <Leader>j <Plug>(easymotion-j)
|
|
nmap <Leader>k <Plug>(easymotion-k)
|
|
endif
|
|
|
|
" ── UndoTree ────────────────────────────────────────────────────────────────
|
|
|
|
if exists('g:plugs["undotree"]')
|
|
nnoremap <F5> :UndotreeToggle<CR>
|
|
nnoremap <leader>u :UndotreeToggle<CR>
|
|
endif
|
|
|
|
" ── Yank Highlight ──────────────────────────────────────────────────────────
|
|
|
|
if exists('##TextYankPost') && has('timers')
|
|
function! s:YankHighlight() abort
|
|
if v:event.operator !=# 'y' | return | endif
|
|
let l:m = matchadd('IncSearch',
|
|
\ printf('\%%>%dl\%%<%dl', line("'[") - 1, line("']") + 1))
|
|
call timer_start(150, {-> matchdelete(l:m)})
|
|
endfunction
|
|
augroup ChopstickYankHL
|
|
autocmd!
|
|
autocmd TextYankPost * call s:YankHighlight()
|
|
augroup END
|
|
endif
|
|
|
|
" ── Auto-Clear Search Highlight ─────────────────────────────────────────────
|
|
|
|
augroup ChopstickSearchHL
|
|
autocmd!
|
|
autocmd CursorHold * if get(v:, 'hlsearch', 0) | let v:hlsearch = 0 | endif
|
|
augroup END
|