showkey
showkey

Reputation: 238

Why does gVim move } at the beginning of the line in insert mode?

I was editing a CSS file with gVim on Windows 7 when I realized every time I press Shift+} in insert mode as the 4th character of a line, it is put as the 1st one. For example, if the cursor is at the end of line 31 (see below)

Initial Situation

and I press Enter, gVim inserts a new line and positions the cursor at the 4th column as follows:

After hitting Enter

Here's when I press Shift+} and } is moved to the 1st column:

After hitting }

Why does gVim behave in such a way? And how could I fix it?

Upvotes: 0

Views: 60

Answers (1)

romainl
romainl

Reputation: 196926

This behavior is perfectly normal and expected so there is nothing to fix.

It is defined in $VIMRUNTIME/indent/css.vim:

setlocal indentkeys=0{,0},!^F,o,O

See :help 'indentkeys'.

Upvotes: 1

Related Questions