update
This commit is contained in:
parent
a0049b8e06
commit
ed3cabf8b0
6 changed files with 119 additions and 8 deletions
39
lua/plugins/cmp.lua
Normal file
39
lua/plugins/cmp.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"L3MON4D3/LuaSnip",
|
||||
},
|
||||
opts = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
return {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
completion = { completeopt = "menu,menuone,noselect" },
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require("cmp").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
||||
36
lua/plugins/lsp.lua
Normal file
36
lua/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"folke/neoconf.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
ts_ls = {},
|
||||
html = {},
|
||||
cssls = {},
|
||||
jsonls = {},
|
||||
bashls = {},
|
||||
marksman = {},
|
||||
intelephense = {},
|
||||
}
|
||||
|
||||
for name, opts in pairs(servers) do
|
||||
local ok, mod = pcall(require, "lspconfig." .. name)
|
||||
if ok and mod and type(mod.setup) == "function" then
|
||||
opts = vim.tbl_deep_extend("force", { capabilities = capabilities }, opts or {})
|
||||
mod.setup(opts)
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
10
lua/plugins/neoconf.lua
Normal file
10
lua/plugins/neoconf.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
"folke/neoconf.nvim",
|
||||
lazy = false, -- load early so it can influence lspconfig later
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function(_, opts)
|
||||
require("neoconf").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +1,25 @@
|
|||
-- Minimal settings for bootstrap phase
|
||||
-- Minimal settings for bootstrap and Phase 3.2
|
||||
|
||||
-- Disable unused language providers early; enable later only if a plugin requires them
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
vim.g.loaded_perl_provider = 0
|
||||
vim.g.loaded_node_provider = 0
|
||||
|
||||
-- Additional non-plugin options will be migrated in Phase 3
|
||||
-- Phase 3.2: non-plugin settings (legacy values where specified)
|
||||
-- Completion UI for nvim-cmp
|
||||
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
||||
|
||||
-- Spelling
|
||||
vim.opt.spelllang = { 'en_gb' }
|
||||
|
||||
-- Visuals
|
||||
vim.opt.showbreak = ' ↳'
|
||||
vim.opt.listchars = {
|
||||
eol = '¬',
|
||||
tab = '│ ',
|
||||
trail = '~',
|
||||
extends = '>',
|
||||
precedes = '<',
|
||||
space = '·',
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue