Say that we have a function:
function StripTrailingWhitespace()
if !&binary && &filetype != 'diff'
normal mz
normal Hmy
%s/\s\+$//e
normal 'yz<CR>
normal `z
endif
endfunction
How to map this function to StripTrailingWhiteSpace command so that we can run :StripTrailingWhiteSpace instead of :call StripTrailingWhiteSpace() ?
How to do the same for functions with arguments ?
The reason for doing that is: we get commands as completion window of fzf/vim-clap/coc plugins. And it's more align with vscode's cmd+shift+p functionality.