Loading ...
Sorry, an error occurred while loading the content.

Re: vim script question

Expand Messages
  • Benji Fisher
    ... I do not think that &insertmode tells you what you think it does. ... In a script, you are always in Command-line mode, except when you explicitly switch
    Message 1 of 5 , Nov 30, 2003
    • 0 Attachment
      On Sat, Nov 29, 2003 at 04:35:02PM -0800, ryan kulla wrote:
      > in a script how can i tell if im in visual mode? I know to find out if im in
      > insert-mode i can check the return value of &insertmode, but theres no
      > &visualmode

      I do not think that &insertmode tells you what you think it does.

      :help 'insertmode'

      In a script, you are always in Command-line mode, except when you
      explicitly switch to another mode.

      :echo "This is Command-line mode."
      :execute "normal aThis is Insert mode.\<Esc>"

      Perhaps with some contxt, I can give a more satisfactory answer.

      HTH --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.