Skip to content

Keymap

All settings found under the keymap key.

local plugin = require('distant')
plugin:setup({
   keymap = {}
})

keymap.dir.enabled

Indicates if assigning keymaps to directories opened with distant is enabled. When true, whenever a buffer is created that represents a directory on a remote machine managed by distant, keymappings defined for remote directories are applied to the buffer.

Boolean representing directory keymappings being enabled. [default: true]

Example
{
    keymap = {
        dir = {
            enabled = false
        }
    }
}

keymap.dir.copy

Keymap to use for copying a file or directory under cursor in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "C"]

Note this is <Shift-C> to trigger the action.

Example
{
    keymap = {
        dir = {
            copy = 'C'
        }
    }
}

keymap.dir.edit

Keymap to use for opening a file or directory under cursor in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: ""]

Example
{
    keymap = {
        dir = {
            edit = '<Return>'
        }
    }
}

keymap.dir.metadata

Keymap to use for opening metadata about a file or directory under cursor in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "M"]

Note this is <Shift-M> to trigger the action.

Example
{
    keymap = {
        dir = {
            metadata = 'M'
        }
    }
}

keymap.dir.newdir

Keymap to use for creating a new directory in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "K"]

Note this is <Shift-K> to trigger the action.

Example
{
    keymap = {
        dir = {
            newdir = 'K'
        }
    }
}

keymap.dir.newfile

Keymap to use for creating a new file in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "N"]

Note this is <Shift-N> to trigger the action.

Example
{
    keymap = {
        dir = {
            newfile = 'N'
        }
    }
}

keymap.dir.rename

Keymap to use for renaming a file or directory under cursor in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "R"]

Note this is <Shift-R> to trigger the action.

Example
{
    keymap = {
        dir = {
            rename = 'R'
        }
    }
}

keymap.dir.remove

Keymap to use for removing a file or directory under cursor in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "D"]

Note this is <Shift-D> to trigger the action.

Example
{
    keymap = {
        dir = {
            remove = 'D'
        }
    }
}

keymap.dir.tabedit

Keymap to open the file or directory under the cursor in a new tab.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "C-t"]

Note this is <Ctrl-t> to trigger the action.

Example
{
    keymap = {
        dir = {
            tabedit = '<C-t>'
        }
    }
}

keymap.dir.up

Keymap to use for moving up to the parent directory in a directory buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "-"]

Example
{
    keymap = {
        dir = {
            up = '-'
        }
    }
}

keymap.file.enabled

Indicates if assigning keymaps to files opened with distant is enabled. When true, whenever a buffer is created that represents a file on a remote machine managed by distant, keymappings defined for remote files are applied to the buffer.

Boolean representing file keymappings being enabled. [default: true]

Example
{
    keymap = {
        file = {
            enabled = false
        }
    }
}

keymap.file.up

Keymap to use for moving up to the parent directory in a file buffer.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "-"]

Example
{
    keymap = {
        file = {
            up = '-'
        }
    }
}

keymap.ui.exit

Keymap to use for exiting an open window in the UI.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "q" or <Esc>]

Example
{
    keymap = {
        ui = {
            exit = {'q', '<Esc>'}
        }
    }
}

keymap.ui.main.connections.kill

Keymap to use for killing the connection under cursor from within the connections tab of the main UI window opened using :Distant.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "K"]

Note this is <Shift-K> to trigger the action.

Example
{
    keymap = {
        ui = {
            main = {
                connections = {
                    kill = 'K'
                }
            }
        }
    }
}

keymap.ui.main.connections.toggle_info

Keymap to use for toggling more information about the connection under cursor from within the connections tab of the main UI window opened using :Distant.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "I"]

Note this is <Shift-I> to trigger the action.

Example
{
    keymap = {
        ui = {
            main = {
                connections = {
                    toggle_info = 'I'
                }
            }
        }
    }
}

keymap.ui.main.tabs.goto_connections

Keymap to use for navigating to the connections tab within the main UI window opened using :Distant.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "1"]

Example
{
    keymap = {
        ui = {
            main = {
                tabs = {
                    goto_connections = '1'
                }
            }
        }
    }
}

keymap.ui.main.tabs.goto_system_info

Keymap to use for navigating to the system info tab within the main UI window opened using :Distant.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "2"]

Example
{
    keymap = {
        ui = {
            main = {
                tabs = {
                    goto_system_info = '2'
                }
            }
        }
    }
}

keymap.ui.main.tabs.goto_help

Keymap to use for navigating to the help tab within the main UI window opened using :Distant.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "?"]

Example
{
    keymap = {
        ui = {
            main = {
                tabs = {
                    goto_help = '?'
                }
            }
        }
    }
}

keymap.ui.main.tabs.refresh

Keymap to use for refreshing the content within the main UI window opened using :Distant for the current tab.

String or list of strings where each string represents a key combination that can be performed to trigger the action. [default: "R"]

Note this is <Shift-R> to trigger the action.

Example
{
    keymap = {
        ui = {
            main = {
                tabs = {
                    refresh = 'R'
                }
            }
        }
    }
}