diff options
| author | Barrett Ruth <62671086+barrettruth@users.noreply.github.com> | 2026-09-12 09:01:41 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-11 19:01:41 -0400 |
| commit | 4ceb92cd76d0234dd7b3ad775d94de46be108b21 (patch) | |
| tree | 818070b4e893bc5fc29450249cda575cdbb99323 /runtime/lua/nvim/dir | |
| parent | 361191790a3c55bc2079ab85ee92acc99eae44df (diff) | |
| download | rneovim-4ceb92cd76d0234dd7b3ad775d94de46be108b21.tar.gz rneovim-4ceb92cd76d0234dd7b3ad775d94de46be108b21.tar.bz2 rneovim-4ceb92cd76d0234dd7b3ad775d94de46be108b21.zip | |
feat(dir): open entries in splits with a, o mappings #41834
Diffstat (limited to 'runtime/lua/nvim/dir')
| -rw-r--r-- | runtime/lua/nvim/dir/fs.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/lua/nvim/dir/fs.lua b/runtime/lua/nvim/dir/fs.lua index 0af9d3229f..9ff95ce8ad 100644 --- a/runtime/lua/nvim/dir/fs.lua +++ b/runtime/lua/nvim/dir/fs.lua @@ -102,6 +102,15 @@ function M.init(buf, path) if api.nvim_get_option_value('filetype', { buf = buf }) ~= 'directory' then api.nvim_set_option_value('filetype', 'directory', { buf = buf }) end + local dir = require('nvim.dir') + vim.keymap.set('n', '<Plug>(nvim-dir-vsplit)', function() + dir._open_entry('vsplit') + end, { buffer = buf, silent = true, desc = 'Open directory entry in a vertical split' }) + vim.keymap.set('n', '<Plug>(nvim-dir-split)', function() + dir._open_entry('split') + end, { buffer = buf, silent = true, desc = 'Open directory entry in a horizontal split' }) + dir._map(buf, 'a', '<Plug>(nvim-dir-vsplit)') + dir._map(buf, 'o', '<Plug>(nvim-dir-split)') api.nvim_buf_call(buf, function() pcall(api.nvim_cmd, { cmd = 'bcd', |