chore: fix cmp auto imports

This commit is contained in:
Kristofers Solo
2024-03-24 11:35:27 +02:00
parent 1c8d7d92a8
commit 3618480fd4
13 changed files with 135 additions and 120 deletions

View File

@@ -1,7 +1,7 @@
return {
"hrsh7th/nvim-cmp",
event = { "InsertEnter", "CmdlineEnter" },
commit = "b356f2c",
-- commit = "b356f2c",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-cmdline",

View File

@@ -11,7 +11,7 @@ return {
"williamboman/mason.nvim",
{ "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" } },
"mfussenegger/nvim-dap",
{ "simrat39/rust-tools.nvim", ft = "rust" },
-- { "simrat39/rust-tools.nvim", ft = "rust" },
{ "mfussenegger/nvim-dap-python", ft = "python" },
"theHamsta/nvim-dap-virtual-text",
"williamboman/mason.nvim",

View File

@@ -1,37 +0,0 @@
return {
"tpope/vim-fugitive",
lazy = false,
enabled = false,
keys = {
{ "<leader>gg", vim.cmd.G, desc = "[G]it" },
{ "<leader>gd", vim.cmd.Gdiffsplit, desc = "[G]it [D]iff" },
{
"<leader>gh",
function()
vim.cmd.diffget("//2")
end,
desc = "[G]it Select Left",
},
{
"<leader>gl",
function()
vim.cmd.diffget("//3")
end,
desc = "[G]it Select Right",
},
{
"<leader>gp",
function()
vim.cmd.Git("pull --rebase")
end,
desc = "[G]it [P]ull",
},
{
"<leader>gP",
function()
vim.cmd.Git("push -u origin")
end,
desc = "[G]it [P]ush",
},
},
}

View File

@@ -0,0 +1,38 @@
return {
"simrat39/inlay-hints.nvim",
opts = {
hints = {
parameter = {
show = true,
highlight = "Comment",
},
type = {
show = true,
highlight = "Comment",
},
},
only_current_line = true,
eol = {
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
parameter = {
separator = ", ",
format = function(hints)
return string.format(" <- (%s)", hints)
end,
},
type = {
separator = ", ",
format = function(hints)
return string.format(" => (%s)", hints)
end,
},
},
},
}

View File

@@ -34,6 +34,9 @@ M.setup = function(lsp, capabilities)
format = {
enable = false,
},
hint = {
enable = true,
},
},
},
})

12
lua/plugins/lsp/rust.lua Normal file
View File

@@ -0,0 +1,12 @@
local M = {}
M.setup = function(lsp, capabilities)
lsp.rust.setup({
capabilities = capabilities,
hint = {
enable = true,
},
})
end
return M

View File

@@ -7,12 +7,13 @@ return {
"folke/neodev.nvim",
"nvim-telescope/telescope.nvim",
"folke/trouble.nvim",
"folke/neoconf.nvim",
},
config = function()
require("mason").setup()
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
local lsp = require("lspconfig")
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
local default_setup = function(server)
lsp[server].setup({
@@ -93,9 +94,7 @@ return {
vim.diagnostic.config({
virtual_text = true, -- virtual text
signs = {
active = signs, -- show signs
},
signs = { active = signs }, -- show signs
update_in_insert = true,
underline = true,
severity_sort = true,
@@ -133,6 +132,7 @@ return {
"tailwindcss",
"texlab",
"tsserver",
"rust_analyzer",
},
handlers = {
default_setup,

43
lua/plugins/neoconf.lua Normal file
View File

@@ -0,0 +1,43 @@
return {
"folke/neoconf.nvim",
cmd = { "Neoconf" },
opts = {
-- name of the local settings files
local_settings = ".neoconf.json",
-- name of the global settings file in your Neovim config directory
global_settings = "neoconf.json",
-- import existing settings from other plugins
import = {
vscode = true, -- local .vscode/settings.json
coc = true, -- global/local coc-settings.json
nlsp = true, -- global/local nlsp-settings.nvim json settings
},
-- send new configuration to lsp clients when changing json settings
live_reload = true,
-- set the filetype to jsonc for settings files, so you can use comments
-- make sure you have the jsonc treesitter parser installed!
filetype_jsonc = true,
plugins = {
-- configures lsp clients with settings in the following order:
-- - lua settings passed in lspconfig setup
-- - global json settings
-- - local json settings
lspconfig = {
enabled = true,
},
-- configures jsonls to get completion in .nvim.settings.json files
jsonls = {
enabled = true,
-- only show completion in json settings for configured lsp servers
configured_servers_only = true,
},
-- configures lua_ls to get completion of lspconfig server settings
lua_ls = {
-- by default, lua_ls annotations are only enabled in your neovim config directory
enabled_for_neovim_config = true,
-- explicitely enable adding annotations. Mostly relevant to put in your local .nvim.settings.json file
enabled = false,
},
},
},
}

View File

@@ -1,42 +0,0 @@
return {
"rest-nvim/rest.nvim",
enabled = false,
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = false,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
-- Encode URL before making request
encode_url = true,
-- Highlight request on run
highlight = {
enabled = true,
timeout = 150,
},
result = {
-- toggle showing URL, HTTP info, headers at top the of result window
show_url = true,
-- show the generated curl command in case you want to launch
-- the same request via the terminal (can be verbose)
show_curl_command = false,
show_http_info = true,
show_headers = true,
-- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them
formatters = {
json = "jq",
html = function(body)
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
},
},
-- Jump to request line on run
jump_to_request = false,
env_file = ".env",
custom_dynamic_variables = {},
yank_dry_run = true,
},
}

View File

@@ -1,16 +0,0 @@
return {
"mrcjkb/rustaceanvim",
version = "^4",
enabled = false,
-- TODO: configure rustaceanvim
ft = { "rust" },
--[[ keys = {
{
"",
function()
vim.cmd.RustLsp("codeAction")
end,
desc = "",
},
}, ]]
}

View File

@@ -2,7 +2,5 @@ return {
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({})
end,
opts = {},
}