:chore: add oil.vim shortcuts
This commit is contained in:
@@ -37,6 +37,14 @@ bind('n', '<leader>w', '<cmd>%s/\\s\\+$/<cr><cmd>nohlsearch<cr>', { desc = 'Dele
|
|||||||
bind('n', '<leader>cc', '<cmd>cclose<cr>')
|
bind('n', '<leader>cc', '<cmd>cclose<cr>')
|
||||||
bind('n', '<leader>co', '<cmd>copen<cr>')
|
bind('n', '<leader>co', '<cmd>copen<cr>')
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<M-1>", function()
|
||||||
|
local dir = vim.fn.expand("%:p:h")
|
||||||
|
if dir == "" then
|
||||||
|
dir = vim.loop.cwd()
|
||||||
|
end
|
||||||
|
require("oil").open(dir)
|
||||||
|
end, { desc = "Open Oil in current file directory" })
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
-- bind('n', '<leader>ff', '<cmd>Telescope find_files<cr>')
|
-- bind('n', '<leader>ff', '<cmd>Telescope find_files<cr>')
|
||||||
-- bind('n', '<leader>fg', '<cmd>Telescope live_grep<cr>')
|
-- bind('n', '<leader>fg', '<cmd>Telescope live_grep<cr>')
|
||||||
|
|||||||
+2
-1
@@ -68,7 +68,8 @@ require("oil").setup({
|
|||||||
["<C-h>"] = { "actions.select", opts = { horizontal = true } },
|
["<C-h>"] = { "actions.select", opts = { horizontal = true } },
|
||||||
["<C-t>"] = { "actions.select", opts = { tab = true } },
|
["<C-t>"] = { "actions.select", opts = { tab = true } },
|
||||||
["<C-p>"] = "actions.preview",
|
["<C-p>"] = "actions.preview",
|
||||||
["<C-c>"] = { "actions.close", mode = "n" },
|
-- ["<C-c>"] = { "actions.close", mode = "n" },
|
||||||
|
["q"] = { "actions.close", mode = "n" },
|
||||||
["<C-l>"] = "actions.refresh",
|
["<C-l>"] = "actions.refresh",
|
||||||
["-"] = { "actions.parent", mode = "n" },
|
["-"] = { "actions.parent", mode = "n" },
|
||||||
["_"] = { "actions.open_cwd", mode = "n" },
|
["_"] = { "actions.open_cwd", mode = "n" },
|
||||||
|
|||||||
Reference in New Issue
Block a user