Updated vim macros
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 22s

This commit is contained in:
2024-06-21 08:06:01 +02:00
parent f33b495d12
commit 39b9d351c0
7 changed files with 57 additions and 10 deletions

View File

@@ -1,3 +1,10 @@
" various tools inside vim
function! GetCharUnderCursor()
let line = getline('.')
let col = col('.')
return line[col - 1]
endfunction
" predefined macros in functions
function SpacedLine()
normal o
@@ -11,7 +18,15 @@ function SwapWords()
normal e
exec 'normal! a '
normal p
normal l
let char = GetCharUnderCursor()
if char == ' '
normal x
endif
normal h
normal b
normal b
endfunction
nnoremap <leader>o :call SpacedLine()<CR>
nnoremap <leader>ls :call SwapWords()<CR>
let @o = ':call SpacedLine()
'