Skip to content

Keymaps for nesting nvim instances using floating windows #106

@zeta-squared

Description

@zeta-squared

I have run into an issue which I am not sure is solvable. Suppose you have nvim open in your terminal, [ nvim1 ], and you then open a floating terminal within the nvim1 instance, [ nvim1 [ fterm ] ]. This puts nvim1 into terminal mode. The default way to exit terminal mode is <C-\\><C-n> however let's suppose that this functionality is remapped to <C-[>. Next, let's open a new instance of nvim within the floating terminal window and enter insert mode, [ nvim1 [ fterm [ nvim2 ] ] ]. If I wanted to use <C-[> to exit insert mode in nvim2 then I would run into issues because the earlier keymap will make nvim1 exit terminal mode first.

My question is, is there anyway to make keycodes go to the inner most nvim instance first? I.e. in the above scenario make <C-[> check if nvim2 is in insert or terminal mode first, in which case exit those, otherwise bubble up to nvim1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions