Powershell中使用Vim

1、下載安裝Vim

ftp直接下載:

ftp://ftp.vim.org/pub/vim/pc/gvim74.exe

官網下載:

https://www.vim.org/download.php#pc

下載後明確自己的Vim的文件位置。

2、以管理員的身份運行PowerShell

執行Set-ExecutionPolicy RemoteSigned命令,在對話框中選擇Y,如下:

  1. Set-ExecutionPolicy RemoteSigned

3、在C:\Windows\System32\WindowsPowerShell\v1.0目錄下新建Microsoft.PowerShell_profile.ps1文件

可以使用記事本打開此Microsoft.PowerShell_profile.ps1文件進行編輯

set-alias vim "C:/Program Files/Git/usr/bin/vim.exe"
#將vim.exe文件位置修改爲自己的位置
 
# To edit the Powershell Profile
# (Not that I'll remember this)
Function Edit-Profile
{
    vim $profile
}
 
# To edit Vim settings
Function Edit-Vimrc
{
    vim $HOME\_vimrc
}

4、重啓Shell,輸入vim進行測試:

5、參考:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章