This commit is contained in:
Christian Nieves
2024-07-08 00:01:40 -05:00
parent 4a80441b38
commit 07e5fe880f
5 changed files with 90 additions and 222 deletions

View File

@ -49,23 +49,23 @@ return {
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
init = function()
vim.api.nvim_create_autocmd("VimEnter", {
group = vim.api.nvim_create_augroup("restore_session", { clear = true }),
callback = function()
if vim.fn.getcwd() ~= vim.env.HOME then
require("persistence").load()
end
end,
nested = true,
})
end,
opts = {},
keys = {
{ "<leader>ss", [[<cmd>lua require("persistence").save()<cr>]] },
{ "<leader>sl", [[<cmd>lua require("persistence").load()<cr>]] },
},
},
{
"rmagatti/auto-session",
dependencies = {
"nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens
},
config = function()
require("auto-session").setup({
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
})
end,
},
{
"johmsalas/text-case.nvim",
dependencies = { "nvim-telescope/telescope.nvim" },

View File

@ -35,93 +35,95 @@ return {
require("mason").setup()
require("mason-lspconfig").setup({
automatic_installation = true,
automatic_installation = false,
ensure_installed = lsps,
})
handlers = {
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
-- vim.notify("Mason LSP:" .. server_name)
require("lspconfig")[server_name].setup({})
end,
-- Prevent mason from setting up rust_analyzer since that's handled by rustaceanvim
["rust_analyzer"] = function() end,
["omnisharp_mono"] = function()
require("lspconfig").omnisharp_mono.setup({
handlers = {
["textDocument/definition"] = require("omnisharp_extended").handler,
},
-- cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" },
require("mason-lspconfig").setup_handlers({
-- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({})
end,
["omnisharp_mono"] = function()
require("lspconfig").omnisharp_mono.setup({
handlers = {
["textDocument/definition"] = require("omnisharp_extended").handler,
},
-- cmd = { "dotnet", "/path/to/omnisharp/OmniSharp.dll" },
-- Enables support for reading code style, naming convention and analyzer
-- settings from .editorconfig.
enable_editorconfig_support = true,
-- Enables support for reading code style, naming convention and analyzer
-- settings from .editorconfig.
enable_editorconfig_support = true,
-- If true, MSBuild project system will only load projects for files that
-- were opened in the editor. This setting is useful for big C# codebases
-- and allows for faster initialization of code navigation features only
-- for projects that are relevant to code that is being edited. With this
-- setting enabled OmniSharp may load fewer projects and may thus display
-- incomplete reference lists for symbols.
enable_ms_build_load_projects_on_demand = false, -- default false
-- If true, MSBuild project system will only load projects for files that
-- were opened in the editor. This setting is useful for big C# codebases
-- and allows for faster initialization of code navigation features only
-- for projects that are relevant to code that is being edited. With this
-- setting enabled OmniSharp may load fewer projects and may thus display
-- incomplete reference lists for symbols.
enable_ms_build_load_projects_on_demand = false, -- default false
-- Enables support for roslyn analyzers, code fixes and rulesets.
enable_roslyn_analyzers = true, -- default false
-- Enables support for roslyn analyzers, code fixes and rulesets.
enable_roslyn_analyzers = true, -- default false
-- Specifies whether 'using' directives should be grouped and sorted during
-- document formatting.
organize_imports_on_format = true, -- default false
-- Specifies whether 'using' directives should be grouped and sorted during
-- document formatting.
organize_imports_on_format = true, -- default false
-- Enables support for showing unimported types and unimported extension
-- methods in completion lists. When committed, the appropriate using
-- directive will be added at the top of the current file. This option can
-- have a negative impact on initial completion responsiveness,
-- particularly for the first few completion sessions after opening a
-- solution.
enable_import_completion = true, -- default false
-- Enables support for showing unimported types and unimported extension
-- methods in completion lists. When committed, the appropriate using
-- directive will be added at the top of the current file. This option can
-- have a negative impact on initial completion responsiveness,
-- particularly for the first few completion sessions after opening a
-- solution.
enable_import_completion = true, -- default false
-- Specifies whether to include preview versions of the .NET SDK when
-- determining which version to use for project loading.
sdk_include_prereleases = true,
-- Specifies whether to include preview versions of the .NET SDK when
-- determining which version to use for project loading.
sdk_include_prereleases = true,
-- Only run analyzers against open files when 'enableRoslynAnalyzers' is
-- true
analyze_open_documents_only = true, -- default false
})
end,
["lua_ls"] = function()
require("lspconfig").lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {
"vim",
"require",
-- Only run analyzers against open files when 'enableRoslynAnalyzers' is
-- true
analyze_open_documents_only = true, -- default false
})
end,
["lua_ls"] = function()
require("lspconfig").lua_ls.setup({
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
},
workspace = {
checkThirdParty = false, -- stop a annoying dialog on startup
-- Make the server aware of Neovim runtime files
-- library = vim.api.nvim_get_runtime_file("", true),
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {
"vim",
"require",
},
},
workspace = {
checkThirdParty = false, -- stop a annoying dialog on startup
-- Make the server aware of Neovim runtime files
-- library = vim.api.nvim_get_runtime_file("", true),
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
},
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
})
end,
})
end,
},
})
end,
}

View File

@ -12,17 +12,6 @@ return {
})
end,
},
{
"mrcjkb/rustaceanvim",
version = "^3", -- Recommended
ft = { "rust" },
keys = {
{ "<leader>rd", ":RustLsp renderDiagnostic<CR>" },
{ "<leader>ree", ":RustLsp explainError<CR>" },
{ "<leader>rem", ":RustLsp expandMacro<CR>" },
},
},
{
"saecki/crates.nvim",
ft = "rust",