Creating alias in Conemu

14

5

Is it possible to create alias for ConEmu? Also in linux, bash terminal have .bashrc file, what is similar to ConEmu?

Thanks

Vivek Kumar

Posted 2013-02-23T14:03:51.790

Reputation: 425

I believe that aliases must be supported by your shell rather than terminal. E.g. mentioned .bashrc belong to bash (shell) but not terminal. And you may use bash with ConEmu too. – Maximus – 2013-02-23T14:19:51.087

Yes your are right. Sorry for this. Actually I am on window. Can you please help me out how to create this on window cmd (which I now think will be used by conemu). – Vivek Kumar – 2013-02-23T14:36:22.303

If powershell is an option, you can define aliases in your profile file – kb_sou – 2013-02-23T17:04:50.817

Answers

16

New answer

In latest ConEmu builds there is an Environment settings page. You may set there environment variables and aliases for cmd.exe. One line set one alias. Example:

alias cdd=cd /d $1

Old answer

You may use doskey for creating aliases. Next example supposed your installation folder is C:\Program Files\ConEmu) and your shell is cmd.exe.

Create following batch file C:\Program Files\ConEmu\ConEmu\aliases.cmd:

@echo off
doskey /EXENAME=cmd.exe cdd=cd /d $1

Start your shell in ConEmu as followed (for example, Settings -> Startup -> Command line):

cmd /k "%ConEmuBaseDir%\aliases.cmd"

Now you may type in prompt something like this

cdd D:\AnyFolder

Maximus

Posted 2013-02-23T14:03:51.790

Reputation: 19 395

I would suggest to use cmd /k "%userprofile%\.conemu\cmdinit.cmd", to stick with lastest version of conemu and keep your files on your side. See doc and default file

– albfan – 2015-09-03T08:49:47.220

I believe using Environment page is much more handy nowadays. – Maximus – 2015-09-03T09:58:21.077

3

You could use TCC/LE with ConEmu. It's a free cmd.exe replacement and, unlike Powershell, is backward compatible. You can use the ALIAS command to create and manage aliases and TCSTART to do a similar thing .bashrc does.

Charles Roper

Posted 2013-02-23T14:03:51.790

Reputation: 9 646

0

For reference purpose...

Multiple arguments: $*

Source: Settings Environment

DiogoLR

Posted 2013-02-23T14:03:51.790

Reputation: 101