Skip to content

A ZSH plugin that allows you to move halfway to the left or right in your terminal using a simple keystroke

License

Notifications You must be signed in to change notification settings

Hoid/line-bisect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

line-bisect

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

Installation

Clone this repository into your $ZSH/custom/plugins directory. Then go into your ~/.zshrc file and add the following:

export ZSH=$HOME/
export ZSH_CUSTOM="$ZSH/custom
plugins=(
    line-bisect  <--- this line, or add the plugins array if you don't have it already
)

Also, you might need to add this line AFTER the loading of plugins in your .zshrc file, ideally at the very end, but for some reason my ZSH installation doesn't have this file so only put it if you do have it:

source $ZSH/oh-my-zsh.sh

You might also need to add this line to your ~/.zshrc file if the plugin isn't getting found:

source $ZSH_CUSTOM/plugins/line-bisect/line-bisect.plugin.zsh

Change the file location above to be where you installed the plugin.

Changing the keybinding

If you want to change that keybinding, you currently would have to change the plugin through the following process.

  1. 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.
  2. Open the line-bisect.plugin.zsh file and change the keycode that comes after the first bindkey inside of the quotation marks.
  3. Repeat step 1 for the right bisect keystroke.
  4. In line-bisect.plugin.zsh, change the keycode that comes after the second bindkey inside the quotation marks.
  5. 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!

About

A ZSH plugin that allows you to move halfway to the left or right in your terminal using a simple keystroke

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages