Nvim Orgmode

website·Indexed 29 days ago

https://nvim-orgmode.github.io

A feature-complete clone of Emacs Orgmode for Neovim 0.12.0+. It provides a flexible note-taking system including agenda files, TODO keywords, and capture templates.

Tokens
12.3K
Snippets
67
Records
114
Agent score
71%

What's inside Nvim Orgmode

  1. Use the Org Agenda

    The Org Agenda provides an overview of multiple org files.

    • Open Agenda: Press <Leader>oa to see specialized views.
    • Help: Press g? within a view to see all available key mappings.
    • Key Actions:
      • t: Change the TODO state of a heading.
      • <Enter>: Open the heading in the current agenda window.
      • <TAB>: Open the heading in a new window.
  2. Archive Org-mode headings

    Headings and their children can be moved to an archive file to clean up the current document.

    • Action: Press <Leader>o$ while the cursor is on the heading to archive it.
    • Default Location: The archived content is moved to <name-of-current-org-file>.org_archive.
    • Customization: The archive location can be changed using the org_archive_location option in org.setup().
  3. Install nvim-orgmode using pckr.nvim

    Add nvim-orgmode/orgmode to your pckr.nvim configuration and call the setup function within the config block.
    require('pckr').add({
      {
       'nvim-orgmode/orgmode',
         config = function()
           require('orgmode').setup({
             org_agenda_files = '~/orgfiles/**/*',
             org_default_notes_file = '~/orgfiles/refile.org',
           })
         end
      }
    })
  4. Set up nvim-orgmode for local development

    To set up a local development environment for nvim-orgmode, you must have StyLua installed for code formatting. Run the setup command to install a pre-commit hook that automatically formats files before they are committed.
    # Install StyLua first, then run:
    make setup_dev
    
    # To manually format all files:
    make format
  5. Install and initialize Nvim Orgmode

    Nvim Orgmode requires Neovim 0.12.0+. It can be installed using the built-in package manager and initialized via the setup function to define agenda files and the default notes file.
    -- Install using built-in package manager
    vim.pack.add({ 'https://github.com/nvim-orgmode/orgmode' })
    
    -- Setup orgmode
    require('orgmode').setup({
      org_agenda_files = '~/orgfiles/**/*',
      org_default_notes_file = '~/orgfiles/refile.org',
    })
    
    -- Experimental LSP support
    vim.lsp.enable('org')
  6. Report bugs and feature requests for nvim-orgmode

    Before reporting, search the issue tracker to avoid duplicates. The project prioritizes core features (those existing in Emacs Orgmode) and bugs over non-core features. When reporting a core feature, provide a link to the official Orgmode documentation describing the feature.
  7. Run tests in nvim-orgmode

    Tests are executed using a make command. You can run the entire test suite or target a specific spec file by setting the FILE environment variable. Note that tests are currently not supported on Windows and will only verify if the tree-sitter grammar can be installed.
    # Run all tests
    make test
    
    # Run a specific test file
    make test FILE=./tests/plenary/api/api_spec.lua
  8. Customize nvim-orgmode key mappings

    You can override the default nvim-orgmode mappings by providing a mappings.org table within the setup configuration call. This allows you to redefine the keys used for Org mode operations such as timestamp manipulation, todo cycling, and headline movement.
    require('orgmode').setup({
      org_agenda_files = {'~/Dropbox/org/*', '~/my-orgs/**/*'},
      org_default_notes_file = '~/Dropbox/org/refile.org',
      mappings = {
        org = {
          org_timestamp_up = '+',
          org_timestamp_down = '-'
        }
      }
    })
  9. Setup headlines.nvim for headline highlights

    The headlines.nvim plugin adds additional highlights to orgmode headlines. It should be initialized after orgmode setup.
    -- Your orgmode setup
    require('orgmode').setup()
    
    --Setup headlines.nvim
    require("headlines").setup()