summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua')
-rw-r--r--.config/nvim/lua/user/lsp/common.lua9
-rw-r--r--.config/nvim/lua/user/lsp/lua.lua15
-rw-r--r--.config/nvim/lua/user/lsp/rust.lua4
3 files changed, 23 insertions, 5 deletions
diff --git a/.config/nvim/lua/user/lsp/common.lua b/.config/nvim/lua/user/lsp/common.lua
index 032cb7f..acc3a64 100644
--- a/.config/nvim/lua/user/lsp/common.lua
+++ b/.config/nvim/lua/user/lsp/common.lua
@@ -11,6 +11,7 @@ luasnip.setup()
local expnoresilent = {expr = true, noremap = true, silent = true}
local noresilent = {noremap = true, silent = true}
+local map = cmp.mapping
-- stolen from https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance
local kind_icons = {
@@ -36,14 +37,18 @@ local stolen_function = function() -- to check whether there are words before cu
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
--- TODO: Finish
cmp.setup {
snippet = {
expand = function(args)
- vim.fn["vsnip#anonymous"](args.body) -- for vsnip (i left it)
+ -- vim.fn["vsnip#anonymous"](args.body) -- for vsnip (i left it)
luasnip.lsp_expand(args.body) -- for luasnip cause i like it more
end,
},
+ mapping = {
+ ["<C-n>"] = map.select_next_item(),
+ ["<C-p>"] = map(map.select_prev_item({ behavior = cmp.SelectBehavior.Insert })),
+ ["<C-Space>"] = map.complete(),
+ },
-- NOTE: ordering or this table affects completions ordering
sources = { -- TODO: Add keyword_length to some of them ??????
{ name = 'nvim_lsp' },
diff --git a/.config/nvim/lua/user/lsp/lua.lua b/.config/nvim/lua/user/lsp/lua.lua
index 5cd4a2e..f352dd6 100644
--- a/.config/nvim/lua/user/lsp/lua.lua
+++ b/.config/nvim/lua/user/lsp/lua.lua
@@ -1 +1,16 @@
lsp = require 'lspconfig'
+
+-- lsp.lua.setup {
+-- cmd = {
+-- "/usr/bin/lua-language-server",
+-- "-E", "/usr/lib/lua-language-server/main.lua"
+-- },
+-- filetypes = { "lua" },
+-- root_dir = lsp.util.root_pattern("Makefile"),
+-- settings = {
+-- ["lua-language-server"] = {
+-- runtime = { version = 'LuaJIT' },
+-- workspace = { library = vim.api.nvim_get_runtime_file("", true) },
+-- },
+-- },
+-- }
diff --git a/.config/nvim/lua/user/lsp/rust.lua b/.config/nvim/lua/user/lsp/rust.lua
index cfc5c2a..def29af 100644
--- a/.config/nvim/lua/user/lsp/rust.lua
+++ b/.config/nvim/lua/user/lsp/rust.lua
@@ -16,11 +16,9 @@ lsp.rust_analyzer.setup{
capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()),
settings = {
["rust-analyzer"] = {
- disgnostics = { enable = false },
+ disgnostics = { enable = true },
inlayHints = { typeHints = true },
},
},
}
-
-