oil working

This commit is contained in:
Fernando Bueno 2024-06-30 21:00:13 -04:00
parent d9aba24302
commit 5723185b69
2 changed files with 46 additions and 4 deletions

View File

@ -93,13 +93,13 @@ local opts = { noremap = true, silent = false }
-- Normal-mode commands
keymap.set('n', '<S-A-k>', ':MoveLine(-1)<CR>', opts)
keymap.set('n', '<S-A-j>', ':MoveLine(1)<CR>', opts)
keymap.set('n', '<A-h>', ':MoveHChar(-1)<CR>', opts)
keymap.set('n', '<A-l>', ':MoveHChar(1)<CR>', opts)
-- keymap.set('n', '<A-h>', ':MoveHChar(-1)<CR>', opts)
-- keymap.set('n', '<A-l>', ':MoveHChar(1)<CR>', opts)
-- Visual-mode commands
keymap.set('v', '<S-A-j>', ':MoveBlock(1)<CR>', opts)
keymap.set('v', '<S-A-k>', ':MoveBlock(-1)<CR>', opts)
keymap.set('v', '<A-h>', ':MoveHBlock(-1)<CR>', opts)
keymap.set('v', '<A-l>', ':MoveHBlock(1)<CR>', opts)
-- keymap.set('v', '<A-h>', ':MoveHBlock(-1)<CR>', opts)
-- keymap.set('v', '<A-l>', ':MoveHBlock(1)<CR>', opts)
-- Harpoon
keymap.set("n", "<leader>a", function() require("harpoon.mark").add_file() end, opts)

View File

@ -0,0 +1,42 @@
return {
{
"stevearc/oil.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("oil").setup {
columns = { "icon" },
default_file_explorer = true,
delete_to_trash = true,
skip_confirm_for_simple_edits = true,
keymaps = {
["<C-h>"] = false,
["<M-h>"] = "actions.select_split",
["q"] = "actions.close",
},
view_options = {
show_hidden = true,
natural_order = true,
is_always_hidden = function(name, _)
-- return name == ".." or name == ".git"
return name == ".git"
end,
},
float = {
padding = 2,
max_width = 90,
max_height = 0,
},
win_options = {
wrap = true,
winblend = 0,
}
}
-- Open parent directory in current window
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
-- Open parent directory in floating window
vim.keymap.set("n", "<space>-", require("oil").toggle_float)
end,
},
}