Kana Natsuno
unread,Apr 7, 2012, 11:00:51 PM4/7/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim_dev
According to the :help i_CTRL-O --
> The CTRL-O command takes you to Normal mode. If you then use a command enter
> Insert mode again it doesn't nest. Thus when typing "a<C-O>a" and then <Esc>
> takes you back to Normal mode, you do not need to type <Esc> twice.
There are several commands to enter Insert mode, for example, a, i, S,
cc.
So I think that Insert mode will never be nested even if such commands
are
used after <C-o>. But Vim seems not to behave so. For example:
$ vim -u NONE -N -e -s -c 'execute "normal!" "ifoo\<C-o>abar
\<Esc>Fb" | verbose echo getline(1, "$") line(".") col(".") | qall!'
['foobar'] 1 4
$ vim -u NONE -N -e -s -c 'execute "normal!" "ifoo\<C-o>ccbar
\<Esc>Fb" | verbose echo getline(1, "$") line(".") col(".") | qall!'
['barFb'] 1 5
$ vim -u NONE -N -e -s -c 'execute "normal!" "ifoo\<C-o>Sbar
\<Esc>Fb" | verbose echo getline(1, "$") line(".") col(".") | qall!'
['barFb'] 1 5
<C-o>a works as documented. But both <C-o>cc and <C-o>S don't work as
documented. They behave as if Insert mode is nested.
Furthermode, <C-o>cc and <C-o>S work as documented if they are
interactively
typed by user. The "nested" behavior only happens if <C-o>cc and <C-
o>S are
executed via :normal or :map.
Is this behavior intentional?
I confirmed it with the following :version:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 8 2012 11:17:30)
MacOS X (unix) version
Included patches: 1-494
Compiled by kana@avril
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
+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: "/Users/kana/.vvm/vims/vimorg--v7-3-494/share/
vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -no-
cpp-precomp -g -O -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -
framework Cocoa