Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [insert-mode]

The mode in Vi and Vim in which you can insert text to the open document.

Filter by
Sorted by
Tagged with
0 votes
1 answer
42 views

Vim: move in the INSERT mode between lines using left/right arrow keys

In Vim while in the INSERT mode, I would like to be able to move between lines using the left and right arrow keys. For example, if the cursor is at the beginning of a line and I press the left arrow ...
nvx's user avatar
  • 9
2 votes
2 answers
55 views

How can I jump outside the scope of LaTeX delimiters?

I want to define insert mode mappings that will jump outside the scope of any delimiter I'm in (forward/backward). Where "delimiter" is in the broad sense of LaTeX delimiters, so not only {},...
Ur Ya'ar's user avatar
  • 127
1 vote
1 answer
79 views

Going to insert mode at the end of command with lua function

I am using Neovim and I want to go to insert mode at the end of this command. vim.cmd([[command! DunB lua run_only_current_file("below") ]]) I have tried | startinsert and | :startinsert. ...
mohamadi_arch's user avatar
1 vote
1 answer
132 views

Searching for text while in insert mode of Neovim

I know how to search for text in visual mode in Vim/Neovim. However, I find it unnecessary when I am in insert mode to have to exit it, search and then come back to insert mode. Is there a way to ...
user3236841's user avatar
1 vote
1 answer
38 views

Stop repositioning last line at bottom of window

I've just noticed that if the cursor is at the last line of a file and I enter insert mode, then the buffer pans so that the cursorline is at the bottom of the [sub]window, as if in response to a zb ...
user2153235's user avatar
0 votes
1 answer
49 views

Lua insert mode mappings are pasting the rhs in buffer instead of executing them

In my init.lua, I've got some keys bound to some actions in insert mode. e.g.: vim.keymap.set('i', '<C-j>', '<Plug>(easymotion-bd-w)') But when I press Ctrl-ew, instead of highlighting ...
technicguy1's user avatar
0 votes
1 answer
358 views

Edit multiple lines and insert

Say I have a text file: abc abc abc I want to change it to this: adbc adbc adbc My current way of doing this is to move the cursor to the b in the first (or last) line, select the column of bs with ...
cheersmate's user avatar
2 votes
1 answer
63 views

Behaviour of Neovim when in insert mode is different from expected

I recently switched from vim to neovim. I have the following keybindings in neovim: vim.keymap.set("i", "0", "<Esc>la", { noremap = true }) vim.keymap.set("i&...
caffeinemachine's user avatar
0 votes
0 answers
153 views

Popup when writing in insert mode part of a string that has been bound to something else

I recently switched from vim to neovim. I have been struggling with the behaviour of neovim while editing which is at times different from that of vim. I have the following keybinding vim.keymap.set(&...
caffeinemachine's user avatar
1 vote
1 answer
121 views

Cursor position 'o' and 'O' insert command with count number

The default behaviour of the o and O when prepended with a count is to keep the cursor always at the bottom. I'm wondering if there's a native way to get the cursor at the top. The way I'm doing this ...
ranemirusG's user avatar
0 votes
1 answer
39 views

How does <cword> work in insert mode?

Basically I want to access the last \w\+ in my current insertion. (Hence I asked this question.) Another solution I thought of was something like the following (I'm echoing, but clearly I'd pass it to ...
Enlico's user avatar
  • 2,214
4 votes
2 answers
2k views

Neovim how to keep the diagnostic message in insert mode?

When I upgrade Neovim 0.8.3 to 0.9.0, the plugin lsp-setup.nvim diagnostic message disappears when the content is entered in insert mode. After exiting insert mode, the diagnostic message appears ...
sharp's user avatar
  • 41
1 vote
1 answer
142 views

Why does not Neovim support 'insertmode' option, and will the Neovim support it in the future?

Vim has the option: 'insertmode'. Why does not Neovim support the 'insertmode' option?
Maksym's user avatar
  • 11
-1 votes
1 answer
131 views

What does Ctrl+e & Ctrl+y do in insert mode of Vim? I have accidentally found out a funny cmd which I don't know what's the application

In normal mode: Ctrl+y Scrolling screen dw with the cursor staying on the same line Ctrl+e Scrolling screen up with the cursor staying on the same line However in insert/edit mode: ...
andrew_ysk's user avatar
0 votes
0 answers
98 views

Insert-mode gqip not idempotent?

I open Vim and add the following lines to a buffer (call this state INITIAL): xx xx xxx xx xxxx xx xxxxx xxxxxxxx xxxxx xxxxxxxxxxx x xxxxx xxx xxxx xxx x xx xxxxxx xxx xxxxxxx xxxxxx xx x xxx xx xxx ...
IssaRice's user avatar
  • 133
2 votes
1 answer
168 views

How to implement a symbol keyboard layer in Vim?

I recently came across this question: Mapping symbols and special characters to home row in insert mode, which introduced me to the idea of a symbol layer on the keyboard. This seems like a nice thing ...
Paul's user avatar
  • 23
1 vote
1 answer
936 views

<Tab> out of insert mode - lua keymap

I'm a relatively new neovim user. I use nvim-autopairs to always induce matching (, [, {, ', " character pairs, and automatically placing my cursor inside them. As an example, in insert mode, if ...
user4687531's user avatar
0 votes
1 answer
36 views

Why inoremapping <c-e> shadows <c-e> completion functionality?

Foreword Open a new file with vim -Nu NONE and insert the following text (| is to indicate the position of the cursor, in insert mode) longline lo| longerline Now hit Ctrl-XCtrl-N and the ...
Enlico's user avatar
  • 2,214
0 votes
1 answer
40 views

What other than mappings and abbreviations can change the text I'm typing?

The question When editing TeX files (to do so, I use vimtex) if I've discovered that if I write lll in insert mode, I get \ell. How do I find why this is happening? My research I thought "ok, I'...
Enlico's user avatar
  • 2,214
0 votes
2 answers
3k views

How to select all text and delete in vi?

Is it possible to select all the text and delete it it in vi other than hitting backspace?
kraber's user avatar
  • 1
1 vote
2 answers
41 views

lnoremap doesn't seem to apply to insert mode when mapping an unwanted key combo to nop

This is a follow up to this question of mine. I found out that having :noremap ^[[29^ <Nop> in my vimrc is not enough to disable the unwanted effect of Ctrl+Menu in insert mode, so I looked at :...
Enlico's user avatar
  • 2,214
0 votes
0 answers
69 views

Vim automatically inserts "* " add the start of every new line in css files

If theres a "* " at the start of the previous line Vim automatically inserts a "* " at the start of the next new line. I want Vim to not insert anything. examples: 1|* {margin: 0;} ...
kongou's user avatar
  • 1
2 votes
1 answer
191 views

How can I have <C-E> and <C-Y>'s normal mode functionalities also work in insert mode?

Once I've asked a general question about special characters, but I've not really pulled anything out of it. So now I'm asking a very specific question. I want to have Ctrl+e and Ctrl+y behave in ...
Enlico's user avatar
  • 2,214
0 votes
1 answer
1k views

How can I have multiple cursors while entering insert mode after Visual Block mode?

Let's say I have some text: ipsum ipsum dolor ipsum dolor sit I want to add the word "Lorem" in front of each line. Loremipsum Loremipsum dolor Loremipsum dolor sit I can do this by: ...
Amarakon's user avatar
  • 261
2 votes
1 answer
67 views

Where is the text data stored during typing text in insert mode?

I would like to develop a small app in React and Nodejs that sends real-time typed text from my Nodejs/Express server to my React frontend. To do this, I would like to use socket.io. The text data is ...
Piet Pro's user avatar
1 vote
0 answers
13 views

How can I get language and keyword completion in omnifunc? [duplicate]

Let's say I'm editing this Python script: something = 1 something_else = 2 My cursor is on the third line, in insert mode. When omnifunc is unset, <C-X><C-O> displays an error: E764: ...
Big McLargeHuge's user avatar
0 votes
1 answer
36 views

How do I type an insert mode command?

I've recently read that some people put inoremap jk <Esc> on their vimrc to exit insert mode without having to move their hands away from the home row. But then how do you type the letters jk? ...
Katie And's user avatar
1 vote
1 answer
78 views

Using an inoremap with `r`

I have some inoremap's in my vimrc, such as inoremap \c <c-v>u2705 which enters a ✅ emoji for when I am writing checklists. However, I noticed that while I am able to use it when in insert mode ...
WalksB's user avatar
  • 507
3 votes
1 answer
340 views

How to undo in ctrl-x mode?

Let's say I just completed following path using Ctrl-x, Ctrl-f (twice) and I haven't exited the Ctrl-x mode yet and I got /home/john.doe/ Let's say I chose john.doe accidentally and actually want to ...
flawr's user avatar
  • 185
1 vote
1 answer
41 views

Odd behaviour when pressing Tab with this mapping

I am trying to map ctrl+shift+i to insert an italics command in LaTeX files, and here's my attempt: autocmd BufNewFile,BufRead,BufWrite *.tex inoremap <buffer> <c-I> \textit{}^[i I am ...
Alvaro Neto's user avatar
1 vote
1 answer
669 views

Cursor not changing to beam in insert mode when using Kitty terminal

Well the common problem again. I could fix my problem for Konsole by adding " Fix cursor for Konsole let &t_SI = "\<Esc>]50;CursorShape=1\x7" let &t_EI = "\<Esc>...
neolith's user avatar
  • 133
1 vote
1 answer
157 views

Ctrl+Arrows work differently in normal mode and in insert mode

For some reason, in my VIM there is a difference in behaviour of Ctrl+Arrow keys in normal mode and in insert mode. To demonstrate this, I edit the file which contents are: aaa.aaa,aaa/aaa!aaa@aaa#aaa$...
CoderFF's user avatar
  • 21
2 votes
2 answers
344 views

Opening files in insert mode

How do I make vim open files in insert mode? I've got the line "startinsert" in my .vimrc, and it does what it's supposed to (vim opens in insert mode), but when I open another file it opens ...
Daniel's user avatar
  • 21
1 vote
1 answer
46 views

Unexpected behavior in edited vimrc: dropped out of insert mode when hitting empty line

sorry for the bad title. I could not think of how to better summarise the problem. I should also state, that I am fairly new to vim, so please be a bit considerate :). I made the following changes in ...
I.P's user avatar
  • 13
0 votes
0 answers
85 views

Modifying file in vim and after restart the file is reset to unmodified

I have two monitors and the second one is detected as primary even tho I made the actual one primary in the settings. I found a hacky metod to make it primary and it involves changing the files. I ...
Bobo Todorov's user avatar
0 votes
2 answers
76 views

How to yank the filename of specific buffer?

Is there a (simple) way to yank the filename of specific buffer in insert mode? For example, in insert mode, Ctrl+R % gives the name from current buffer, Ctrl+R # gives the alt one, but what about an ...
IvanDi's user avatar
  • 99
0 votes
1 answer
95 views

alt dot to insert the last word of previous line

In bash shell, alt + . inserts the last argument of the previous command. and there are alt + (number) + . and alt + , variations. I like to do the same while editing shell script in vim, i.e. I want ...
auditory's user avatar
  • 170
0 votes
0 answers
60 views

Vim doesn't respect inoremap bind in insert mode for windows wsl config

I have these two configs :nnoremap <F5> "=strftime("%F %r")<CR>P :inoremap <F5> <C-R>=strftime("%F %r")<CR> In normal mode f5 inserts date-time,...
eguneys's user avatar
  • 145
0 votes
0 answers
129 views

Neovim diffrent behaviour than vim on spelling sugestion

First thing first I am writing a foreign language with a different keyboard(greek-english). I was trying some spell checking features of vim and neovim and I noticed that neovim might have a bug. At ...
Spyros Mourelatos's user avatar
0 votes
1 answer
303 views

keyboard shortcut to insert text at the end of several lines of same length instead of 10,12s/$/pattern_to_be_inserted/gc

to insert the same text inside several lines in one particular line <ctrl> + <v> to select the line and then <shift> + <i> to insert a texte BEFORE the particular column. Is ...
ecjb's user avatar
  • 149
2 votes
3 answers
2k views

Exit insert mode and write to file in one command

Is there a command to exit insert mode and perform :w or :wq in the same command? I am tired of pressing esc + :w every time I need to write to a file after making edits. Alternatively, is there an ...
Origami's user avatar
  • 29
0 votes
1 answer
207 views

How to insert on a newline, pushing everything after the cursor down with it

Say my cursor is []: (A very intelligent turtle[)] I'd like to issue something like o that would put me in insert mode here: (A very intelligent turtle [)] I'm using spacemacs.
mcp's user avatar
  • 169
0 votes
0 answers
43 views

What does the "§" key do in insert mode? [duplicate]

I stumbled into a weird behavior when using vim and it has been month of me just enduring it. When in insert mode, when I type on the "§" key my cursor jumps into my file.\ :h § doesn't ...
Leo's user avatar
  • 101
1 vote
1 answer
590 views

Set cursor anywhere in window

How to setup Vim so you can f.e mouse click in the middle of new opened empty Vim window and place cursor exactly there ( f.e line 23 char 49), instead of line 1 char 1 because? Is there better way ...
kondziorf's user avatar
1 vote
1 answer
571 views

How to delete .yaml elements like maps or arrays efficiently in Vim?

I often need to edit huge .yaml files, where I need to delete entire maps or arrays. My current approach is to go into visual (line-wise) mode (Shift + V) and mark the lines manually, but that feels ...
Shuzheng's user avatar
  • 1,255
1 vote
2 answers
350 views

How to go to the nth-to-last character in insert mode?

Capital A in Vim takes me to the last character in insert mode, but can I go to the nth-to-last character in insert mode (or append mode) in vim? Example: this is some t|ext how to go specifically to ...
an4s911's user avatar
  • 111
2 votes
1 answer
277 views

Delete from cursor position until end of line in command-line mode

I am trying to emulate readline keybindings in insert and command-line modes (for example, <C-u> for deleting from cursor position to beginning of the line, or <C-w> to delete previous ...
mgarort's user avatar
  • 275
1 vote
2 answers
171 views

Tab to align cursor with next non-whitespace character in the line above (in insert mode)

How can we do this with vim? set hlsearch " Highlight search matches set incsearch " Highlight search matches as you type set visualbell ...
webninja's user avatar
1 vote
1 answer
784 views

How to set a keybinding in Insert mode

I'm new to Vim, and I've read that a best practice in Vim is to begin a new Append with each line. In other words, instead of pressing <Enter>, it is more advisable to leave Insert mode, and ...
Yehuda's user avatar
  • 275
0 votes
1 answer
300 views

Replacement of characters gives ^@ when replaced with newline but not newline [duplicate]

Why does replacement of something by using :%s/,/\n/gc in vim gives me ^@ instead of giving me newline. Sed replacement works perfectly sed s/,/'\n'/g. Any idea how to do sed thingy in Vim and save ...
Machinexa's user avatar
  • 103

1
2 3 4 5 6