1

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

起始文件:

line 1
line 2
line 3 █ 

之后3dd

line 1
line 2
line 3 █ 

之后k3dd

line 1 █ 
4

1 回答 1

0

我会说错误,因为 dd 将删除该行...

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

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

我的vi

    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"
于 2013-05-23T10:02:18.237 回答