mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-10-31 17:32:27 +08:00 
			
		
		
		
	Added vi/vim aliases and fixed powershell startup errors
This commit is contained in:
		| @@ -5,3 +5,4 @@ pwd=cd | ||||
| clear=cls | ||||
| history=cat %CMDER_ROOT%\config\.history | ||||
| unalias=alias /d $1 | ||||
| vi=vim $* | ||||
|   | ||||
							
								
								
									
										14
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								vendor/profile.ps1
									
									
									
									
										vendored
									
									
								
							| @@ -27,7 +27,14 @@ if( -not $env:PSModulePath.Contains($CmderModulePath) ){ | ||||
| try { | ||||
|     Get-command -Name "vim" -ErrorAction Stop >$null | ||||
| } catch { | ||||
|     $env:Path += ";$env:CMDER_ROOT\vendor\git-for-windows\usr\share\vim\vim74" | ||||
|     # # You could do this but it may be a little drastic and introduce a lot of | ||||
|     # # unix tool overlap with powershel unix like aliases | ||||
|     # $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\usr\bin") | ||||
|     # set-alias -name "vi" -value "vim" | ||||
|     # # I think the below is safer. | ||||
|     set-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe $1 $2 $3 $4 $5 $6 $7 $8 $9") | ||||
|     set-alias -name "vi" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe $1 $2 $3 $4 $5 $6 $7 $8 $9") | ||||
|      | ||||
| } | ||||
|  | ||||
| try { | ||||
| @@ -78,8 +85,10 @@ if ($gitStatus) { | ||||
| $cmderStartKey = 'HKCU:\Software\cmder' | ||||
| $cmderStartSubKey = 'CMDER_START' | ||||
|  | ||||
| $cmderStart = (Get-Item -Path $cmderStartKey).GetValue($cmderStartSubKey) | ||||
| $cmderStart = (Get-Item -Path $cmderStartKey -ErrorAction SilentlyContinue) | ||||
|  | ||||
| if ( $cmderStart ) { | ||||
|     $cmderStart = $cmderStart.GetValue($cmderStartSubKey) | ||||
|     $cmderStart = ($cmderStart).Trim('"').Trim("'") | ||||
|     if ( $cmderStart.EndsWith(':') ) { | ||||
|         $cmderStart += '\' | ||||
| @@ -96,6 +105,7 @@ if ( $cmderStart ) { | ||||
|     Set-Location -Path "${env:HOME}" | ||||
| } | ||||
|  | ||||
|  | ||||
| # Enhance Path | ||||
| $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user