dotfiles/config/neovim/after/plugin/lir.lua

68 lines
1.4 KiB
Lua
Raw Normal View History

2022-02-16 07:59:33 +00:00
local has_lir, lir = pcall(require, "lir")
if not has_lir then
return
end
2022-03-22 21:27:38 +00:00
local actions = require "lir.actions"
local clipboard_actions = require "lir.clipboard.actions"
local mark_actions = require "lir.mark.actions"
2022-02-16 07:59:33 +00:00
lir.setup {
hide_cursor = true,
show_hidden_files = true,
2022-08-06 05:10:12 +00:00
devicons_enable = true,
2022-02-16 07:59:33 +00:00
mappings = {
2022-03-22 21:27:38 +00:00
["l"] = actions.edit,
["<C-s>"] = actions.split,
["<C-v>"] = actions.vsplit,
["<C-t>"] = actions.tabedit,
["h"] = actions.up,
["q"] = actions.quit,
["K"] = actions.mkdir,
["N"] = actions.newfile,
["R"] = actions.rename,
["@"] = actions.cd,
["Y"] = actions.yank_path,
["."] = actions.toggle_show_hidden,
["D"] = actions.delete,
["J"] = function()
2022-02-16 07:59:33 +00:00
mark_actions.toggle_mark()
2022-03-22 21:27:38 +00:00
vim.cmd "normal! j"
2022-02-16 07:59:33 +00:00
end,
2022-03-22 21:27:38 +00:00
["C"] = clipboard_actions.copy,
["X"] = clipboard_actions.cut,
["P"] = clipboard_actions.paste,
2022-02-16 07:59:33 +00:00
},
float = {
winblend = 0,
curdir_window = {
enable = false,
2022-03-22 21:27:38 +00:00
highlight_dirname = false,
2022-02-16 07:59:33 +00:00
},
},
on_init = function()
-- use visual mode
vim.api.nvim_buf_set_keymap(
0,
"x",
"J",
':<C-u>lua require"lir.mark.actions".toggle_mark("v")<CR>',
{ noremap = true, silent = true }
)
-- echo cwd
2022-03-22 21:27:38 +00:00
vim.api.nvim_echo({ { vim.fn.expand "%:p", "Normal" } }, false, {})
2022-02-16 07:59:33 +00:00
end,
}
2022-08-06 05:10:12 +00:00
require("lir.git_status").setup {
show_ignored = false,
}