feat: modify for v0.9.2
This commit is contained in:
@@ -9,11 +9,6 @@ require('gitsigns').setup {
|
||||
},
|
||||
numhl = false,
|
||||
linehl = false,
|
||||
keymaps = {
|
||||
-- Default keymap options
|
||||
noremap = true,
|
||||
buffer = true,
|
||||
},
|
||||
watch_gitdir = {
|
||||
interval = 1000
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ require('pluginconfig/dashboard-nvim')
|
||||
require('pluginconfig/galaxyline')
|
||||
require('pluginconfig/gitsigns')
|
||||
require('pluginconfig/hop')
|
||||
require('pluginconfig/lspinstall')
|
||||
require('pluginconfig/mason')
|
||||
require('pluginconfig/neodev') -- must before lspconfig
|
||||
require('pluginconfig/mkdx')
|
||||
require('pluginconfig/neotest')
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
lsp_installer.settings({
|
||||
install_root_dir = table.concat { vim.fn.stdpath("data"), "/lspinstall" },
|
||||
})
|
||||
|
||||
-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished
|
||||
-- or if the server is already installed).
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
local opts = {
|
||||
}
|
||||
|
||||
-- (optional) Customize the options passed to the server
|
||||
-- if server.name == "tsserver" then
|
||||
-- opts.root_dir = function() ... end
|
||||
-- end
|
||||
|
||||
-- This setup() function will take the provided server configuration and decorate it with the necessary properties
|
||||
-- before passing it onwards to lspconfig.
|
||||
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
server:setup(opts)
|
||||
end)
|
||||
@@ -0,0 +1 @@
|
||||
require("mason").setup()
|
||||
@@ -0,0 +1,20 @@
|
||||
local lint_lib = require('lint')
|
||||
|
||||
lint_lib.linters_by_ft = {
|
||||
go = {'golangcilint'}
|
||||
}
|
||||
|
||||
local golangcilint = lint_lib.linters.golangcilint
|
||||
golangcilint.args = {
|
||||
'run',
|
||||
'--config',
|
||||
'~/.dotfile/.golangci_strict.yml',
|
||||
'--out-format',
|
||||
'json',
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
@@ -1,5 +1,22 @@
|
||||
local tree_cb = require'nvim-tree.config'.nvim_tree_callback
|
||||
local function my_on_attach(bufnr)
|
||||
local api = require "nvim-tree.api"
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
-- default mappings
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
|
||||
-- custom mappings
|
||||
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
|
||||
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
|
||||
vim.keymap.set('n', 'l', api.node.open.edit, opts('Edit'))
|
||||
vim.keymap.set('n', 'h', api.node.navigate.parent_close, opts('Parent Close'))
|
||||
end
|
||||
|
||||
require'nvim-tree'.setup {
|
||||
on_attach = my_on_attach,
|
||||
disable_netrw = true,
|
||||
hijack_netrw = true,
|
||||
--auto_close = false,
|
||||
@@ -22,46 +39,6 @@ require'nvim-tree'.setup {
|
||||
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||
ignore_list = {}
|
||||
},
|
||||
view = {
|
||||
mappings = {
|
||||
--custome_only= false,
|
||||
list = {
|
||||
-- ["<CR>"] = ":YourVimFunction()<cr>",
|
||||
-- ["u"] = ":lua require'some_module'.some_function()<cr>",
|
||||
|
||||
-- default mappings
|
||||
{key="<CR>" ,cb= tree_cb("edit")},
|
||||
{key="o" ,cb= tree_cb("edit")},
|
||||
{key="l" ,action="edit"},
|
||||
{key="<2-LeftMouse>" ,cb= tree_cb("edit")},
|
||||
{key="<2-RightMouse>" ,cb= tree_cb("cd")},
|
||||
{key="<C->" ,cb= tree_cb("cd")},
|
||||
{key="v" ,cb= tree_cb("vsplit")},
|
||||
{key="s" ,cb= tree_cb("split")},
|
||||
{key="<C-t>" ,cb= tree_cb("tabnew")},
|
||||
{key="<" ,cb= tree_cb("prev_sibling")},
|
||||
{key=">" ,cb= tree_cb("next_sibling")},
|
||||
{key="<BS>" ,cb= tree_cb("close_node")},
|
||||
{key="h" ,action="close_node"},
|
||||
{key="<S-CR>" ,cb= tree_cb("close_node")},
|
||||
{key="<Tab>" ,cb= tree_cb("preview")},
|
||||
{key="I" ,cb= tree_cb("toggle_ignored")},
|
||||
{key="H" ,cb= tree_cb("toggle_dotfiles")},
|
||||
{key="R" ,cb= tree_cb("refresh")},
|
||||
{key="a" ,cb= tree_cb("create")},
|
||||
{key="d" ,cb= tree_cb("remove")},
|
||||
{key="r" ,cb= tree_cb("rename")},
|
||||
{key="<C-r>" ,cb= tree_cb("full_rename")},
|
||||
{key="x" ,cb= tree_cb("cut")},
|
||||
{key="c" ,cb= tree_cb("copy")},
|
||||
{key="p" ,cb= tree_cb("paste")},
|
||||
{key="[c" ,cb= tree_cb("prev_git_item")},
|
||||
{key="c" ,cb= tree_cb("next_git_item")},
|
||||
{key="-" ,cb= tree_cb("dir_up")},
|
||||
{key="q" ,cb= tree_cb("close")},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
|
||||
@@ -73,3 +50,4 @@ vim.g.nvim_tree_icons = {
|
||||
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
|
||||
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user