iago-lito
iago-lito

Reputation: 3218

Are there Vim's explicit "native functions"?

I'm trying not to get messed up in remapping keys with Vim, and it's getting better now I've been reading documentation for half a day. @_@

Still, I am very happy when I can type something pretty straightforward like this in my .vimrc :

map <onekey> <plug>OneExplicitFunctionalityName

or :

noremap <onekey> :call OneExplicitFunctionalityName()<CR>

And I then wonder: do the basic Vim's actions have explicit names we could call like these above? Is there a way to replace something like

nnoremap > ;

by something like

nnoremap > :call MoveToTheNextFSearchResult()<CR>

?

Are there such things like MoveCursorLeft(), DeleteLine(), GetWordLimits() etc?

The idea, of course, is to play around then with these "native motions"..

Upvotes: 0

Views: 83

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172520

There are no Vimscript functions for built-in commands; you can include them in a (:noremap) mapping, or explicitly invoke them via :normal!.

nmap > ;

When you remap built-in commands, you should use :noremap; it makes the mapping immune to remapping and recursion. Your above mapping would do strange things should you remap ; as well.

Upvotes: 3

Related Questions