2021-04-14 08:53:10 +01:00
|
|
|
local g = vim.g
|
|
|
|
|
2021-03-13 01:23:02 +00:00
|
|
|
vim.o.termguicolors = true
|
2021-03-07 14:22:30 +00:00
|
|
|
|
2021-04-02 06:36:20 +01:00
|
|
|
g.nvim_tree_side = "left"
|
2021-06-14 03:27:56 +01:00
|
|
|
g.nvim_tree_width = 25
|
2021-04-02 06:36:20 +01:00
|
|
|
g.nvim_tree_ignore = {".git", "node_modules", ".cache"}
|
|
|
|
g.nvim_tree_auto_open = 0
|
|
|
|
g.nvim_tree_auto_close = 0
|
|
|
|
g.nvim_tree_quit_on_open = 0
|
|
|
|
g.nvim_tree_follow = 1
|
|
|
|
g.nvim_tree_indent_markers = 1
|
|
|
|
g.nvim_tree_hide_dotfiles = 1
|
|
|
|
g.nvim_tree_git_hl = 1
|
2021-05-10 18:30:48 +01:00
|
|
|
g.nvim_tree_root_folder_modifier = ":t"
|
|
|
|
g.nvim_tree_tab_open = 0
|
2021-04-02 06:36:20 +01:00
|
|
|
g.nvim_tree_allow_resize = 1
|
|
|
|
|
|
|
|
g.nvim_tree_show_icons = {
|
2021-03-13 01:23:02 +00:00
|
|
|
git = 1,
|
|
|
|
folders = 1,
|
|
|
|
files = 1
|
|
|
|
}
|
2021-03-07 14:22:30 +00:00
|
|
|
|
2021-04-02 06:36:20 +01:00
|
|
|
g.nvim_tree_icons = {
|
2021-03-13 01:23:02 +00:00
|
|
|
default = " ",
|
|
|
|
symlink = " ",
|
|
|
|
git = {
|
|
|
|
unstaged = "✗",
|
|
|
|
staged = "✓",
|
|
|
|
unmerged = "",
|
|
|
|
renamed = "➜",
|
2021-06-01 19:45:55 +01:00
|
|
|
untracked = "★",
|
|
|
|
deleted = "",
|
|
|
|
ignored = "◌"
|
2021-03-13 01:23:02 +00:00
|
|
|
},
|
|
|
|
folder = {
|
|
|
|
default = "",
|
|
|
|
open = "",
|
2021-06-01 19:45:55 +01:00
|
|
|
symlink = "",
|
|
|
|
empty = "",
|
2021-06-14 03:27:56 +01:00
|
|
|
empty_open = "",
|
2021-06-01 19:45:55 +01:00
|
|
|
symlink_open = ""
|
2021-03-13 01:23:02 +00:00
|
|
|
}
|
|
|
|
}
|
2021-03-07 14:22:30 +00:00
|
|
|
-- Mappings for nvimtree
|
|
|
|
|
2021-03-13 01:23:02 +00:00
|
|
|
vim.api.nvim_set_keymap(
|
|
|
|
"n",
|
|
|
|
"<C-n>",
|
|
|
|
":NvimTreeToggle<CR>",
|
|
|
|
{
|
|
|
|
noremap = true,
|
|
|
|
silent = true
|
|
|
|
}
|
|
|
|
)
|
2021-03-07 14:22:30 +00:00
|
|
|
|
2021-06-01 19:45:55 +01:00
|
|
|
local tree_cb = require "nvim-tree.config".nvim_tree_callback
|
|
|
|
|
2021-04-02 06:36:20 +01:00
|
|
|
g.nvim_tree_bindings = {
|
2021-06-01 19:45:55 +01:00
|
|
|
["u"] = ":lua require'some_module'.some_function()<cr>",
|
|
|
|
-- default mappings
|
|
|
|
["<CR>"] = tree_cb("edit"),
|
|
|
|
["o"] = tree_cb("edit"),
|
|
|
|
["<2-LeftMouse>"] = tree_cb("edit"),
|
|
|
|
["<2-RightMouse>"] = tree_cb("cd"),
|
|
|
|
["<C-]>"] = tree_cb("cd"),
|
|
|
|
["<C-v>"] = tree_cb("vsplit"),
|
|
|
|
["<C-x>"] = tree_cb("split"),
|
|
|
|
["<C-t>"] = tree_cb("tabnew"),
|
|
|
|
["<"] = tree_cb("prev_sibling"),
|
|
|
|
[">"] = tree_cb("next_sibling"),
|
|
|
|
["<BS>"] = tree_cb("close_node"),
|
|
|
|
["<S-CR>"] = tree_cb("close_node"),
|
|
|
|
["<Tab>"] = tree_cb("preview"),
|
|
|
|
["I"] = tree_cb("toggle_ignored"),
|
|
|
|
["H"] = tree_cb("toggle_dotfiles"),
|
|
|
|
["R"] = tree_cb("refresh"),
|
|
|
|
["a"] = tree_cb("create"),
|
|
|
|
["d"] = tree_cb("remove"),
|
|
|
|
["r"] = tree_cb("rename"),
|
|
|
|
["<C-r>"] = tree_cb("full_rename"),
|
|
|
|
["x"] = tree_cb("cut"),
|
|
|
|
["c"] = tree_cb("copy"),
|
|
|
|
["p"] = tree_cb("paste"),
|
|
|
|
["y"] = tree_cb("copy_name"),
|
|
|
|
["Y"] = tree_cb("copy_path"),
|
|
|
|
["gy"] = tree_cb("copy_absolute_path"),
|
|
|
|
["[c"] = tree_cb("prev_git_item"),
|
|
|
|
["]c"] = tree_cb("next_git_item"),
|
|
|
|
["-"] = tree_cb("dir_up"),
|
|
|
|
["q"] = tree_cb("close")
|
2021-03-07 14:22:30 +00:00
|
|
|
}
|