aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--store/config/nvim/init.lua4
-rw-r--r--store/config/nvim/lazy-lock.json2
-rw-r--r--store/config/nvim/lua/plugins.lua1
-rw-r--r--store/config/nvim/lua/setup/init.lua3
-rw-r--r--store/config/nvim/lua/setup/lsp.lua48
5 files changed, 35 insertions, 23 deletions
diff --git a/store/config/nvim/init.lua b/store/config/nvim/init.lua
index 95d1c30..47afca0 100644
--- a/store/config/nvim/init.lua
+++ b/store/config/nvim/init.lua
@@ -10,7 +10,9 @@ if not vim.uv.fs_stat(lazy_path) then
})
end
vim.opt.rtp:prepend(lazy_path)
-require("lazy").setup("plugins")
+require("lazy").setup {
+ spec = { { import = "plugins" } }
+}
if vim.g.neovide then
vim.opt.guifont = "Maple Mono NF";
diff --git a/store/config/nvim/lazy-lock.json b/store/config/nvim/lazy-lock.json
index 9869b1d..69c535c 100644
--- a/store/config/nvim/lazy-lock.json
+++ b/store/config/nvim/lazy-lock.json
@@ -11,7 +11,7 @@
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lint": { "branch": "master", "commit": "b47cbb249351873e3a571751c3fb66ed6369852f" },
- "nvim-lspconfig": { "branch": "master", "commit": "8adb3b5938f6074a1bcc36d3c3916f497d2e8ec4" },
+ "nvim-lspconfig": { "branch": "master", "commit": "036885e8e5456d3907626b634693234f628afef6" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
diff --git a/store/config/nvim/lua/plugins.lua b/store/config/nvim/lua/plugins.lua
index 480ea8f..4f61660 100644
--- a/store/config/nvim/lua/plugins.lua
+++ b/store/config/nvim/lua/plugins.lua
@@ -19,7 +19,6 @@ return {
"MunifTanjim/nui.nvim",
-- {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information
},
- lazy = false, -- neo-tree will lazily load itself
},
{
"nvim-lualine/lualine.nvim",
diff --git a/store/config/nvim/lua/setup/init.lua b/store/config/nvim/lua/setup/init.lua
index df3eb3d..ec8c8d4 100644
--- a/store/config/nvim/lua/setup/init.lua
+++ b/store/config/nvim/lua/setup/init.lua
@@ -1,3 +1,5 @@
+-- spellchecker: words termguicolors
+
local function close_float()
local wins = vim.api.nvim_list_wins()
for _, v in ipairs(wins) do
@@ -12,7 +14,6 @@ local function setup()
require("setup.win").setup()
end
- -- spellchecker: ignore termguicolors
vim.opt.termguicolors = true;
vim.opt.fileformats = "unix,dos";
vim.opt.number = true;
diff --git a/store/config/nvim/lua/setup/lsp.lua b/store/config/nvim/lua/setup/lsp.lua
index 15deacd..77c9062 100644
--- a/store/config/nvim/lua/setup/lsp.lua
+++ b/store/config/nvim/lua/setup/lsp.lua
@@ -15,19 +15,21 @@ local function setup_clangd()
clangd = brew_clangd_path
end
- vim.lsp.config("clangd", {
- cmd = { clangd }
+ vim.lsp.config("clangd", { cmd = { clangd } })
+
+ vim.api.nvim_create_autocmd('LspAttach', {
+ callback = function(ev)
+ local client = vim.lsp.get_client_by_id(ev.data.client_id)
+ if client and client.name == "clangd" then
+ vim.keymap.set('n', 'grs', "<cmd>ClangdSwitchSourceHeader<cr>", {
+ buffer = ev.buf
+ })
+ end
+ end
})
- local old_on_attach = vim.lsp.config.clangd.on_attach
- vim.lsp.config.clangd.on_attach = function(client, bufnr)
- if old_on_attach then old_on_attach(client, bufnr) end
- vim.keymap.set('n', 'grs', "<cmd>ClangdSwitchSourceHeader<cr>", {
- buffer = bufnr
- })
- end
end
-local function setup_luals()
+local function setup_lua_ls()
vim.lsp.config("lua_ls", {
settings = {
Lua = {
@@ -43,8 +45,6 @@ local function setup_luals()
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
},
- maxPreload = 100000,
- preloadFileSize = 10000,
},
},
},
@@ -52,15 +52,25 @@ local function setup_luals()
end
local function setup()
- vim.lsp.enable('denols')
- vim.lsp.enable('cmake')
- vim.lsp.enable('bashls')
- vim.lsp.enable('html')
- vim.lsp.enable('cssls')
setup_clangd()
- setup_luals()
-end
+ setup_lua_ls()
+
+ function _G.crupest_no_range_format()
+ vim.notify("Range format is no supported by the lsp.", vim.log.levels.ERROR, {})
+ end
+
+ vim.api.nvim_create_autocmd('LspAttach', {
+ callback = function(ev)
+ local client = vim.lsp.get_client_by_id(ev.data.client_id)
+ vim.keymap.set('n', 'gqa', vim.lsp.buf.format, { buffer = ev.buf })
+ if client and not client:supports_method('textDocument/rangeFormatting') then
+ vim.bo[ev.buf].formatexpr = "v:lua.crupest_no_range_format()"
+ end
+ end
+ })
+ vim.lsp.enable({ "clangd", "lua_ls", "denols" })
+end
return {
setup = setup