Git Product home page Git Product logo

ztanesh's Introduction

Improve your UNIX command line experience and productivity with the the configuration provided by ztanesh project: the tools will make your shell more powerful and easier to use.

https://cloud.github.com/downloads/miohtama/ztanesh/Screen%20shot%202012-05-07%20at%207.52.12%20PM.png

The screenshot above shows additional ls coloring. Prompt: top left is active virtualenv etc. development environment, top right is server, time, bottom right is path.

https://cloud.github.com/downloads/miohtama/ztanesh/Screen%20Shot%202012-05-22%20at%2011.01.46%20PM.png

Colorize terminal tabs automatically based on which server you are logged in. No need to preconfigure servers - the color is calculated from the hostname

As of December 14, 2012, an attempt to merge the code with the Oh my zsh code started, due to the enormous amount of plugins readily available for the latter project. The goal is to merge the both projects into something where the startup files could be automatically compiled and catenated for superfast startup as is done for the ztanesh currently, while enabling the drop-in use of Oh my zsh plugins and themes.

Out of the box you will be able to

  • Colorize terminal tabs based on SSH connection. Each server automatically gets its own color. (iTerm2)
  • Automatically update the window title on your terminal based on the currently running command etc.
  • Just type in the directory name on the command prompt to enter into it. Cdable environment variables for fast navigation - instead of cd $MYDIR/project you can now hit in shell prompt MY<TAB>p<TAB>.
  • In-word completions - to cd into that linux-2.6.28 folder, just type 28<TAB> - the only matching word is automatically completed. To go to /usr/bin type in shell prompt /u/b<TAB> (no cd needed).
  • Double-tap TAB for autocompletion menu with arrow navigation. Type ./<TAB> to start file explorer in the current folder. Press space to advance the next folder. Press backspace to undo the selection.
  • Autocompletion for remote server commands like svn, scp
  • Typo correction when autocompleting: wrong case, mispelt character, etc.
  • Improved prompt readability: bold text by default, timestamps, user, server name and smart current working directory indicator
  • Turn on colored output for tools like less and grep automatically
  • Improved ls output colors - including grouping filesizes in groups of 3.
  • Settings files are preprocessed for fast shell start-up
  • Mouse support on command line; press alt-m (meta-m) to toggle mouse mode and enable position text edit cursor with the mouse
  • Forward- and backward moving in directories stack using alt+left/right arrows (Linux only)
  • Support for Mac standard edit keys: alt+arrow to move between words. fn+arrow (home, end) to go to the beginning and end of the line
  • Automatic update via Github. Global (across machines, autoupdated) and local (macine specific) .rc settings files
  • Over ten years of running in production experience
  • Upcoming: intershell clipboard using a pure python X client (you need X forwarding and X11 daemon on an originating computer. Launching local commands from remote commandline over ssh X11 forwarding.

The installation instructions are based on the assumption you checkout Git repository under ~/tools folder in your home directory.

We recommend using ZSH 5.0 which is the latest stable version. As the writing of this most operating systems ship with older versions, however, Ubuntu 12.10 defaults to ZSH 5.0.

Ubuntu install commands:

cd ~
sudo apt-get install git-core highlight zsh perl
git clone git://github.com/miohtama/ztanesh.git ~/tools
~/tools/zsh-scripts/setup.zsh

Test that ZSH starts properly:

zsh

Then activate zsh for your user by default:

chsh -s /bin/zsh $USER

... or for the other users:

sudo usermod -s /bin/zsh TARGETUSERNAME

Gentoo Linux install commands:

sudo emerge -av git highlight zsh
git clone https://github.com/miohtama/ztanesh.git ~/tools
~/tools/zsh-scripts/setup.zsh

Test that ZSH starts properly:

zsh

Then activate zsh for your user by default:

chsh -s /bin/zsh $USER

... or for the other users:

sudo usermod -s /bin/zsh TARGETUSERNAME

With Homebrew:

brew install zsh coreutils lesspipe findutils highlight
# Note: you might have to edit the zsh brew formula if it shows "Error: Download failed: http://www.zsh.org/pub/zsh-5.0.0.tar.bz2"
# brew edit zsh
# then change: url 'http://www.zsh.org/pub/zsh-5.0.2.tar.bz2' => url 'http://sourceforge.net/projects/zsh/files/zsh/5.0.0/zsh-5.0.0.tar.bz2'

Clone ztanesh:

git clone https://github.com/miohtama/ztanesh.git ~/tools
~/tools/zsh-scripts/setup.zsh

GNU coreutils are not enabled by default by Homebrew. Edit ~/.zshrc and add at the beginning of the file:

PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"

Test that ZSH starts properly:

zsh

Activate zsh for your user account as the default shell:

sudo dscl . -create /Users/$USER UserShell /opt/homebrew/bin/zsh
# or if you use Homebrew before: sudo dscl . -create /Users/#$USER UserShell /usr/local/bin/zsh

Other UNIX flavour operating systems should work just fine. Please adjust the installation commands according to your distribution and report back to us how you did it.

If you want to autoupdate deploy your own global ZSH rc changes fork this repository on Github under your own user account, or set up your own private fork on anywhere you want. The authors are less benevolent dictators (read: BOFHs) of this project and may feel to change the scripts breaking everything for you any day.

But you can also feel free to hack this project into pieces. If you find good patches just make Pull request on Github.

  • See various aliases
  • Use CTRL+R to search shared ZSH history

ZtaneSH scripts are located in ~/tools/zsh-scripts/rc folder. They are processed pretty much like init.d scripts (loaded in number prefix order).

Edit these source scripts. Then run comprc. This will update ~/tools/zsh-scripts/var/compiled/allrcs file. This file is optimized ZSH script output and loaded on every start up.

Push your changes to Github.

Put your local settings to ~/.zsh-local/rc and run comprc alias to make them effective for the next zsh startup.

If ZSH does not start up properly (CTRL+C interruption, Git update failure, etc.) you may see the error:

/Users/mikko/.zsh//lib/ztanesh-rcs.zsh:103: command not found: rainbow-parade.py

You can fix this issue by enabling comprc function by hand and run it to rebuild startup files:

source ~/tools/zsh-scripts/rc/65-functions
comprc

GPL3+.

  • Antti "ztane" Haapala
  • Cleaned up for public release by Mikko Ohtamaa
  • mouse.zsh: Stephane Chazelas
  • Gentoo: Alberto Zuin

ztanesh's People

Contributors

miohtama avatar sevanteri avatar snwfog avatar ztane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ztanesh's Issues

Make ztanesh run on BSD userland

Almost similar to OS X (see #3), it doesn't quite run out-of-the-box on FreeBSD 9.1. The fix is pretty easy, though.

1. Install shells/zsh, devel/git and misc/gnuls.

2. Install ztanesh.

3. In the beginning of lsx, change:
my $ls_command = '/usr/local/bin/gls';
to
my $ls_command = '/usr/local/bin/gnuls';

(or create a symlink /usr/local/bin/gls -> /usr/local/bin/gnuls)

4. Fix 'touch' commands in ~/tools/zsh-scripts/rc/65-functions as in #3:

Change:
touch -d "today 00:00" $TEMPFILE
to:
touch -t date +%m%d0000 $TEMPFILE

...and:
touch -d yesterday ~/.zsh/var/run/last_updated
to:
touch -t printf "%s%02d0000" `date +%m` $((`date +%d`-1)) ~/.zsh/var/run/last_updated

5. Run comprc

Colored SVN and interactive input / perl stdout buffering

Currently colored svn wrapperscript is included in ztanesh. However, it is disabled due to lack of support for interactive sessions. For example if svn command asks for the server certificate, the readline prompt asking options (below) is never displayed:

   (R)eject, accept (t)emporarily or accept (p)ermanently? 

To fix this, I assume one should fiddle settings how colorsvn buffers the svn application output.

My Perl-fu is not strong enough. Delegating this task to the higher on Olympos mountain.

Currently command colorsvn is included, but not aliased to svn.

lsx dies with an exception

Here:

[~]% ls -lh Desktop 
total 131M
Traceback (most recent call last):
  File "/Users/mikko/.zsh/bin/lsx", line 148, in <module>
    Runner().main()
  File "/Users/mikko/.zsh/bin/lsx", line 142, in main
    i = LINE_REGEX.sub(self.do_line_subst, i)
  File "/Users/mikko/.zsh/bin/lsx", line 95, in do_line_subst
    return ''.join(m)
TypeError: sequence item 4: expected string, NoneType found

No idea what's causes it.

setup-nullmailer.sh Error with nullmailer-queue: Envelope sender address is invalid.

I found with your setup-nullmailer.sh on Ubuntu Server 10.04 that I was getting an error "Envelope sender address is invalid."

I fixed it by editing /etc/mailname and switching it from localhost to the short name of the server. So, in my case I had a cloud node named lander1, so I switched it from localhost to lander1. I didn't have to rerun your script after that -- I just sent mail using the mail command (apt-get install mailutils to get that command).

Moving cursor on highlighted command row hides cursor

After pulling highlighted commands:
Moving cursor with for example arrow keys on long rows of text renders cursor invisible until moving is stopped. This makes landing on exact points in text a tad bit difficult.

SSH server-name autocompletion should prefer .ssh/config

When you now autocomplete server names like:

 ssh yourserv[tab]

It autocompletes to:

ssh yourserver.company.com 

However if you have the matching key in .ssh/config yourserver you want to hit it first. This is because SSH config entry have username, agent forward, etc. related configured.

Timeout git up

If you have very slow network the auto-update feature doesn't timeout in timely manner. The shell doesn't start.

GREP_OPTIONS is deprecated

Gets grep: warning: GREP_OPTIONS is deprecated
when using grep
...Issue since grep 2.20 (at least on Ubuntu 15.11 and 16.04)

lsx broken on old systems

Some systems still ship with pre-2.6 Python

/root/.zsh/bin/lsx:37: Warning: 'with' will become a reserved keyword in Python 2.6
  File "/root/.zsh/bin/lsx", line 37
    with open(filename) as config:
            ^
SyntaxError: invalid syntax

Detect /usr/bin/python version no lsx if it looks bad (py2.5, py3)?

ls raises a TypeError: can't use a string pattern on a bytes-like object

I came across a possible bug.

[~/test]% /usr/bin/ls -lh
total 0

[~/test]% ls             
Traceback (most recent call last):
  File "/home/olkkoo/.zsh/bin/lsx", line 148, in <module>
    Runner().main()
  File "/home/olkkoo/.zsh/bin/lsx", line 142, in main
    i = LINE_REGEX.sub(self.do_line_subst, i)
TypeError: can't use a string pattern on a bytes-like object

[~]% which ls
ls: aliased to lsx

[~]% zsh --version
zsh 5.0.2 (x86_64-unknown-linux-gnu)

I am running the commit 61954f4 of ztanesh.

Moving git indicator

Currently the git indivcator is next to folder prompt

http://imgur.com/My2Bl

What would be needed to move this indiciator to next to venv indicator?

Pros

  • More space there, as the upper line is now mostly unused
  • More natural place tell (here go all development related...)

Problem with ztanesh on OSX Mountain Lion (touch -d options don't exist on OSX)

Hi, I'm getting the following on every session start:

Last login: Mon Oct 8 07:47:04 on ttys003
/Users/yg/.zsh/var/compiled/allrcs:122: command not found: dircolors
touch: illegal option -- d
usage:
touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...
Checking updates for RC files
Updating ~/tools
Already up-to-date.
/Users/yg/.zsh/var/compiled/allrcs:122: command not found: dircolors
touch: illegal option -- d
usage:
touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...
Checking updates for RC files
Updating ~/tools
Already up-to-date.
/Users/yg/.zsh/var/compiled/allrcs:122: command not found: dircolors
touch: illegal option -- d
usage:
touch [-A [-][[hh]mm]SS] [-acfhm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...

This is due to the dact that the touch command on OSX only supports -t and not the -d option.
Also dircolors don't exist on ML so you can change that to gdircolors.

In order to fix it, you can do the following:

Edit .zsh/var/compiled/allrcs

on line 283, change:

From:

touch -d "today 00:00" $TEMPFILE 

To:

touch -t `date +%m%d0000` $TEMPFILE

on line 287, change:

From:

touch -d yesterday ~/.zsh/var/run/last_updated

To:

touch -t `printf "%s%02d0000" \`date +%m\` $((\`date +%d\`-1))` ~/.zsh/var/run/last_updated

on line 122, change:

From:

eval `dircolors ~/.zsh/etc/dircolors` 2>&1 > /dev/null

To:

eval `gdircolors ~/.zsh/etc/dircolors` 2>&1 > /dev/null

This solves all issues on OSX Mountain Lion (10.8).

Folder issue with using dev and master branches

In dev branch, when you run comprc, it creates a binfix folder. That is fine. However, when you checkout to master, the folder stays in there conflicting with master branch's layout, requiring either adding a line in .gitignore or removing the folder manually. binfix/python2 is already in dev's .gitignore.

Should it be added a line to .gitignore in master branch or done something else?

make files cdable

Occasionally you want to CD to a file, copy paste the location, and cd to it, only to notice that it is not permitted to cd to /etc/fstab because it is a file... well in that case, cd to the dirname $1 instead...

Oh my zsh updates fail

Last login: Sat Dec 29 14:09:33 2012 from 201-42-50-178.dsl.telesp.net.br
[Oh My Zsh] Would you like to check for updates?
Type Y to update oh-my-zsh: y
/bin/sh: Can't open /home/users/miohtama/.zsh//bin/upgrade.sh

Automatically drop in sane ~/.subversion/config

The default UNIX installations lack sane subversion config file. At least the following options should be set up in the place automatically

--> Otherwise novice people will clutter their passwords all over the server and commit shit into your repos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.