ZSH Gem #16: Command arguments completion

Posted by | Comments (0) | Trackbacks (0)

ZSH has lots of great expansion and auto completion features and I have shown you many of them. One more completion feature I want to show you is command arguments completion. With this completion of command line parameters you can auto complete the arguments of your command line tools. Many completion definitions are already included in ZSH, many more can be installed via your package manager.

Read more…

ZSH Gem #15: Shared history

Posted by | Comments (0) | Trackbacks (0)

If one thing annoys me then it's when the shell history doesn't handle multiple simultaneous shell sessions properly. Once you close a shell instance, its complete history is written to the history file. And when you close the second instance, it writes its whole history in one go, too. The result is that I have to go through all history entries of the second instance to come to the last entry of the first one (if they're not already deleted because the history of the second shell was longer than the maximum history size or because the shell is configured to replace the whole history instead of appending new entries).

Read more…

ZSH Gem #14: Anonymous functions

Posted by | Comments (2) | Trackbacks (0)

I hope, you're familiar with parameter scopes, i.e. local and global variables. Global variables are visible in all contexts including subshells, functions and what not. Local variables are only visible in the current scope (e.g. a function).

Read more…

ZSH Gem #13: Parameter expansion

Posted by | Comments (0) | Trackbacks (0)

Today I want to show you some examples of parameter expansion or parameter substitution as it is called in Bash. I've already used parameter expansion a few times in this series but now I want to show you how it works (at least some basics, I don't want to report the whole manual here).

Read more…

ZSH Gem #12: Autoloading functions

Posted by | Comments (0) | Trackbacks (0)

Have you ever wondered why ZSH provides so many features but is still so fast? That's because of its autoloading mechanism. Functions can be marked as empty so they aren't loaded before they are executed the first time. This saves a lot of memory and much processing power.

Read more…

ZSH Gem #11: Path and filename expansion

Posted by | Comments (6) | Trackbacks (0)

Yesterday I told you about Backtick expansion. Today I want to show you one more interesting expansion feature and that is path expansion for executable files.

Read more…

ZSH Gem #10: Backtick expansion

Posted by | Comments (0) | Trackbacks (0)

Today's Gem is very short. I just want to mention an interesting feature of ZSH and that is backtick expansion.

Read more…

ZSH Gem #9: zshexit() and other hook functions

Posted by | Comments (0) | Trackbacks (0)

Yesterday I told you about the chpwd() hook function. Today I want to go one step further and round up this topic. As you might have found out (or maybe you knew it already or at least guessed it), there are also other hook functions and today I want to present you some.

Read more…

ZSH Gem #8: Hook function chpwd()

Posted by | Comments (0) | Trackbacks (0)

There is a number of magic functions called hook functions in ZSH which are automatically executed under certain circumstances. One of these functions is chpwd() and it is executed each time you change the current working directory.

Read more…

ZSH Gem #7: Editing variables with vared

Posted by | Comments (2) | Trackbacks (0)
Today I'm showing you how to edit variables by using vared. The vared shell builtin invokes the ZSH line editor, to interactively edit variables. This is sometimes very useful when you have appended values to a variable but then recognize that you added something you didn't want to add. Instead of rebuilding all the contents of the variable you could just use vared and clean up the mess.

Read more…

   (Page 2 of 6, totaling 60 entries)
Design and Code Copyright © 2010-2012 Janek Bevendorff Content on this site is published under the terms of the GNU Free Documentation License (GFDL). You may redistribute content only in compliance with these terms. tweetbackcheck