Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab Indentation #21

Closed
stanleygu opened this issue May 15, 2013 · 22 comments
Closed

Tab Indentation #21

stanleygu opened this issue May 15, 2013 · 22 comments

Comments

@stanleygu
Copy link

There does not appear to be a way to set the indentation style to tabs using .editorconfig.

@maksimr
Copy link
Owner

maksimr commented May 15, 2013

You can put the following lines in .editorconfig to set tab indention for javascript files

[*.js]
indent_style = tab
indent_size = 4

@stanleygu
Copy link
Author

I've tried
indent_style = tab
I have also tried tabs and /t but no luck. Could I be missing something
else here?
On May 15, 2013 12:06 AM, "Maksim Ryzhikov" notifications@github.com
wrote:

You can put the following lines in .editorconfig to set tab indention for
javascript files

[*.js]
indent_style = tab
indent_size = 4


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-17923201
.

@maksimr
Copy link
Owner

maksimr commented May 15, 2013

Where located .editorconfig file?

@stanleygu
Copy link
Author

In my home directory.
On May 15, 2013 12:12 AM, "Maksim Ryzhikov" notifications@github.com
wrote:

Where located .editorconfig file?


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-17923384
.

@maksimr
Copy link
Owner

maksimr commented May 15, 2013

Can you show what output command inside js file
:echo b:config_Beautifier?

@maksimr
Copy link
Owner

maksimr commented May 15, 2013

Sorry! :)
Global settings must be in the section [**.js]

like this

[**.js]
indent_style = tab
indent_size = 4

@stanleygu
Copy link
Author

Here it is:

{'js': {'indent_style': 'tab', 'indent_size': '2'}, 'html': {'brace_style': 'expand', 'indent_style': 'tab', 'indent_size': '2', 'max_char': '78'}, 'css': {'indent_style': 'space', 'indent_size': '2'}}

On Wed, May 15, 2013 at 12:17 AM, Maksim Ryzhikov
notifications@github.comwrote:

Can you show what output command inside js file
:echo b:config_Beautifier?


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-17923519
.

@stanleygu
Copy link
Author

Hm, I believe that is what I have already

On Wed, May 15, 2013 at 12:27 AM, Maksim Ryzhikov
notifications@github.comwrote:

Sorry! :)
Global settings must be in the section [**.js]

like this

[**.js]
indent_style = tab
indent_size = 4

Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-17923801
.

@maksimr
Copy link
Owner

maksimr commented May 15, 2013

Thanks! I have reproduced it :)
I'll try to fix it as soon as possible.

Now you can put it in .editorconfig:

[**.js]
indent_char = \t
indent_style = tab
indent_size = 1

and it should work ✌️

@stanleygu
Copy link
Author

The workaround appears to be working.

On Wed, May 15, 2013 at 12:37 AM, Maksim Ryzhikov
notifications@github.comwrote:

Thanks! I have reproduced it :)
I'll try to fix it as soon as possible.

Now you can put it in .editorconfig:

[**.js]
indent_char = \t
indent_style = tab
indent_size = 1

and it should work [image: ✌️]


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-17924139
.

@maksimr
Copy link
Owner

maksimr commented May 15, 2013

Fixed it. Now it should work correct :)

@luckydrq
Copy link

@maksimr exec :echo b:config_Beautifier in my vim is {'jsx': {}, 'js': {}, 'json': {}, 'html': {}, 'css': {}}, why is that? My .editorconfig locates at my home directory.

@luckydrq
Copy link

image

I want to set indent_size to 2 which defaults to 4. But no effect, the plugin still works as indent_size=4.

@luckydrq
Copy link

Problem solved.

Remove ~/.editorconfig and modify path/to/vim-jsbeautify/plugin/.editorconfig, it works.

But i still have no idea why it fails with ~/.editorconfig set up.

@maksimr
Copy link
Owner

maksimr commented Dec 12, 2015

@luckydrq looks very strange...

Do you have g:config_Beautifier or g:editorconfig_Beautifier defined?
Maybe problem in $HOME variable can you check in vim $HOME :echo $HOME

Thanks

@luckydrq
Copy link

:echo $HOME outputs /Users/xuezu which is correct.

@luckydrq
Copy link

Do you have g:config_Beautifier or g:editorconfig_Beautifier defined?

Sorry, i'm new to vim. How to check if the variable is defined?

PS: i'm using OSX10.10.5 and ide is macvim

@maksimr
Copy link
Owner

maksimr commented Dec 12, 2015

@luckydrq you can simple type :echo g:editorconfig_Beautifier

@maksimr
Copy link
Owner

maksimr commented Dec 12, 2015

@luckydrq you can check can we read file in root or not by command:

:echo filereadable(expand('$HOME/.editorconfig')) if it's print 1 then yes if 0 then no

@luckydrq
Copy link

@maksimr

After execute the echo g:xxx command, i find out g:editorconfig_Beautifier is not defined. Is it normal?

:echo filereadable(expand('$HOME/.editorconfig')) outputs 1 which is yes

@luckydrq
Copy link

Does the ~/.editorconfig take prior to vim-jsbeautify/plugin/.editorconfig?

@maksimr
Copy link
Owner

maksimr commented Dec 12, 2015

Does the ~/.editorconfig takes prior to vim-jsbeautify/plugin/.editorconfig?

Yes

find out g:editorconfig_Beautifier is not defined. Is it normal?

Yup.

But you can put it in your vimrc.

g:editorconfig_Beautifier = exapnd('$HOME/.editorconfig')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants