fix: touch

This commit is contained in:
TaurusXin 2024-10-16 10:35:18 +08:00
parent a8fc60a5a6
commit 889c6c1907

View File

@ -201,13 +201,10 @@ Set-PSReadlineKeyHandler -Key "Ctrl+d" -Function ViExit
# 设置 Ctrl+z 为撤销 # 设置 Ctrl+z 为撤销
Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo
# 使用 ls 和 ll 查看目录 # 使用 ll 查看目录
function ListDirectory { function ll {
(Get-ChildItem).Name Get-ChildItem
Write-Host("")
} }
Set-Alias -Name ls -Value ListDirectory
Set-Alias -Name ll -Value Get-ChildItem
# 设置向上键为后向搜索历史记录 # 设置向上键为后向搜索历史记录
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
@ -215,8 +212,15 @@ Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
# 设置向下键为前向搜索历史纪录 # 设置向下键为前向搜索历史纪录
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
# rm alias # rm -rf alias
Set-Alias rmrf "Remove-Item -Force -Recurse" function rmrf ($dir_path){
Remove-Item -Recurse -Force $dir_path
}
# mv alias
function mv($file_path, $des_name) {
Move-Item -Path $file_path -Destination $des_name
}
# touch alias # touch alias
function touch { function touch {