我已经按照 Python 环境的 vimrc 设置,如果我直接打开 GitBash 就可以正常工作:
" enable syntax highlighting
syntax enable
" show line numbers
set number
" set tabs to have 4 spaces
set ts=4
" indent when moving to the next line while writing code
set autoindent
" expand tabs into spaces
set expandtab
" when using the >> or << commands, shift lines by 4 spaces
set shiftwidth=4
" show the matching part of the pair for [] {} and ()
set showmatch
" enable all Python syntax highlighting features
let python_highlight_all = 1
但是,当我从 ConsoleZ 窗口内运行 Git bash 时,它似乎不起作用。还有其他一些设置需要完成吗?在任何地方都找不到任何关于此的信息。
最佳答案
第一步是确保 Git bash 是最新的:Git for Windows 2.4.4(PortableGit-2.4.4.2-3rd-release-candidate-64-bit.7z.exe
,今天提前 4 小时发布)
我解释了为什么适用于 Windows 的新 Git 64 位版本出现在“Why is it that if you download Git 2.0 from the net, you always get a 1.9.4 installer package?”中。
启动它的 bash:
c:\path\to\PortableGit-2.4.4.2-3rd-release-candidate-64-bit\git-bash.exe
然后确保 vimrc 具有 Unix eol(行尾)字符,而不是 Windows eol。
关于python - vimrc 设置不适用于在 ConsoleZ 中运行的 git bash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30950750/