User Tools

Site Tools


obarun-zsh

The default shell for Obarun is zsh, unlike most other distros that use bash. Obarun through this package obarun-zsh provides a modified .zshrc that should be found on your home directories ( /root/.zshrc and ~/.zshrc ) and a zsh environment file accordingly that sets the default directories that the shell will look for executable files and shared resources.

If during a custom installation you ended up without them and run zsh you will be prompted to set a .zshrc manually through a questionnaire as it is set up by arch the first time you start zsh. Instead you can copy .zshenv and .zshrc from /etc/skel/ where the obarun-zsh stores its “templates”.

What does Obarun's .zshrc provide:

The .zshrc

  • It can set a home directory other than the default /home/$username
  • It defines a special directory where zsh modification files can be stored
  • It defines the history file and its location where commands are stored and can be used by the autocompletion utility.
  • It defines the number of commands to store in the history file (default: ~/.zsh_history)
  • It defines the default text (console/terminal) editor to use for other scripts that call an EDITOR to be used.
  • It sets a color template to be used to colorize output of various commands. (example: if you run ls -al /etc the different types of files and directories will have different colors so it would be easier to locate what you are looking for)
  • If a mispelled command is issued it asks you whether you really wanted to run this and guessed a similar spelling of a proper command. If you run a command requiring root privileges it offers to run the same with sudo in front. etc.
  • It provides the zmv utility for renaming files by specific patterns
  • It can guess the remaining of a long command that has been issued before after the first few characters have been entered by using arrows (up/down).
  • Control-x-e to open current line in $EDITOR, awesome when writting functions or editing multi-line commands.
  • It provides a colorful default prompt with user@hostname $ but it can be edited to look otherwise and provide alternative information.
  • When duplicate commands appear in history they are ignored as being one but most frequent ones appear first during autocompletion. For example if you use $ sudo pacman -Syu everyday but just this once you just used $ sudo pacman -U /var/cache/pacman/pkg/obarun-install…..xz then when you enter $ sudo pac and up arrow the most frequent one will come up first.
  • It provides you with a list of Aliases for more complex commands to simpler ones if you use them often. This and all other settings in .zshrc can be set to suit your needs and habits. For example if you frequently use $ ls -altr to see files ordered by date in reverse, you can call this $ lsd and make it have the same function as the longer command. $ lsd /etc/*.pacnew will have the output $ ls -altr /etc/*.pacnew
  • You can colorize grep/egrep output and adjust its functions.
  • You can search command history easier for a command you can not remember
  • …and more …
obarun-zsh.txt · Last modified: 2019/05/23 13:05 by fungalnet