加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vim中的可视块编辑

发布时间:2020-12-15 21:52:10 所属栏目:安全 来源:网络整理
导读:我已经参考这个 post在vim中使用块编辑.但是当我在块选择后键入I或c时,vim进入正常编辑模式,就像我按下了i一样.我还发现,当选择块时,我可以使用x键删除块中的字符. 在按I之前: 按I后: 如何阻止输入字符? visualextra已从以下版本信息启用. $vim --version
我已经参考这个 post在vim中使用块编辑.但是当我在块选择后键入I或c时,vim进入正常编辑模式,就像我按下了i一样.我还发现,当选择块时,我可以使用x键删除块中的字符.

在按I之前:

enter image description here

按I后:

enter image description here

如何阻止输入字符?

visualextra已从以下版本信息启用.

> $vim --version VIM - Vi IMproved 7.4 (2013 Aug 10,compiled Jan  2
> 2014 19:39:47) Included patches: 1-52 Modified by
> pkg-vim-maintainers@lists.alioth.debian.org Compiled by buildd@ Huge
> version with GTK2-GNOME GUI.  Features included (+) or not (-):
> +acl             +farsi           +mouse_netterm   +syntax
> +arabic          +file_in_path    +mouse_sgr       +tag_binary
> +autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
> +balloon_eval    +float           +mouse_urxvt     -tag_any_white
> +browse          +folding         +mouse_xterm     +tcl
> ++builtin_terms  -footer          +multi_byte      +terminfo
> +byte_offset     +fork()          +multi_lang      +termresponse
> +cindent         +gettext         -mzscheme        +textobjects
> +clientserver    -hangul_input    +netbeans_intg   +title
> +clipboard       +iconv           +path_extra      +toolbar
> +cmdline_compl   +insert_expand   +perl            +user_commands
> +cmdline_hist    +jumplist        +persistent_undo +vertsplit
> +cmdline_info    +keymap          +postscript      +virtualedit
> +comments        +langmap         +printer         +visual
> +conceal         +libcall         +profile         +visualextra
> +cryptv          +linebreak       +python          +viminfo
> +cscope          +lispindent      -python3         +vreplace
> +cursorbind      +listcmds        +quickfix        +wildignore
> +cursorshape     +localmap        +reltime         +wildmenu
> +dialog_con_gui  +lua             +rightleft       +windows
> +diff            +menu            +ruby            +writebackup
> +digraphs        +mksession       +scrollbind      +X11
> +dnd             +modify_fname    +signs           -xfontset
> -ebcdic          +mouse           +smartindent     +xim
> +emacs_tags      +mouseshape      -sniff           +xsmp_interact
> +eval            +mouse_dec       +startuptime     +xterm_clipboard
> +ex_extra        +mouse_gpm       +statusline      -xterm_save
> +extra_search    -mouse_jsbterm   -sun_workshop    +xpm    system vimrc file: "$VIM/vimrc"
>      user vimrc file: "$HOME/.vimrc"  2nd user vimrc file: "~/.vim/vimrc"
>       user exrc file: "$HOME/.exrc"   system gvimrc file: "$VIM/gvimrc"
>     user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc"
>     system menu file: "$VIMRUNTIME/menu.vim"   fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H
> -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/harfbuzz   -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/x86_64-linux-gnu/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/libpng12     -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/usr/include/tcl8.6  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1 Linking: gcc   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic -Wl,-E  -Wl,relro -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype     -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lfreetype -lgconf-2 -lgthread-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0   -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.2 -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.18/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions  -L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm  -L/usr/lib

解决方法

在视觉块模式下按I后,vim似乎已进入插入模式.但是当您退出插入模式并再次进入正常模式时,您将看到在插入模式下按下的键已在整个选定的块中生效.

这个link有一个演示版

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读