feat(shell): Use one keymaps for shell

This commit is contained in:
js0ny 2025-01-28 14:26:25 +00:00
parent 68ff1bb357
commit 2346c13564
19 changed files with 530 additions and 265 deletions

View file

@ -2,27 +2,28 @@
# Date: 2024-12-01
# Author: js0ny
# Aliases for PowerShell
### VARIABLES ###
$EDITOR = "code"
# Shell Equivalents #
# Unix Shell Equivalents #
Set-Alias "touch" "New-Item"
${function:l} = { Get-ChildItem -Force }
${function:tree} = { lsd.exe --tree $args }
${function:tree} = { lsd --tree $args }
Set-Alias "which" "Get-Command"
# Shell Configurations #
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
# Editors #
Set-Alias "v" "nvim"
Set-Alias "c" "code"
Set-Alias "gvi" "neovide"
Get-Command neovide -ErrorAction SilentlyContinue > $null && Set-Alias "gvi" "neovide"
# File Creation #
function mkcd { param ( [string] $dirname) New-Item -ItemType Directory -Name $dirname && Set-Location $dirname }
function tc { param ( [string] $filename) New-Item $filename && code $filename }
function tv { param ( [string] $filename) New-Item $filename && nvim $filename }
function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem }
function zls { param( [string] $dirname) z $dirname && Get-ChildItem }
function zl { param( [string] $dirname) z $dirname && lsd }
### Dev ###
@ -30,7 +31,10 @@ function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem
Set-Alias "py" "python"
Set-Alias "ipy" "ipython"
if ($isWindows) {
# Debugging
# function kex { wsl -d kali-linux kex --sl -s }
if ($Env:WEZTERM) {
# Environment variable injected by wezterm/wezterm.lua
${function:icat} = { wezterm imgcat $args }
}
elseif ($Env:KITTY) {
${function:icat} = { kitty +kitten icat $args }
}