Erwin Müller Blog

Setup and Configure Zsh, Bash-Completion, Autojump


Setup and Configure Zsh, Bash-Completion, Autojump

  • Zsh is an interactive shell that is mostly compatible with Bash,
  • Bash-Completion enhances the shell with automatic and programmable commands and arguments completions. It works also on Windows and Mac OS X systems because it depends only on the Bash shell;
  • Autojump stores the last visited directories and allows for fast navigation in the file system. It works also on Windows and Mac OS X systems because it uses Python.

All three together are really useful tools that are going to increase the productivity of any console-user immensely, although the Zsh shell should only by used for the console and not for scripts, because of portability and interoperability issues. This article will describe how install and configure those tools on a Debian Jessie system (but it should be the same on any other GNU/Linux system). Basically, everything is contained in the Makefile and the simple command make will install and configure those tools. The make targets will use optional environment variables and arguments to customize the tools.

Usage

Download the archive from Github devent/zsh-setup, unpack the archive somewhere, open a console inside the directory where the archive was unpacked and run make.

The following files and directories are created by the default make target.

  • /etc/sudoers.d/08proxy
  • /etc/apt/apt.conf.d/08proxy
  • /etc/profile.d/proxy.sh only if any proxy environment variables were set;
  • .user_rc the file is not removed or changed and is suppose to have user specific aliases and functions;
  • .user_zshrc the file is not removed or changed and is suppose to have user specific Zsh settings;
  • .zshrc
  • /opt/oh-my-zsh

Environment Variables

  • http_proxy
  • https_proxy
  • ftp_proxy
  • no_proxy, if those environment variables are present, the make targets will configure sudoers, apt and Zsh to use the environment variables.

Arguments

  • WORK sets the work directory, defaults to the user home directory;
  • THEME sets the oh-my-zsh theme, defaults to “gentoo”;
  • PLUGINS sets the plugins to load, defaults to “”;
  • REMOTE_EDITOR sets the remote editor to use, defaults to “emacs”;
  • LOCAL_EDITOR sets the local editor to use, defaults to “emacs”;

Additional Targets

  • clean removes the generated files:
    • /etc/sudoers.d/08proxy
    • /etc/apt/apt.conf.d/08proxy
    • /etc/profile.d/proxy.sh
    • .zshrc

Test

Using Vagrant a test system can be installed in VirtualBox to test and preview the tools. The target will install Debian Jessie image in VirtualBox, run make and enter the system via ssh. The proxy environment variables mentioned above are passed to the system. After the user reviewed and exit the system, the system is removed.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Leave a Reply