Saturday, June 19, 2010

Re: unwanted indentation

* Kamil Dworakowski on Saturday, June 19, 2010:
> This is a minor annoyance when editing. I demonstrate
> on a javascript file.
>
> Given the following are the contents of /tmp/foo.js
>
> function foo() {
> return {
> bar|
> }
> }
>
> (the pipe shows where the cursor is)
>
> When I type colon character (:) it un-indents the
> line, effectively transforming it into:
>
> function foo() {
> return {
> bar:|
> }
> }
>
> I'd like to know what is causing it. I tried turning off various
> options like autoindent and smarindent but with no difference.
>
> I have javascript syntax file from [1] in my local configuration,
> on top of what vim 7.2 has.

Happens with stock javascript.vim as well. I avoid it by setting

" default cinkeys without colon
setlocal cinkeys=0{,0},0),0#,!^F,o,O,e

in ~/.vim/after/ftplugin/javascript.vim

c
--
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org/
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: