在PowerShell中使用Vim
来源:互联网 发布:淘宝我订购的应用 编辑:程序博客网 时间:2024/05/09 09:47
原文出处。蜗窝科技,http://www.wowotech.net/soft/vim_in_powershell.html
蜗蜗想要的无非就是一个命令行的环境,加上Vim工具。而微软在WIN7、WIN8时,就在系统中集成了一个Shell工具----PowerShell,这个工具虽然没有Linux系统的Shell强大,但相比Windows的Command Line,还是强大不少。那是否可以利用它呢?答案是肯定的。
首先,需要去Vim官网下载并安装一个可运行于Win8系统的执行文件。
然后,设置PowerShell环境,使能“allow scripts to run”选项,步骤如下:
- 以管理员的身份运行PowerShell
- 执行Set-ExecutionPolicy RemoteSigned命令,在对话框中选择Y,如下
- PS C:\Windows\system32> Set-ExecutionPolicy RemoteSigned
- 执行策略更改
- 执行策略可帮助你防止执行不信任的脚本。更改执行策略可能会产生安全风险,如 http://go.microsoft.com/fwlink/?LinkID=135170
- 中的 about_Execution_Policies 帮助主题所述。是否要更改执行策略?
- [Y] 是(Y) [N] 否(N) [S] 挂起(S) [?] 帮助 (默认值为“Y”): Y
- PS C:\Windows\system32>
接下来,使用new-item命令,创建一个PowerShell的配置文件Profile。
- new-item -path $profile -itemtype file -force
最后,编辑配置文件(notepad $profile),添加vim相关的alias。
- set-alias vim "C:/Program Files/Vim/Vim74/./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
- }
重启PowerShell后,就可以正常使用了,如下(后续可以按照正常的方式,配置VIM,这里就不多说了)。
1 1
- 在PowerShell中使用Vim
- powershell中使用vim
- 如何在PowerShell中运行VIM
- 在 PowerShell 中使用 WMI 远程调用
- 使用Splatting在PowerShell中传递参数
- 如何在PowerShell中使用.NET Framework
- 在 PowerShell 中使用 SQL Server
- 在PowerShell中使用枚举类型
- 在PowerShell中使用curl(Invoke-WebRequest)
- PowerShell使用Vim的方法
- 【vim】在vim中使用unix命令
- 在vim中使用make
- 在Vim中使用ctags
- 在Vim中使用ctags
- 在eclipse中使用vim
- 在Eclipse 中使用 vim
- 在vim中使用shell
- 在vim中使用cscope
- 求分数的循环节和小数表示
- ZOJ 3798 Abs Problem
- 小贝学习html--超链接
- 简述UITextField的属性和用法
- 『IOS』报错:failed to get the task for process XXX(解决方案)
- 在PowerShell中使用Vim
- 每天一个linux命令(5):rm 命令
- leetcode dfs Validate Binary Search Tree
- const_interator的用法
- Java NIO 系列教程
- Android背景平铺
- Anagram --- 哈希算法
- 蓝桥杯试题
- 3Sum Closest