lsp_lines added
This commit is contained in:
parent
c47d849a01
commit
1cd81cee70
52
init.lua
52
init.lua
|
@ -76,6 +76,8 @@ require('lazy').setup({
|
|||
require 'plugins.alpha',
|
||||
require 'plugins.autotag',
|
||||
require 'plugins.colorizer',
|
||||
require 'plugins.fugitive',
|
||||
require 'plugins.rhubarb',
|
||||
|
||||
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
|
||||
--
|
||||
|
@ -255,23 +257,24 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
|
||||
-- LSP Plugins
|
||||
{
|
||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua',
|
||||
opts = {
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
-- Main LSP Configuration
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
|
||||
{
|
||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||
-- used for completion, annotations and signatures of Neovim apis
|
||||
'folke/lazydev.nvim',
|
||||
ft = 'lua',
|
||||
opts = {
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||
-- Mason must be loaded before its dependents so we need to set it up here.
|
||||
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
||||
|
@ -284,6 +287,7 @@ require('lazy').setup({
|
|||
|
||||
-- Allows extra capabilities provided by blink.cmp
|
||||
'saghen/blink.cmp',
|
||||
{ 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' },
|
||||
},
|
||||
config = function()
|
||||
-- Brief aside: **What is LSP?**
|
||||
|
@ -348,7 +352,7 @@ require('lazy').setup({
|
|||
-- To jump back, press <C-t>.
|
||||
map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- WARN: This is not Goto De
|
||||
-- For example, in C this would take you to the header.
|
||||
map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
||||
|
@ -477,7 +481,6 @@ require('lazy').setup({
|
|||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- ts_ls = {},
|
||||
--
|
||||
|
||||
lua_ls = {
|
||||
-- cmd = { ... },
|
||||
-- filetypes = { ... },
|
||||
|
@ -488,7 +491,7 @@ require('lazy').setup({
|
|||
callSnippet = 'Replace',
|
||||
},
|
||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
-- diagnostics = { disable = { 'missing-fields' } }, },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -527,6 +530,18 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
}
|
||||
|
||||
require('lsp_lines').setup()
|
||||
vim.diagnostic.config { virtual_text = true, virtual_lines = false }
|
||||
|
||||
vim.keymap.set('', '<leader>l', function()
|
||||
local config = vim.diagnostic.config() or {}
|
||||
if config.virtual_text then
|
||||
vim.diagnostic.config { virtual_text = false, virtual_lines = true }
|
||||
else
|
||||
vim.diagnostic.config { virtual_text = true, virtual_lines = false }
|
||||
end
|
||||
end, { desc = 'Toggle lsp_lines' })
|
||||
end,
|
||||
},
|
||||
|
||||
|
@ -770,10 +785,7 @@ 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 recommend keymaps
|
||||
require 'kickstart.plugins.lint',
|
||||
|
||||
-- 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.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" },
|
||||
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
|
||||
|
@ -17,6 +18,7 @@
|
|||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||
"nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||
|
@ -27,5 +29,7 @@
|
|||
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "386daa2e9d98e23e27ad089afcbe5c5a903e488d" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
-- Powerful Git integration for Vim
|
||||
'tpope/vim-fugitive',
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
-- GitHub integration for vim-fugitive
|
||||
'tpope/vim-rhubarb',
|
||||
}
|
Loading…
Reference in New Issue