Versionado
This commit is contained in:
parent
3338d39206
commit
5e62f0a6b2
66
init.lua
66
init.lua
|
|
@ -166,6 +166,9 @@ vim.o.scrolloff = 10
|
||||||
-- See `:help 'confirm'`
|
-- See `:help 'confirm'`
|
||||||
vim.o.confirm = true
|
vim.o.confirm = true
|
||||||
|
|
||||||
|
-- Relative numbers in the quickfix window
|
||||||
|
vim.o.relativenumber = true
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
-- See `:help vim.keymap.set()`
|
-- See `:help vim.keymap.set()`
|
||||||
|
|
||||||
|
|
@ -572,6 +575,9 @@ require('lazy').setup({
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||||
|
|
||||||
|
-- Jump to the definition of the word under your cursor.
|
||||||
|
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
|
|
||||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||||
---@param client vim.lsp.Client
|
---@param client vim.lsp.Client
|
||||||
---@param method vim.lsp.protocol.Method
|
---@param method vim.lsp.protocol.Method
|
||||||
|
|
@ -661,6 +667,37 @@ require('lazy').setup({
|
||||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
|
|
||||||
|
local vue_language_server_path = vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server'
|
||||||
|
|
||||||
|
vim.notify('Setting up Vue Language Server at ' .. vue_language_server_path, vim.log.levels.INFO, {
|
||||||
|
title = 'Kickstart.nvim',
|
||||||
|
})
|
||||||
|
|
||||||
|
local vue_plugin = {
|
||||||
|
name = '@vue/typescript-plugin',
|
||||||
|
location = vue_language_server_path,
|
||||||
|
languages = { 'vue' },
|
||||||
|
configNamespace = 'typescript',
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.enable 'vtsls'
|
||||||
|
|
||||||
|
vim.lsp.config('vtsls', {
|
||||||
|
settings = {
|
||||||
|
vtsls = {
|
||||||
|
tsserver = {
|
||||||
|
globalPlugins = {
|
||||||
|
vue_plugin,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- (Opcional) vue-language-server para otras funcionalidades
|
||||||
|
vim.lsp.config('vue_ls', {})
|
||||||
|
|
||||||
-- Enable the following language servers
|
-- Enable the following language servers
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||||
--
|
--
|
||||||
|
|
@ -714,14 +751,18 @@ require('lazy').setup({
|
||||||
-- You can add other tools here that you want Mason to install
|
-- You can add other tools here that you want Mason to install
|
||||||
-- for you, so that they are available from within Neovim.
|
-- for you, so that they are available from within Neovim.
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
|
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'stylua', -- Used to format Lua code
|
'stylua', -- Used to format Lua code
|
||||||
|
'vtsls', -- Vetur Language Server for Vue
|
||||||
|
'vue-language-server', -- Vue Language Server
|
||||||
})
|
})
|
||||||
|
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
||||||
automatic_installation = false,
|
automatic_installation = true,
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
|
|
@ -772,7 +813,9 @@ require('lazy').setup({
|
||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
|
-- Formato de Vue con prettierd
|
||||||
|
vue = { 'prettierd' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -854,9 +897,16 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lsp', 'path', 'snippets', 'lazydev' },
|
default = { 'lsp', 'path', 'snippets', 'lazydev', 'copilot' },
|
||||||
providers = {
|
providers = {
|
||||||
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
||||||
|
-- Integración de Copilot con Blink.cmp, para evitar las letras grises
|
||||||
|
copilot = {
|
||||||
|
name = 'copilot',
|
||||||
|
module = 'blink-cmp-copilot',
|
||||||
|
score_offset = 100,
|
||||||
|
async = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -944,7 +994,7 @@ require('lazy').setup({
|
||||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'php', 'javascript', 'vue' },
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
|
@ -976,15 +1026,15 @@ require('lazy').setup({
|
||||||
-- require 'kickstart.plugins.debug',
|
-- require 'kickstart.plugins.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
-- require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
-- require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
require 'kickstart.plugins.neo-tree',
|
||||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
-- This is the easiest way to modularize your config.
|
-- This is the easiest way to modularize your config.
|
||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
--
|
--
|
||||||
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
return {
|
||||||
|
-- GitHub Copilot backend (sin ghost text ni panel)
|
||||||
|
{
|
||||||
|
'zbirenbaum/copilot.lua',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
config = function()
|
||||||
|
require('copilot').setup {
|
||||||
|
suggestion = { enabled = false }, -- ✅ no ghost text
|
||||||
|
panel = { enabled = false }, -- ✅ no panel
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Integración con blink.cmp
|
||||||
|
{
|
||||||
|
'giuxtaposition/blink-cmp-copilot',
|
||||||
|
dependencies = { 'zbirenbaum/copilot.lua' },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
return {
|
||||||
|
require('lspconfig').intelephense.setup {
|
||||||
|
settings = {
|
||||||
|
intelephense = {
|
||||||
|
environment = {
|
||||||
|
phpVersion = '8.3',
|
||||||
|
},
|
||||||
|
files = {
|
||||||
|
maxSize = 5000000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
return {
|
||||||
|
'adalessa/laravel.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'tpope/vim-dotenv',
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
'MunifTanjim/nui.nvim',
|
||||||
|
'kevinhwang91/promise-async',
|
||||||
|
},
|
||||||
|
cmd = { 'Laravel' },
|
||||||
|
keys = {
|
||||||
|
{ '<leader>la', ':Laravel artisan<cr>' },
|
||||||
|
{ '<leader>lr', ':Laravel routes<cr>' },
|
||||||
|
{ '<leader>lm', ':Laravel related<cr>' },
|
||||||
|
{
|
||||||
|
'gf',
|
||||||
|
function()
|
||||||
|
if require('laravel').app('gf').cursor_on_resource() then
|
||||||
|
return '<cmd>Laravel gf<CR>'
|
||||||
|
else
|
||||||
|
return 'gf'
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
noremap = false,
|
||||||
|
expr = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
event = { 'VeryLazy' },
|
||||||
|
opts = {},
|
||||||
|
config = true,
|
||||||
|
}
|
||||||
|
|
@ -11,7 +11,7 @@ return {
|
||||||
},
|
},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
keys = {
|
keys = {
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
{ '<C-n>', ':Neotree toggle<CR>', desc = 'NeoTree toggle', silent = true },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
print '✅ lsp/init.lua cargado correctamente'
|
||||||
|
vim.notify('✅ LSP init.lua cargado', vim.log.levels.INFO)
|
||||||
|
|
||||||
|
local lspconfig = require 'lspconfig'
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
|
||||||
|
local vue_language_server_path = vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server'
|
||||||
|
|
||||||
|
local vue_plugin = {
|
||||||
|
name = '@vue/typescript-plugin',
|
||||||
|
location = vue_language_server_path,
|
||||||
|
languages = { 'vue' },
|
||||||
|
configNamespace = 'typescript',
|
||||||
|
}
|
||||||
|
|
||||||
|
lspconfig.vtsls.setup('vtsls', {
|
||||||
|
settings = {
|
||||||
|
vtsls = {
|
||||||
|
tsserver = {
|
||||||
|
globalPlugins = {
|
||||||
|
vue_plugin,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ✅ (Opcional) vue-language-server para otras funcionalidades
|
||||||
|
lspconfig.vue_ls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue