Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [insert-mode]

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

0
votes
2answers
61 views

How to put a word into like as if in R (type over) mode? [duplicate]

What I need to do is yank a word (yw) and then move my cursor to a diffent location and "paste" the word over whatever follows the cursor without disturbing the other characters in the line "yw" ......
0
votes
1answer
29 views

How to show the left-hand side of insert mode mappings while invoking them in Neovim

Much like what was asked in this question: I want Neovim to show what I type, and keep recognising it as a mapping in progress even if I use Backspace or Delete. This is actually a very useful ...
0
votes
0answers
23 views

“--INSERT--” doesn't go away with a remapped escape key

I remapped the Esc key to jj as follows: inoremap jj <esc>l If I only put <esc> the cursor is always one letter to the right, however once I add the l the notification message --INSERT -...
1
vote
1answer
17 views

Vim doesn't extend Roxygen R comments

I'd like it if, when filling out my Roxygen comment snippet, #' Title #' #' @param #' #' @return #' #' @examples #' #' #' @export ...
0
votes
1answer
43 views

May I have a Vim session report its “Mode” in its “Window Title”?

Clarification of the moving parts First, let me clarify what I mean by "Window Title", and what I expect to achieve On Windows OS, GUI programs will have three attributes: its Window Title texts, ...
3
votes
1answer
54 views

Exiting and entering insert mode again with key-binding

I'd like to experiment one of the tip by Drew Neil in his Vimcast, that is to "escape" regularly, so that it gives more granularity to the "undo" command. For example, I write one short sentence. ...
0
votes
1answer
53 views

How to enter insert mode on the next line without creating a new line?

If my cursor is at position * below, how can I enter insert mode at the beginning of the next line without creating a newline? o does what I want, except that it adds an additional unwanted line into ...
3
votes
1answer
62 views

Insert comma on new line in array

I like to format my arrays like this: myArray = [ "lorem" , "ipsum" , "dolor" , "sit" , "amet" ]; If I open a new line below the "amet" line, I ...
1
vote
2answers
35 views

How to copy all non-alphanumeric characters at the begining of the line to the next line?

I want to implement something similar to Org mode M-RET into neovim. In Org mode it creates new list item or heading depending on what line the point is on. I'm thinking of a mapping in neovim that ...
1
vote
1answer
26 views

Editing diffs in-line in vim

I want to be able to make the changes that I’m making to certain files a lot more visible while I’m editing them. Does any plugin or functionality of vim allow for viewing the editing history of the ...
0
votes
0answers
37 views

i<c-e> and i<c-y> copy to end of line

In insert mode <c-e> and <c-y> copy a character at a time from the above line. I generally use these when working with aligned bits of text inside a program and want to copy to the end of ...
0
votes
1answer
34 views

Make conditional imap to text being enclosed in certain characters

How can I create mappings that work only if the cursor is enclosed by certain characters? As an example, I want to map ja to \alpha if the cursor is enclosed by $$ or by \[\] so as to make This jar ...
1
vote
1answer
38 views

Insert Page break ^L automatically after specific number of lines/characters?

How could VIM (script?) insert ^L (page break) and /r on an empty line, automatically after every 30 Lines OR 1800 characters while writing? Any ideas?
2
votes
2answers
144 views

How to light the Caps Lock LED when in insert mode (on GNU/Linux)?

On Xubuntu LTS, I already managed to remap CapsLock to Esc. However, now I discovered some Vim users are lighting the Scroll Lock LED, Caps Lock LED or even the entire keyboard to indicate that (g)...
0
votes
1answer
40 views

How to make this work in insert/edit mode too?

I want to switch between tabs, but this works only in command mode. Is it possible to make this work in edit (insert?) mode too? noremap <C-k> :tabprevious<CR> noremap <C-l> :...
1
vote
1answer
47 views

How to stop “tab” key indenting whole line

In one version of VIM that I run, when I hit the "tab" key in insert mode, it indents the whole line, regardless of the cursors position in the line. Here is what I believe to be the only modified ...
2
votes
1answer
31 views

How to source an Ex file and automatically go to Insert mode

I want to have a simple alias to take quick notes. Each note starts with the current date and time (ISO 8601). The alias should: Start vim Add the current date and time Position the cursor in the ...
1
vote
1answer
46 views

How do I find commands that're available in insert mode?

I know of 4 commands I can use in Vim's insert mode. C-w delete word C-k delete line C-d delete one 'shiftwidth' worth of indent C-t add one 'shiftwidth' worth of indent C-O begin a quick command. ...
1
vote
3answers
56 views

Substitute an insert-mode input immediately

I would like to type begin! in insert mode and having it immediately replaced by: begin [cursor here] end I considered mappings: :inoremap begin! begin end<Left><Left><Left><...
1
vote
0answers
36 views

remap keybinding for vim gocode autocomplete feature? (remap keybinding in insert mode) [duplicate]

So I installed vim-go and gocode and Blackrush/vim-gocode.git (the latter because I use pathogen). So far so good! I am fine, I can type <C-x><C-o> in insert mode and I get completion ...
1
vote
2answers
94 views

Scroll view up or down while in insert mode

I really like Ctrl-E and Ctrl-Y in normal mode, which expose additional lines at the bottom or top of the screen (respectively) without moving the cursor. I'd like to do the same thing in insert mode ...
0
votes
1answer
37 views

How to invoke mapped `i_CTRL-W` in function

First I will describe what I am trying to achieve: In general I use set iskeyword+=- as I see this more usable (one should always put spaces around operators when needed). This is quite helpful, but ...
1
vote
1answer
33 views

Going to the start of insert command on exit

Hi Vi StackExchange, A Picture of what I want Say I have the following in my buffer: foo("a", "bar") And I am in normal mode with my point on b in bar. Now I want to insert some characters, say ...
1
vote
0answers
31 views

how to edit the command when copy into conque

I am using conque plugin in Vim. When I copy some content into conque, it seems only possible to edit at the end of the command. What I wish to do is to copy something into conque and change a little ...
9
votes
1answer
466 views

Is there a prepend insert mode?

I was trying to write a string with all chars from z to a and I thought this would be much easier if I could write backwards. The idea would be like an INSERT mode in which the cursor doesn't step ...
0
votes
1answer
39 views

Is there possibly something wrong with (i)mapping the left bracket?

I've been using the vim-surround plugin for as long as I can remember and have grown accustomed to typing <c-g>s ) when I want to insert text between brackets. I was writing with the atom editor ...
0
votes
1answer
253 views

Make backspace delete character and enter insert mode when in normal mode

I want the backspace to behave the same in normal mode as insert mode and it should also enter insert mode.
1
vote
1answer
65 views

Is there something like '5s' for replacing words (instead of letters)?

Given the following line this is a testing line When my cursor is on "a" and then I type 2s, it becomes this is testing line My cursor is on "t" of testing, and I am in insert mode. Is there ...
1
vote
2answers
98 views

How to not trigger InsertLeave inside an imap?

When you want to leave insert mode, it's possible to avoid to trigger the InsertLeave event by pressing Ctrl-C instead of Esc. But when I try to use this method inside an insert mapping, it still ...
0
votes
1answer
40 views

How to replace ) by <left> when closing bracket [config]

I have the following in my .vimrc, it permits to automatically close brackets. ino " ""<left> ino ( ()<left> ino ' ''<left> ino [ []<left> ino { {}<left> What I would ...
-1
votes
1answer
69 views

Insert position

Recently insert position becomes strange. i can change insert position. Sometimes insert to the left of current cursor, sometimes to the right. Caps is not activated. VIM 8.0 1-586
0
votes
2answers
36 views

How to print the filename with parent directory in insert mode?

I know that I can print whole path by Ctrlr = expand('%:p') in insert mode. I can also print head/tail with expand('%:h'), expand('%:t'). I want to print the filename with it's parent directory. ...
1
vote
1answer
69 views

Using getcompletion function for insert mode autocompletion

I recently became aware of the getcompletion function which can return autocompletion options for a variety of different things (shell commands, vim autocommand events, files, etc.). Many of the ...
1
vote
1answer
92 views

Use Python to change to normal mode

I'm writing a function that uses Vim's Python API. The function runs while I'm in insert mode and I want this function to set my mode to normal mode. I tried a few things, like for example, this ...
1
vote
0answers
52 views

Fish-like autosuggestions depending on 'completeopt'

I describe this as Fish-like as it is referenced as such by zsh-autocomplete, and I would define it as follows: The appearance of a (temporary) automatically inserted completion match, that is ...
1
vote
1answer
83 views

What is Lang-Arg in vim?

I was seeing the docs in :help map-mode where I saw that map! works for Insert and Command-line modes while lmap works on Insert, Command-line, Lang-Arg But I've never heard of Lang-Arg mode. Can you ...
0
votes
1answer
273 views

Backspace over newline [duplicate]

In Vim the Backspace key only works on the current line of text. This creates a problem if I am entering multiple lines of text and notice an error on the previous line. I have no apparent way to ...
3
votes
2answers
92 views

Replace text and move cursor to end of replacement in insert mode

How can I perform a search-and-replace and leave the cursor at the end of the replacement? I want to replace $...$ with \(...\) as I type in insert mode. Notice that I can't use an abbreviation, ...
0
votes
2answers
146 views

Linux gvim - toggle/retain insert-select mode while Shift key is pressed

I noticed using evim that when I press Shift key plus any direction key (so <S-Up>, <S-Down> etc., the editor automatically switches to insert-select mode, letting me select the text block ...
0
votes
2answers
471 views

Vim is in read-only mode [duplicate]

I'm using vim for scripting and configs and noticed that I sometimes forget to open file with sudo and therefore when I made some editings I got the error: E45: 'readonly' option is set (add ! to ...
4
votes
1answer
192 views

Using a no-op key in insert mode, can't use key after using no-op mapping

I have the following bindings in my ~/.vimrc to make it easier to "disengage" some of my insert-mode key-bindings. Here's an example. ` for <Nop> and `` to enter a literal `. inoremap ` <...
2
votes
1answer
1k views

What does CTRL-K do in insertion mode?

When I press ^K in my vim while I'm in insertion mode a '?' appears and then if I press a and then another character some strange characters appear the following are a few of the characters I could ...
1
vote
1answer
47 views

Insert text automatically surrounded by other text

For easy typesetting of song sheets using the leadsheets LaTeX package I want to make a shortcut for vim. Using the leadsheets package, chords are inserted into the lyrics like this: ^{Am7}Sunny So ...
7
votes
2answers
1k views

Start Vim in insert mode for new files

I mostly use Vim to edit configuration files so I understand why it starts in normal mode. But I also use vi mode for the REPL (bash, zsh, ipython, etc.) and the shell always starts in insert mode (...
1
vote
1answer
140 views

Map autocomplete word in normal mode?

I want to map , in normal mode to function as autocompleting a word <c-n> in insert mode. Also, I want to keep pressing , in normal mode to cycle through the list and then finally when I finish ...
0
votes
1answer
37 views

How to make `i_ctrl-o` unaffected by the mode from which we entered insert mode?

By default, C-o allows to execute a normal command from insert mode. Example: foo bar| baz ^ represents the cursor The current mode being insert mode, and the cursor being after the word bar, ...
3
votes
1answer
784 views

Deleting and inserting in a single visual block selection

I'm trying to understand how the visual-block mode deals with Backspace and Delete, and if it is possible to vertically select a column of text, delete some characters, then insert new ones in a ...
0
votes
2answers
604 views

Have backspace delete whole tabs

Under regular conditions, the tab key will insert a tab character and backspacing that tab deletes the whole tab character. I have set up expandtab and softtabstop=4 so that when I hit tab it will ...
4
votes
2answers
226 views

Case-insensitive abbreviations

I use abbreviations extensively to make writing in languages other than English easier. For example, I have something like this set up for when I'm writing in Italian: inoreabbrev perche' perché ...
3
votes
2answers
157 views

Automatically change interface colors for normal(visual) vs input mode

I have found a related question here: Automatically set the 'number' option in Vim when entering Ex mode, set 'nonumber' in visual mode Still I am not sure that I can follow those ...