neovim conf part 4 i think
This commit is contained in:
parent
ac7ba4097d
commit
d6c19e2e92
12 changed files with 154 additions and 166 deletions
|
@ -1,10 +1,13 @@
|
|||
return {
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
keymaps = {
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
buf_options = {
|
||||
buflisted = true
|
||||
},
|
||||
keymaps = {
|
||||
['<C-j>'] = { '<Down><C-j>', remap = true },
|
||||
|
||||
['<Space>'] = { callback = function()
|
||||
|
@ -18,31 +21,31 @@ return {
|
|||
if cursor_entry.type == 'directory' then
|
||||
oil.select()
|
||||
else
|
||||
|
||||
vim.cmd.wincmd('h')
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
local is_empty = bufname == '' and not vim.bo.modified
|
||||
|
||||
if is_empty then
|
||||
vim.cmd(':q')
|
||||
oil.select({ vertical = true, split = 'topleft' }, function()
|
||||
vim.cmd.wincmd('l')
|
||||
vim.api.nvim_win_set_width(0, 40)
|
||||
vim.cmd.wincmd('h')
|
||||
end)
|
||||
else
|
||||
vim.cmd.wincmd('l')
|
||||
oil.select({ tab = true })
|
||||
end
|
||||
oil.select(nil, function()
|
||||
vim.cmd.wincmd('h')
|
||||
local buf_name = vim.api.nvim_buf_get_name(0)
|
||||
local is_empty = buf_name == '' and not vim.bo.modified
|
||||
if is_empty then
|
||||
-- delete empty buffer
|
||||
vim.cmd('bd')
|
||||
else
|
||||
-- close window of not empty buffer
|
||||
vim.cmd('q')
|
||||
end
|
||||
end)
|
||||
end
|
||||
end, nowait = true },
|
||||
|
||||
-- shift space remapping
|
||||
['<F26>'] = 'actions.parent',
|
||||
}
|
||||
},
|
||||
-- dependencies = { { 'echasnovski/mini.icons', opts = {} } },
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
|
||||
['<C-w>'] = { callback = function()
|
||||
vim.cmd('bd')
|
||||
end, nowait = true }
|
||||
}
|
||||
},
|
||||
-- dependencies = { { 'echasnovski/mini.icons', opts = {} } },
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue