Merge branch 'main' of git.andr3h3nriqu3s.com:andr3/nvim-config

This commit is contained in:
Andre Herniques 2023-05-15 13:59:09 +01:00
commit d086bf69df
3 changed files with 80 additions and 36 deletions

View File

@ -1,7 +1,11 @@
require 'andr3.lsp_adds.prettier'
require 'andr3.lsp_adds.null-ls'
-- Items
-- Signature
require 'lsp_signature'.setup({ });
-- Items {{{
require('vim.lsp.protocol').CompletionItemKind = {
'', -- Text
'', -- Method
@ -29,8 +33,34 @@ require('vim.lsp.protocol').CompletionItemKind = {
'', -- Operator
'', -- TypeParameter
}
--- }}}
vim.diagnostic.config({ virtual_text = { prefix = '🅰', } })
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
-- Enable underline, use default values
underline = true,
-- Enable virtual text, override spacing to 4
virtual_text = {
spacing = 4,
prefix = '~',
},
-- Use a function to dynamically turn signs off
-- and on, using buffer local variables
signs = function(bufnr, client_id)
local ok, result = pcall(vim.api.nvim_buf_get_var, bufnr, 'show_signs')
-- No buffer local variable set, so just enable by default
if not ok then
return true
end
return result
end,
-- Disable a feature
update_in_insert = false,
}
)
-- vim.diagnostic.config({ virtual_text = { prefix = '🅰', } })
local warn = "😞";
local signs = { Error = "☣️ ", Warn = warn, Hint = "❤️ ", Info = "🆓" }
@ -151,8 +181,9 @@ keymap("n", "<leader>sf", "<cmd>Lspsaga lsp_finder<CR>", { silent = true })
keymap({"n","v"}, "<leader>ca", function () saga.code_action() end, {})
keymap("n", "gr", "<cmd>Lspsaga rename<CR>", { silent = true })
keymap("n", "gd", "<cmd>Lspsaga peek_definition<CR>", { silent = true })
keymap("n", "<leader>cd", "<cmd>Lspsaga show_line_diagnostics<CR>", { silent = true })
--keymap("n", "<leader>cd", "<cmd>Lspsaga show_line_diagnostics<CR>", { silent = true })
keymap("n", "<leader>cd", "<cmd>Lspsaga show_cursor_diagnostics<CR>", { silent = true })
keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', { silent = true })
keymap("n", "[e", "<cmd>Lspsaga diagnostic_jump_prev<CR>", { silent = true })
keymap("n", "]e", "<cmd>Lspsaga diagnostic_jump_next<CR>", { silent = true })
@ -250,6 +281,13 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
require "lsp_signature".on_attach({
bind = true,
handler_opts = {
border = "rounded"
}
}, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')

View File

@ -15,6 +15,7 @@ return require('packer').startup(function()
-- other stuff
use 'neovim/nvim-lspconfig'
use 'ray-x/lsp_signature.nvim'
use 'jose-elias-alvarez/null-ls.nvim'

View File

@ -49,8 +49,8 @@ local function save_profiles(threshold)
end
time([[Luarocks path setup]], true)
local package_path_str = "/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/Users/AHS40/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
local package_path_str = "/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/andr3/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
@ -76,157 +76,162 @@ time([[Defining packer_plugins]], true)
_G.packer_plugins = {
["ayu-vim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/ayu-vim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/ayu-vim",
url = "https://github.com/ayu-theme/ayu-vim"
},
catppuccin = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/catppuccin",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/catppuccin",
url = "https://github.com/catppuccin/nvim"
},
["cmp-buffer"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-buffer",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-buffer",
url = "https://github.com/hrsh7th/cmp-buffer"
},
["cmp-cmdline"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
url = "https://github.com/hrsh7th/cmp-cmdline"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-path"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/cmp-path",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
["eva01.vim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/eva01.vim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/eva01.vim",
url = "https://github.com/hachy/eva01.vim"
},
["html5.vim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/html5.vim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/html5.vim",
url = "https://github.com/othree/html5.vim"
},
["lsp_signature.nvim"] = {
loaded = true,
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim",
url = "https://github.com/ray-x/lsp_signature.nvim"
},
["lspkind.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
url = "https://github.com/onsails/lspkind.nvim"
},
["lspsaga.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
url = "https://github.com/glepnir/lspsaga.nvim"
},
["night_owl_light.vim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/night_owl_light.vim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/night_owl_light.vim",
url = "https://github.com/macguirerintoul/night_owl_light.vim"
},
["null-ls.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
},
["nvim-cmp"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-cmp",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-lspconfig"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-tree.lua"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
url = "https://github.com/nvim-tree/nvim-tree.lua"
},
["nvim-treesitter"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["nvim-web-devicons"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
url = "https://github.com/nvim-tree/nvim-web-devicons"
},
["packer.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/packer.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/packer.nvim",
url = "https://github.com/wbthomason/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/plenary.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["prettier.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/prettier.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/prettier.nvim",
url = "https://github.com/MunifTanjim/prettier.nvim"
},
["telescope.nvim"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/telescope.nvim",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
undotree = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/undotree",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/undotree",
url = "https://github.com/mbbill/undotree"
},
["vim-airline"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-airline",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-airline",
url = "https://github.com/vim-airline/vim-airline"
},
["vim-airline-themes"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-airline-themes",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-airline-themes",
url = "https://github.com/vim-airline/vim-airline-themes"
},
["vim-commentary"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-commentary",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-commentary",
url = "https://github.com/chrisbra/vim-commentary"
},
["vim-cyberpunk"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-cyberpunk",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-cyberpunk",
url = "https://github.com/thedenisnikulin/vim-cyberpunk"
},
["vim-gitgutter"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-gitgutter",
url = "https://github.com/airblade/vim-gitgutter"
},
["vim-javascript"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-javascript",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-javascript",
url = "https://github.com/pangloss/vim-javascript"
},
["vim-svelte"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-svelte",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-svelte",
url = "https://github.com/evanleck/vim-svelte"
},
["vim-visual-multi"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-visual-multi",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-visual-multi",
url = "https://github.com/mg979/vim-visual-multi"
},
["vim-vsnip"] = {
loaded = true,
path = "/Users/AHS40/.local/share/nvim/site/pack/packer/start/vim-vsnip",
path = "/home/andr3/.local/share/nvim/site/pack/packer/start/vim-vsnip",
url = "https://github.com/hrsh7th/vim-vsnip"
}
}