mirror of
https://github.com/arkorty/Neolite.git
synced 2026-03-17 16:51:42 +00:00
Refactor plugin configs for safe import
This commit is contained in:
@@ -42,7 +42,7 @@ if colorscheme == "onedark" then
|
||||
})
|
||||
|
||||
-- Load One Dark
|
||||
require("onedark").load()
|
||||
onedark.load()
|
||||
end
|
||||
|
||||
if colorscheme == "catppuccin" then
|
||||
@@ -96,7 +96,7 @@ if colorscheme == "catppuccin" then
|
||||
})
|
||||
|
||||
-- Load Catppuccin
|
||||
require("catppuccin").load()
|
||||
catppuccin.load()
|
||||
end
|
||||
|
||||
if colorscheme == "gruvbox" then
|
||||
@@ -126,5 +126,5 @@ if colorscheme == "gruvbox" then
|
||||
})
|
||||
|
||||
-- Load Gruvbox
|
||||
require("gruvbox").load()
|
||||
gruvbox.load()
|
||||
end
|
||||
|
||||
@@ -55,17 +55,6 @@ cmp.setup({
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
kind.kind = " " .. (strings[1] or "") .. " "
|
||||
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||
|
||||
return kind
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
@@ -79,4 +68,19 @@ cmp.setup({
|
||||
experimental = {
|
||||
ghost_text = false,
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
local lk_ok, lspkind = pcall(require, "lspkind")
|
||||
if not lk_ok then
|
||||
return
|
||||
end
|
||||
local kind = lspkind.cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
kind.kind = " " .. (strings[1] or "") .. " "
|
||||
kind.menu = " (" .. (strings[2] or "") .. ")"
|
||||
|
||||
return kind
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-- disable netrw
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- set termguicolors to enable highlight groups
|
||||
|
||||
@@ -19,7 +19,12 @@ mason_lspconfig.setup({
|
||||
ensure_installed = { "lua_ls", "rust_analyzer", "clangd" },
|
||||
})
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
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)
|
||||
|
||||
@@ -68,8 +68,11 @@ packer.startup(function(use)
|
||||
use({
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
run = function()
|
||||
local ts_update = require("nvim-treesitter.install").update({ with_sync = true })
|
||||
local ntsi_ok, nvim_treesitter_install = pcall(require, "nvim-treesitter.install")
|
||||
if ntsi_ok then
|
||||
local ts_update = nvim_treesitter_install.install.update({ with_sync = true })
|
||||
ts_update()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user