Questions tagged [normal-mode]

Command mode is the initial mode. Vim calls this Normal mode. Not to be confused with command-line-mode, which is what you get after you press :, /, ?, or !

Filter by
Sorted by
Tagged with
4 votes
1 answer
112 views

Why doesn't Vim recognize a pair of <\> as a single unit?

I'm kind of confused about why doesn't Vim accept di> operation on this piece of text: <This is a random text but has a backslash at the end\> but rather does on this: <This is a text with ...
nekomekoraiyuu's user avatar
3 votes
3 answers
551 views

How to move cursor, insert text, etc. freely after the end of line?

For example, to close this "box" (the $ signs added to show the end of lines), ########$ #$ # lofa$ #$ ########$ I would have to manually edit each line to add the appropriate amount spaces,...
toraritte's user avatar
  • 400
1 vote
1 answer
45 views

VIM "forgets" last edited line

I've noticed that VIM "forgets" last edited line after some time. Sometimes when I open a file that I haven't been editing since a few days (maybe 3 and more) and type '. in normal mode I'll ...
ka3ak's user avatar
  • 261
1 vote
1 answer
165 views

What is `normal! zvzz` in vimscript?

I found here the following command normal! zvzz But I don't know what it does.
linrongbin's user avatar
3 votes
1 answer
99 views

The default behavior of "di("

As is well known, di( deletes the contents inside a () block. When the cursor is not within a group of (), the cursor jumps to the near () group and delete the contents in it. Is there any way to ...
gaoqiang's user avatar
-1 votes
2 answers
89 views

What are the letter keys in vim that can be mapped along with Alt and Ctrl?

Probably the most frustrating/lame part of using vim has been the fact that a lot of the easy-to-imagine shortcuts have already been mapped to something else by the developers...For some reason, <C-...
user avatar
0 votes
0 answers
69 views

automatically execute zz after register jump?

whenever you are jumping between marks some of the marks are placed at the bottom of the screen and you have to do zz to bring them to the middle. Is there a way to auto-execute zz after each jump ...
sourcevault's user avatar
0 votes
4 answers
53 views

How to repeat substitution on the consequent lines?

Say I want to fix a mistake in the following php code: $line1 = intval($line[$1]); $line2 = intval($line[$2]); $line3 = intval($line[$3]); and do substitution on the first line with: :s/\$\(\d\)/\1/ #...
l00p's user avatar
  • 243
2 votes
2 answers
3k views

Recommended way to run vimscript normal commands with lua

What is the recommended way to run VimScript normal commands in Neovim with Lua? Sometimes, I can achieve things very easily with a few keypresses executed as a normal command compared to scripting ...
matko031's user avatar
0 votes
0 answers
184 views

Convert execute normal command into Lua

This handy dandy function inserts the current date and time on the current line after the cursor: function! InsertDate() execute "normal \"=strftime('%FT%T%z')\<CR>p" ...
Big McLargeHuge's user avatar
1 vote
1 answer
121 views

Insert result of expression after cursor

This function inserts the current date and time on the line after the cursor: function! InsertDate() put = strftime('%FT%T%z') endfunction I'd like to insert the date and time on the current line ...
Big McLargeHuge's user avatar
2 votes
1 answer
82 views

Select the current line without moving the cursor

If my cursor is in the middle of a line, how can I select the whole active line (i.e. without the possible indentations at the beginning of the line, so between ^ and $) without moving the cursor to ...
Student's user avatar
  • 121
1 vote
1 answer
33 views

How to execute a command in normal mode ignoring any mappings made to it?

For example, if I have the mapping nnoremap p ]p and want to put text only once with the unmapped p behaviour, is there a key I can press before p to bypass those mappings? Something like a shell ...
anakimluke's user avatar
1 vote
1 answer
98 views

Remap square bracket commands to fit a swiss layout keyboard

I'm new to vim and currently trying to understand the different commands. :help index shows me a list of all commands for each mode. Section 2.3 is about "Square bracket commands" like [* ...
Arber's user avatar
  • 113
2 votes
1 answer
102 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
2 answers
154 views

Passing current line as argument to external command

Say I have a file with contents: abc def https://www.google.com and my cursor is on the 3rd line. How do I: run wget/curl with the contents of that line as argument (in particular, not pass the ...
shyamsfo's user avatar
1 vote
2 answers
110 views

Ignore/map case in command prompt :edit fileName

I would like to use case-ignoring completion in the file arguments I pass to (n)vim in the internal command prompt: For example, :edit case<tab> should suggest caselower.txt and Caseupper.txt. ...
mcint's user avatar
  • 113
1 vote
1 answer
98 views

ci" or ci' doesn't work in vim key bindings for zsh command line editing [closed]

I have vim keybindings enabled for command line editing by bindkey -v. When I am trying to use ci", ci', di" or di' it doesn't work. For example: If I have a command echo "hello" '...
gmtek's user avatar
  • 145
0 votes
1 answer
35 views

How to paste below, not to the right nor to the left

Question I think you see the problem... How can I paste directly below? Is there a way? Setup I have this table and I want to copy/yank the 3 × | in visual block mode and then paste it: | sign | ...
Pixelbog's user avatar
  • 417
1 vote
1 answer
38 views

How to increase one window and make all others equal height?

I use Vim version 8.2 I have e.g. 5 windows. I have made these of equal height by normal command CTRL-W = first question: How to write this to be executed as :excommand in the EXcmd line? second ...
Anton Wessel's user avatar
0 votes
1 answer
60 views

NeoVim runs part of mapping while starting

I am using a Raspberry Pi for learning C. I use NeoVim and Mingw-GCC on the Pi over SSH. Building is done with a custom script named build. Initial builds were done by calling ./build from the command ...
Supragy Mishra's user avatar
1 vote
2 answers
25 views

Use Word for `*`/`#`

As a lot of people, I have removed _ from iskeyword, so it considers it kind of like whitespace. This is really useful for changing part of an identifier in languages like Python and Rust with normal ...
Dominik Teiml's user avatar
0 votes
0 answers
15 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>&...
user1779331's user avatar
1 vote
1 answer
36 views

How can I repeat a command a hexadecimal number of times?

The file I'm working on contains a hexdump. I pulled it directly out of memory, so it starts from an arbitrary offset, like this: 0x1234: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1244: 00 00 ...
ymbirtt's user avatar
  • 243
0 votes
0 answers
31 views

understanding and modifying an include-search map command

I found a useful map at the include-search ([I) help. map <leader>1 [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR> This opens the ...
barak.o's user avatar
0 votes
2 answers
280 views

Normal mode command in Command-line mode

I'm in the process of mapping MacOS keybindings (Cmd/Alt + arrows/backspace/delete) to Vim commands, and the only thing remaining is to make the movements in normal mode (such as b or e) work in the ...
Dominik Teiml's user avatar
0 votes
1 answer
225 views

in normal mode, How to place the cursor at the end of the line just like how insert mode behaves?

Is there a way to set the cursor in normal mode to the end of the line? for example, |abcdefg to abcdefg| not abcdef|g Cursor moves one character backwards on exiting insert mode https://stackoverflow....
NoName's user avatar
  • 3
2 votes
2 answers
449 views

How do you clear what you accidently typed in normal mode?

Vim is an interesting program and all, but I switched back to nano for the time being because normal mode keeps behaving strangely. This might be bugs, yet I think its just as likely that I accidently ...
user avatar
1 vote
0 answers
19 views

Update the display when :normal is busy

The [n]vim manual on :normal says "The display is not updated while ":normal" is busy". Is there a way to have it do so? If not, is there a plugin that defines its own version of :...
typecasto's user avatar
3 votes
1 answer
53 views

mapping to toggle whether a vowel in Unicode has a macron and whether a consonant has a dot

When writing transliterated Arabic (which looks like this: lammā aktub naṣṣan ʿarabiyyan bi-ḥurūfin lātīniyyah) I sometimes leave off a macron that should go on a vowel (e.g., ā ē ī ō ū), or a dot ...
Alex Roberts's user avatar
0 votes
2 answers
374 views

Indicate EOF / BOF in Vim?

Is there a way to turn on an indicator that states that this is the beginning or the end of the file in VIM? You can do it in SEU on the iSeries, see below:
leeand00's user avatar
  • 3,457
2 votes
2 answers
246 views

Use *-like command in normal mode to execute a find/replace

Background It's nice to be able to type * in normal mode and automatically have Vim search for the word under the cursor. Question Is there an analogous command for executing a find/replace? E.g. the ...
Alex Roberts's user avatar
2 votes
1 answer
142 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,172
6 votes
2 answers
3k views

What does g CTRL-A really do?

Today I had that old feeling of wonder on how powerful VIM is: I needed a number sequence in the start of some fields and discovered the power of g CTRL-A. So as I always do when I discover something ...
Nelson Teixeira's user avatar
2 votes
1 answer
406 views

Break line after the n-th comma

Suppose I have the next line 1,0,10,10,9,7,7,5,41,3,57,7,1,9 I want to split it into several lines, each containing n commands for example, for n = 4 1,0,10,10, 9,7,7,5, 41,3,57,7, 1,9
juaninf's user avatar
  • 153
2 votes
1 answer
86 views

vim-textobj-entire does not work if "e" not typed immediately after "a" or "i"

I'm using Neovim v0.7.2 with Kana Natsuno's vim-textobj-entire plugin, but I observed that when using ae or ie after some operator (say doing something like g~ae to toggle the case of an entire buffer)...
CrashAndSideburns's user avatar
2 votes
1 answer
566 views

Deleting between two marks (or, from the previous mark to the cursor)

I'm a long time vi/vim user from college days in the 90s, but never considered myself a power user. I'd like to improve at it and the other day I was staring at something in an Ansible playbook like ...
Joe's user avatar
  • 123
2 votes
2 answers
1k views

Leave terminal normal mode

Once I'm in 'terminal normal mode' (where VIM has control on the terminal display), i can't come back to simple 'terminal mode' (where i can write BASH or launch process). How to leave the "...
floupinette's user avatar
2 votes
1 answer
178 views

How to :edit executable from path?

Environment: Linux I apologize in advance if this question already exists somewhere and has a proper answer. It is just so difficult for me to search because the keywords are all so generic. Put ...
Josh Thies's user avatar
2 votes
1 answer
465 views

Only highlight trailing whitespace in normal mode

I have some code in my ~/.vimrc to highlight trailing whitespace. " Highlight trailing whitespace hi TrailingWhitespace ctermbg=red guibg=red matchadd("TrailingWhitespace", '\v\s+$') I ...
user2609980's user avatar
1 vote
1 answer
108 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
0 votes
0 answers
60 views

a `nnoremap <buffer><silent>` on .vimrc make the curssor very slow on normal mode

To automate a bit the title creation for rst text I added this to my .vimrc: au FileType rst nnoremap <buffer><silent>h1 yypVr=o au ...
user3313834's user avatar
4 votes
1 answer
118 views

'de' and 'e' is not analogous to 'dw' and 'w'

(Context: I am doing the vim tutor) Exploring 'e' and 'w' commands I noticed 'e' places the cursor on top of the last letter of the current word, and if I type 'de' with the cursor somwhere between ...
user avatar
1 vote
1 answer
390 views

Special characters, escaped special characters, escape sequences, and terminal codes

I refer to those 4 terms using terminology picked up by various sources: Steve Losh, in his Learn Vimscript the Hard Way's chapter 16 refers to things like <cr> (these 4 characters typed in a ...
Enlico's user avatar
  • 2,172
0 votes
2 answers
101 views

Can Vim be configured to leave insert/replace mode when I use the cursor keys

I find I forget to leave INSERT or REPLACE to navigate around the file with cursor keys, Page Up, Page Down, etc. Or, I walk off from the computer to make my coffee, or whatever. Then when my brain ...
Omar and Lorraine's user avatar
2 votes
2 answers
2k views

How to speed up cursor movement?

When I hold the key k to move cursor up, is it possible to speed up the cursor movement? I know that I can combine number with command (like: 20k) to move up many lines, but sometime I just prefer to ...
Lai32290's user avatar
  • 255
0 votes
0 answers
49 views

$ moves caret past last character

This is the starting situation: Now I press $: Now I press i: Now I press Esc: Why did the $ move past the end of the line?
robertspierre's user avatar
1 vote
2 answers
96 views

`db` including current character

When in normal mode, with the following (^ indicates cursor position): Lorem ipsum ^ How do I delete the entire word ipsum in the least keystrokes? Things I've Tried: db gets Lorem m ^...
Elliot Hodge's user avatar
1 vote
1 answer
435 views

Visually select two words in Vim

Say I have a phrase is later found at and what to delete a phrase later found, then what I do would be In the normal mode, I put a cursor on l, and press vww. This will select from l to a of at. This ...
Tom's user avatar
  • 379
4 votes
1 answer
52 views

Speedier indentation of many files

I recently needed to re-indent a large number of files. I used variations of: find . -type f -exec vim -c "normal gg=GZZ" {} \; Which worked well, but incredibly slowly (across several ...
Allen's user avatar
  • 141

1
2 3 4 5
7