Vim插入模式不允许编辑文件中的现有行,只允许新添加的行

时间:2012-02-15 17:17:28

标签: vim

过去,当我在现有文件上进入插入模式时,我可以点击“删除”,这样就行了。现在我仍然可以删除和修改我新添加到文件中的内容,但是如果在我打开文件时有现有内容,我就无法删除它。我只能删除和修改新内容。但是,在插入模式下,我仍然可以使用常规dd类型命令删除内容。我的.vimrc非常简单,我唯一的插件就是SuperTab。

如果有帮助,这是我的.vimrc:

set tags=./tags,~/kent/src/tags,~/kent/src/lib/tags,~/kent/src/inc/tags,~/kent/src/hg/lib/tags,~/kent/src/hg/inc/tags,~/kent/src/jkOwnLib/tags  
syntax on
filetype indent plugin on
set modeline
au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
set background=dark
set wildmode=longest,list,full
set wildmenu

以下是vim --version的输出:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Feb  8 2012 10:41:54)
Included patches: 1-434
Compiled by John St. John
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent 
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
-conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path 
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv 
+insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent 
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 
-mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse 
+mouse_xterm -mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg 
+path_extra -perl +persistent_undo +postscript +printer -profile +python 
-python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent 
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
+tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
 -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/cluster/home/jstjohn/share/vim"
Compilation: gcc44 -c -I. -Iproto -DHAVE_CONFIG_H     -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/usr/include  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  
Linking: gcc44   -L/usr/local/lib -Wl,--as-needed -o vim       -lm -lncurses -lnsl  -lselinux      -L/hive/groups/recon/local/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic  -L/usr/lib -ltcl8.4 -ldl -lpthread -lieee -lm    

1 个答案:

答案 0 :(得分:1)

您最有可能需要set backspace+=start。通常你可能想要set backspace=indent,eol,start,但只是“开始”应该特别解决这个问题。

有关其他选项的详情,请参阅:help 'backspace'