Make shortcut toolbar for F1-F12 keys.
- zsh
- ruby 2.3.4 or later (only if for automatic generation of config)
If you use oh-my-zsh
- Clone this repository into
~/.oh-my-zsh/custom/plugins
cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/zpm-zsh/f-shortcuts
- After that, add
f-shortcuts
to your oh-my-zsh plugins array.
If you use Zgen
- Add
zgen load zpm-zsh/f-shortcuts
to your.zshrc
with your other plugin - run
zgen save
If you use my ZPM
- Add
zpm load zpm-zsh/f-shortcuts
into your.zshrc
Add $pr_shortkeys
somethere in your PROMPT
or RPROMPT
Start a new terminal session.
You can define simple commands for FN keys in ~/.zsh-f-shortcuts.yaml
file.
File should have two base keys:
default_view
- default view to show.views
- list of defined views.
views
section contains views you want to show. Key is a view name.
Under view name key you should define next keys:
text
- text that will show on touchbar key.command
orview
-command
means executing some command that under is this key andview
means show view that is under this key
default_view: "List functions"
views:
"List functions":
1:
text: Next 👉
view: "NPM functions"
2:
text: List
command: ls
3:
text: One per line
command: ll
4:
text: All files
command: la
"NPM functions":
1:
text: Next 👉
view: "Git functions"
2:
text: NPM modules
command: npm ls
"Git functions":
1:
text: Next 👉
view: "List functions"
2:
text: Git status
command: git status
- Change plugin name
If you have some proposals how to improve this boilerplate feel free to open issues and send pull requests!
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Available as open source under the terms of the MIT License.