Dive into the system smoothly.
The sys-diver enables directory change and editor startup with only key operations using widgits without typing cd /to/dir/path/
or vim /to/file/path
on the command line. This plugin provides a smooth command line operation.
When using antigen, please add the following code to zshrc.
antigen bundle ToruIwashita/sys-diver-zsh
When installing manually, it is as follows
git clone [email protected]:ToruIwashita/sys-diver-zsh.git /path/to/sys-diver-zsh
echo 'source /path/to/sys-diver-zsh/sys-diver.plugin.zsh' >> ~/.zshrc
The simple way is to add the following code to zshrc.
WARNING: This setting overrides some default settings. See Cosutom Settings when you want to set it finely.
sd-default-setting
By default ^z
is prefix. If you want to change it, pass the prefix as argument to sd-default-setting
.
sd-default-setting '^q'
By adding this you can get a smooth command line operation.
1. Start completion by ^k
, expand next completion candidates under the directory selected by ^k
again and change the directory by ^o
2. If the selected path is a file, a file is inserted on the command line by ^z^o
when changing the directory
Adding the sd-set-splash-dive
setting.
sd-set-splash-dive on
Since sd-default-setting
makes the following settings, if you need to change, change the settings referring to the following.
setopt autocd
setopt menucomplete
setopt completeinword
bindkey -v '^k' menu-complete-files
bindkey -v '^l' edge-start-editor
bindkey -v '^o' cd-leaf-dir
bindkey -v '^^' cdup
bindkey -v '^zi' immediate-vls
bindkey -v '^z^i' immediate-ls
bindkey -v '^z^j' immediate-cat
bindkey -v '^z^k' menu-complete-recent-dirs
bindkey -v '^z^l' start-editor
bindkey -v '^z^o' cd-leaf-dir-and-insert-leaf-file-in-prompt
bindkey -M menuselect '^a' beginning-of-line
bindkey -M menuselect '^b' backward-char
bindkey -M menuselect '^e' end-of-line
bindkey -M menuselect '^f' forward-char
bindkey -M menuselect '^g' .send-break
bindkey -M menuselect '^i' forward-char
bindkey -M menuselect '^j' .accept-line
bindkey -M menuselect '^k' infer-next-history
bindkey -M menuselect '^m' accept-line
bindkey -M menuselect '^n' down-line-or-history
bindkey -M menuselect '^p' up-line-or-history
bindkey -M menuselect '^r' history-incremental-search-forward
bindkey -M menuselect '^u' send-break
bindkey -M menuselect '^]' accept-and-hold
bindkey -M menuselect '^z' vi-insert
Enable default settings.
Execute ls
command after directory change.
Change color of list in menuselect.
e.g.)
sd-set-menu-completion-ls-colors '0:di=01;34:ln=01;36:mh=00:pi=40;'
Change to the directory at the end of the path with the end of the command line as the path. If the target is a file path (e.g. works/tmp.txt
), change to the parent directory (e.g. works/
) of the file.
It behaves almost like cd-leaf-dir. However, if a path such as works/tmp.txt
is the target, change to works/
and insert tmp.txt
at the prompt.
Change parent directory.
Start the editor set in EDITOR
environment variable. If strings is inputted to the command line, start with the string at the end of the command line as an argument.
Start the editor set in EDITOR
environment variable. If strings is inputted to the command line, all strings are activated as arguments.
Execute cat
command with the sring at the end of the command line as an argument.
Execute ls
command with the sring at the end of the command line as an argument.
Execute ls -1
command with the sring at the end of the command line as an argument.
Completion with _files
as completer.
Completion of directory history saved by cdr
.