All Questions
116
questions
1
vote
2
answers
2k
views
How do you manage your bash/zsh Aliases?
How do you manage your bash/zsh Aliases?
Is there a tool to do this more easily and less "think of an alias -> open .zshrc-sourced-file -> edit -> close, reload .zshrc -> use alias"?
11
votes
3
answers
1k
views
Defining an alias and immediately use it
In zsh this works fine:
alias foo=ls
foo
But this does not:
alias foo=ls; foo
Pressing enter an extra time is not an issue when running interactively. But when running through ssh it suddenly ...
0
votes
1
answer
554
views
zsh alias with linefeeds, commas and quotes
In my zshrc I have an alias like this:
alias sl='screen -list'
It fits my need (seeing what screens I have running), but the output is rather ugly:
[pts/7]~% sl
There are screens on:
32765....
0
votes
1
answer
4k
views
zsh parse error after alias do=…
I have the following .zshrc file in my home directory:
# modify the prompt to contain git branch name if applicable
git_prompt_info() {
current_branch=$(git current-branch 2> /dev/null)
if [[ -...
3
votes
1
answer
294
views
How can I use !! in zsh alias
I am trying to create an alias that builds upon my previous command.
Say I run
ag foo
After looking at the list I want to be able to use those results in vim so I do
vim -q<(!! --vimgrep)
The ...
29
votes
2
answers
5k
views
How to make the zsh "correct" functionality remember my spell-correction decisions
I have enabled correction (I wouldn't call it autocorrection specifically because of this issue) in zsh by enabling setopt correct in my .zshrc.
Now, when I type dtae in a terminal, I get:
dtae ...
1
vote
1
answer
826
views
alias -g '${1+"$@"}'='"$@"', what does it do?
Most makefile have this strange set of symbols '${1+"$@"}'. $@ is the makefile target filename. But why does, people try to use the complex symbol like '${1+"$@"}'?
25
votes
1
answer
5k
views
how to find file defining an alias
I am having a problem I'm not sure how to get around.
Somehwhere on my system, I have an alias defined as such:
alias subl=\''/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'\'
I ...
26
votes
5
answers
14k
views
Clear or disable aliases in zsh
I installed oh-my-zsh to make terminal use a bit easier. One thing that bugs me though is the prolific aliases added by it, like "ga", "gap", "gcmsg", "_", which are harder to remember than the ...
1
vote
2
answers
380
views
In zsh how to set an alias for `less` to get stderr output?
I find that there is a "global alias" for zsh. so when I set
alias -g L='| less'
command L will be replaced with command | less.
But it seems that it cannot work with stderr output when I set
...
5
votes
3
answers
6k
views
Automatically put an alias into ~/.bashrc or ~/.zshrc [duplicate]
Is there a command line util/script that automatically saves aliases? E.g.
save-alias my-ip="curl ipecho.net/plain"
and that will define an alias, then add/update it in ~/.bashrc or ~/.zshrc
I was ...
14
votes
3
answers
8k
views
Resolve all aliases in a zsh command line
I have nested aliases and I want to resolve all of them before executing the command. How do I do that?
If there is a function that is not bound to any keys then M-x foobar is fine for me too. I ...
40
votes
2
answers
38k
views
alias vs export for simple commands
For simple commands like less, is it better to make an alias or to export the options? Is there any benefit of one over the other?
For example, if I want less to always use the -R option to show raw ...
12
votes
5
answers
1k
views
How can I "stack" shell aliases?
In my .profile (sourced in sh emulation mode from my .zshrc) I have the following snippet:
if [ -f /usr/bin/pacmatic ]; then
alias pacman=pacmatic
fi
# Colorized Pacman output
alias pacman="...
3
votes
3
answers
423
views
How to alias a command with '
I wanted to make an alias turn caps lock off:
python -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), ...