Whenever I type a colon in insert mode, it moves my text to the very beginning of the line

Whenever I type a: (colon), it moves all the text in the current line to the beginning of the line, ignoring spaces and tabs.

So, if I type

var combo = new Ext.form.ComboBox({ typeAhead //I'm about to type a colon, but right now it looks fine }) 

Then I type a colon in which it moves the text, and now it looks like

 var combo = new Ext.form.ComboBox({ typeAhead: //text is no longer indented }) 

Is this a javascript file that might cause the problem?

How can I stop text wrapping at the beginning of a line when typing a colon?

+4
source share
1 answer

Adding a colon to the end of the token causes vim to interpret it as a jump mark for C-indenting purposes. :set cino+=L0 should force it to remain in the current column.

Also, isn't JSON syntax allowing you to quote a thing preceding a colon? This should prevent vim from thinking that this is also a shortcut.

 var combo = new Ext.form.ComboBox({ "typeAhead": "foo" // this isn't a jump label }); 
+7
source

Source: https://habr.com/ru/post/1493239/


All Articles