:set tabstop=4 " Force tabs to be displayed/expanded to 4 spaces (instead of default 8).:set softtabstop=4 " Make Vim treat <Tab> key as 4 spaces, but respect hard Tabs.: " I don't think this one will do what you want.:set expandtab " Turn Tab keypresses into spaces. Sounds like this is happening to you." You can still insert real Tabs as [Ctrl]-V [Tab].:set noexpandtab " Leave Tab keys as real tabs (ASCII 9 character).:1,$retab! " Convert all tabs to space or ASCII-9 (per "expandtab")," on lines 1_to_end-of-file.:set shiftwidth=4 " When auto-indenting, indent by this much." (Use spaces/tabs per "expandtab".):help tabstop " Find out more about this stuff.:help vimrc " Find out more about .vimrc/_vimrc :-)
vim中tab键的相关设置
最新推荐文章于 2024-05-26 09:39:26 发布