mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-07 16:00:41 +01:00
Initial commit of Zsh Navigation Tools
This commit is contained in:
38
plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
Executable file
38
plugins/zsh-navigation-tools/zsh-navigation-tools.plugin.zsh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
REPO_DIR="${0%/*}"
|
||||
CONFIG_DIR="$HOME/.config/znt"
|
||||
|
||||
#
|
||||
# Copy configs
|
||||
#
|
||||
|
||||
if ! test -d "$HOME/.config"; then
|
||||
mkdir "$HOME/.config"
|
||||
fi
|
||||
|
||||
if ! test -d "$CONFIG_DIR"; then
|
||||
mkdir "$CONFIG_DIR"
|
||||
fi
|
||||
|
||||
set n-aliases.conf n-env.conf n-history.conf n-list.conf n-panelize.conf n-cd.conf n-functions.conf n-kill.conf n-options.conf
|
||||
|
||||
for i; do
|
||||
if ! test -f "$CONFIG_DIR/$i"; then
|
||||
cp "$REPO_DIR/.config/znt/$i" "$CONFIG_DIR"
|
||||
fi
|
||||
done
|
||||
|
||||
#
|
||||
# Load functions
|
||||
#
|
||||
|
||||
autoload n-aliases n-cd n-env n-functions n-history n-kill n-list n-list-draw n-list-input n-options n-panelize
|
||||
autoload znt-usetty-wrapper znt-history-widget znt-cd-widget znt-kill-widget
|
||||
alias naliases=n-aliases ncd=n-cd nenv=n-env nfunctions=n-functions nhistory=n-history
|
||||
alias nkill=n-kill noptions=n-options npanelize=n-panelize
|
||||
|
||||
zle -N znt-history-widget
|
||||
bindkey '^R' znt-history-widget
|
||||
setopt AUTO_PUSHD HIST_IGNORE_DUPS PUSHD_IGNORE_DUPS
|
||||
|
||||
Reference in New Issue
Block a user