" configure expanding of tabs for various file types au BufRead,BufNewFile *.py set expandtab au BufRead,BufNewFile *.c set noexpandtab au BufRead,BufNewFile *.h set noexpandtab au BufRead,BufNewFile Makefile* set noexpandtab au BufWritePre *.py :%s/\s\+$//e " -------------------------------------------------------------------------------- " configure editor with tabs and nice stuff... " -------------------------------------------------------------------------------- set expandtab " enter spaces when tab is pressed set textwidth=120 " break lines when line length increases set tabstop=4 " use 4 spaces to represent tab set softtabstop=4 set shiftwidth=4 " number of spaces to use for auto indent set autoindent " copy indent from current line when starting a new line " make backspaces more powerfull set backspace=indent,eol,start set ruler " show line and column number syntax on " syntax highlighting set showcmd " show (partial) command in status line set showmode set pastetoggle=<F2>
本文介绍如何为不同类型的文件配置编辑器的Tab设置,包括使用空格代替Tab,设置文本宽度,以及自动缩进等技巧,以提高代码编辑效率与美观。
570

被折叠的 条评论
为什么被折叠?



