Compare commits

..

No commits in common. "89bca77ef481eed5ea255261544012c070fbb1d6" and "e64316e3363d8ed0768a9f0cf30f740cf6e22362" have entirely different histories.

2 changed files with 19 additions and 63 deletions

View File

@ -35,27 +35,18 @@ return {
config = function()
require('mason').setup()
require('mason-lspconfig').setup({
automatic_installation = false,
ensure_installed = {
'ansiblels', -- Ansible
'bashls', -- Bash
'clangd', -- C/C++
'cmake', -- Cmake
'docker_compose_language_service', -- Docker Compose
'dockerls', -- Dockerfile
'esbonio', -- Sphinx
'html', -- HTML
'jsonls', -- JSON
'lemminx', -- XML
'lua_ls', -- Lua
'opencl_ls', -- OpenCL
'powershell_es', -- Powershell
'pyright', -- Python
'ruff_lsp', -- Python
'vimls', -- VimScript
'yamlls', -- YAML
'clangd',
'cmake',
'jsonls',
'lemminx',
'lua_ls',
'pyright',
'ruff_lsp',
'vimls',
'yamlls',
},
automatic_installation = false,
handlers = {
-- Default handler, sets up everything unless a custom language server
-- setup handler is defined below
@ -98,62 +89,30 @@ return {
require('luasnip').lsp_expand(args.body)
end
},
mapping = cmp.mapping.preset.insert({
-- Open completion menu/confirm completion
['<C-Space>'] = cmp.mapping.complete(),
['<C-l>'] = cmp.mapping.confirm({ select = true }),
-- Select completion from menu
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll documentation of selected completion item
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-l>'] = cmp.mapping.confirm({ select = true }),
}),
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'nvim_lsp' },
-- { name = 'buffer' },
{ name = 'path' },
-- { name = 'cmdline' },
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
})
-- Customise LSP UI
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
vim.lsp.handlers.hover, {
border = 'rounded',
title = 'Hover',
}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help, {
border = 'rounded',
title = 'Signature Help'
}
)
-- Disable displaying diagnostics as virtual text
vim.diagnostic.config({ virtual_text = false })
-- Customise diagnostics UI
vim.diagnostic.config({
float = {
border = 'rounded', -- Enable rounded border on floats
},
virtual_text = false, -- Disable trailing virtual text
})
-- Diagnostics mappings
-- Diagnostic mappings
-- TODO: trouble.nvim mappings instead? https://youtu.be/MuUrCcvE-Yw?t=631
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { remap = false })
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { remap = false })
vim.keymap.set('n', '<leader>sd', vim.diagnostic.open_float, { remap = false })
-- Mappings created when LSP is attached to a buffer
-- LSP mappings created when attached to a buffer
local augroup = vim.api.nvim_create_augroup('lsp', { clear = true })
vim.api.nvim_create_autocmd('LspAttach', {
pattern = '*',

View File

@ -60,9 +60,6 @@ local function get_mode()
return current_mode.name
end
-- Display cusor line/total and column
local position = '# ☰ %l/%L 󰠷 %2c '
-- Construct a statusline for special buffer types.
local function special(group, name, title)
-- Display current mode with dynamic highlights.
@ -70,7 +67,7 @@ local function special(group, name, title)
-- Display filename with dark highlights.
line = line .. '%#StatusLineDark# ' .. title
-- Display current/total lines and column with dynamic highlights.
line = line .. '%=' .. '%#' .. group .. position
line = line .. '%=' .. '%#' .. group .. '# ☰%l/%L ·%2c '
-- Combine the elements into a single string to be evaluated.
return line
end
@ -103,7 +100,7 @@ local function generic(group, name, show_lsp)
'%{&fileencoding ==# "utf-8" ? "" : &fileencoding}' ..
'%{&fileformat ==# "unix" ? "" : "[".&fileformat."]"}' .. ' %)'
-- Display current/total lines and column with dynamic highlights.
line = line .. '%#' .. group .. position
line = line .. '%#' .. group .. '# ☰ %l/%L 󰠷 %2c '
-- Combine the elements into a single string to be evaluated.
return line
end