fix: modify mason server

This commit is contained in:
2024-06-12 17:49:36 +08:00
parent a9f48d2d59
commit d97fb14d1f
2 changed files with 36 additions and 33 deletions
+7 -5
View File
@@ -6,12 +6,14 @@ return {
"stylua",
"selene",
"luacheck",
"shellcheck",
"bashls",
"shfmt",
"tailwindcss-language-server",
"typescript-language-server",
"css-lsp",
"tailwindcss",
"tsserver",
"pylyzer",
"cssls",
})
end,
},
}
}
+29 -28
View File
@@ -1,38 +1,38 @@
local function my_on_attach(bufnr)
local api = require "nvim-tree.api"
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'))
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Horizontal Split'))
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Vertical Split'))
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"))
vim.keymap.set("n", "s", api.node.open.horizontal, opts("Horizontal Split"))
vim.keymap.set("n", "v", api.node.open.vertical, opts("Vertical Split"))
vim.keymap.set("n", "<S-r>", api.tree.reload, opts("Reload"))
end
vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open
vim.g.nvim_tree_auto_ignore_ft = 'startify' --empty by default, don't auto open tree on specific filetypes.
vim.g.nvim_tree_auto_ignore_ft = "startify" --empty by default, don't auto open tree on specific filetypes.
vim.g.nvim_tree_icons = {
default = '',
symlink = '',
git = {unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = ""},
folder = {default = "", open = "", empty = "", empty_open = "", symlink = ""}
default = "",
symlink = "",
git = { unstaged = "", staged = "✓", unmerged = "", renamed = "➜", untracked = "" },
folder = { default = "", open = "", empty = "", empty_open = "", symlink = "" },
}
return {
{
'nvim-tree/nvim-tree.lua',
"nvim-tree/nvim-tree.lua",
dependencies = {
'nvim-tree/nvim-web-devicons', -- optional
"nvim-tree/nvim-web-devicons", -- optional
},
opts = {
on_attach = my_on_attach,
@@ -41,7 +41,7 @@ return {
--auto_close = false,
filters = {
dotfiles = false,
custom = {}
custom = {},
},
git = {
enable = true,
@@ -50,14 +50,15 @@ return {
},
update_focused_file = {
-- enables the feature
enable = true,
enable = true,
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
-- only relevant when `update_focused_file.enable` is true
update_cwd = false,
update_cwd = false,
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
ignore_list = {}
ignore_list = {},
},
},
},
}
}