aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2022-10-30 21:59:47 +0200
committersrdusr <trevorgray@srdusr.com>2022-10-30 21:59:47 +0200
commit9ffdeceda3c36dc6a894190fdaf57b66d3018cd7 (patch)
treed734aae1af4511c8436b568443c457ccf3de1a7d
parentd262b6b886d3d39ce2acc8ad74ba8efbaa479657 (diff)
downloaddotfiles-9ffdeceda3c36dc6a894190fdaf57b66d3018cd7.tar.gz
dotfiles-9ffdeceda3c36dc6a894190fdaf57b66d3018cd7.zip
TODO: fix formatting and diagnostic server settings
-rw-r--r--init.lua2
-rw-r--r--lua/plugins/lsp.lua47
-rw-r--r--lua/user/opts.lua3
3 files changed, 33 insertions, 19 deletions
diff --git a/init.lua b/init.lua
index 2ac0b01..8de653a 100644
--- a/init.lua
+++ b/init.lua
@@ -39,6 +39,7 @@ if impatient_ok then
end
-- Check if we have the latest stable version of nvim
+local opts = { noremap = true, silent = true, buffer = true }
local utils = require("user.utils")
local expected_ver = "0.8.0"
local nvim_ver = utils.get_nvim_version()
@@ -130,3 +131,4 @@ vim.g.do_filetype_nvim = 1
vim.g.did_load_filetypes = 0
+
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua
index f39cc58..097699e 100644
--- a/lua/plugins/lsp.lua
+++ b/lua/plugins/lsp.lua
@@ -7,7 +7,7 @@ local utils = require("user.utils")
local custom_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-
+--vim.lsp.protocol.CompletionItemKind = {}
-- Mappings.
local map = function(mode, l, r, opts)
opts = opts or {}
@@ -149,25 +149,36 @@ map('n', '<Leader>m', ':call v:lua.toggle_diagnostics()<CR>')
-- })
-- The below command will highlight the current variable and its usages in the buffer.
- if client.server_capabilities.documentHighlightProvider then
- vim.cmd([[
- hi! link LspReferenceRead Visual
- hi! link LspReferenceText Visual
- hi! link LspReferenceWrite Visual
- augroup lsp_document_highlight
- autocmd! * <buffer>
- autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
- autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
- augroup END
- ]])
- end
+-- if client.server_capabilities.documentHighlightProvider then
+-- vim.cmd([[
+-- hi! link LspReferenceRead Visual
+-- hi! link LspReferenceText Visual
+-- hi! link LspReferenceWrite Visual
+-- augroup lsp_document_highlight
+-- autocmd! * <buffer>
+-- autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
+-- autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
+-- autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
+-- augroup END
+-- ]])
+-- end
+
+ -- Only highlight if compatible with the language
+-- if client.resolved_capabilities.document_highlight then
+-- vim.cmd('augroup LspHighlight')
+-- vim.cmd('autocmd!')
+-- vim.cmd('autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()')
+-- vim.cmd('autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()')
+-- vim.cmd('augroup END')
+-- end
- if vim.g.logging_level == "debug" then
- local msg = string.format("Language server %s started!", client.name)
- vim.notify(msg, vim.log.levels.DEBUG, { title = "Server?" })
- end
+-- if vim.g.logging_level == "debug" then
+-- local msg = string.format("Language server %s started!", client.name)
+-- vim.notify(msg, vim.log.levels.DEBUG, { title = "Server?" })
+-- end
+-- suppress error messages from lang servers
end
-
+vim.lsp.set_log_level("debug")
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
capabilities.textDocument.completion.completionItem.snippetSupport = true
diff --git a/lua/user/opts.lua b/lua/user/opts.lua
index 3033325..9d9a138 100644
--- a/lua/user/opts.lua
+++ b/lua/user/opts.lua
@@ -10,7 +10,8 @@ vim.cmd([[
]])
-- Environment
-vim.opt.shell = "zsh" --
+--vim.opt.shell = "zsh" --
+vim.o.shell = "/bin/zsh"
vim.scriptencoding = "utf-8" --
vim.opt.encoding = "utf-8" --
vim.opt.fileencoding = "utf-8" --