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 !

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
21 views

How to disable mouse scroll wheel when in normal mode?

I want to completely disable the mouse but mouse scrolling in normal mode is not disabled. I have disabled other mouse function but scrolling in normal mode is still on. To disable the mouse I have ...
2
votes
0answers
58 views

how to have two different colour schemes for command mode and edit mode in vim?

I have been using vim for some time now but I am always unsure of which mode I am currently in and hence end up pressing Esc too often even in the command mode. This causes an irritating computer ...
1
vote
0answers
24 views

Keyboard mapping that mostly avoids Shift or Ctrl

I prefer to avoid pressing Shift and Ctrl keys when navigating code and doing minor edits. I rather type 2 small letters than Shift-key or Ctrl-Key combinations. Yet many commands in Vim require to ...
1
vote
0answers
21 views

Change colour of character under cursor?

I'd like the character under my cursor to always be black in normal mode, so it contrasts with the cursor. I'm using windows terminal, which doesn't support this directly, and vim (not gvim), so guifg ...
1
vote
0answers
40 views

How to repeat `f <char>` in opposite direction when using `,` as the map leader?

I have set mapleader="," in my ~/.vimrc. How can I continue to repeat f <char> in the opposite direction, when using , as the map leader? Is it possible to remap , in the context of f &...
1
vote
2answers
109 views

How can I make external command use current line as input and append output to end of same line?

Using Vim 8.0 I'm trying to make a table where the first column is the name of a file and the second column the creation date of such file, to which I have access by the exif data. I would like to ...
1
vote
0answers
54 views

indenting with ':g' command not working from the command line

When I need to work with some scrambled javascript/json code, one of my first steps is to introduce proper line breaks, followed by proper brace based indentation. For the later, I found the following ...
0
votes
1answer
20 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 ...
0
votes
2answers
36 views

How to convert spaces on a line to tabs?

I know there's a way because it happened by accident. I was frenetically moving in a short region of text and at some point, with some wrong keystroke, the leading spaces on the line became a tab (and ...
0
votes
0answers
23 views

What keywordprg do you use for javascript?

I've recently learnt about using K in normal mode to get the manual information of the word under the cursor. In this regard, I'd like to know what programs I could use to handle javascript files, or ...
0
votes
0answers
33 views

VSCode Vim — don't want escape to enter normal mode if I'm exiting tooltip or Intellisense

I'm new to VIM and I'm loving it. I'm learning slowly but surely. I've passed the point where there's enough benefit and not too much hassle. I'm using the VS code integration. I'm learning VIM (...
0
votes
1answer
36 views

noremap in .vimrc for YouCompleteMe does not work

noremap <leader>gdf :YcmCompleter\ GoToDefinition<cr> noremap <leader>gdc :YcmCompleter\ GoToDeClaration<cr> noremap <leader>gi :YcmCompleter\ GoToInclude<cr> ...
0
votes
0answers
33 views

What is the shortkey for adding a space before a word in normal mode?

I have the following text: #Text My cursor is on character T; I want to obtain # Text i.e., to put a space between # and T, without "pressing i and then space". Instead, I want to do so in ...
0
votes
0answers
32 views

<number>dd not doing anything on an ubuntu machine

I use 999dd as a goto command before pasting/overwriting the entire contents from the clipboard. For some reason this is not working (at all) on a specific ubuntu machine. Why would this not work be ...
0
votes
0answers
25 views

cursor moves in range

I have this function that gets range. From the help: The cursor is still moved to the first line of the range, as is the case with all Ex commands. Can it not do it? I just want to ...
0
votes
0answers
137 views

Remove command echo in status bar

I've noticed that sometimes in ViM the status bar shows me the command I've just executed (for instance, if I keep the key 'l' pressed to keep going right, I see at the bottom right of the screen a ...
0
votes
1answer
315 views

Visual block mode insert/append not working in vim on RHEL/CentOS?

I was trying to append some text to multiple lines in vi on a RHEL 6 system, however I could not get it to work. I press Control + V to get into visual block mode, select the lines I need, but when I ...
0
votes
0answers
90 views

Don’t start in insert mode when opening a shell script

How can I prevent vi from starting in insert mode when opening a "test.sh"-like file with the vi-plugin "bash-support" v4.3 ? When I vim test.sh it opens in insert mode When I vim .vimrc it opens in ...
0
votes
0answers
66 views

How to get the same message and error behavior as normal `n` when calling `normal n` in function

I wrote a vimscript function that prevents the cursor from changing its location on the screen when I press n: function! my_n() let l:start=line("w0") let end = line("w$") let cursor = ...