Skip to content

Use ftplugin directory for filetype initialization #1110

@numEricL

Description

@numEricL

Does this feature exist in Emacs orgmode core?

N/A

Orgmode link

No response

Feature value

I have a plugin, table.vim that I would like to use extend orgmode to format tables. There is a keymap collision with <tab>. The <tab> mapping used in my plugin is context dependent, instead of simply disabling orgmode's <tab> mapping, I would prefer to capture it and use it as fallback when the context is not a table.

Orgmode uses the FileType event to set keymaps. This is not ideal as it fires after the ftplugin and after/plugin directories in the runtime path. I cannot make plugin-side changes to table.vim to ensure it maps <tab> after orgmode does. Currently I must register my own FIleType callback after Orgmode loads.

Neovim defines an org filetype, but it is not very substantive. It seems to me that Orgmode should define the org filetype in ftplugin/org.lua and set the b:did_ftplugin option to override neovim's definition. This would also allow other plugins to use the after/ftplugin directory to extend orgmode.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement, not necessarily available in emacs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions