Skip to content

org_refile can't refile headings #911

@cezarmathe

Description

@cezarmathe

Describe the bug

I'm trying to move a heading from my-org-file.org to refile.org. Both files are located in ${HOME}/org. When I do <Leader>or the autocomplete omits a few characters from the start of each file, e.g. refile.org is shown as efile.org. Upon selecting any file or typing the correct file myself I get the following error: "nil" is not a file specified in the "org_agenda_files" setting. Refiling canceled..

Steps to reproduce

  1. Create a new file: refile.org.
  2. Create a new file: 2025-02-27.org.
  3. In 2025-02-27.org: <Leader>oit and add Hello, world!.
  4. In 2025-02-27.org: <Leader>or on the header you've added previously and type refile.org.

Expected behavior

I expect that <Leader>or moves the heading to the desired destination.

Emacs functionality

No response

Minimal init.lua

-- You can add your own plugins here or in other files in this directory!
--  I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {
  'nvim-orgmode/orgmode',
  event = 'VeryLazy',
  ft = { 'org' },
  config = function()
    -- Setup orgmode
    require('orgmode').setup {
      org_agenda_files = '~/org/**/*',
      org_default_notes_file = '~/org/refile.org',
    }

    -- NOTE: If you are using nvim-treesitter with ~ensure_installed = "all"~ option
    -- add ~org~ to ignore_install
    -- require('nvim-treesitter.configs').setup({
    --   ensure_installed = 'all',
    --   ignore_install = { 'org' },
    -- })
  end,
}

Screenshots and recordings

Screen.Recording.2025-02-27.at.13.06.23.mov

OS / Distro

MacOS 15.3.1

Neovim version/commit

NVIM v0.10.4 / Build type: Release / LuaJIT 2.1.1736781742

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions