feat: add lsp configuration
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
function run()
|
||||
function Run()
|
||||
local dep = require("check_dependencies")
|
||||
|
||||
dep.setup({
|
||||
@@ -20,4 +20,4 @@ function run()
|
||||
dep.run()
|
||||
end
|
||||
|
||||
vim.api.nvim_create_user_command("DependenciesCheck", run, {})
|
||||
vim.api.nvim_create_user_command("DependenciesCheck", Run, {})
|
||||
|
||||
+13
-11
@@ -1,13 +1,15 @@
|
||||
require('config.settings')
|
||||
require('config.keybinds')
|
||||
require('config.pack')
|
||||
require("config.settings")
|
||||
require("config.keybinds")
|
||||
require("config.pack")
|
||||
require("config.lsp")
|
||||
|
||||
require('config.theme')
|
||||
require('config.neogit')
|
||||
require('config.oil')
|
||||
require('config.autopairs')
|
||||
require('config.fzf')
|
||||
require('config.indent_blank_line')
|
||||
require('config.conform')
|
||||
require("config.theme")
|
||||
require("config.neogit")
|
||||
require("config.oil")
|
||||
require("config.autopairs")
|
||||
require("config.fzf")
|
||||
require("config.indent_blank_line")
|
||||
require("config.conform")
|
||||
|
||||
require("config.check_dependencies")
|
||||
|
||||
require('config.check_dependencies')
|
||||
|
||||
@@ -54,3 +54,11 @@ end, {
|
||||
})
|
||||
|
||||
bind("n", "<leader><C-M-l>", "<cmd>FormatConform<cr>")
|
||||
|
||||
-- Lsp
|
||||
bind("n", "<leader>e", vim.diagnostic.open_float)
|
||||
bind("n", "<leader>gl", vim.diagnostic.setloclist)
|
||||
bind("n", "<leader>gf", vim.diagnostic.setqflist)
|
||||
bind("n", "<leader>f", vim.lsp.buf.format)
|
||||
bind("n", "K", vim.lsp.buf.hover)
|
||||
bind("n", "<leader>k", vim.lsp.buf.signature_help)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
| Set | Mapping | Function | Neovim Function | Brief Description |
|
||||
| --- | ------------- | ---------------------------- | --------------------------------------- | --------------------------------------------------------------------------- |
|
||||
| y | `gd` | Go to Definition | `vim.lsp.buf.definition()` | Jump to the symbol's definition. |
|
||||
| y | `gD` | Go to Declaration | `vim.lsp.buf.declaration()` | Jump to the symbol's declaration. |
|
||||
| y | `K` | Hover Documentation | `vim.lsp.buf.hover()` | Show documentation and type information for the symbol under the cursor. |
|
||||
| y | `<leader>k` | Signature Help | `vim.lsp.buf.signature_help()` | Display the current function signature and parameter information. |
|
||||
| y | `grr` | Find References | `vim.lsp.buf.references()` | List all references to the symbol across the project. |
|
||||
| y | `gri` | Go to Implementation | `vim.lsp.buf.implementation()` | Jump to the implementation(s) of the symbol. |
|
||||
| y | `grt` | Go to Type Definition | `vim.lsp.buf.type_definition()` | Jump to the definition of the symbol's type. |
|
||||
| y | `grn` | Rename Symbol | `vim.lsp.buf.rename()` | Rename the symbol and update all references. |
|
||||
| y | `gra` | Code Actions | `vim.lsp.buf.code_action()` | Show available quick fixes and refactoring actions. |
|
||||
| ? | `gO` | Document Symbols | `vim.lsp.buf.document_symbol()` | List all symbols (functions, classes, variables, etc.) in the current file. |
|
||||
| y | `[d` | Previous Diagnostic | `vim.diagnostic.goto_prev()` | Jump to the previous diagnostic (error, warning, hint, or info). |
|
||||
| y | `]d` | Next Diagnostic | `vim.diagnostic.goto_next()` | Jump to the next diagnostic. |
|
||||
| y | `<leader>e` | Diagnostic Float | `vim.diagnostic.open_float()` | Show diagnostic details in a floating window. |
|
||||
| y | `<leader>gl` | Diagnostics to Location List | `vim.diagnostic.setloclist()` | Populate the location list with diagnostics from the current buffer. |
|
||||
| y | `<leader>f` | Format Buffer | `vim.lsp.buf.format()` | Format the current buffer using the LSP server. |
|
||||
| n | `<leader>wa` | Add Workspace Folder | `vim.lsp.buf.add_workspace_folder()` | Add a folder to the current LSP workspace. |
|
||||
| n | `<leader>wr` | Remove Workspace Folder | `vim.lsp.buf.remove_workspace_folder()` | Remove a folder from the current LSP workspace. |
|
||||
| n | `<leader>wl` | List Workspace Folders | `vim.lsp.buf.list_workspace_folders()` | List all folders in the current LSP workspace. |
|
||||
| n | `<leader>cl` | Run CodeLens | `vim.lsp.codelens.run()` | Execute the CodeLens action at the current cursor position. |
|
||||
| n | `<leader>cr` | Refresh CodeLens | `vim.lsp.codelens.refresh()` | Refresh available CodeLens actions in the buffer. |
|
||||
| n | `<leader>th` | Toggle Inlay Hints | `vim.lsp.inlay_hint.enable()` | Enable or disable inline type and parameter hints. |
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
vim.lsp.config["lua_lsp"] = {
|
||||
cmd = { "lua-language-server" },
|
||||
filetypes = { "lua" },
|
||||
root_markers = { { ".luarc.json", ".luarc.jsonc" }, ".git" },
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.lsp.enable('lua_lsp')
|
||||
Reference in New Issue
Block a user