nvim-orgmode/org-bullets.nvim

[Feature request] Conceal indented heading asterixes

ashincoder opened this issue ยท 31 comments

The following video showcases the problem. After one use of the bullet heading the others don't work

@ashincoder this isn't a bug I believe because the way this plugin is written assumes that the correct todo headlines should not be indented. If you try your example again but without the indentation of the headline it should work. I think that in orgmode headlines aren't normally indented. If you find org mode docs saying they should/can be then please post them here and I'll update the plugin

It is indented in emacs orgmode

I will show it now in a video

video-210728-1556-47.mp4

I don't think it maybe be a bug. Just pointing it out. https://orgmode.org/manual/Org-Indent-Mode.html#Org-Indent-Mode. It can be possible using org-indent-mode. In real org it can be set using org-indent-mode. I use doom-emacs. But I also tested it with vanilla emacs by using emacs -q and by enabling org-indent-mode the sub headlines are indented and thus the stars leaking are hided

I am currently in the process of learning lua. Otherwise I would really love to put a PR.

@ashincoder it seems that this isn't default behaviour though and something you need to turn on a special setting for though right?

By default will org mode allow indenting of headlines? In either case not sure when I'll have time to look into this. It's primarily a matter of changing the vim regex this plugin uses to either allow optional whitespace or start at the beginning

https://github.com/akinsho/org-bullets.nvim/blob/6a9e15bc22dd8824b89ba053fc088c5644320bf2/lua/org-bullets.lua#L60

Maybe something like ^\s? at the start like an optional lookbehind ๐Ÿคท๐Ÿฟโ€โ™‚๏ธ

Yeah we have to enable it in vanilla emacs. But in doom-emacs , the indent is by default

Should I keep this issue open ? Also no hurry. You can look into this whenever you think it is the right time.
Maybe after I learn something I will try to make a PR. I am shitty amateur. ๐Ÿ˜„

@ashincoder feel free to leave it open, I'll to it at some point ๐Ÿ‘๐Ÿฟ

@ashincoder exactly how you enable it in vanilla emacs? If there is an option for that in emacs, I should implement it in orgmode.nvim.

Edit: This requires change in the indentexpr. It's fairly simple change, I just need to figure out where to put it (here or orgmode). If it's part of the bullets plugin in emacs, I'll make a PR here with a fix.

i think it is org-indent-mode

sorry for the late reply

Using noindent value in orgmode configuration should solve this specific issue for you, since there is no any indentation added. Problem is that it doesn't indent anything, so you will not have indentation where you expect it.

I'll make a PR here with the fix for this tomorrow.

Using noindent value in orgmode configuration should solve this specific issue for you, since there is no any indentation added. Problem is that it doesn't indent anything, so you will not have indentation where you expect it.

I'll make a PR here with the fix for this tomorrow.

Nice ๐Ÿ‘

@ashincoder what is your org-indent-mode in emacs? I just tried installing org-bullets for emacs, and it still doesn't work like on the video, without any specific settings. This seems to be working like on video only when org-indent-mode is enabled. We cannot currently support that because there's no way to indent things only visually (at least not yet, hopefully in v0.6).

yeah it only works in org-indent-mode.

video-210830-1906-05.mp4

This is vanilla emacs.

The problem is that, after typing a main heading with a '*' then do a return then start writing another sub heading with '**' it will not accept it as a heading u have to move out of the indent to do another sub heading.

Enabled org-indent-mode creates a "virtual" indentation, which means that if you open up this org file from emacs in any other text editor, none of the text will be indented. Emacs has a way to create "virtual indents", but that's not yet possible in Neovim.

video-210830-1917-10.mp4

@kristijanhusak watch this u will understand more. And please say ur say

@ashincoder I understand what's the problem. I'm trying to explain why it works in emacs, and why we cannot solve it in Neovim at this moment.

Great atleast u understand what I am saying. ๐Ÿ˜„

@ashincoder If you use this config for orgmode.nvim, it should properly work for this specific case in video:

require('orgmode').setup({
  org_indent_mode = 'noindent',
})

but none of the real content under a headline will be indented, because of the Neovim limitations.

@akinsho you can close this, since this is not an issue with your plugin.

@ashincoder If you want, I can give you small chunk of vimL code that will make this work for you every time you start the line with one or more *, even with enabled indents.

yeah I will close the issue and @kristijanhusak can give me the viml chunk :)

@kristijanhusak Can you share it with me as well?

@nguyenhai97 It is no longer needed. You can switch to nightly Neovim and use virtual indents https://github.com/nvim-orgmode/orgmode/blob/master/DOCS.md#org_startup_indented