Merge branch 'nvim-lua:master' into master

This commit is contained in:
Thomas Alcala Schneider 2024-02-06 10:57:48 +01:00 committed by GitHub
commit 230b568f00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 75 additions and 4 deletions

View file

@ -100,7 +100,18 @@ require('lazy').setup({
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
'L3MON4D3/LuaSnip',
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets
-- This step is not supported in many windows environments
-- Remove the below condition to re-enable on windows
if vim.fn.has 'win32' == 1 then
return
end
return 'make install_jsregexp'
end)(),
},
'saadparwaiz1/cmp_luasnip',
-- Adds LSP completion capabilities
@ -193,8 +204,13 @@ require('lazy').setup({
-- Theme inspired by Atom
'navarasu/onedark.nvim',
priority = 1000,
lazy = false,
config = function()
vim.cmd.colorscheme 'onedark'
require('onedark').setup {
-- Set a style preset. 'dark' is default.
style = 'dark', -- dark, darker, cool, deep, warm, warmer, light
}
require('onedark').load()
end,
},
@ -205,7 +221,7 @@ require('lazy').setup({
opts = {
options = {
icons_enabled = false,
theme = 'onedark',
theme = 'auto',
component_separators = '|',
section_separators = '',
},
@ -514,7 +530,9 @@ local on_attach = function(_, bufnr)
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('<leader>ca', function()
vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } }
end, '[C]ode [A]ction')
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')