summaryrefslogtreecommitdiff
path: root/powershell
diff options
context:
space:
mode:
authorIndrajith K L2022-03-21 21:52:44 +0530
committerIndrajith K L2022-03-21 21:52:44 +0530
commit460ee862c0a8105d69c2dd35745f0b3913705fbf (patch)
tree20ea93a6fe2eef4af25bdad9280775a6c62c32a3 /powershell
downloadwindows-dot-files-460ee862c0a8105d69c2dd35745f0b3913705fbf.tar.gz
windows-dot-files-460ee862c0a8105d69c2dd35745f0b3913705fbf.tar.bz2
windows-dot-files-460ee862c0a8105d69c2dd35745f0b3913705fbf.zip
Initial Commit
* Lite-XL Dot Files * Powershell Dot Files
Diffstat (limited to 'powershell')
-rw-r--r--powershell/user_profile.ps155
1 files changed, 55 insertions, 0 deletions
diff --git a/powershell/user_profile.ps1 b/powershell/user_profile.ps1
new file mode 100644
index 0000000..d0cbd49
--- /dev/null
+++ b/powershell/user_profile.ps1
@@ -0,0 +1,55 @@
+#Prompt
+Import-Module posh-git
+Import-Module oh-my-posh
+Set-PoshPrompt star
+Import-Module -Name Terminal-Icons
+# Alias
+Set-Alias vim nvim
+Set-Alias ll ls
+Set-Alias grep findstr
+Set-Alias tig 'C:\Program Files\Git\usr\bin\tig.exe'
+Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
+Set-Alias -Name lv -Value Love2D
+
+## Git Alias
+Set-Alias g git
+Set-Alias -Name gdiff -Value GitDiff
+Set-Alias -Name branch -Value GitCurrentBranch
+Set-Alias -Name gg -Value GitGui
+Set-Alias -Name gbs -Value GitSearchBranch
+Set-Alias -Name push -Value GitPush
+
+function GitDiff {
+ $output = (git diff --stat) | Out-String
+ if (!$output) {
+ Write-Output "NONE"
+ } else {
+ Write-Output $output
+ }
+}
+
+function GitCurrentBranch {
+ $output = (git branch) | grep '*' | Out-String
+ Write-Output $output
+}
+
+function GitGui {
+ (git gui)
+}
+
+function GitSearchBranch {
+ $output = (git branch) | grep $args[0] | Out-String
+ Write-Output $output
+}
+
+function Love2D {
+ (love . --console)
+}
+
+function GitPush{
+ if(($args.Length -lt 2) -or ($args.Length -gt 2)) {
+ Write-Output "Usage: push <origin> <branch>"
+ } else {
+ (git push -u $args[0] $args[1])
+ }
+}