some bugfixes for the upcomming version of neovim (0.12.0)
This commit is contained in:
parent
23a5559fc8
commit
e8dddacc01
4 changed files with 14 additions and 48 deletions
2
init.lua
2
init.lua
|
@ -6,4 +6,4 @@ require("pika.lazy")
|
||||||
-- │ themes are under ./lua/pika/plugins/colorschemes.lua │
|
-- │ themes are under ./lua/pika/plugins/colorschemes.lua │
|
||||||
-- ╰──────────────────────────────────────────────────────╯
|
-- ╰──────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
vim.cmd.colorscheme("zephyr")
|
vim.cmd.colorscheme("lavish")
|
||||||
|
|
|
@ -7,16 +7,10 @@ return {
|
||||||
{ "folke/neodev.nvim", opts = {} },
|
{ "folke/neodev.nvim", opts = {} },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- import lspconfig plugin
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
-- import mason_lspconfig plugin
|
|
||||||
local mason_lspconfig = require("mason-lspconfig")
|
local mason_lspconfig = require("mason-lspconfig")
|
||||||
|
|
||||||
-- import cmp-nvim-lsp plugin
|
|
||||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
|
local keymap = vim.keymap
|
||||||
local keymap = vim.keymap -- for conciseness
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||||
|
@ -57,21 +51,18 @@ return {
|
||||||
end
|
end
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers({
|
mason_lspconfig.setup_handlers({
|
||||||
-- default handler for installed servers
|
|
||||||
function(server_name)
|
function(server_name)
|
||||||
lspconfig[server_name].setup({
|
lspconfig[server_name].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
["svelte"] = function()
|
["svelte"] = function()
|
||||||
-- configure svelte server
|
|
||||||
lspconfig["svelte"].setup({
|
lspconfig["svelte"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
pattern = { "*.js", "*.ts" },
|
pattern = { "*.js", "*.ts" },
|
||||||
callback = function(ctx)
|
callback = function(ctx)
|
||||||
-- Here use ctx.match instead of ctx.file
|
|
||||||
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
@ -79,14 +70,12 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
["graphql"] = function()
|
["graphql"] = function()
|
||||||
-- configure graphql language server
|
|
||||||
lspconfig["graphql"].setup({
|
lspconfig["graphql"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
|
filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
["emmet_ls"] = function()
|
["emmet_ls"] = function()
|
||||||
-- configure emmet language server
|
|
||||||
lspconfig["emmet_ls"].setup({
|
lspconfig["emmet_ls"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
|
@ -102,12 +91,10 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
["lua_ls"] = function()
|
["lua_ls"] = function()
|
||||||
-- ─< configure lua server (with special settings) >────────────────────────────────────
|
|
||||||
lspconfig["lua_ls"].setup({
|
lspconfig["lua_ls"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
-- ─< make the language server recognize "vim" global >─────────────────────────────────
|
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "vim" },
|
globals = { "vim" },
|
||||||
},
|
},
|
||||||
|
@ -119,25 +106,22 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
["cssls"] = function()
|
["cssls"] = function()
|
||||||
-- ─< configure CSS server >────────────────────────────────────────────────────────────
|
|
||||||
lspconfig["cssls"].setup({
|
lspconfig["cssls"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = {
|
filetypes = { "css", "scss" },
|
||||||
-- "html",
|
|
||||||
"css",
|
|
||||||
"scss",
|
|
||||||
-- "php",
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
["intelephense"] = function()
|
["intelephense"] = function()
|
||||||
-- ─< configure PHP server >────────────────────────────────────────────────────────────
|
|
||||||
lspconfig["intelephense"].setup({
|
lspconfig["intelephense"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = {
|
filetypes = { "php", "blade.php" },
|
||||||
"php",
|
})
|
||||||
"blade.php",
|
end,
|
||||||
},
|
["tsserver"] = function()
|
||||||
|
-- Replace tsserver with typescript-language-server
|
||||||
|
lspconfig["typescript-language-server"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
@ -18,7 +18,7 @@ return {
|
||||||
keys = {
|
keys = {
|
||||||
-- ─< just the standard two keybindings I configured. Be sure to make your own one, if you'd like >─
|
-- ─< just the standard two keybindings I configured. Be sure to make your own one, if you'd like >─
|
||||||
{ "<leader>sm", "<cmd>TelesnipShowSnippets<CR>", desc = "Open Snippet Picker" },
|
{ "<leader>sm", "<cmd>TelesnipShowSnippets<CR>", desc = "Open Snippet Picker" },
|
||||||
{ "<leader>cs", "<cmd>TelesnipCustomSnippet<CR>", desc = "Save Custom Snippet" },
|
{ "<leader>sc", "<cmd>TelesnipCustomSnippet<CR>", desc = "Save Custom Snippet" },
|
||||||
{ "<leader>cs", "<cmd>TelesnipCustomSnippet<CR>", mode = "v", desc = "Save Custom Snippet" },
|
{ "<leader>sc", "<cmd>TelesnipCustomSnippet<CR>", mode = "v", desc = "Save Custom Snippet" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,33 +9,18 @@ return {
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
},
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
autotag = { enable = true },
|
autotag = { enable = true },
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"fish",
|
-- "fish",
|
||||||
-- "http",
|
|
||||||
-- "html",
|
|
||||||
-- "php",
|
|
||||||
-- "css",
|
|
||||||
-- "scss",
|
|
||||||
"gitignore",
|
"gitignore",
|
||||||
"git_config",
|
"git_config",
|
||||||
"markdown",
|
"markdown",
|
||||||
"markdown_inline",
|
"markdown_inline",
|
||||||
-- "dockerfile",
|
|
||||||
"yaml",
|
"yaml",
|
||||||
-- "json",
|
|
||||||
-- "javascript",
|
|
||||||
-- "typescript",
|
|
||||||
-- "graphql",
|
|
||||||
"lua",
|
"lua",
|
||||||
-- "query",
|
|
||||||
-- "c",
|
|
||||||
-- "prisma",
|
|
||||||
-- "hyprlang",
|
|
||||||
"ini",
|
"ini",
|
||||||
"passwd",
|
"passwd",
|
||||||
"vim",
|
"vim",
|
||||||
|
@ -50,9 +35,6 @@ return {
|
||||||
node_decremental = "<bs>",
|
node_decremental = "<bs>",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Add these fields to address the error
|
|
||||||
sync_install = true,
|
|
||||||
auto_install = true,
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue