Skip to main content

All Questions

Tagged with
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"?
wildeyes's user avatar
  • 1,155
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 ...
Ole Tange's user avatar
  • 35.8k
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....
tuvokki's user avatar
  • 103
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 [[ -...
Steven L.'s user avatar
  • 755
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 ...
chrisortman's user avatar
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 ...
shrx's user avatar
  • 445
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+"$@"}'?
user avatar
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 ...
Ali Samii's user avatar
  • 441
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 ...
Siyuan Ren's user avatar
  • 1,382
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 ...
Hongxu Chen's user avatar
  • 5,858
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 ...
Don Manley's user avatar
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 ...
WeSenseASoulInSearchOfAnswers's user avatar
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 ...
skittleys's user avatar
  • 645
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="...
strugee's user avatar
  • 15.1k
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), ...
jinawee's user avatar
  • 187

15 30 50 per page
1
4 5 6
7
8