为什么3dd不能在vim的最后一行工作?

时间:2013-05-23 09:57:57

标签: vim

如果我使用光标在文件中的倒数第二行进行3dd,则会按预期删除两行。如果我对最后一行的光标做同样的事情,我希望删除一行,但这不会发生。为什么会出现这种差异?

开始文件:

line 1
line 2
line 3 █ 

3dd之后:

line 1
line 2
line 3 █ 

k3dd之后:

line 1 █ 

1 个答案:

答案 0 :(得分:0)

我会说bug,因为dd会删除该行......

编辑:是的,我可以使用dd前面的任何其他数字重现该行为......

Edit2:除了1dd,它按预期工作。对我来说这是一个错误......

我的vim

    VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr  5 2012 10:17:30)
    Included patches: 1-411
    Modified by <bugzilla@redhat.com>
    Compiled by <bugzilla@redhat.com>
    Huge 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
    +cryptv +cscope +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
    +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
    -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte
    +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript
    +printer +profile +python +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: "/etc/vimrc"
         user vimrc file: "$HOME/.vimrc"