Questions tagged [alias]

An alias is an alternative name. In computer science, the most common contexts are command aliases in shells, column aliases in databases, or variable references in languages like C++.

For bash aliases use the tag.

4406 questions
174
votes
3 answers

How to alias 'git checkout' to 'git co'

I'd like the command git co to be the same as typing git checkout. A normal Bash alias (alias co='checkout') doesn't work.
joseph.hainline
  • 24,829
  • 18
  • 53
  • 70
173
votes
8 answers

How to create an alias for a command in Vim?

Vim is my preferred text editor when I program, and thus I always run into a particularly annoying issue. Frequently, when I quickly need to save the buffer and continue on to some other miscellaneous task, I do the typical :w However, I always —…
Sean
  • 5,233
  • 5
  • 22
  • 26
152
votes
5 answers

How can I delete a git alias?

I'm learning to work with git, and I tried to set some aliases like this: git config --global alias.trololo 'status' So now when I type git trololo it works like git status. Now trololo alias is not needed. How can I correctly delete it?
Daydreaming Duck
  • 2,110
  • 3
  • 18
  • 25
138
votes
9 answers

How can I set Bash aliases for docker containers in Dockerfile?

I am new to Docker. I found that we can set environment variables using the ENV instruction in the Dockerfile. But how does one set Bash aliases for long commands in Dockerfile?
np20
  • 1,935
  • 3
  • 16
  • 24
134
votes
17 answers

How to open webstorm from terminal

To edit files from terminal I use subl (for sublime text) in order to edit the file; example: If i need to edit app.js file I use subl app.js Is there any way I can set up webstorm to open from the terminal ?
Jackal
  • 2,591
  • 3
  • 25
  • 29
130
votes
8 answers

How do I assign an alias to a function name in C++?

It's easy to create a new name for a type, a variable or a namespace. But how do I assign a new name to a function? For example, I want to use the name holler for printf. #define is obvious... any other way? Solutions: #define holler printf void…
Agnel Kurian
  • 57,975
  • 43
  • 146
  • 217
123
votes
2 answers

Using a 'using alias = class' with generic types?

So sometimes I want to include only one class from a namespace rather than a whole namespace, like the example here I create a alias to that class with the using statement: using System; using System.Text; using Array =…
csharptest.net
  • 62,602
  • 11
  • 71
  • 89
119
votes
3 answers

Is inject the same thing as reduce in ruby?

I saw that they were documented together here. Are they the same thing? Why does Ruby have so many aliases (such as map/collect for arrays)? Thanks a lot.
Jacky
  • 8,619
  • 7
  • 36
  • 40
115
votes
5 answers

How to make .bashrc aliases available within a vim shell command? (:!...)

I use bash on mac and one of the aliases is like this alias gitlog='git --no-pager log -n 20 --pretty=format:%h%x09%an%x09%ad%x09%s --date=short --no-merges' However when I do :! gitlog I get /bin/bash: gitlog: command not found I know I can…
Nick Vanderbilt
  • 36,724
  • 29
  • 83
  • 106
109
votes
11 answers

Quit and restart a clean R session from within R?

Is there a way I can make an alias, within R, that will execute q() and then restart a clean R session? And yes, I am too lazy to type q() and then the letter R :)
justin
  • 1,091
  • 2
  • 8
  • 3
108
votes
3 answers

Does TypeScript allow type aliases?

So I wish I could use an alias to an ugly type that looks like this: Maybe, Problem>>[] Something like: import Response = Maybe, Problem>>[]; Is there a way to do type aliases in TypeScript?
Trident D'Gao
  • 18,973
  • 19
  • 95
  • 159
103
votes
11 answers

How to open google chrome from terminal?

I'm trying to create an alias that opens google chrome to localhost. Port 80 in this case. I'd also really like to be able to be in any git directory and have it open that specific project in the browser, but I'm not sure if that's even…
Spencer Rohan
  • 1,759
  • 3
  • 12
  • 23
101
votes
22 answers

Why are these tsconfig paths not working?

I'm trying to do something very similar to the jquery path example in the documentation, but TS keeps throwing TS2307 (webpack compiles fine): "compilerOptions": { "baseUrl": "./src", "paths": { "@client": [ "client", …
Jakob Jingleheimer
  • 30,952
  • 27
  • 76
  • 126
98
votes
5 answers

How to embed bash script directly inside a git alias

Can I embed the following bash shell code: for name in $(git diff --name-only $1); do git difftool $1 $name & done directly into the creation of a git alias: git config --global alias.diffall ***my-bash-code-here*** This leads on from my previous…
Seba Illingworth
  • 5,672
  • 3
  • 27
  • 25
97
votes
6 answers

How can I write a PowerShell alias with arguments in the middle?

I'm trying to set up a Windows PowerShell alias to run MinGW's g++ executable with certain parameters. However, these parameters need to come after the file name and other arguments. I don't want to go through the hassle of trying to set up a…
Ken Bellows
  • 6,711
  • 13
  • 50
  • 78