Questions tagged [insert-mode]
The mode in Vi and Vim in which you can insert text to the open document.
274
questions
0
votes
0
answers
31
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 ...
2
votes
1
answer
33
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 ...
1
vote
1
answer
94
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 ...
0
votes
1
answer
19
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 ...
0
votes
1
answer
32
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'...
0
votes
0
answers
13
views
Getting mode after feedkeys
I'm trying to run keys through feedkeys and extract what mode I end up with. Sadly every time feedkeys is run either it ends up in normal or the method hang. I tried with the "\<Ignore>&...
0
votes
2
answers
95
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?
1
vote
2
answers
34
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 :...
0
votes
0
answers
40
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;}
...
2
votes
1
answer
100
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 ...
0
votes
1
answer
219
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:
...
2
votes
1
answer
44
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 ...
1
vote
0
answers
12
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: ...
0
votes
1
answer
32
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? ...
1
vote
1
answer
67
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 ...
3
votes
1
answer
107
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 ...
1
vote
1
answer
37
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 ...
0
votes
1
answer
332
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>...
1
vote
1
answer
60
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$...
2
votes
2
answers
106
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 ...
1
vote
1
answer
39
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 ...
0
votes
0
answers
31
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 ...
0
votes
2
answers
50
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 ...
0
votes
1
answer
38
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 ...
0
votes
0
answers
44
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,...
0
votes
0
answers
90
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 ...
0
votes
1
answer
97
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 ...
2
votes
3
answers
525
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 ...
0
votes
1
answer
55
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.
0
votes
0
answers
42
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 ...
1
vote
1
answer
303
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 ...
1
vote
1
answer
282
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 ...
0
votes
2
answers
222
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 ...
2
votes
1
answer
161
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 ...
1
vote
2
answers
91
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 ...
0
votes
1
answer
229
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 ...
0
votes
1
answer
59
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 ...
3
votes
1
answer
418
views
Can macros be edited? [duplicate]
I want to end up in insert mode after a macro. Is there a way to do that?
A real life example:
Given "foo", I'm wanting to convert it into "$123" where the number is something I ...
0
votes
1
answer
31
views
Trigger complete keybind mapping using <C-O> when in Insert mode
I know that when I am in insert mode I can enter Normal mode for one command only and automatically switch back to insert mode using <C-O>. For example to go to the end of the line when in ...
2
votes
1
answer
116
views
Inserting abbreviation from file
First, I apologize if this is a trivial question.
I have the following file (main.ab) defining a Python snippet:
def main(args):
...
if __name__ == '__main__':
args = ...
main(args)
And ...
1
vote
1
answer
125
views
Auto pairing using strings instead of characters
I'm already aware of existing solution to automatically "surround" sentences/word/etc (eg: auto-surround, vim-surround, etc) but those (as far as i know) don't support using normal strings ...
-1
votes
1
answer
68
views
How to make cursor move to the top line inserted with 2O?
Using a simple example:
h[]ello
If I type 2o<esc>, the cursor will be moved to the last inserted line like this:
hello
[]
But if I type 2O<esc>, the cursor will be moved to the last ...
1
vote
2
answers
203
views
How to return to normal mode by pressing ESC only once
I have been using vim for a short time, so I may not know a lot, please forgive me.
There is a problem with my vim. It cannot enter normal mode from insert mode by pressing esc/ctrl-[ only once, but ...
1
vote
0
answers
214
views
NeoVim : Can we "insert literally" every ASCII symbol with `<c-v>` ? (including delete `^?` )
In insert or command mode, the printable ASCII chars, like a can be insert with just a
(we don't need <c-v> for those ones, but most of them will still work with <c-v>letter ).
If I type, ...
0
votes
1
answer
398
views
How to make mouse click ALSO enter Insert mode?
I've enabled mouse and clipboard and ... something else:
set mouse=a
set clipboard+=autoselect guioptions+=a
That's almost perfect, but I want it so that when I left click it moves the cursor and ...
0
votes
0
answers
26
views
How to automatically start in Normal mode? [duplicate]
I am using zsh on Mac and noticed that whenever I start vim, it always starts in insert mode. I use vim to inspect files more often than to edit. I tried adding set noinsertmode but it didn't have any ...
1
vote
1
answer
142
views
Enter insert mode automatically after moving (e.g. with e, w)
Is there something similar to A and I for "smaller ranges" like w and e, i.e. I don't want to have to press i to insert, after navigating to the end of the word with e?
0
votes
2
answers
321
views
How to backward-kill-word in Vim insert mode like zsh?
I'm re-learning Vim. My question is that I want to option + ⌫ to backward-delete a word in INSERT MODE. I've spent some days to achieve this (and succeeded) to my zsh shell through bindkey in .zshrc ...
0
votes
0
answers
19
views
Shift+AnyLetter and Forward Slash Not Working on wsltty [duplicate]
I'm noticing errant behaviour with some standard key sequences with Vim 8.1 on wsltty. The correct behaviour is displayed when inside wsltty's standard terminal, so until proven otherwise I'm assuming ...
0
votes
1
answer
762
views
When would I use append and when would I use insert?
I already know that a and i makes the cursor one space to the right and left respectively, but when would I use i to edit a file? Is there some special circumstance that makes insertion mode more ...