Where are the key binding functions located? How can I create one? How to Install Pulgins Manually? #9826
-
There are functions like https://fishshell.com/docs/current/cmds/bind.html#special-input-functions Where are these functions located in my machine. I want to read them to make functions like that (I need some custom functionality with the key bindings). Please also let me know where to put the new functions when I write them. I want install the plugin https://github.com/daleeidd/natural-selection I know there are plugin managers but how to install it manually? The following is my zle widgets (this is the last piece of the puzzle). Most of them is for natural movement. Some is to copy and paste from clipboard. Some for ctrl+c to copy and ctrl+v to paste and others. For example, ctrl+a to select the whole buffer. How can I have these in fish and how can I make them. After this I am all done. There might be some minor issues but hopefully will not be any major one. Here is the code (There is no urgency. Please look at it at your convenience, I know 80% of this is already in fish):
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The "special input functions" aren't "functions" in the scripting sense. They're things the reader knows how to perform, in the C++ source. But you can call fishscript functions from a binding, simply create a function and call it. You would typically make it autoloaded, which just means it's a file called "name-of-function.fish" in a directory in $fish_function_path - mostly that's ~/.config/fish/functions.
"Plugins" are just scripts. They're either autoloaded functions (see above), or eagerly executed configuration snippets. Mostly this means you want to install anything in a plugin's "functions/" directory in ~/.config/fish/functions and anything in a "conf.d/" directory in ~/.config/fish/conf.d/. Or you can save the functions in their own directory and add it to $fish_function_path with something like set -p fish_function_path ~/.config/fish/plugins/natural-selection/functions |
Beta Was this translation helpful? Give feedback.
The "special input functions" aren't "functions" in the scripting sense. They're things the reader knows how to perform, in the C++ source.
But you can call fishscript functions from a binding, simply create a function and call it. You would typically make it autoloaded, which just means it's a file called "name-of-function.fish" in a directory in $fish_function_path - mostly that's ~/.config/fish/functions.
funced name-of-function
andfuncsave name-of-function
can help you here.