I am coding in R in nvim and having some difficulty with the way the indentations are turning out.
I have my indentation configured as:
opt.tabstop=2
opt.shiftwidth=2
opt.expandtab=true
And when I do =G
, I get the following result (image), which is too many indents. Is this my R LSP messing things up, or do I not understand tabstop, shiftwidth and expandtab actually do?
How can I make it so that I don’t 8 indents when I only want two. What am I doing wrong?
The output of :verbose set shiftwidth
is
shiftwidth=2
Last set from Lua
And
:verbose set indentexpr?
says
indentexpr=GetRIndent()
Last set from /usr/share/nvim/runtime/indent/r.vim line 15
and :verbose set equalprg?
says
equalprg=
I think I have an idea of where my issues are. And there is a good chance I am wrong about this being the Nvim/vim R-LSP. The LSP itself is here : GitHub - REditorSupport/languageserver: An implementation of the Language Server Protocol for R.
- Would hacking the lsp config cause issues down the line? With something like updates from the upstream?
If yes,
- Can I use something else to make the indents uniform? Whenever I copy paste something from other places, nvim just prints them out of whack. If
=
is not the answer then I am happy to use something else.