百果园和爱德基金会、腾讯公益等携手 助力关爱流浪猫活动
Tagged with neovim indentation
26 questions
1
vote
1
answer
123
views
Smart indentation for html tags in tsx/jsx/html files does not work in Neovim v0.11+
For some reason, smartindent doesn’t seem to work properly for HTML tags inside .tsx, .jsx, or .html files. I've searched for solutions, but most of what I found are outdated answers from the Vim ...
2
votes
1
answer
161
views
Issue with de-indent of lines after entering a closing parenthesis
As far as I've seen good coding practices go, when splitting things like parameters passing/definition in parentheses on multiple lines, you indent them twice to distinguish them from regular indents. ...
1
vote
1
answer
466
views
How can I improve treesitter's indentation when editing a multi-line string?
I mostly edit php files, using Neovim with kickstarter.nvim loading lazy, phpactor & nvim-treesitter.
I believe nvim-treesitter is what ends up being responsible for auto-indentaion.
Indeed if I ...
1
vote
1
answer
309
views
Why are my indentation settings not considered by Vim/Neovim?
I have set my indentation settings in my vimrc file or in my init.lua file but when I open a buffer I notice that they have been overridden.
By indentation settings I mean:
tabstop
expandtab
...
0
votes
1
answer
54
views
How to apply cindent to other filetypes such as glsl or lua without messing up highlighting/lsp?
I have been using cindent since I started using Neovim to edit C files.
I could not love it more since lsp/formatters like clangd do not provide what I expect at an acceptable cost. I also turned off ...
0
votes
1
answer
67
views
My code gets indented with spaces, even though I have expandtab=false
local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
-------------------------------------- globals -----------------------------------------
g....
2
votes
2
answers
2k
views
How can I adjust the indentation settings in Neovim based on file content or a specific keyword?
I'd like to know if it's possible to dynamically adjust indentation settings (e.g., shiftwidth, tabstop, expandtab) based on the content of the file being edited.
For example:
If the file contains a ...
0
votes
1
answer
29
views
Setting guard variables does not prevent default ftplugin/syntax/indent files from running
I want to prevent the default ftplugin/syntax/indent files from running for tex files.
I have a tex.vim in the $XDG_CONFIG_HOME/nvim/ftplugin directory, i confirmed it runs before the default ftplugin/...
3
votes
3
answers
262
views
Preventing cursor from indenting after a previously indented line
I'm using neovim and a init.lua file.
In what follows ? will indicate the cursor:
for i in range(1,5):
print(i?
Then I press o:
for i in range(1,5):
print(i)
?
Then I press backspace:
...
1
vote
3
answers
2k
views
Why is indentation on Github different from indentation in my Neovim?
After committing I realised that indents on GitHub show differently from what I see in Neovim.
I also noticed that all formatting (including indentation) is reset when an error occurs when loading the ...
2
votes
1
answer
249
views
How do I tell (*Neovim*) that `.ipynb` files have 1 space indents, so indent guides are correctly shown?
I'm using the Indent Blankline plugin to show indent guides.
My Jupyter Notebook/.ipynb files have 1 space indents. Vim identifies them as JSON files.
One way to tell Neovim that Jupyter Notebook ...
0
votes
0
answers
63
views
Why does <esc> on empty, indented line, jump to beginning?
I'm trying to do something very simple, enter normal mode and ALWAYS be able to somehow put the normal mode cursor where it was in insert mode, whether through a mark, or otherwise.
I'm doing this ...
1
vote
1
answer
916
views
How to fix indentation for *.nix files?
How can I tell Neovim not to ignore characters after // as well as treat (space) in lists as separator when it comes to indentation?
Closing }; below users.root should be two characters to the ...
6
votes
1
answer
5k
views
How can I make (Neo)Vim wrap lines in respect to indentation?
Currently, indented lines will wrap all the way to the left of the text area. This is what they look like:
This is a long line of text that is indented wi
th tabs. In order for it to properly fit ...
4
votes
1
answer
385
views
Trouble in overriding `indentexpr` in neovim
Say I do not quite like the shipped Lua indentexpr (GetLuaIndent(), defined in $VIMRUNTIME/indent/lua.vim). With vim, I can disable or change it using this minimal configuration:
~ % cat .vimrc
...