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
2 votes
1 answer
67 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 ...
  • 121
1 vote
1 answer
23 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 ...
1 vote
1 answer
41 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 [* ...
  • 113
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 ...
  • 23
0 votes
2 answers
51 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 ...
1 vote
2 answers
43 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. ...
  • 113
1 vote
1 answer
50 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" '...
  • 11
0 votes
1 answer
26 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 | ...
  • 172
1 vote
1 answer
27 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 ...
0 votes
1 answer
38 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 ...
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 ...
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>&...
1 vote
1 answer
29 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 ...
  • 243
0 votes
0 answers
26 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 ...
0 votes
2 answers
63 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 ...
0 votes
1 answer
24 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....
  • 3
2 votes
2 answers
390 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 ...
1 vote
0 answers
16 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 :...
3 votes
1 answer
42 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 ...
0 votes
2 answers
94 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:
  • 3,303
2 votes
2 answers
162 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 ...
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 ...
  • 2,014
5 votes
2 answers
2k 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 ...
2 votes
1 answer
192 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
  • 143
2 votes
1 answer
71 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)...
2 votes
1 answer
178 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 ...
  • 123
1 vote
2 answers
564 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 "...
2 votes
1 answer
144 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 ...
2 votes
1 answer
182 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 ...
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$...
  • 21
0 votes
0 answers
42 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 ...
4 votes
1 answer
64 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
109 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 ...
  • 2,014
0 votes
2 answers
67 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 ...
2 votes
2 answers
798 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 ...
  • 215
0 votes
0 answers
45 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?
1 vote
2 answers
56 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 ^...
1 vote
1 answer
189 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 ...
  • 379
4 votes
1 answer
46 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 ...
  • 141
0 votes
1 answer
38 views

Quickest Way To Fold Using Marks

I've found if do :set number, I can fold between specific lines x and y with xGzfyG or easier for me xggzfygg. That's great but it's a distraction to find the line numbers as is [visual]zf. I use ...
  • 103
4 votes
1 answer
73 views

Are there any commands starting with Z other than ZZ and ZQ?

As far as I understand it is the only two commands that exist. And this "Z" chosen because it not used for anything else. But I am not sure. Sorry for such basic question. I tried to use :...
1 vote
3 answers
511 views

How supply range to normal mode key-binding?

I've created a mapping to a function that accepts a range. Like this: command! -range Test call TestFunc(<range>,<line1>,<line2>) nnoremap <leader>t :Test<CR> How do I ...
  • 309
6 votes
2 answers
2k views

Ctrl-A and Ctrl-X doing the opposite of what they should

I had the following piece of Markdown text that I wanted to edit: * 2-6 for a moka pot * 7-10 for a drip machine * 5-12 for a pour-over When I had the cursor over the number 6 in the first bullet ...
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 ...
7 votes
1 answer
522 views

How to prevent Vim from clearing the system clipboard (:reg +) on exit?

After copying text to the system keyboard clipboard in vim, I'm unable to paste the text after exiting vim. I find this behavior frustrating, since I often copy text in files to paste it on the ...
  • 1,155
0 votes
1 answer
59 views

How to select non-uniform length strings from within multiple lines

Suppose I have this data: import { york1400 } from "./data/york1400"; import { york1430 } from "./data/york1430"; import { york1500 } from "./data/york1500"; import { ...
  • 217
2 votes
2 answers
293 views

How to make an user-defined command that works in normal and visual mode?

Goal I would like to create a command that can automatically put an x inside a []. This command should work in both normal mode and visual mode. normal mode If it is in normal mode, and the cursor is ...
  • 587
1 vote
1 answer
55 views

Run :terminal so it starts in terminal-normal mode?

I want to run an async command and when it completes open a terminal window. Since the opening is delayed, I don't want it to steal input from me, so the new window should be in Terminal-Normal mode. ...
  • 549
0 votes
0 answers
17 views

How to add a line at the beginning of my file from normal mode?

I'm trying to add the line HELLO WORLD to the beginning of my file from normal mode. How do I do this?
  • 111
1 vote
0 answers
36 views

How to do a motion without leaving history (in .)?

Often, you do a complicated motion, which you want to repeat soon by pressing . but carry out a simpler motion overwrites that one. Can I keep that complicated motion in . itself ? Concrete example: ...
  • 43

1
2 3 4 5 6