Skip to content

Instantly share code, notes, and snippets.

@Kvieta1990
Last active February 23, 2022 15:47
Show Gist options
  • Save Kvieta1990/d838510fc573bebaf8daf01d83f28032 to your computer and use it in GitHub Desktop.
Save Kvieta1990/d838510fc573bebaf8daf01d83f28032 to your computer and use it in GitHub Desktop.
Windows DOS profile
load(io.popen('oh-my-posh --config="C:/Users/yuanp/AppData/Local/Programs/oh-my-posh/themes/ohmyposhv3-v2.json" --init --shell cmd'):read("*a"))()
@echo off
Title DOS
for %%* in (.) do set ADDRESS= %%~n*
prompt $E[1;30;40m[$E[1;35;40mZYP$E[1;34;40m-$E[1;32;40mDOS $E[1;31;40m@ $E[1;36;40m$d$E[1;30;40m]$E[1;31;40m$$$s$E[1;37;40m
:: Temporary system path at cmd startup
:: set PATH=%PATH%;"C:\Program Files\Sublime Text 2\"
call conda activate
:: Commands
DOSKEY la=wsl ls -al
DOSKEY lat=wsl ls -alth
DOSKEY lar=wsl ls -altrh
DOSKEY rr=wsl rm -rf
DOSKEY pwd=wsl pwd
DOSKEY vi=vim $*
DOSKEY subl=sublime_text $*
DOSKEY pr=sublime_text D:\Documents\Configs\profiles.cmd
DOSKEY open=explorer $*
DOSKEY ca=conda activate $*
DOSKEY da=conda deactivate
:: Common directories
:: DOSKEY gd=cd D:\GooDrive
@Kvieta1990
Copy link
Author

Kvieta1990 commented Dec 5, 2021

  1. Refer to the following links for configuring Windows CMD to load profile on startup,

    https://jack-kawell.com/2020/03/18/create-bashrc-files-for-command-prompt-and-powershell-in-windows/

    https://www.notion.so/iris2020/Create-bashrc-files-for-Command-Prompt-and-PowerShell-in-Windows-Jack-Kawell-69f7096761c1443ba2117ce7024f6dfb

  2. Refer to the following link for details about configuring ohmyposh with Windows CMD,

    https://ohmyposh.dev/docs/windows

  3. Sometimes, the autorun function of clink will not be working, in which case, we need to manually inject clink into a starting CMD session. To do this, add the following link to the profile file,

    "C:\Program Files (x86)\clink\0.4.6\clink_x64.exe" inject
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment