nvim: Add more plugins; create lsp setup
This commit is contained in:
parent
8ace6f1d1c
commit
2f902123a9
16
nvim/.config/nvim/lua/plugins/copilot.lua
Normal file
16
nvim/.config/nvim/lua/plugins/copilot.lua
Normal file
@ -0,0 +1,16 @@
|
||||
vim.pack.add({ "https://github.com/zbirenbaum/copilot.lua" })
|
||||
|
||||
require("copilot").setup({
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
keymap = {
|
||||
accept = "<C-l>"
|
||||
-- accept_word = false,
|
||||
-- accept_line = false,
|
||||
-- next = "<M-]>",
|
||||
-- prev = "<M-[>",
|
||||
-- dismiss = "<C-]>"
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -21,13 +21,40 @@ require("mason-lspconfig").setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
float = true,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
callback = function()
|
||||
local width = vim.api.nvim_win_get_width(0);
|
||||
|
||||
vim.diagnostic.open_float(nil, {
|
||||
scope = "cursor",
|
||||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||
source = true,
|
||||
relative = "editor",
|
||||
width = 40,
|
||||
focusable = false,
|
||||
-- focus = false,
|
||||
border = "rounded",
|
||||
title = "Diagnostics",
|
||||
header = "",
|
||||
title_pos = "center",
|
||||
offset_x = width,
|
||||
offset_y = -1,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- vim.diagnostic.handlers["quickfix"] = {
|
||||
-- show = function(_, _, _, _)
|
||||
-- vim.diagnostic.setqflist({ open = false })
|
||||
-- end,
|
||||
--
|
||||
-- hide = function(_, _)
|
||||
-- vim.fn.setqflist({}, 'r')
|
||||
-- end
|
||||
-- }
|
||||
|
||||
--
|
||||
--
|
||||
@ -70,26 +97,18 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<M-L>',
|
||||
function() vim.lsp.buf.format() end,
|
||||
{
|
||||
function() vim.lsp.buf.format() end, {
|
||||
desc = "Format",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
vim.keymap.set('i', '<M-L>',
|
||||
function() vim.lsp.buf.format() end,
|
||||
{
|
||||
function() vim.lsp.buf.format() end, {
|
||||
desc = "Format",
|
||||
noremap = true,
|
||||
silent = true
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, {
|
||||
desc = "Go to definition"
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "grr", ":Trouble lsp_references<CR>", {
|
||||
desc = "Show references"
|
||||
})
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, { desc = "Go to definition" })
|
||||
end,
|
||||
})
|
||||
|
||||
12
nvim/.config/nvim/lua/plugins/outline.lua
Normal file
12
nvim/.config/nvim/lua/plugins/outline.lua
Normal file
@ -0,0 +1,12 @@
|
||||
vim.pack.add({ "https://github.com/hedyhli/outline.nvim" })
|
||||
require("outline").setup({
|
||||
outline_window = {
|
||||
focus_on_open = false,
|
||||
},
|
||||
symbol_folding = {
|
||||
autofold_depth = 3,
|
||||
markers = { '', '' },
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>l", "<cmd>Outline<CR>", { desc = "Toggle Outline" })
|
||||
2
nvim/.config/nvim/lua/plugins/quicker.lua
Normal file
2
nvim/.config/nvim/lua/plugins/quicker.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.pack.add({"https://github.com/stevearc/quicker.nvim"})
|
||||
require("quicker").setup()
|
||||
@ -23,3 +23,5 @@ vim.api.nvim_create_autocmd('FileType', {
|
||||
})
|
||||
|
||||
vim.opt.cmdheight = 0
|
||||
|
||||
vim.o.updatetime = 50
|
||||
|
||||
@ -8,6 +8,10 @@
|
||||
"rev": "292492a",
|
||||
"src": "https://github.com/rmagatti/auto-session"
|
||||
},
|
||||
"copilot.lua": {
|
||||
"rev": "5bde2cf",
|
||||
"src": "https://github.com/zbirenbaum/copilot.lua"
|
||||
},
|
||||
"dressing.nvim": {
|
||||
"rev": "2d7c2db",
|
||||
"src": "https://github.com/stevearc/dressing.nvim"
|
||||
@ -45,6 +49,10 @@
|
||||
"rev": "2010fc6",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-notify": {
|
||||
"rev": "8701bec",
|
||||
"src": "https://github.com/rcarriga/nvim-notify"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "42fc28ba",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
@ -57,6 +65,10 @@
|
||||
"rev": "7e1cd77",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"outline.nvim": {
|
||||
"rev": "6b62f73",
|
||||
"src": "https://github.com/hedyhli/outline.nvim"
|
||||
},
|
||||
"overseer.nvim": {
|
||||
"rev": "c77c78b",
|
||||
"src": "https://github.com/stevearc/overseer.nvim",
|
||||
@ -66,6 +78,10 @@
|
||||
"rev": "b9fd522",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"quicker.nvim": {
|
||||
"rev": "12a2291",
|
||||
"src": "https://github.com/stevearc/quicker.nvim"
|
||||
},
|
||||
"session-lens": {
|
||||
"rev": "eae46b4",
|
||||
"src": "https://github.com/rmagatti/session-lens"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user