Closed dylan-chong closed 2 years ago
I think instead of the guard, you probably want to use :setglobal
for the top level definitions.
@tpope fixed
@tpope I just realise that your solution of using set global is actually a equivalent to removing those lines altogether.
Using set globals, when I open a new file indenting is still set to tabs. Should I just revert the changes back to what it was before with the guard?
Why does the file type-specific command go before the globals? (not a vim expert)
Do I put the setglobal
commands before something like vim-plug?
edit: Looks like setglobal
doesn't work with vim-plug. I'm using vim 8.0.
@aleclarson i have just updated the instructions can you have a look at it again
@dylan-chong set
works great. Thanks!
@aleclarson Would you mind hitting approve once you are confident that it works perfectly? I assume @tpope is a little busy, so hopefully this might speed up getting this merged
Just noticed an issue. Setting tabstop
causes changes to JSON files (eg: adding a new property to a JSON object via a new line) to be indented wrong. You need to add the JSON property, do :wq
, then re-open the file to see what I mean.
Here's what I'm doing:
set expandtab
set tabstop=2
set shiftwidth=2
@aleclarson extendtab?
Could you clarify what you mean? I am not sure i understand what you mean
@dylan-chong That was a typo. I meant expandtab
i'm still not understanding the problem you're having.
You've tried reproducing what I said above?
If you follow those instructions, you should see the newly added JSON property is indented more than it should be.
It may be caused by another plugin if you can't reproduce it.
Sorry I don't understand your instructions. Could you provide your Json file and provide an exact list of commands/keystrokes to run?
I tried this and it overrides vim-sleuth detection for some reason.
I'm not really sure about _has_set_default_indent_settings
, idk where it is set in sleuth.vim...
@minhduc0711 _has_set_default_indent_settings is defined only in the snippet
I see, then how does it know if vim-sleuth has detected the indent settings or not?
It does not :( . iirc it relies on running before sleuth detection is triggered (because the vimrc is loaded before the file being edited is loaded)
Hmm in that case I don't know why this is not working for me. If I open this tab-indented snippet https://pastebin.com/raw/LHvPPuW8, it would ignore the tabs and default to 4 spaces. Could you please try with your setup?
Hopefully a good enough for now fix for #50