feat: modify for v0.9.2

This commit is contained in:
2023-09-13 12:29:12 +08:00
parent d2aa7bad86
commit 47f16510b2
8 changed files with 47 additions and 78 deletions
-5
View File
@@ -9,11 +9,6 @@ require('gitsigns').setup {
},
numhl = false,
linehl = false,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
},
watch_gitdir = {
interval = 1000
},
+1 -1
View File
@@ -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')
-21
View File
@@ -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)
+1
View File
@@ -0,0 +1 @@
require("mason").setup()
+20
View File
@@ -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,
})
+19 -41
View File
@@ -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 = ""}
}
+5 -9
View File
@@ -37,7 +37,7 @@ return require("packer").startup(function(use)
-- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
use { "neovim/nvim-lspconfig"}
use { 'tami5/lspsaga.nvim', opt = true }
use { "williamboman/nvim-lsp-installer", opt = true }
use { "williamboman/mason.nvim" }
use { "folke/trouble.nvim", opt = true }
use { 'stevearc/aerial.nvim', config = function() require('aerial').setup() end }
use {'mfussenegger/nvim-lint'}
@@ -81,10 +81,10 @@ return require("packer").startup(function(use)
-- Explorer
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
opt = true,
config = function() require 'nvim-tree'.setup {} end
'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional
},
}
use { "ahmedkhalf/lsp-rooter.nvim", opt = true } -- with this nvim-tree will follow you
-- TODO remove when open on dir is supported by nvimtree
@@ -158,7 +158,6 @@ return require("packer").startup(function(use)
require_plugin("lspsaga.nvim")
require_plugin("nvim-lsp-installer")
require_plugin('trouble.nvim')
require_plugin("popup.nvim")
require_plugin("plenary.nvim")
@@ -167,7 +166,6 @@ return require("packer").startup(function(use)
require_plugin("nvim-dap")
require_plugin("nvim-ts-autotag")
require_plugin('vim-matchup')
require_plugin("nvim-tree.lua")
require_plugin("gitsigns.nvim")
require_plugin("which-key.nvim")
require_plugin("dashboard-nvim")
@@ -194,8 +192,6 @@ return require("packer").startup(function(use)
use { "akinsho/toggleterm.nvim", tag = '*', config = function()
require("toggleterm").setup()
end }
use { "Pocco81/DAPInstall.nvim", opt = true }
require_plugin("DAPInstall.nvim")
use {
'phaazon/hop.nvim',