chore: updated keybinds and options
993f6854
2 file(s) · +26 −0
| 7 | 7 | noremap <leader>c :bd<CR> |
|
| 8 | 8 | noremap <C-d> <C-d>zz |
|
| 9 | 9 | noremap <C-u> <C-u>zz |
|
| 10 | + | ||
| 11 | + | " Spelling suggestions (requires fzf) |
|
| 12 | + | function! s:SpellReplace(word, choice) abort |
|
| 13 | + | execute 'normal! ciw' . a:choice |
|
| 14 | + | stopinsert |
|
| 15 | + | endfunction |
|
| 16 | + | ||
| 17 | + | function! s:SpellSuggest() abort |
|
| 18 | + | let l:word = expand('<cword>') |
|
| 19 | + | if empty(l:word) |
|
| 20 | + | return |
|
| 21 | + | endif |
|
| 22 | + | call fzf#run(fzf#wrap({ |
|
| 23 | + | \ 'source': spellsuggest(l:word, 25), |
|
| 24 | + | \ 'sink': function('s:SpellReplace', [l:word]), |
|
| 25 | + | \ 'options': ['--prompt', 'Spelling: ' . l:word . '> '] |
|
| 26 | + | \ })) |
|
| 27 | + | endfunction |
|
| 28 | + | ||
| 29 | + | nnoremap <silent> <leader>s :call <SID>SpellSuggest()<CR> |
| 22 | 22 | ||
| 23 | 23 | set mouse=a "Enabled mouse for scrolling |
|
| 24 | 24 | set spell |
|
| 25 | + | " System clipboard: * register on macOS, + when xterm_clipboard is built in |
|
| 26 | + | if has('unnamedplus') |
|
| 27 | + | set clipboard=unnamedplus |
|
| 28 | + | else |
|
| 29 | + | set clipboard=unnamed |
|
| 30 | + | endif |