以下是我完整的 .vimrc 文件:
出现问题的地方在文件底部的
是否存在需要修复的冲突命令?还是我做错了什么?
出现问题的地方在文件底部的
set wrap
和 set textwidth=73
(我希望文件在 73 列处自动换行,但似乎并没有生效)。我仍然可以在文件中输入超过 73 列的内容。是否存在需要修复的冲突命令?还是我做错了什么?
set nocompatible
set smartindent
set cursorline
filetype plugin indent on
set background=dark
syntax enable
set grepprg=grep\ -nH\ $*
syntax on
set mouse=a
set history=1000
set showmode
if has('cmdline_info')
set ruler " show the ruler
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
set showcmd " show partial commands in status line and
endif
set backspace=indent,eol,start " backspace for dummys
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
set showmatch " show matching brackets/parenthesis
set incsearch " find as you type search
set hlsearch " highlight search terms
set winminheight=0 " windows can be 0 line high
set ignorecase " case insensitive search
set smartcase " case sensitive when uc present
set wildmenu " show list instead of just completing
set wildmode=list:longest,full
set scrolljump=5 " lines to scroll when cursor leaves screen
set scrolloff=3 " minimum lines to keep above and below cursor
set gdefault " the /g flag on :s substitutions by default
set autoindent " indent at the same level of the previous line
set shiftwidth=4 " use indents of 4 spaces
set expandtab " tabs are spaces, not tabs
set tabstop=4 " an indentation every four columns
set softtabstop=4 " let backspace delete indent
set matchpairs+=<:>
set comments=sl:/*,mb:*,elx:*/
autocmd FileType c,cpp,java,php,js,python,twig,xml,yml autocmd BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))
set foldmethod=syntax "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set foldlevel=0 "this is just what i use
set wrap
set textwidth=73
set formatoptions+=t
编辑:我希望VIM可以在73行时自动换行(实时)。这是可能的吗?我已经尝试添加set formatoptions+=t
来包装文本,但它仍然没有效果。
:verbose set tw
命令,查看覆盖设置的原因。很可能是某个(文件类型)插件所导致的。 - sehe