Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Bash added to the Vi mode indicator     - Why not use the ifconfig command under RedHat Linux 5 (Linux)

- Install Linux Mint 17: 20 things to do (Linux)

- Linux atomic operations and synchronization mechanisms (Programming)

- Docker use Dockerfile created since the launch of the service support SSH container mirror (Server)

- Android judgment toward camera pictures (Programming)

- 3 ways to create a lightweight, durable system of Ubuntu Linux USB disk (Linux)

- SSH does not require a password to log on to a Linux server (Server)

- SQL Beginner Guide (Database)

- Oracle 11G R2 DataGuard structures (Database)

- Oracle utilized undo data recovery operations (Database)

- installation and configuration of the PHP environment (Apache2) under Linux (Server)

- Linux platform host to prevent hacking skills (Linux)

- Fatal: unable to connect to github.com problem solving (Linux)

- Zabbix monitors the status of TCP connections (Server)

- Using nmcli commands to manage network in RedHat / CentOS 7.x (Linux)

- Learning the Linux powerful network management capabilities (Linux)

- Using DOS command to change UNIX administrator password (Linux)

- How to modify the Emacs Major Mode Shortcuts (Linux)

- Android float ball and boot from the start (Programming)

- Vim plugin installation YouCompleteMe (Linux)

  Bash added to the Vi mode indicator
  Add Date : 2018-11-21      
  With a long zsh the Vi command line editing mode, sometimes trance Where own patterns. As we all know, Vim status line can be displayed indicating mode, in order to illustrate the normal mode or insert mode. If this feature we can Vim zsh transplanted into the body, it would be perfect.

With a man zshzle looked at the documents, I found not difficult to implement, simply add the following to the .zshrc in:

function zle-line-init zle-keymap-select {
     VIMODE = "$ {$ {KEYMAP / vicmd / - NORMAL -} / (main | viins) / - INSERT -}"
     zle reset-prompt
zle -N zle-line-init
zle -N zle-keymap-select

RPROMPT = '% {$ fg [green]%} $ {VIMODE}% {$ reset_color%}'

Explain a little, we set the first variable VIMODE save the default state (insert), then use two widgets zle provided to replace the variable content and redraws the prompt. Then perform zle widgets, and set RPROMPT enable indicator appears on the right.
- Android Studio and Git Git configuration file status (Linux)
- MySQL to manage multiple instances of method (Database)
- Linux system server network security management tips (Linux)
- apt-get and apt-cache show command examples (Linux)
- User rights management system under Linux (Linux)
- Heartbeat cluster components Overview (Server)
- Unix average load average load calculation method (Server)
- CentOS network configuration 7, and set the host name and IP-bound problems (Linux)
- Open Ubuntu system updates (Linux)
- How to query the role of Linux services (Linux)
- Seven Steps to Help Google Chrome Speed - (Linux)
- 10 important Linux ps command combat (Linux)
- Linux server Php injection prevention (Linux)
- Using Oracle for Oracle GoldenGate to achieve a one-way data synchronization (Database)
- How to extend / remove swap partitions (Linux)
- 14 useful example Linux Sort command (Linux)
- MongoDB query timeout exception SocketTimeoutException (Database)
- HTTP and HTTPS request response process difference (Linux)
- xCAT Installation Kit (Linux)
- Oracle to create an external table (Database)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.