Mercurial > dotfiles
comparison .chezmoitemplates/config.vim @ 627:a2a5862a3bd3
convert more vimscript to lua
author | zegervdv <zegervdv@me.com> |
---|---|
date | Thu, 28 Jul 2022 22:25:29 +0200 |
parents | f795168ece65 |
children | c5ed13440614 |
comparison
equal
deleted
inserted
replaced
626:f795168ece65 | 627:a2a5862a3bd3 |
---|---|
23 | 23 |
24 " | 24 " |
25 | 25 |
26 " Mappings | 26 " Mappings |
27 | 27 |
28 " Highlight VCS conflict markers | |
29 match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' | |
30 | 28 |
31 | 29 |
32 " Search for selected text, forwards or backwards. | 30 " if has('nvim') |
33 vnoremap <silent> * :<C-U> | 31 " tnoremap <C-h> <C-\><C-n><C-w>h |
34 \let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR> | 32 " tnoremap <C-j> <C-\><C-n><C-w>j |
35 \gvy/<C-R><C-R>=substitute( | 33 " tnoremap <C-k> <C-\><C-n><C-w>k |
36 \escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR> | 34 " tnoremap <C-l> <C-\><C-n><C-w>l |
37 \gV:call setreg('"', old_reg, old_regtype)<CR> | 35 " augroup enter_term |
38 vnoremap <silent> # :<C-U> | 36 " au! |
39 \let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR> | 37 " autocmd TermOpen * startinsert! |
40 \gvy?<C-R><C-R>=substitute( | 38 " autocmd BufEnter * if &buftype ==# 'terminal' | :startinsert! | endif |
41 \escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR> | 39 " autocmd BufLeave * if &buftype ==# 'terminal' | :stopinsert! | endif |
42 \gV:call setreg('"', old_reg, old_regtype)<CR> | 40 " augroup END |
43 | 41 " let $GIT_EDITOR = 'nvr -cc split --remote-wait' |
44 xnoremap <silent> p p:if v:register == '"'<Bar>let @@=@0<Bar>endif<CR> | 42 " endif |
45 | |
46 | |
47 if has('nvim') | |
48 tnoremap <C-h> <C-\><C-n><C-w>h | |
49 tnoremap <C-j> <C-\><C-n><C-w>j | |
50 tnoremap <C-k> <C-\><C-n><C-w>k | |
51 tnoremap <C-l> <C-\><C-n><C-w>l | |
52 augroup enter_term | |
53 au! | |
54 autocmd TermOpen * startinsert! | |
55 autocmd BufEnter * if &buftype ==# 'terminal' | :startinsert! | endif | |
56 autocmd BufLeave * if &buftype ==# 'terminal' | :stopinsert! | endif | |
57 augroup END | |
58 let $GIT_EDITOR = 'nvr -cc split --remote-wait' | |
59 endif | |
60 | 43 |
61 " | 44 " |
62 | 45 |
63 " Functions | 46 " Functions |
64 " When editing a file, always jump to the last known cursor position. | 47 " When editing a file, always jump to the last known cursor position. |
127 return "\<CR>:u " | 110 return "\<CR>:u " |
128 else | 111 else |
129 return "\<CR>" | 112 return "\<CR>" |
130 endif | 113 endif |
131 endfunction | 114 endfunction |
132 cnoremap <expr> <CR> CCR() | 115 " cnoremap <expr> <CR> CCR() |
133 " | 116 " |
134 | 117 |
135 " Filetype specific settings | 118 " Filetype specific settings |
136 " Text | 119 " Text |
137 augroup ft_text | 120 augroup ft_text |