Skip to content

Instantly share code, notes, and snippets.

@MohannadNaj
Created February 18, 2018 01:26
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save MohannadNaj/2cbbe09874e9b04c28715a18cac85d5b to your computer and use it in GitHub Desktop.
Save MohannadNaj/2cbbe09874e9b04c28715a18cac85d5b to your computer and use it in GitHub Desktop.
My windows aliases list.

My windows aliases list.

Installation

1- Attaching Aliases to the native command line:

Steps in this stackoverflow answer.Quoting:

you may make the alias(es) persistent with the following steps,

  1. Create a .bat or .cmd file with your DOSKEY commands.

  2. Run regedit and go to HKEY_CURRENT_USER\Software\Microsoft\Command Processor

  3. Add String Value entry with the name AutoRun and the full path of your .bat/.cmd file.

    For example, %USERPROFILE%\alias.cmd, replacing the initial segment of the path with %USERPROFILE% is useful for syncing among> multiple machines.

This way, every time cmd is run, the aliases are loaded.

2- Using ConEMU.

Documentation here.

Settings > Startup > Environment


Aliases

@echo off

set PATH=%PATH%;C:\Program Files\Git\cmd

:: Common directories
DOSKEY lh=cd "C:\Program Files (x86)\Ampps\www\$*"
DOSKEY localhost=cd "C:\Program Files (x86)\Ampps\www\$*"
DOSKEY nodes = C:$Tcd "C:\nodes\$*"

:: Common Programs
DOSKEY ampps="C:\Program Files (x86)\Ampps\Ampps.exe"
DOSKEY gitcmd="C:\Program Files\Git\bin\sh.exe" --login -i

:: Trying to be Linux?
DOSKEY ls=dir
DOSKEY cat=type
DOSKEY ip=ipconfig
DOSKEY rm=rmdir /S $*$Tdel $*
DOSKEY mkdir=mkdir $1$Tcd $1
DOSKEY touch=copy nul $* > nul
DOSKEY clear=cls

:: Git
DOSKEY gitconfig="C:\Program Files\Sublime Text 3\sublime_text.exe" "C:\Users\DELL\.gitconfig"
DOSKEY git-save = git add .$Tgit stash save --keep-index
DOSKEY wip = git add .$Tgit commit -m "WIP"
DOSKEY gitlog = git log --pretty=oneline


:: Conemu
DOSKEY reload=cls$Tcmd cur_console
DOSKEY new=cmd -new_console:s$*

:: Laravel
DOSKEY serve=php artisan serve --host=127.0.0.1
DOSKEY artisan=php artisan $*
DOSKEY ar=php artisan $*
DOSKEY art=php artisan tinker
DOSKEY refresh=php artisan migrate:refresh --seed

:: PHP
DOSKEY php5="C:\Program Files (x86)\Ampps\php-5.6\php.exe" $*
:: Edit PHP.INI file
DOSKEY phpini="C:\Program Files\Sublime Text 3\sublime_text.exe" "C:\Program Files (x86)\Ampps\php\php.ini"
:: PHPUnit
DOSKEY p="vendor/bin/phpunit"
DOSKEY pf="vendor/bin/phpunit" --filter $*

:: Composer Dump Autoload
DOSKEY cda=composer dump-autoload

:: Node.js Commands
DOSKEY gw=gulp watch
DOSKEY nrw=npm run watch $*
DOSKEY nrp=npm run prod $*
DOSKEY nrt=npm run test $*
DOSKEY nrtdd=npm run tdd $*
DOSKEY nr=npm run $*

:: Windows Shutdown set seconds
DOSKEY st=shutdown /s /t $*
:: Shutdown abort
DOSKEY sta=shutdown /a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment