Update config after a long time
This commit is contained in:
parent
7ac1b932a7
commit
c789e148a1
39 changed files with 1278 additions and 125 deletions
|
@ -1,40 +1,44 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "b4bc24c4925aeb05fd47d2ee9b24b7f73f5d7e32" },
|
||||
"LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "243893ba9d5d1049dd451a25cab32ec7f8f67bcf" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"copilot.vim": { "branch": "release", "commit": "1358e8e45ecedc53daf971924a0541ddf6224faf" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "66e4990240f92e31b0d5e4df6deb6bb0160ae832" },
|
||||
"copilot.lua": { "branch": "master", "commit": "2c942f33ba5c621c906e625e00a1bb504b65e2f0" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "1d0dac346de7c6895ac72528df3276386c6b149b" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
|
||||
"impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" },
|
||||
"kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "aba872ec78ffe7f7367764ab0fff6f0170421fde" },
|
||||
"leap.nvim": { "branch": "main", "commit": "6f2912755c9c4ae790abd829f0cf1b07c037b2a4" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" },
|
||||
"neorg": { "branch": "main", "commit": "a7291f4662664d0c3be3016adff6767dc52f907d" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "08bb00c7c2cd58c72e02cf54e4b9cbfe14b03e09" },
|
||||
"nvim": { "branch": "main", "commit": "57b421ee5f7380f816791fa451e86f213b625ece" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7747bbae60074acf0b9e3a4c13950be7a2dff444" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "27079f70603c9d8a002635acfb95db33318e4eef" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "f24a86c32238867f24fbff49913db0068f8488d2" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "986875b7364095d6535e28bd4aac3a9357e91bbe" },
|
||||
"onedark.vim": { "branch": "main", "commit": "4e983447f0442dba1629cdaeddfd137793d71d28" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
|
||||
"leap.nvim": { "branch": "main", "commit": "5efe985cf68fac3b6a6dfe7a75fbfaca8db2af9c" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "f014db32437aa61c86fc0ef1067cd2bc6a37205c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
|
||||
"neorg": { "branch": "main", "commit": "069cf8a460594ca6f4233c83aac1a31a96c62d98" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "defad64afbf19381fe31488a7582bbac421d6e38" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "cc388d3f6b9c7c943ae2b2dcd46ad470fd257f91" },
|
||||
"nvim-tmux-navigation": { "branch": "main", "commit": "543f090a45cef28156162883d2412fffecb6b750" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "794266a4edc8ab57b0d637626f01b5278a9123d8" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "b6c763db8cc486215ba96e0a67418848a710ab25" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" },
|
||||
"oil.nvim": { "branch": "master", "commit": "9e036c6a4868b971127f3cb6bac6197bb4103723" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
|
||||
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||
"startup.nvim": { "branch": "master", "commit": "5295eabe35eb66d0b355ada0ca06ec8bdb8f9698" },
|
||||
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
|
||||
"tailwind-sorter.nvim": { "branch": "main", "commit": "efc34952eb0a20520f12c8a273ea44298c11a4fa" },
|
||||
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "b79cd6c88b3d96b0f49cb7d240807cd59b610cd8" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
|
||||
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "6fcb0ad03982de646e3fecb6915e585651b9a9fb" },
|
||||
"vim-obsession": { "branch": "master", "commit": "fe9d3e1a9a50171e7d316a52e1e56d868e4c1fe5" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vimtex": { "branch": "master", "commit": "5f0a79f2fa9f02eeac9b9902be83bc1b43a402fe" },
|
||||
"yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "6e6c963d70a8e47854fa656987666bfb863f9c4e" }
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }
|
||||
}
|
|
@ -3,11 +3,11 @@ local map = vim.api.nvim_set_keymap
|
|||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Move to previous/next
|
||||
map('n', '<A-,>', '<Cmd>BufferLineCyclePrev<CR>', opts)
|
||||
map('n', '<A-.>', '<Cmd>BufferLineCycleNext<CR>', opts)
|
||||
map('n', '<A-h>', '<Cmd>BufferLineCyclePrev<CR>', opts)
|
||||
map('n', '<A-l>', '<Cmd>BufferLineCycleNext<CR>', opts)
|
||||
-- Re-order to previous/next
|
||||
map('n', '<A-<>', '<Cmd>BufferLineMovePrevious<CR>', opts)
|
||||
map('n', '<A->>', '<Cmd>BufferLineMoveNext<CR>', opts)
|
||||
map('n', '<A-H>', '<Cmd>BufferLineMovePrev<CR>', opts)
|
||||
map('n', '<A-L>', '<Cmd>BufferLineMoveNext<CR>', opts)
|
||||
-- Goto buffer in position...
|
||||
map('n', '<A-1>', '<Cmd>BufferLineGoToBuffer 1<CR>', opts)
|
||||
map('n', '<A-2>', '<Cmd>BufferLineGoToBuffer 2<CR>', opts)
|
||||
|
|
|
@ -111,14 +111,19 @@ cmp.setup {
|
|||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
--vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
vim_item.kind = string.format('[%s %s]', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
["vim-dadbod-completion"] = "[]",
|
||||
nvim_lua = "[LSP]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
if vim.tbl_contains({ "nvim_lsp" }, entry.source.name) then
|
||||
tailwind = require("tailwindcss-colorizer-cmp")
|
||||
return tailwind.formatter(entry, vim_item)
|
||||
else
|
||||
vim_item.kind = string.format('[%s %s]', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
["vim-dadbod-completion"] = "[]",
|
||||
nvim_lua = "[LSP]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end
|
||||
end,
|
||||
},
|
||||
sorting = {
|
||||
|
|
28
.config/nvim/lua/plugins/copilot.lua
Normal file
28
.config/nvim/lua/plugins/copilot.lua
Normal file
|
@ -0,0 +1,28 @@
|
|||
require('copilot').setup({
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-h>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
yaml = false,
|
||||
markdown = false,
|
||||
help = false,
|
||||
gitcommit = false,
|
||||
gitrebase = false,
|
||||
hgcommit = false,
|
||||
svn = false,
|
||||
cvs = false,
|
||||
["."] = false,
|
||||
},
|
||||
copilot_node_command = 'node', -- Node.js version must be > 16.x
|
||||
server_opts_overrides = {},
|
||||
})
|
|
@ -5,7 +5,6 @@ lazy.setup({
|
|||
'lewis6991/impatient.nvim',
|
||||
|
||||
-------------------------------------------THEMES------------------------------------------
|
||||
'joshdick/onedark.vim',
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
lazy = false,
|
||||
|
@ -15,6 +14,14 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
-------------------------------------------------------QOL---------------------------------
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require 'plugins.copilot'
|
||||
end,
|
||||
},
|
||||
--better navigation with 's-letter'
|
||||
{
|
||||
'ggandor/leap.nvim',
|
||||
|
@ -23,6 +30,14 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup {}
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'folke/zen-mode.nvim',
|
||||
config = function()
|
||||
|
@ -37,14 +52,37 @@ lazy.setup({
|
|||
'tpope/vim-obsession',
|
||||
'tpope/vim-fugitive',
|
||||
|
||||
--Database integration
|
||||
'tpope/vim-dadbod',
|
||||
{'kristijanhusak/vim-dadbod-ui',
|
||||
|
||||
{
|
||||
'NvChad/nvim-colorizer.lua',
|
||||
config = function()
|
||||
vim.g.db_ui_auto_execute_table_helpers = 1
|
||||
end
|
||||
require 'colorizer'.setup()
|
||||
end
|
||||
},
|
||||
'kristijanhusak/vim-dadbod-completion',
|
||||
|
||||
{
|
||||
"roobert/tailwindcss-colorizer-cmp.nvim",
|
||||
config = function()
|
||||
require("tailwindcss-colorizer-cmp").setup({
|
||||
color_square_width = 2,
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'laytan/tailwind-sorter.nvim',
|
||||
dependencies = {'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim'},
|
||||
build = 'cd formatter && bun i && bun run build',
|
||||
config = true,
|
||||
},
|
||||
--Database integration
|
||||
-- 'tpope/vim-dadbod',
|
||||
-- {
|
||||
-- 'kristijanhusak/vim-dadbod-ui',
|
||||
-- config = function()
|
||||
-- vim.g.db_ui_auto_execute_table_helpers = 1
|
||||
-- end
|
||||
-- },
|
||||
-- 'kristijanhusak/vim-dadbod-completion',
|
||||
|
||||
'mbbill/undotree',
|
||||
|
||||
|
@ -64,12 +102,12 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
-- Rename variable pop up
|
||||
'stevearc/dressing.nvim',
|
||||
-- 'stevearc/dressing.nvim',
|
||||
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
config = function()
|
||||
require('nvim-autopairs').setup ({
|
||||
require('nvim-autopairs').setup({
|
||||
map_cr = true,
|
||||
map_bs = true,
|
||||
})
|
||||
|
@ -115,6 +153,7 @@ lazy.setup({
|
|||
--LSP Status
|
||||
{
|
||||
'j-hui/fidget.nvim',
|
||||
tag = 'legacy',
|
||||
config = function()
|
||||
require('fidget').setup {
|
||||
window = {
|
||||
|
@ -140,6 +179,8 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
|
||||
'simrat39/rust-tools.nvim',
|
||||
|
||||
{
|
||||
'jose-elias-alvarez/null-ls.nvim',
|
||||
config = function()
|
||||
|
@ -147,12 +188,12 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
|
||||
{
|
||||
'lervag/vimtex',
|
||||
config = function()
|
||||
require 'plugins.vimtex'
|
||||
end
|
||||
},
|
||||
-- {
|
||||
-- 'lervag/vimtex',
|
||||
-- config = function()
|
||||
-- require 'plugins.vimtex'
|
||||
-- end
|
||||
-- },
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
-- Syntax Highlighting
|
||||
|
@ -192,13 +233,13 @@ lazy.setup({
|
|||
|
||||
|
||||
--Main menu
|
||||
{
|
||||
'startup-nvim/startup.nvim',
|
||||
dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim' },
|
||||
config = function()
|
||||
require('startup').setup { theme = 'dashboard' }
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- 'startup-nvim/startup.nvim',
|
||||
-- dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim' },
|
||||
-- config = function()
|
||||
-- require('startup').setup { theme = 'dashboard' }
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-------------------------------------------OTHERS----------------------------------------------
|
||||
|
||||
|
@ -214,8 +255,8 @@ lazy.setup({
|
|||
dependencies = { { "nvim-lua/plenary.nvim" } },
|
||||
},
|
||||
|
||||
'kmonad/kmonad-vim',
|
||||
'elkowar/yuck.vim',
|
||||
-- 'kmonad/kmonad-vim',
|
||||
-- 'elkowar/yuck.vim',
|
||||
--Discord Rich Presence
|
||||
'andweeb/presence.nvim'
|
||||
|
||||
|
|
|
@ -1,72 +1,82 @@
|
|||
local mason_lspconfig = require "mason-lspconfig"
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = { "lua_ls", "rust_analyzer", "texlab", "hls", "yamlls" },
|
||||
automatic_installation = true
|
||||
ensure_installed = { "lua_ls", "texlab", "hls", "yamlls" },
|
||||
automatic_installation = true
|
||||
})
|
||||
|
||||
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>ge', function() vim.diagnostic.goto_next() end, bufopts)
|
||||
vim.keymap.set('n', '<space>gE', function() vim.diagnostic.goto_prev() end, bufopts)
|
||||
vim.keymap.set('n', '<space>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
-- vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
-- pattern = '<buffer>',
|
||||
-- callback = function() vim.lsp.buf.format({ async = true }) end
|
||||
-- })
|
||||
if client.name == "yamlls" then
|
||||
client.server_capabilities.document_formatting = true
|
||||
end
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { noremap = true, silent = true }
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>ge', function() vim.diagnostic.goto_next() end, bufopts)
|
||||
vim.keymap.set('n', '<space>gE', function() vim.diagnostic.goto_prev() end, bufopts)
|
||||
vim.keymap.set('n', '<space>fo', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
end
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
-- ADD NVIM CMP AS A CAPABILITY
|
||||
local lsp_defaults = lspconfig.util.default_config
|
||||
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
'force',
|
||||
lsp_defaults.capabilities,
|
||||
require('cmp_nvim_lsp').default_capabilities()
|
||||
'force',
|
||||
lsp_defaults.capabilities,
|
||||
require('cmp_nvim_lsp').default_capabilities()
|
||||
)
|
||||
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
|
||||
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end,
|
||||
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup {
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
require("rust-tools").setup({
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tools = {
|
||||
hover_actions = {
|
||||
auto_focus = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
@ -6,11 +6,12 @@ null_ls.setup({
|
|||
null_ls.builtins.formatting.stylish_haskell,
|
||||
null_ls.builtins.formatting.fourmolu,
|
||||
null_ls.builtins.formatting.blue,
|
||||
null_ls.builtins.formatting.gofmt,
|
||||
null_ls.builtins.formatting.sql_formatter.with({
|
||||
extra_args = { "--config", "/home/afonso/.config/nvim/lua/plugins/sql_formatter.json"}
|
||||
}),
|
||||
null_ls.builtins.formatting.prettierd.with({
|
||||
filetypes = { "html", "json", "yaml", "markdown" },
|
||||
filetypes = { "html", "json", "css", "js", "yaml", "markdown" },
|
||||
}),
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue