我在Windows8.1上使用vim 10。这个 vim 带有git bash。
当我键入 Tab 键时,我实际上得到了一个正确的 TAB 字符,8 宽,这就是我想要的。
但是,如果我编辑一个.py文件,那么我会得到 4 个空格,而不是 TAB。呸。为什么?
无论如何。。。我有我的~/.vimrc说:
set tabstop=8
set ts=8
set shiftwidth=8
set gfn=Courier_New:h14:cANSI:qDRAFT
但是为什么不使用呢?
$ vi -V1
not found in 'runtimepath': "ftdetect/*.vim"
not found in 'packpath': "pack/*/start/*"
not found in 'packpath': "pack/*/start/*"
not found in 'runtimepath': "plugin/**/*.vim"
Reading viminfo file "/c/Users/abrahamstolk/.viminfo" info oldfiles
Press ENTER or type command to continue
当我使用vi --version
时,我看到 vim 声称正在读取$HOME/.vimrc
但它似乎没有这样做?
$ vi --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 1 2019 05:31:13)
Included patches: 1-2104
Compiled by <alexpux@gmail.com>
Huge version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt -tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
-balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
-browse +gettext +num64 +textprop
++builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand +perl/dyn -toolbar
+cindent +job +persistent_undo +user_commands
-clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap +python/dyn +visual
+cmdline_info +libcall +python3/dyn +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap +ruby/dyn +wildmenu
+cursorbind -lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con +mksession +smartindent -X11
+diff +modify_fname -sound -xfontset
+digraphs +mouse +spell -xim
-dnd -mouseshape +startuptime -xpm
-ebcdic +mouse_dec +statusline -xsmp
+emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/etc"
f-b for $VIMRUNTIME: "/usr/share/vim/vim81"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/include/ncursesw -march=x86-64 -mtune=generic -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -pipe -fstack-protector-strong -pipe -Wl,--as-needed -o vim.exe -lm -lelf -lncursesw -liconv -lacl -lintl -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt
在 Python世界中,空间是首选,因此vim
编辑 Python 文件配置为展开选项卡。
从技术上讲,这是以这种方式完成的。已安装的vim
具有庞大的运行时库,其中包括文件类型插件。Python ftplugin setexpandtab
.每次检测到 Python 文件时vim
都会加载 ft 插件。