From ead9a06e790c6c41d62c0c42202db754e97be614 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 25 Aug 2024 12:13:37 +0200 Subject: [PATCH] configured lf plugin --- lua/pika/plugins/lf.lua | 59 ++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/lua/pika/plugins/lf.lua b/lua/pika/plugins/lf.lua index 00183e4..95cf162 100644 --- a/lua/pika/plugins/lf.lua +++ b/lua/pika/plugins/lf.lua @@ -1,26 +1,43 @@ 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 + "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({ - escape_quit = false, - border = "rounded", - }) + require("lf").setup({ + default_action = "drop", -- default action when `Lf` opens a file + default_actions = { -- default action keybindings + [""] = "tabedit", + [""] = "split", + [""] = "vsplit", + [""] = "tab drop", + }, + winblend = 10, -- psuedotransparency level + dir = "", -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD) + direction = "float", -- window type: float horizontal vertical + border = "shadow", -- border kind: single double shadow curved + -- height = fn.float2nr(fn.round(0.75 * o.lines)), -- height of the *floating* window + -- width = fn.float2nr(fn.round(0.75 * o.columns)), -- width of the *floating* window + 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 = true, -- tmux statusline can be disabled on opening of Lf + default_file_manager = false, -- 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", "lf", "Lf") + -- Set keymap for Lf + vim.keymap.set("n", "lf", "Lf") - -- 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, + -- 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, }