question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using o to open a new line, indentation is not respected

See original GitHub issue

Here’s a video to demonstrate, but basically I use o to open a new line and insert some text. The problem is that it doesn’t automatically indent, as you can see in the video the line open, the caret is moving to the new line but it goes at the start of the line. I then have to press Tab to get the proper indentation and start typing, it’s not so much of extra typing but it doesn’t feel natural, plus it’s none of the behavior of neovim and vsc, so I wonder if it’s a bug.

https://user-images.githubusercontent.com/2827383/111926289-88428180-8aac-11eb-9efb-b47e3868a225.mp4

If it’s not a bug and there is a way to fix that, sorry but I couldn’t find anywhere how to, please let me know.

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
raffylopezcommented, Apr 10, 2021

autoindent might be getting set to disabled somehow, as was happening in my case, though for only certain file types

In init.vim:

" ------- vscode-neovim specific settings ----- "
...

" ------- FIX: Keep autoindent enabled for all filetypes all the time ----- "
autocmd BufEnter * silent! set autoindent smartindent

" ------- Stop vscode-neovim from loading remainder of file ----- "
if exists('g:vscode') 
   finish
endif

" ------- Rest of init.vim ----- "
....

EDIT: Added smartindent.

1reaction
vlwkaoscommented, Mar 22, 2021
nnoremap o ox<BS>
nnoremap O Ox<BS>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Indent the first line of a paragraph - Microsoft Support
To indent the first line of a paragraph, put your cursor at the beginning of the paragraph and press the tab key. When...
Read more >
Eclipse indents new line with tabs instead of spaces
When I press return , I get a new line that is indented with tabs instead of spaces. If I backspace to clear...
Read more >
Indentation amount not respected when entering new line ...
Creating a new line in the code (created by pressing ENTER) does not appear to respect to the indentation amount set.
Read more >
Tabs and indents settings does not work
Go to Settings and change indentation to Tab; Go back to file and press Enter so it creates new line (e.g. after opening...
Read more >
Indenting with respect to another line - LaTeX Stack Exchange
Where the the second line is aligned with 'B' of Battle. Is there something similar to the align environment for text? indentation ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found