cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
996 stars 46 forks source link

Add space rules (and ignore tags) #19

Closed perrin4869 closed 8 years ago

perrin4869 commented 8 years ago

Hi, made a few simple new rules that I think should be there by default, for your consideration!

perrin4869 commented 8 years ago

I guess that the only thing missing would be some tests for these new rules

cpixl commented 8 years ago

Maybe the (\%#$ {\%#$ and \[\%#$ rules should be removed, as it conflicts with the following sequence:

Before        Input         After~
------------------------------------
foo |         {             foo {}
------------------------------------
foo {|}       <cr>          foo {
                              |
                            }
------------------------------------
foo {|        <space>       foo { }

}                           }

There are good chances that someone will try to put a // comment on there, or a |foo| in Ruby files.

perrin4869 commented 8 years ago

yup, you're right, fixed! also, the tests seem to fail, but I've no clue why...

cohama commented 8 years ago

I don't think this rule should be by default. Because I can't believe many people want it.

Does anyone else have any opinion?

cpixl commented 8 years ago

Well, delimitMate and auto-pairs provide this functionality, and as a JavaScript delevoper it is really useful when writing something like this:

var foo = { bar: 42 };

... it is very common to write it all around the code.

Maybe for consistency reasons or to allow an easier migration from these plugins it would be nice to have these rules built-in, or at least to have an example on the README showing how to do it easily.

perrin4869 commented 8 years ago

I also think it should be on by default, because I can't think of a situation where I would not want the extra space added, but I'm fine either way.

cohama commented 8 years ago

Well, delimitMate and auto-pairs provide this functionality

OK, I see. I will merge this pull request if you fix followings.

perrin4869 commented 8 years ago

Oh, just saw your messages.

1) Done :) 2) Damn don't know why I removed those, gonna return them 3) Will do! 4) Hm... Why not ignore the tags though? 5) Good opportunity to pick up vim-themis!

perrin4869 commented 8 years ago

ok, I'm basically done with all the points except 4... I just don't get why not add tags to gitignore since it's generated automatically in all environments

cohama commented 8 years ago

uh... I am using neobundle as plugin manager and doc/tags directory has not been generated. O.K. I will merge your .gitignore change.

Finally you should squash your changes into 2 commits. (using git rebase -i and git push -f) One is 'Add space rules' and another is 'Ignore doc/tags'.

cohama commented 8 years ago

oops. test failed. But it seems your commits do not affect to this. I will try to find the reason.

perrin4869 commented 8 years ago

Done :)

cohama commented 8 years ago

Thank you very much!

perrin4869 commented 8 years ago

Awesome! Thank you too! By the way, I raised an issue regarding mapping a few days ago, I'd appreciate it if you could take a look at it!