Zsh is a shell with many advanced command-line and scripting features.
1
vote
1answer
16 views
How to append / extend zshell completions?
I am using zsh with oh-my-zsh. Unfortunately, oh-my-zsh does not use file ~/.ssh/config for hostname auto-completion (see Issue #1009, for instance).
This could easily archived by the following code:
...
3
votes
1answer
32 views
How to expand a substring of a command?
I would like to know what a command would look like if I entered a substring of this command. I'm not interested in the result, but in the history expansion.
The purpose of this is to show in an ...
4
votes
3answers
102 views
What's the right way to sort a associated array in bash or zsh?
I'm wondering how should I sort the associated array in bash? I tried the manual, but seems nothing related to sort.
The current solution is echo everything out, and use external program i.e key ...
1
vote
2answers
31 views
zsh copy and paste like emacs
I have noticed that zsh has a lot of things I see in emacs. I can make a selection with ctrl+space and selecting a region. I can make copies just like in emacs while I stay inside zsh. In emacs I'm ...
1
vote
2answers
39 views
Is it possible to include file in config file of zsh? How?
I'd like to have a file eg. f with only zsh aliases (pureness reasons). Then I'd like to include f file in my .zshrc file, so that the aliases defined in f are visible in .zshrc.
Is it possible?
If ...
2
votes
4answers
74 views
Editing output of command as a new command
I have a script that outputs a string that I would like to edit and then run as a command.
For example, I am using
cat ... | xsel -p
And then I want to edit the output of `xsel -op´ and run the ...
3
votes
3answers
142 views
Using OR patterns in shell wildcards
Contents of my dir are
$ ls -lrt
total 0
-rw-r--r-- 1 user1 admin 19 Oct 8 12:31 night.txt
-rw-r--r-- 1 user1 admin 19 Oct 8 12:31 noon.txt
-rw-r--r-- 1 user1 admin 38 Oct 8 12:31 day.txt
I ...
3
votes
1answer
47 views
Silently start task in background
I know that you can use this to start a process in the background, without getting the notification when the process is put in the background and when it is done like so:
(command &) &> /dev/null
...
1
vote
1answer
27 views
zsh prompt not escaped properly
This is my current prompt definition:
PROMPT='%(?..%F{red}%?%f:)%F{blue}%n%f:%F{green}%{${PWD/#$HOME/~}%} %(!.%F{red}.%f)%# %f'
The cursor sometimes starts one character behind the actual prompt, ...
2
votes
3answers
75 views
Bash Auto-Completion feature for SSHing into Different Hosts
I have big list of servers which I normally ssh to all the time. Is there any way using bash or zsh so that I can keep the list of hostname and bash auto-completion goes through the file and gives me ...
1
vote
0answers
32 views
ESC-q doesn't work in tmux with zsh
The title says it all. I use Escq a lot (stashing the current line while I execute another command), and it works fine with Gnome Terminal 3.6.0 + zsh. However, if I start tmux, then it stops working: ...
2
votes
0answers
42 views
Stop tab completion suggesting 'messagebus'
I've got a directory called build, which I cd into quite a bit.
If there isn't any directory bu* in the current directory, zsh tab completion: cd buTAB suggests messagebus/, which isn't in .. If I ...
4
votes
2answers
58 views
Inhibit Variable Expansion in Paths
How do I prevent Zshell (and Bash I assume) from expanding environment variables in paths be completed as shown in the following example:
$PREFIX/alt/li
should expand to
$PREFIX/alt/lib
and not ...
0
votes
1answer
58 views
Asking ls to only list files in a path that match a specific glob/regex
In Zsh: Is there a way to use ls to only list files and folders in the current directory that match a specific globbing or regex pattern?
For example, say I have multiple files that start with the ...
2
votes
1answer
46 views
Change completion behaviour with brace expansion in zsh
I have got used to using tab-autocompleting inside braces without expanding in zsh. This was possible, while I used zsh with a basic grml-config. Since I migrated to oh-my-zsh, I can't reproduce this ...