addet explorer.lua to have central management of fileexplorer -> also changed the default to ranger
This commit is contained in:
parent
450104e75e
commit
a98a9aa78d
2 changed files with 73 additions and 40 deletions
73
lua/pika/plugins/explorer.lua
Normal file
73
lua/pika/plugins/explorer.lua
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"kelly-lin/ranger.nvim",
|
||||||
|
config = function()
|
||||||
|
local ranger_nvim = require("ranger-nvim")
|
||||||
|
ranger_nvim.setup({
|
||||||
|
enable_cmds = false,
|
||||||
|
replace_netrw = false,
|
||||||
|
keybinds = {
|
||||||
|
["<C-v>"] = ranger_nvim.OPEN_MODE.vsplit,
|
||||||
|
["<C-h>"] = ranger_nvim.OPEN_MODE.split,
|
||||||
|
["ot"] = ranger_nvim.OPEN_MODE.tabedit,
|
||||||
|
["or"] = ranger_nvim.OPEN_MODE.rifle,
|
||||||
|
},
|
||||||
|
ui = {
|
||||||
|
border = "none",
|
||||||
|
height = 0.7,
|
||||||
|
width = 0.7,
|
||||||
|
x = 0.5,
|
||||||
|
y = 0.5,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("ranger-nvim").setup({ replace_netrw = true })
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>lf", "", {
|
||||||
|
noremap = true,
|
||||||
|
callback = function()
|
||||||
|
require("ranger-nvim").open(true)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- "lmburns/lf.nvim",
|
||||||
|
-- dependencies = {
|
||||||
|
-- "akinsho/toggleterm.nvim",
|
||||||
|
-- },
|
||||||
|
-- config = function()
|
||||||
|
-- -- This feature will not work if the plugin is lazy-loaded
|
||||||
|
-- vim.g.lf_netrw = 1
|
||||||
|
--
|
||||||
|
-- require("lf").setup({
|
||||||
|
-- default_action = "drop", -- default action when `Lf` opens a file
|
||||||
|
-- default_actions = { -- default action keybindings
|
||||||
|
-- ["<C-t>"] = "tabedit",
|
||||||
|
-- ["<C-x>"] = "split",
|
||||||
|
-- ["<C-v>"] = "vsplit",
|
||||||
|
-- ["<C-o>"] = "tab drop",
|
||||||
|
-- },
|
||||||
|
-- winblend = 30, -- psuedotransparency level
|
||||||
|
-- direction = "float", -- window type: float horizontal vertical
|
||||||
|
-- border = "curved", -- border kind: single double shadow curved
|
||||||
|
-- escape_quit = true, -- map escape to the quit command (so it doesn't go into a meta normal mode)
|
||||||
|
-- focus_on_open = true, -- focus the current file when opening Lf (experimental)
|
||||||
|
-- mappings = true, -- whether terminal buffer mapping is enabled
|
||||||
|
-- tmux = false, -- tmux statusline can be disabled on opening of Lf
|
||||||
|
-- default_file_manager = true, -- make lf default file manager
|
||||||
|
-- disable_netrw_warning = true, -- don't display a message when opening a directory with `default_file_manager` as true
|
||||||
|
-- })
|
||||||
|
--
|
||||||
|
-- -- Set keymap for Lf
|
||||||
|
-- vim.keymap.set("n", "<leader>lf", "<Cmd>Lf<CR>")
|
||||||
|
--
|
||||||
|
-- -- Create autocmd for LfTermEnter
|
||||||
|
-- vim.api.nvim_create_autocmd("User", {
|
||||||
|
-- pattern = "LfTermEnter",
|
||||||
|
-- callback = function(a)
|
||||||
|
-- vim.api.nvim_buf_set_keymap(a.buf, "t", "q", "q", { nowait = true })
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
}
|
|
@ -1,40 +0,0 @@
|
||||||
return {
|
|
||||||
"lmburns/lf.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"akinsho/toggleterm.nvim",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- This feature will not work if the plugin is lazy-loaded
|
|
||||||
vim.g.lf_netrw = 1
|
|
||||||
|
|
||||||
require("lf").setup({
|
|
||||||
default_action = "drop", -- default action when `Lf` opens a file
|
|
||||||
default_actions = { -- default action keybindings
|
|
||||||
["<C-t>"] = "tabedit",
|
|
||||||
["<C-x>"] = "split",
|
|
||||||
["<C-v>"] = "vsplit",
|
|
||||||
["<C-o>"] = "tab drop",
|
|
||||||
},
|
|
||||||
winblend = 30, -- psuedotransparency level
|
|
||||||
direction = "float", -- window type: float horizontal vertical
|
|
||||||
border = "curved", -- border kind: single double shadow curved
|
|
||||||
escape_quit = true, -- map escape to the quit command (so it doesn't go into a meta normal mode)
|
|
||||||
focus_on_open = true, -- focus the current file when opening Lf (experimental)
|
|
||||||
mappings = true, -- whether terminal buffer mapping is enabled
|
|
||||||
tmux = false, -- tmux statusline can be disabled on opening of Lf
|
|
||||||
default_file_manager = true, -- make lf default file manager
|
|
||||||
disable_netrw_warning = true, -- don't display a message when opening a directory with `default_file_manager` as true
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Set keymap for Lf
|
|
||||||
vim.keymap.set("n", "<leader>lf", "<Cmd>Lf<CR>")
|
|
||||||
|
|
||||||
-- Create autocmd for LfTermEnter
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
pattern = "LfTermEnter",
|
|
||||||
callback = function(a)
|
|
||||||
vim.api.nvim_buf_set_keymap(a.buf, "t", "q", "q", { nowait = true })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue