Skip to content

ali7line/org-bullets.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Org-bullets.nvim

This plugin is a clone of org-bullets. It replaces the asterisks in org syntax with unicode characters.

This plugin is an extension intended for use with orgmode.nvim

This plugin works by using neovim extmarks, rather than conceal for a few reasons.

  • conceal can only have one global highlight see :help hl-Conceal.
  • conceal doesn't work when a block is folded.

see below for a simpler conceal-based solution

folded

Pre-requisites

  • This plugin requires the use of treesitter with tree-sitter-org installed
  • neovim 0.7+

Installation

With packer.nvim

use 'akinsho/org-bullets.nvim'

Usage

To use the defaults use:

use {'akinsho/org-bullets.nvim', config = function()
  require('org-bullets').setup()
end}

The full options available are:

NOTE: Do NOT copy and paste this block as it is not valid, it is just intended to show the available configuration options

use {"akinsho/org-bullets.nvim", config = function()
  require("org-bullets").setup {
    concealcursor = false, -- If false then when the cursor is on a line underlying characters are visible
    symbols = {
      -- headlines can be a list
      headlines = { "", "", "", "" },
      -- or a function that receives the defaults and returns a list
      headlines = function(default_list)
        table.insert(default_list, "")
        return default_list
      end,
      checkboxes = {
        half = { "", "OrgTSCheckboxHalfChecked" },
        done = { "", "OrgDone" },
        todo = { "˟", "OrgTODO" },
      },
    }
  }
end}

Conceal-based alternative

A simpler conceal based alternative is:

syntax match OrgHeadlineStar1 /^\*\ze\s/me=e-1 conceal cchar= containedin=OrgHeadlineLevel1 contained
syntax match OrgHeadlineStar2 /^\*\{2}\ze\s/me=e-1 conceal cchar= containedin=OrgHeadlineLevel2 contained
syntax match OrgHeadlineStar3 /^\*\{3}\ze\s/me=e-1 conceal cchar= containedin=OrgHeadlineLevel3 contained
syntax match OrgHeadlineStar4 /^\*{4}\ze\s/me=e-1 conceal cchar= containedin=OrgHeadlineLevel4 contained

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%