Last active
March 27, 2022 06:14
-
-
Save AbiruzzamanMolla/c15211ce1f8d558f48e572af067b6d5b to your computer and use it in GitHub Desktop.
powershell profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# PSReadLine, see https://github.com/PowerShell/PSReadLine | |
## | |
## behaviour of Tab key autocomplete | |
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete | |
## From docs: | |
## With these bindings, up arrow/down arrow will work like PowerShell/cmd if the | |
## current command line is blank. If you've entered some text though, it will | |
## search the history for commands that start with the currently entered text. | |
## | |
## Like zsh completion. | |
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward | |
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward | |
$env:POSH_PATH | |
Import-Module oh-my-posh | |
Set-PoshPrompt -Theme clean-detailed | |
Import-Module -Name Terminal-Icons | |
# Laravel Artisan Commands Shortcut | |
function art($arg1,$arg2,$arg3,$arg4,$arg5) { php artisan $arg1 $arg2 $arg3 $arg4 $arg5} | |
Set-Alias pa art | |
# Git Commands Shortcut | |
function githubs($arg1,$arg2,$arg3,$arg4,$arg5) { git $arg1 $arg2 $arg3 $arg4 $arg5} | |
Set-Alias g githubs | |
# Remove Defaults | |
rename-item alias:\gc gk -force | |
# Git Commit Commands Shortcut | |
function gitcommit($arg1) { git commit -m "$arg1"} | |
Set-Alias gc gitcommit | |
# Git Commit Commands Shortcut | |
function gitadd { git add .} | |
Set-Alias gaa gitadd | |
#### Use as by default Alias ##### | |
# ge:r => generate:resource | |
# ge:c => generate:controller | |
# ge:s => generate:seed | |
# ge:m => generate:model | |
# ge:sc => generate:scaffold | |
# m:m => migrate:make | |
# m:f => migrate:refresh | |
# m:re => migrate:reset | |
# m:b => migrate:rollback | |
# Try it | |
## PS c:\laravel_proj> a ge:r post | |
# For CodeCept | |
## Assuming codecept.phar file is in your current working Directory | |
function composers($arg1,$arg2,$arg3,$arg4) { composer $arg1 $arg2 $arg3 $arg4 } | |
Set-Alias c composers | |
# *** Other *** # | |
function www($arg1) { | |
$arg="C:\laragon\www" + $arg1 | |
cd $arg | |
} | |
## Try it: | |
# PS C:\> www | |
# OR, | |
# PS C:\> www laravel_proj | |
# Useful shortcuts for traversing directories | |
function cd... { cd ..\.. } | |
function cd.... { cd ..\..\.. } | |
# Quick shortcut to start notepad | |
function n { notepad $args } | |
# We don't need these any more; they were just temporary variables to get to $isAdmin. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment