Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 120 additions & 7 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ vim.o.scrolloff = 10
-- See `:help 'confirm'`
vim.o.confirm = true

-- Relative numbers in the quickfix window
vim.o.relativenumber = true

-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`

Expand Down Expand Up @@ -556,6 +559,35 @@ require('lazy').setup({
-- For example, in C this would take you to the header.
map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')

-- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc.
map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols')

-- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project.
map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')

-- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*.
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)
---@param client vim.lsp.Client
---@param method vim.lsp.protocol.Method
---@param bufnr? integer some lsp support methods only in specific files
---@return boolean
local function client_supports_method(client, method, bufnr)
if vim.fn.has 'nvim-0.11' == 1 then
return client:supports_method(method, bufnr)
else
return client.supports_method(method, { bufnr = bufnr })
end
end

-- The following two autocommands are used to highlight references of the
-- word under your cursor when your cursor rests there for a little while.
-- See `:help CursorHold` for information about when this is executed
Expand Down Expand Up @@ -595,6 +627,72 @@ require('lazy').setup({
end,
})

-- Diagnostic Config
-- See :help vim.diagnostic.Opts
vim.diagnostic.config {
severity_sort = true,
float = { border = 'rounded', source = 'if_many' },
underline = { severity = vim.diagnostic.severity.ERROR },
signs = vim.g.have_nerd_font and {
text = {
[vim.diagnostic.severity.ERROR] = '󰅚 ',
[vim.diagnostic.severity.WARN] = '󰀪 ',
[vim.diagnostic.severity.INFO] = '󰋽 ',
[vim.diagnostic.severity.HINT] = '󰌶 ',
},
} or {},
virtual_text = {
source = 'if_many',
spacing = 2,
format = function(diagnostic)
local diagnostic_message = {
[vim.diagnostic.severity.ERROR] = diagnostic.message,
[vim.diagnostic.severity.WARN] = diagnostic.message,
[vim.diagnostic.severity.INFO] = diagnostic.message,
[vim.diagnostic.severity.HINT] = diagnostic.message,
}
return diagnostic_message[diagnostic.severity]
end,
},
}

-- LSP servers and clients are able to communicate to each other what features they support.
-- By default, Neovim doesn't support everything that is in the LSP specification.
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
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
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
-- See `:help lsp-config` for information about keys and how to configure
Expand Down Expand Up @@ -656,8 +754,11 @@ require('lazy').setup({
--
-- You can press `g?` for help in this menu.
local ensure_installed = vim.tbl_keys(servers or {})

vim.list_extend(ensure_installed, {
-- You can add other tools here that you want Mason to install
'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 }
Expand Down Expand Up @@ -707,7 +808,9 @@ require('lazy').setup({
-- python = { "isort", "black" },
--
-- 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' },
},
},
},
Expand Down Expand Up @@ -786,7 +889,17 @@ require('lazy').setup({
},

sources = {
default = { 'lsp', 'path', 'snippets' },
default = { 'lsp', 'path', 'snippets', 'lazydev', 'copilot' },
providers = {
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,
},
},
},

snippets = { preset = 'luasnip' },
Expand Down Expand Up @@ -950,15 +1063,15 @@ require('lazy').setup({
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
require 'kickstart.plugins.autopairs',
require 'kickstart.plugins.neo-tree',
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`
-- 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.
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!
Expand Down
19 changes: 19 additions & 0 deletions lua/custom/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -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' },
},
}
14 changes: 14 additions & 0 deletions lua/custom/plugins/intelephense.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
return {
require('lspconfig').intelephense.setup {
settings = {
intelephense = {
environment = {
phpVersion = '8.3',
},
files = {
maxSize = 5000000,
},
},
},
},
}
30 changes: 30 additions & 0 deletions lua/custom/plugins/laravel.lua
Original file line number Diff line number Diff line change
@@ -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,
}
2 changes: 1 addition & 1 deletion lua/kickstart/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ return {
},
lazy = false,
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
{ '<C-n>', ':Neotree toggle<CR>', desc = 'NeoTree toggle', silent = true },
},
---@module 'neo-tree'
---@type neotree.Config
Expand Down
32 changes: 32 additions & 0 deletions lua/lsp/init.lua
Original file line number Diff line number Diff line change
@@ -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