Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:51:02+00:00 2026-06-08T05:51:02+00:00

In vim , if I execute the following from the command line :normal! i

  • 0

In vim, if I execute the following from the command line

:normal! i

vim does not enter insert mode. Likewise the command

:normal! A

will move the cursor to the end of the line, but the cursor remains in insert mode.

Any ideas why this doesn’t work? Failing that I would like to know an alternative way to enter insert mode from the body of a vimscript function (and have insert mode persist after the function returns of course).

Edit: Looks like :startinsert will fullfill the second part of the question, but I’m still wondering how I can do something like :normal! A or :normal! a and why those don’t simply work as expected. Simulating “append” with arrow movements is a bad solution, because of things like empty lines and such.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:51:03+00:00Added an answer on June 8, 2026 at 5:51 am

    The normal command considers ending in insert mode as an incomplete command and aborts. From help normal:

    {commands} should be a complete command. If {commands} does not
    finish a command, the last one will be aborted as if <Esc> or <C-C>
    was typed. The display isn’t updated while “:normal” is busy. This
    implies that an insert command must be completed (to start Insert
    mode, see :startinsert)

    :startinsert might be the command you are looking for.

    :normal A can be achieved by appending a bang (!) to startinsert, as suggested by Ingo Karkat. From help startinsert:

    When the ! is included it works like “A”, append to the line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to execute a Vim command on a file from the
I have the following Vim-function: fu! Create_file_and_write_to_it(name, text) new execute normal i . a:text
How can I execute a command in Vim, under the cursor? On the (word)
I'm trying to add an autocmd to vim that will execute whenever I open
I'm trying to insert the following autocommand into Vim: autocmd BufEnter *.c :call SourceTagsVim()<CR>
I need to execute vim commands on thousands of files without suffering from interactive
Sometimes a Vim command takes too much time to execute. Typical example : gf
In VIM script, i want to check if VIM was started with command-line arguments
I want to execute a command automatically after cd'ing to a new directory from
In VIM, I want to execute a command (like :!mkdir src/main/scala/xxx ) Then, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.