mirror of
https://github.com/arkorty/Neolite.git
synced 2026-03-18 00:57:12 +00:00
Call the new plugins
Add gruvbox colorscheme
Turn off jump on jumpable for code snippets
Add git integration
Remove unnecessary keybinds
Change keybinds for LSP functions
Turn off format on buffer write
Add plugin sources
Remove 'help' from syntax highlighting
Add transparency option
Add visible indentations
Changes to be committed:
modified: init.lua
modified: lua/colorschemes.lua
modified: lua/completions.lua
new file: lua/git-integration.lua
modified: lua/keybinds.lua
modified: lua/lsp-config.lua
modified: lua/lsp-format.lua
modified: lua/plugins.lua
modified: lua/syntax-highlight.lua
new file: lua/transparency.lua
new file: lua/visible-indents.lua
91 lines
2.8 KiB
Lua
91 lines
2.8 KiB
Lua
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
|
if not lspconfig_status_ok then
|
|
return
|
|
end
|
|
|
|
local mason_status_ok, mason = pcall(require, "mason")
|
|
if not mason_status_ok then
|
|
return
|
|
end
|
|
|
|
local mason_lspconfig_status_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
|
|
if not mason_lspconfig_status_ok then
|
|
return
|
|
end
|
|
|
|
mason.setup({})
|
|
|
|
mason_lspconfig.setup({
|
|
ensure_installed = { "lua_ls", "rust_analyzer", "clangd", "marksman" },
|
|
})
|
|
|
|
local cnl_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
|
if not cnl_ok then
|
|
return
|
|
end
|
|
|
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
|
|
|
mason_lspconfig.setup_handlers({
|
|
function(server)
|
|
lspconfig[server].setup({
|
|
capabilities = capabilities,
|
|
})
|
|
lspconfig.lua_ls.setup({
|
|
capabilities = capabilities,
|
|
settings = {
|
|
Lua = {
|
|
diagnostics = {
|
|
-- Get the language server to recognize the `vim` global
|
|
globals = { "vim" },
|
|
},
|
|
},
|
|
},
|
|
})
|
|
end,
|
|
["rust_analyzer"] = function()
|
|
local rt_ok, rust_tools = pcall(require, "rust-tools")
|
|
if rt_ok then
|
|
rust_tools.setup({})
|
|
end
|
|
end,
|
|
})
|
|
|
|
-- Global mappings.
|
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
|
vim.keymap.set("n", "<Leader>e", vim.diagnostic.open_float)
|
|
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
|
|
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
|
|
vim.keymap.set("n", "<Leader>q", vim.diagnostic.setloclist)
|
|
|
|
-- Use LspAttach autocommand to only map the following keys
|
|
-- after the language server attaches to the current buffer
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
|
callback = function(ev)
|
|
-- Enable completion triggered by <c-x><c-o>
|
|
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
|
|
|
-- Buffer local mappings.
|
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
|
local opts = { buffer = ev.buf }
|
|
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
|
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
|
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
|
|
vim.keymap.set("n", "<Leader>wa", vim.lsp.buf.add_workspace_folder, opts)
|
|
vim.keymap.set("n", "<Leader>wr", vim.lsp.buf.remove_workspace_folder, opts)
|
|
vim.keymap.set("n", "<Leader>wl", function()
|
|
print(vim.inspect(vim.lsp.buf.list_workLeader_folders()))
|
|
end, opts)
|
|
vim.keymap.set("n", "<Leader>D", vim.lsp.buf.type_definition, opts)
|
|
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename, opts)
|
|
vim.keymap.set({ "n", "v" }, "<Leader>ca", vim.lsp.buf.code_action, opts)
|
|
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
|
vim.keymap.set("n", "<Leader>f", function()
|
|
vim.lsp.buf.format({ async = true })
|
|
end, opts)
|
|
end,
|
|
})
|