MSysGit will read your ~/.bash_profile file and load various functions and aliases from it. Is there any way for Cmder to have this feature since it uses MSysGit?
Thanks
.bash_profile allows you to create bash functions that can be called directly from the CLI. The key advantage of functions is that they can accept parameters.
For work, I often SSH into a set of specific servers. To make it easier, I create a single function called "s" that accepts a server name as an argument. The body of the function is a switch statement that maps the server name I passed in to an IP address or domain.
I can't seem to find any docs from MSysGit. I would imagine it is a straight copy from the bash implementation found here. .bash_profile is essentially just a file that gets run when the terminal starts. You may be able to just emulate the feature by running some file within the cmder directory.
Here is an easy way to demonstrate the feature.
I think there is nothing like that for cmd.exe + msysgit.
But
I think it would be nice to also add git bash to cmder. So I will add that to the todo!
@Knotix As a workaround, I edited my init.bat to launch bash, which launched the MSysGit bash and have a .bash_profile in my home directory, which is picked up by MSysGit bash
@Knotix My workaround for this was to add the following lines to /vendor/msysgit/etc/profile
if [ -e $CMDER_ROOT/config/.bash_aliases ]; then
. $CMDER_ROOT/config/.bash_aliases
fi
Then place all of my desired aliases in /config/.bash_aliases.
There's now a config/user-startup.cmd file created for this purpose as well as the already available powershell $profile areas to use. Should be available from the 1.3 release onwards.
Most helpful comment
There's now a
config/user-startup.cmdfile created for this purpose as well as the already available powershell $profile areas to use. Should be available from the 1.3 release onwards.