Skip to main content

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
1 vote
0 answers
44 views

set noshowcmd to only hide partial commands

In normal mode when I press Space (which is my leader), Vim/NeoVim always displays <20> in the command area. I find this visually distracting. I know that I can disable it with set noshowcmd, ...
aep's user avatar
  • 111
0 votes
0 answers
26 views

Set the current line limit for jumping in Vim

I want to set a limit for the use of e. Basically e is for jumping forward to the end of words, but I do not want to go to the next line. I just want to jump to the end of all the words in the current ...
mohamadi_arch's user avatar
0 votes
2 answers
28 views

How to split terminal and start in the other buffer?

I currently have the following abbreviation: cnoreabbrev tright vert rightb terminal zsh With this, :tright in normal mode will open a terminal buffer on the right side of the screen, which is great. ...
Patrick O'Brien's user avatar
0 votes
1 answer
48 views

keybindings that change mode: cannot use keybindings on the new mode

I have defined the following keybindings: local opts = { noremap = true } local ll = "<leader>i" opts["desc"] = "Send visual lines" vim.keymap.set("v", ...
robertspierre's user avatar
0 votes
0 answers
63 views

Why is the buffer being overwritten with the commands I use in normal mode?

I am using Alacritty terminal on MacOS and when I am type commands in Normal mode sometimes it writes them over the text. For example, when moving with l, it prints the l in an empty space it finds in ...
Miguel Cortes's user avatar
1 vote
1 answer
144 views

Please explain/provide example of difference between gd and 1gd commands?

I was reading the vim :help docs and stumbled upon the gd and 1gd normal mode commands. But I haven't been able to grasp what's the difference. The docs says: *1gd* 1gd ...
d.k's user avatar
  • 704
0 votes
3 answers
262 views

Why Y doesn't work like `yy`, but works like `y$`?

Why Y command doesn't work like yy, but works like y$? I mean, everyone says that it does work like yy, but for me, it doesn't. So how do I fix it? For the close reason: This question doesn't help me. ...
Fmbalbuena's user avatar
4 votes
1 answer
117 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
581 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
60 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
289 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
100 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
  • 143
-1 votes
2 answers
232 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
100 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
55 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
  • 263
2 votes
2 answers
7k 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
306 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
184 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
149 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
45 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
154 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
192 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
317 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
149 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
179 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
48 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 | ...
Bog's user avatar
  • 509
1 vote
1 answer
42 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
67 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
1 answer
249 views

:normal o in visual mode WORKS

In my environment, invoking :normal in Visual mode does Visual mode command. " A map for calling command without quitting visual mode " It gets the cursor to the other side of selection ...
Dugesia7'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
1 vote
1 answer
45 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
35 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
583 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
448 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
523 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
1 answer
45 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
63 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
767 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,621
2 votes
2 answers
342 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
211 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,244
6 votes
2 answers
4k 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
528 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
106 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
3 votes
1 answer
1k 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
  • 133
3 votes
2 answers
2k 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
198 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
685 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
176 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
  • 121
0 votes
0 answers
64 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
176 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
2 3 4 5
7