Some helper functions used in my .vimrc.
Install using your favorite package manager, or use Vim's built-in package support:
mkdir -p ~/.vim/bundle/vim-jaandrle_utils
cd ~/.vim/bundle/vim-jaandrle_utils
git clone -b main --single-branch https://github.com/jaandrle/vim-jaandrle_utils.git --depth 1
In .vimrc:
set runtimepath^=~/.vim/bundle/*
Now, you can use any function.
function! jaandrle_utils#trimEndLineSpaces(line_start, line_end)
The name doesn't lie
function! jaandrle_utils#fold_nextClosed(dir)
function! jaandrle_utils#fold_nextOpen(dir)
Use function! jaandrle_utils#fold_nextOpen(dir)
j/k as arguments, navigates to the next fold.
function! jaandrle_utils#grep(...)
`:grep` alternative which is asynchronous and also uses system grep tool (see `:help 'grepprg'`)
function! jaandrle_utils#redir(is_keep, command, range, line_start, line_end)
Redirecs any Vim `command` to ‘nofile’ buffer, `is_keep` modify deleting buffer when leaving and also (no)split.
```
command! -complete=command -bar -range -nargs=+ ALTredir call jaandrle_utils#redir(0, <q-args>, <range>, <line1>, <line2>)
" run curent line(s) in node
'<,'>ALTredir !node
" changes in buffer
ALTredir changes
```
function! jaandrle_utils#AppendModeline(additional)
Add current `modeline` (see `:help modeline`)
function! jaandrle_utils#MapSmartKey(key_name)
Argument `Home`/`End` → smart key behav. (first, first nonwhite, hadle wrap, …)
function! jaandrle_utils#copyRegister()
To copy content between registers
function! jaandrle_utils#gotoJumpChange(cmd)
Argument can be `"jump"`/`"changes"`, invokes combination of showing list and option to navigate
function! jaandrle_utils#gotoMarks()
Argument is `mark` name, invokes combination of showing list and option to navigate (via `g\`★`)
- better README
- tbd