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

Wrong indentation settings when editing Julia files #280

Closed
mihrits opened this issue Dec 8, 2021 · 2 comments
Closed

Wrong indentation settings when editing Julia files #280

mihrits opened this issue Dec 8, 2021 · 2 comments

Comments

@mihrits
Copy link

mihrits commented Dec 8, 2021

I am new to vim/neovim so this might be my own mistake or misunderstanding.

I want to get indents with tabs expanded to spaces and have a width of 4 spaces.

In my init.lua I have set

vim.bo.expandtab = true
vim.bo.shiftwidth = 4
vim.bo.tabstop = 4
vim.bo.softtabstop = 4

and it works most of the time when editing files with neovim, but when I edit Julia files, then the shiftwidth is set to 8 and expandtab to false. I am not sure, why this happens. I am not even sure it because of julia-vim, but it's my best guess. I can manually change them, when I have a file open, or could also probably add an autocmd, but I would like to get to the bottom of this.

I am using Neovim v0.6.0, also tried v0.5.1.

I tried running Neovim with norc (nvim -u NORC), which gives shiftwidth=8 and noexpandtab, but does so by default for all the files, except for python files, where I get shiftwidth=4 and expandtab

I tried running Neovim with minimal config (the 4 lines written above), which produces the exact same results as running with full config, which means everything except Julia files has shiftwidth=4 and expandtab, and Julia has shiftwidth=8 and noexpandtab.

I tried running Neovim with minimal config and with --noplugin flag, but that didn't change anything. Maybe I have to do something more to disable plugins from loading?

I found in .../packer/start/julia-vim/ftplugin/julia.vim a line that contains

let b:undo_plugin = ... shiftwidth< expandtab< indentexpr<...

which resets the values of these options to a global value, but I don't know what this global value refers to. Is it the value in my config file or is it the default value for vim?

If I could provide any more information to help solve this, let me know.

carlobaldassi added a commit that referenced this issue Feb 18, 2022
since we don't set them any more, we don't need to restore them

trying to address #280
@carlobaldassi
Copy link
Contributor

I have just pushed an update that removes shiftwidth and expandtab from the undo list. Indeed, we used to set them (like python does) but then they were left to user's preference, and still they remained in the undo.
I'm not sure of how exactly this could have produced the behavior you observed, but since that's the only place where those two options appeared I'm hoping that removing them could fix the issue.

@mihrits
Copy link
Author

mihrits commented Feb 21, 2022

Thank you! It seems to be working as I expected now after updating. No more 8 spaces worth of tabs.

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

No branches or pull requests

2 participants