Windows Terminal/Powershell 设置自动补全, 智能提示 【类似于mac的iterm2功能】 |
您所在的位置:网站首页 › pycharm自动补全功能 › Windows Terminal/Powershell 设置自动补全, 智能提示 【类似于mac的iterm2功能】 |
文章目录
一、需求:二、powershell自动补全。1、安装:´PSReadLine´ version 2.1.02、初始化:3、检测是否有配置好文件4、编辑profile配置文件:5、重新打开一个新的powershell或者Terminal页面。
三、如何pycharm的terminal的cmd改为powershell:pycharm的替换步骤:1、找到powershell的存放路径。2、去pycharm里面替换到cmd.exe.
一、需求:
用了一段时间的mac,也是要Mac的iterm2的自动补全功能,发现真的爽。 但是回到家,自己组装的台式机,又是不能使用自动补全功能。 有了需求,就想找到能完成目前的任务。找相关的软件或者工具。 刚开始一直搜索cmd的东西,发现一直不能搜到。 我也有用到window的powershell,Terminal终端【其实最后还是powershell】 最初以为mac的iterm2能再window上使用,结果发现并不行。 然后找到可以再powershell下面使用自动补全功能。 二、powershell自动补全。随便一个目录,使用管理员权限打开powershell。 然后输入下面步骤: 1、安装:´PSReadLine´ version 2.1.0 Install-Module PSReadLine -RequiredVersion 2.1.0 2、初始化: Import-Module PSReadLine Set-PSReadLineOption -PredictionSource History 3、检测是否有配置好文件 Test-path $profile如果返回是‘false’ 执行下面: New-item –type file –force $profile如果返回是ture,或者上一步创建好,直接下一步 4、编辑profile配置文件:编辑文件: notepad $profile输入一下内容: # Shows navigable menu of all options when hitting Tab Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete # Autocompletion for arrow keys Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward # auto suggestions Import-Module PSReadLine Set-PSReadLineOption -PredictionSource History保存之后,退出。 5、重新打开一个新的powershell或者Terminal页面。随便输入一次命令,然后第二部输入首字母就会有自动提示了,按左右键就可以补全。上下键是可以切换以前面的一样的命令。 有了上面的自动补全,发现只能再powershell和window自带的Terminal。 idea全家桶里面的,再window里面,却还是cmd,dos命令语法。还是不支持自动补全功能。 如果能把编译器的terminal替换为powershell,不是就可以了么,然后搜索,还真可以。 欣喜万分。 pycharm的替换步骤:其他idea全家桶,我觉得都一样,自己尝试即可。 1、找到powershell的存放路径。cmd中,输入where powershell。 file–>setting–>tools—>terminal
完美了,从此window也能随便自动补全了,主要以后是terminal里面执行各种命令,都能记录下来了,和Mac里面的iterm2一样爽了。比如经常git提交项目的命令,都可以自动补全,提高工作效率。 参考地址: https://dev.to/animo/fish-like-autosuggestion-in-powershell-21ec https://zhuanlan.zhihu.com/p/421568420 https://www.csdn.net/tags/MtTaEg2sNzYwODI5LWJsb2cO0O0O.html |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |