Windows 10 上的 Bash:.vimrc 在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42772115/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bash on Windows 10: where is .vimrc?
提问by JTW
Where is .vimrc located when using Bash on Windows? I'm trying to add settings to make Bash on Windows suitable for vim use and to allow performing git diff/merge, etc. with custom settings, i.e., ignore whitespace.
在 Windows 上使用 Bash 时 .vimrc 在哪里?我正在尝试添加设置以使 Windows 上的 Bash 适合 vim 使用,并允许使用自定义设置执行 git diff/merge 等,即忽略空格。
回答by edi
Use vim --version | grep vimrc
to find it.
使用vim --version | grep vimrc
找到它。
For me its
对我来说
- System wide file: "/etc/vimrc"
- User file: "$HOME/.vimrc"
- Second user file: "~/.vim/vimrc"
- 系统范围的文件:“/etc/vimrc”
- 用户文件:"$HOME/.vimrc"
- 第二个用户文件:"~/.vim/vimrc"
回答by Jim U
Edit your vimrc:
编辑你的 vimrc:
:e $MYVIMRC
Reload your vimrc after saving changes:
保存更改后重新加载 vimrc:
:source $MYVIMRC
OMG Shortcuts!
OMG 捷径!
use \e
in normal mode whenever you want to edit your vimrc and \s
to reload it
\e
每当您想编辑 vimrc 并\s
重新加载它时,请在正常模式下使用
let mapleader="\"
nnoremap <leader>e :vsplit $MYVIMRC<cr>
nnoremap <leader>s :source $MYVIMRC<cr>
reference: Learn Vimscript the Hard Way CH7
回答by u7512030
just type cd ~ and then you will enter your HOME directary ,and .vimrc is there
只需输入 cd ~ 然后您将进入您的 HOME 目录,.vimrc 就在那里