

GitHub - zdharma/zsh-tig-plugin: A Zsh Plugin that automatically extends `tig&am...
source link: https://github.com/zdharma/zsh-tig-plugin
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Table of Contents generated with DocToc
zsh-tig-plugin
A plugin for Zsh that automatically adds a few advanced bindings and also
provides a Zsh-rewritten function and/or script tig-pick
(i.e.: the code is
agnostic and can be run either as a script or as a function; it defaults to
function), originally shipped with tig as sh
-script in the contrib/
subdirectory.
The Added Bindings
—— Make Bindings ——
xmf – eXecute MakeFile
Retrieves the list of targets for Makefile
in the current directory and runs
fzf
or fzy
on the list and then, when a target gets selected, executes
make
on that target.
xamf – eXecute all
MakeFile
Runs make all
xcmf – eXecute clean
MakeFile
Runs make clean
—— Copy Bindings ——
xcp - eXecute CoPy
Copies the SHA of currently active (highlighted) commit into the clipboard.
Supports OS X's pbcopy
and Linux/other's xsel
and xclip
.
xfcp - eXecute File CoPy
Copies the contents of currently active (highlighted) file into the clipboard.
Supports OS X's pbcopy
and Linux/other's xsel
and xclip
.
—— Editor Bindings ——
xed - eXecute EDitor
Executes an editor on selected file. It's either $VISUAL
, then $EDITOR
and
then vim
.
xled - eXecute List EDitor
Runs fuzzy-finder (either fzf
or fzy
) on the list of the files in the
repository and after selecting one it then executes an editor like in xed
.
—— Midnight Commander Bindings ——
xmc – eXecute Midnight Commander
Executes mc
with the left pane set to the repository and the right pane to
$ZSH_TIG_MC_DIR
. If the variable isn't set it uses $HOME
instead.
xhmc – eXecute Home Midnight Commander
Executes mc
with the left pane set to the repository and the right pane to the
home directory.
Installation
Zplugin
Add zplugin load zdharma/zsh-tig-plugin
to your .zshrc
file. Zplugin will
clone the plugin the next time you start zsh. To update issue zplugin update zdharma/zsh-tig-plugin
.
zplugin load zdharma/zsh-tig-plugin
Or with use of the Turbo mode:
zplugin wait lucid for zdharma/zsh-tig-plugin
Antigen
Add antigen bundle zdharma/zsh-tig-plugin
to your .zshrc
file. Antigen will
handle cloning the plugin for you automatically the next time you start zsh.
antigen bundle zdharma/zsh-tig-plugin
Oh-My-Zsh
cd ~/.oh-my-zsh/custom/plugins
git clone [email protected]:zdharma/zsh-tig-plugin.git
- Add
zsh-tig-plugin
to your plugin list
Add zgen load zdharma/zsh-tig-plugin
to your .zshrc file in the same place
you're doing your other zgen load
calls in.
</article
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK