replace some more plugins with lua variants

This commit is contained in:
2021-11-15 07:47:19 +01:00
parent 6c688b5a55
commit 91912472ea
7 changed files with 105 additions and 14 deletions

14
lua/plugins/lualine.lua Normal file
View File

@@ -0,0 +1,14 @@
-- Inserts a component in lualine_c at left section
local config = {}
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- Inserts a component in lualine_x ot right section
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
local config = require('lualine').get_config()
config.options.theme = 'onedark'
require('lualine').setup(config)

33
lua/plugins/nvim-tree.lua Normal file
View File

@@ -0,0 +1,33 @@
local tree_cb = require('nvim-tree.config').nvim_tree_callback
require("nvim-tree").setup {
auto_close = true,
view = {
width = "15%",
side = "left",
mappings = {
custom_only = true,
list = {
{ key = {"<CR>", "<2-LeftMouse>"}, cb = tree_cb("edit") },
{ key = "vs", cb = tree_cb("vsplit") },
{ key = "s", cb = tree_cb("split") },
{ key = "t", cb = tree_cb("tabnew") },
{ key = "<Tab>", cb = tree_cb("preview") },
{ key = "K", cb = tree_cb("first_sibling") },
{ key = "J", cb = tree_cb("last_sibling") },
{ key = "R", cb = tree_cb("refresh") },
{ key = "ma", cb = tree_cb("create") },
{ key = "md", cb = tree_cb("remove") },
{ key = "mm", cb = tree_cb("rename") },
{ key = "<C-r>", cb = tree_cb("full_rename") },
{ key = "mc", cb = ':lua require"nvim-tree".on_keypress("copy");require"nvim-tree".on_keypress("paste")<CR>' },
{ key = "?", cb = tree_cb("toggle_help") },
}
}
}
}
-- Hide statusline in nvim-tree buffer/tabs.
-- vim.cmd('au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname("%") == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif')

View File

@@ -0,0 +1,2 @@
require('telescope').load_extension('fzf')