Home

Awesome

zsh-smartinput

This is a zsh plugin to provided smart input. When brackets/quotes are inputted, the corresponding brackets/quotes are automatically inputted. Support character is (), [], {}, ", ' and `.

This plugin consulted vim-smartinput.

Installation

Using zplug

zplug "momo-lab/zsh-smartinput"

Manually

Clone this repository somewhere (~/.zsh-smartinput for example) and source it in your .zshrc

git clone https://github.com/momo-lab/zsh-smartinput.git
source ~/.zsh-smartinput/smartinput.plugin.zsh

For Example

This plugin provides the following rules (note that "#" indicates the cursor position in the following examples):

Automatically complements the corresponding brackets/quotes:

BeforeInputAfter
#((#)
#[[#]
#{{#}
#""#"
#''#'
#``#`

Input right brackets/quotes to leave the block:

BeforeInputAfter
(#))()#
(foo#))(foo)#

Input the backspace key to remove the corresponding brackets/quotes:

BeforeInputAfter
(#)<BS>#
()#<BS>#

Care to escaping characters:

BeforeInputAfter
\#(\(#

Care to English words:

BeforeInputAfter
foo#'sfoo's#