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
" 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
|
|
|
|
" ── Blank Line Insertion (replaces vim-unimpaired) ──────────────────────────
|
|
|
|
nnoremap <silent> [<Space> :<C-u>put! =repeat(nr2char(10), v:count1)<CR>'[
|
|
nnoremap <silent> ]<Space> :<C-u>put =repeat(nr2char(10), v:count1)<CR>
|
|
|
|
" ── Auto-Clear Search Highlight ─────────────────────────────────────────────
|
|
|
|
augroup ChopstickSearchHL
|
|
autocmd!
|
|
autocmd CursorHold * if get(v:, 'hlsearch', 0) | let v:hlsearch = 0 | endif
|
|
augroup END
|