This project allows you to move your cursor in your terminal by bisecting the current command left or right with a single keystroke. Currently the keybinding is set to alt+left arrow and alt+right arrow, which are the ^[[1;3D and ^[[1;3C keycodes, respectively.
bisect.mp4
Clone this repository into your $ZSH/custom/plugins directory. Then go into your ~/.zshrc file and add the following:
plugins=(
line-bisect <--- this line, or add the plugins array if you don't have it already
)
Also, make sure this line comes AFTER the loading of plugins in your .zshrc file, ideally at the very end:
source $ZSH/oh-my-zsh.sh
If you want to change that keybinding, you currently would have to change the plugin through the following process.
- In your terminal, enter the
cat
command, then press the single keystroke you wish to use with the left bisect, such as CMD+[, or something similar. This will print out the keycode that gets sent when you press that keystroke. Copy that keycode. - Open the line-bisect.plugin.zsh file and change the keycode that comes after the first
bindkey
inside of the quotation marks. - Repeat step 1 for the right bisect keystroke.
- In line-bisect.plugin.zsh, change the keycode that comes after the second
bindkey
inside the quotation marks. - Save line-bisect.plugin.zsh and restart ZSH. Make sure you have the line-bisect plugin included in your plugin array in the
.zshrc
file!