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@example.com: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.
^z is prefix. If you want to change it, pass the prefix as argument to
By adding this you can get a smooth command line operation.
Example of use
1. Start completion by
^k, expand next completion candidates under the directory selected by
^k again and change the directory by
2. If the selected path is a file, a file is inserted on the command line by
^z^o when changing the directory
3. If you press
^l while inputting multiple paths, the editor is started for the last path
^z^l is used, the editor is started for all paths
^z^k start the recent directory completion
6. Show a list of directories after directory change
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
Functions and widgets
Enable default settings.
ls command after directory change.
Change color of list in menuselect.
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.
catcommand with the sring at the end of the command line as an argument.
lscommand with the sring at the end of the command line as an argument.
ls -1command with the sring at the end of the command line as an argument.
_files as completer.
Completion of directory history saved by