作者ggirls (哥)
看板Editor
标题Re: [vim ] Windows 上,执行 shell 先 chcp?
时间Thu Nov 24 20:49:33 2016
在这里提供一点小心得,算是个 workaround ,但是陷在这里太久,不想再弄了。
这里预设的是 cmd.exe,其它 shell 不论。
1. 让每个 cmd 起来後都先执行 chcp 65001
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
建立键 AutoRun
值 chcp 65001
若不想要有执行画面,用 chcp 65001 > nul
若是 PowerShell,要使用 profile 设定,见
https://goo.gl/nmR6CI
2. 在 _vimrc
set shellcmdflag=/c
这部分是预设值,基本上可不设。但要注意,不能用 /u 参数。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 223.137.254.115
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Editor/M.1479991775.A.0F8.html
1F:→ Bellkna: 有点好奇vim里跑什麽东西 为什麽shell要chcp 11/24 21:15
2F:→ ggirls: 凡是在shell里跑结果,又导回结果的都会用到啊。譬如之前 11/25 13:11
3F:→ ggirls: 讲的 :r!dir 还是一些 plugin 应该都会用到。 11/25 13:11
4F:→ Bellkna: 我是只有用dir 用/u就没问题了 才在想为什麽要chcp 11/25 18:59