feat(nvim): add lir.nvim
This commit is contained in:
parent
06664fda41
commit
d2ff1cb546
64
roles/neovim/files/after/plugin/lir.lua
Normal file
64
roles/neovim/files/after/plugin/lir.lua
Normal file
|
@ -0,0 +1,64 @@
|
|||
local has_lir, lir = pcall(require, "lir")
|
||||
if not has_lir then
|
||||
return
|
||||
end
|
||||
|
||||
local actions = require'lir.actions'
|
||||
local clipboard_actions = require'lir.clipboard.actions'
|
||||
local mark_actions = require 'lir.mark.actions'
|
||||
|
||||
lir.setup {
|
||||
hide_cursor = true,
|
||||
show_hidden_files = true,
|
||||
-- devicons_enable = true,
|
||||
|
||||
mappings = {
|
||||
['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()
|
||||
mark_actions.toggle_mark()
|
||||
vim.cmd('normal! j')
|
||||
end,
|
||||
|
||||
['C'] = clipboard_actions.copy,
|
||||
['X'] = clipboard_actions.cut,
|
||||
['P'] = clipboard_actions.paste,
|
||||
},
|
||||
|
||||
float = {
|
||||
winblend = 0,
|
||||
curdir_window = {
|
||||
enable = false,
|
||||
highlight_dirname = false
|
||||
},
|
||||
},
|
||||
|
||||
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
|
||||
vim.api.nvim_echo({ { vim.fn.expand("%:p"), "Normal" } }, false, {})
|
||||
end,
|
||||
}
|
||||
|
|
@ -51,6 +51,8 @@ return packer.startup(function()
|
|||
|
||||
-- Navigation
|
||||
use "ThePrimeagen/harpoon"
|
||||
use "tamago324/lir-git-status.nvim"
|
||||
use "tamago324/lir.nvim"
|
||||
|
||||
-- Treesitter
|
||||
use {
|
||||
|
|
Loading…
Reference in a new issue