aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/neovim/default.nix3
-rw-r--r--modules/neovim/nvim/lua/config/lsp/clangd.lua21
-rw-r--r--modules/neovim/nvim/lua/config/lsp/init.lua (renamed from modules/neovim/nvim/lua/config/lsp.lua)14
-rw-r--r--modules/neovim/nvim/lua/config/lsp/zls.lua11
-rw-r--r--modules/sway/default.nix2
5 files changed, 47 insertions, 4 deletions
diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix
index 8052535..d3c1096 100644
--- a/modules/neovim/default.nix
+++ b/modules/neovim/default.nix
@@ -45,13 +45,14 @@ in
type = "lua";
}
plenary-nvim
-# blink-cmp
nvim-lspconfig
base16-nvim
telescope-nvim
telescope-fzf-native-nvim
vim-obsession
];
+ # extraLuaPackages = ps: with ps; [
+ # ];
extraLuaConfig = ''
${builtins.readFile ./nvim/init.lua}
'';
diff --git a/modules/neovim/nvim/lua/config/lsp/clangd.lua b/modules/neovim/nvim/lua/config/lsp/clangd.lua
new file mode 100644
index 0000000..14554a4
--- /dev/null
+++ b/modules/neovim/nvim/lua/config/lsp/clangd.lua
@@ -0,0 +1,21 @@
+return {
+ cmd = { "clangd" },
+ filetypes = { "c", "cpp", "cuda" },
+ root_markers = {
+ "meson.build",
+ ".clang-format",
+ ".clang-tidy",
+ "compile_commands.json",
+ "compile_flags.txt",
+ "configure.ac"
+ },
+ single_file_support = true,
+ capabilities = {
+ textDocument = {
+ completion = {
+ editsNearCursor = true,
+ },
+ },
+ offsetEncoding = { "utf-8", "utf-16" },
+ },
+}
diff --git a/modules/neovim/nvim/lua/config/lsp.lua b/modules/neovim/nvim/lua/config/lsp/init.lua
index d0a9827..d618df2 100644
--- a/modules/neovim/nvim/lua/config/lsp.lua
+++ b/modules/neovim/nvim/lua/config/lsp/init.lua
@@ -4,10 +4,15 @@ vim.opt.pumblend=5
local methods = vim.lsp.protocol.Methods
local map = vim.keymap.set
+vim.lsp.config = {
+ ['clangd'] = require("config.lsp.clangd"),
+ ['zls'] = require("config.lsp.zls")
+}
+
local servers = {
clangd = {},
zls = {},
- rust_analyzer = {}
+-- rust_analyzer = {}
}
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
@@ -81,5 +86,10 @@ local lspconfig = require('lspconfig')
for server, config in pairs(servers) do
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
- lspconfig[server].setup({})
+ vim.lsp.config[server].settings = config
+ vim.lsp.enable(server)
+-- lspconfig[server].setup({})
end
+
+-- vim.lsp.config['clangd'] = require('config.lsp.clangd')
+-- vim.lsp.enable('clangd')
diff --git a/modules/neovim/nvim/lua/config/lsp/zls.lua b/modules/neovim/nvim/lua/config/lsp/zls.lua
new file mode 100644
index 0000000..d2013a4
--- /dev/null
+++ b/modules/neovim/nvim/lua/config/lsp/zls.lua
@@ -0,0 +1,11 @@
+return {
+ cmd = { "zls" },
+ filetypes = { "zig", "zir" },
+ on_new_config = function(new, old)
+ if vim.fn.filereadable(vim.fs.joinpath(new_root_dir, "zls.json")) ~= 0 then
+ new.cmd = { "zls", "--config-path", "zls.json" }
+ end
+ end,
+ root_markers = { "zls.json", "build.zig", ".git" },
+ single_file_support = true,
+}
diff --git a/modules/sway/default.nix b/modules/sway/default.nix
index 8ea4e38..b2d029e 100644
--- a/modules/sway/default.nix
+++ b/modules/sway/default.nix
@@ -258,7 +258,7 @@ in
seat = {
"*" = {
- hide_cursor = "1500";
+ # hide_cursor = "1500";
xcursor_theme = "Adwaita 18";
};
};