feat: update config
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
-- luasnip setup
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
@@ -9,106 +8,109 @@ local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
require("lspconfig").html.setup({
|
||||
capabilities = capabilities,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
require("nvim-autopairs").setup()
|
||||
require("copilot").setup()
|
||||
require("copilot_cmp").setup({
|
||||
clear_after_cursor = true,
|
||||
require("copilot").setup({
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false },
|
||||
})
|
||||
require("copilot_cmp").setup {
|
||||
method = "getCompletionsCycling",
|
||||
}
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.fn.col(".") - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||
local col = vim.fn.col(".") - 1
|
||||
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
|
||||
end
|
||||
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menuone,noselect",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-Leader>"] = cmp.mapping.complete({}),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
max_width = 50,
|
||||
symbol_map = { Copilot = "" },
|
||||
}),
|
||||
},
|
||||
sources = {
|
||||
{ name = "copilot" },
|
||||
{ name = "vim-dadbod-completion", filetype = "sql" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "emoji" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
{ name = "calc" },
|
||||
},
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menuone,noselect",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-Leader>"] = cmp.mapping.complete({}),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif check_backspace() then
|
||||
fallback()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
"i",
|
||||
"s",
|
||||
}),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = "symbol_text",
|
||||
max_width = 50,
|
||||
symbol_map = { Copilot = "" },
|
||||
}),
|
||||
},
|
||||
sources = {
|
||||
{ name = "copilot" },
|
||||
{ name = "vim-dadbod-completion", filetype = "sql" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "emoji" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
{ name = "calc" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline("/", {
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(":", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
|
||||
|
@@ -2,19 +2,20 @@ local mason = require("mason")
|
||||
local mason_lsp = require("mason-lspconfig")
|
||||
local lsp = require("lspconfig")
|
||||
|
||||
|
||||
require("null-ls").setup({
|
||||
sources = {
|
||||
require("null-ls").builtins.formatting.stylua,
|
||||
require("null-ls").builtins.diagnostics.eslint,
|
||||
require("null-ls").builtins.code_actions.eslint_d,
|
||||
-- require("null-ls").builtins.completion.spell,
|
||||
},
|
||||
sources = {
|
||||
require("null-ls").builtins.formatting.stylua,
|
||||
require("null-ls").builtins.diagnostics.eslint,
|
||||
-- require("null-ls").builtins.code_actions.eslint_d,
|
||||
-- require("null-ls").builtins.completion.spell,
|
||||
},
|
||||
})
|
||||
|
||||
mason.setup()
|
||||
|
||||
mason_lsp.setup({
|
||||
ensure_installed = { "sumneko_lua", "jsonls", "tsserver", "svelte", "cssls" },
|
||||
ensure_installed = { "sumneko_lua", "jsonls", "tsserver", "svelte", "cssls" },
|
||||
})
|
||||
|
||||
local runtime_path = vim.split(package.path, ";")
|
||||
@@ -22,230 +23,201 @@ table.insert(runtime_path, "lua/?.lua")
|
||||
table.insert(runtime_path, "lua/?/init.lua")
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format()
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format()
|
||||
|
||||
if client.name == "tsserver" or client.name == "svelte" then
|
||||
-- params for the request
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(bufnr) },
|
||||
title = "",
|
||||
}
|
||||
if client.name == "tsserver" or client.name == "svelte" then
|
||||
-- params for the request
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(bufnr) },
|
||||
title = "",
|
||||
}
|
||||
|
||||
-- perform a syncronous request
|
||||
-- 500ms timeout depending on the size of file a bigger timeout may be needed
|
||||
vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500)
|
||||
end
|
||||
end,
|
||||
})
|
||||
else
|
||||
-- vim.notify("Lsp (" .. client.name .. ") doesnt support format")
|
||||
end
|
||||
-- perform a syncronous request
|
||||
-- 500ms timeout depending on the size of file a bigger timeout may be needed
|
||||
vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500)
|
||||
end
|
||||
end,
|
||||
})
|
||||
else
|
||||
-- vim.notify("Lsp (" .. client.name .. ") doesnt support format")
|
||||
end
|
||||
end
|
||||
|
||||
lsp.sumneko_lua.setup({
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
capabilities.textDocument.foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
}
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
lsp.prismals.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
local custom_lsp = {};
|
||||
|
||||
lsp.emmet_ls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
custom_lsp.tsserver = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = lsp.util.root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git"),
|
||||
}
|
||||
|
||||
lsp.solargraph.setup({
|
||||
filetypes = { "ruby" },
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.elixirls.setup({
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.jsonls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
provideFormatter = false,
|
||||
json = {
|
||||
schemas = {
|
||||
{
|
||||
description = "TypeScript compiler configuration file",
|
||||
fileMatch = { "tsconfig.json", "tsconfig.*.json" },
|
||||
url = "http://json.schemastore.org/tsconfig",
|
||||
},
|
||||
{
|
||||
description = "ESLint config",
|
||||
fileMatch = { ".eslintrc.json", ".eslintrc" },
|
||||
url = "http://json.schemastore.org/eslintrc",
|
||||
},
|
||||
{
|
||||
description = "Prettier config",
|
||||
fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" },
|
||||
url = "http://json.schemastore.org/prettierrc",
|
||||
},
|
||||
{
|
||||
description = "JSON schema for Import Maps files",
|
||||
fileMatch = { "importmap.json", "import_map.json", "import-map.json" },
|
||||
name = "importmap.json",
|
||||
url = "https://json.schemastore.org/importmap.json",
|
||||
},
|
||||
{
|
||||
description = "NPM configuration file",
|
||||
fileMatch = { "package.json" },
|
||||
name = "package.json",
|
||||
url = "https://json.schemastore.org/package.json",
|
||||
},
|
||||
},
|
||||
},
|
||||
custom_lsp.sumneko_lua = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
lsp.svelte.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
lsp.tsserver.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
lsp.html.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
lsp.phpactor.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
lsp.intelephense.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
intelephense = {
|
||||
stubs = {
|
||||
"wordpress",
|
||||
"woocommerce",
|
||||
"wordpress-globals",
|
||||
"wp-cli",
|
||||
},
|
||||
environment = {
|
||||
includePaths = "/home/max/.composer/vendor/php-stubs/", -- this line forces the composer path for the stubs in case inteliphense don't find it...
|
||||
},
|
||||
files = {
|
||||
maxSize = 5000000,
|
||||
},
|
||||
|
||||
custom_lsp.jsonls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
provideFormatter = false,
|
||||
json = {
|
||||
schemas = {
|
||||
{
|
||||
description = "TypeScript compiler configuration file",
|
||||
fileMatch = { "tsconfig.json", "tsconfig.*.json" },
|
||||
url = "http://json.schemastore.org/tsconfig",
|
||||
},
|
||||
},
|
||||
})
|
||||
lsp.cssls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.zls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.bashls.setup({
|
||||
capabilities = capabilities,
|
||||
filetypes = { "sh", "bash" },
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.rust_analyzer.setup({
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
{
|
||||
description = "ESLint config",
|
||||
fileMatch = { ".eslintrc.json", ".eslintrc" },
|
||||
url = "http://json.schemastore.org/eslintrc",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lsp.gopls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lsp.yamlls.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*",
|
||||
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
|
||||
["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml",
|
||||
["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml",
|
||||
},
|
||||
{
|
||||
description = "Prettier config",
|
||||
fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" },
|
||||
url = "http://json.schemastore.org/prettierrc",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lsp.glslls.setup(require("max.configs.lsp-glsl"))
|
||||
|
||||
lsp.ltex.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "de",
|
||||
disabledRules = { ["en-US"] = { "PROFANITY" } },
|
||||
dictionary = {
|
||||
["en-US"] = { "perf", "ci", "neovim" },
|
||||
},
|
||||
hiddenFalsePositives = {
|
||||
"neovim",
|
||||
"Neovim",
|
||||
"waybar",
|
||||
},
|
||||
{
|
||||
description = "JSON schema for Import Maps files",
|
||||
fileMatch = { "importmap.json", "import_map.json", "import-map.json" },
|
||||
name = "importmap.json",
|
||||
url = "https://json.schemastore.org/importmap.json",
|
||||
},
|
||||
{
|
||||
description = "NPM configuration file",
|
||||
fileMatch = { "package.json" },
|
||||
name = "package.json",
|
||||
url = "https://json.schemastore.org/package.json",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
custom_lsp.intelephense = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
intelephense = {
|
||||
stubs = {
|
||||
"wordpress",
|
||||
"woocommerce",
|
||||
"wordpress-globals",
|
||||
"wp-cli",
|
||||
},
|
||||
environment = {
|
||||
includePaths = "/home/max/.composer/vendor/php-stubs/", -- this line forces the composer path for the stubs in case inteliphense don't find it...
|
||||
},
|
||||
files = {
|
||||
maxSize = 5000000,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
custom_lsp.rust_analyzer = {
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
imports = {
|
||||
granularity = {
|
||||
group = "module",
|
||||
},
|
||||
prefix = "self",
|
||||
},
|
||||
cargo = {
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
custom_lsp.yamlls = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*",
|
||||
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
|
||||
["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml",
|
||||
["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
custom_lsp.glslls = require("max.configs.lsp-glsl")
|
||||
|
||||
custom_lsp.ltex = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "de",
|
||||
disabledRules = { ["en-US"] = { "PROFANITY" } },
|
||||
dictionary = {
|
||||
["en-US"] = { "perf", "ci", "neovim" },
|
||||
},
|
||||
hiddenFalsePositives = {
|
||||
"neovim",
|
||||
"Neovim",
|
||||
"waybar",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require('mason-lspconfig').setup_handlers({
|
||||
function(server_name)
|
||||
if custom_lsp[server_name] ~= nil then
|
||||
lsp[server_name].setup(custom_lsp[server_name])
|
||||
else
|
||||
lsp[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@@ -1,4 +1,7 @@
|
||||
require("nvim-treesitter.configs").setup({
|
||||
context_commentstring = {
|
||||
enable = true
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
|
@@ -41,8 +41,18 @@ augroup filetypedetect
|
||||
augroup END
|
||||
]])
|
||||
|
||||
autocmd({ "BufReadPost" }, {
|
||||
pattern = "*",
|
||||
group = config_group,
|
||||
command = "filetype detect",
|
||||
-- autocmd({ "BufReadPost" }, {
|
||||
-- pattern = "*",
|
||||
-- group = config_group,
|
||||
-- command = "filetype detect",
|
||||
-- })
|
||||
|
||||
autocmd("BufReadPost", {
|
||||
callback = function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(0)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@@ -27,6 +27,7 @@ map("n", "<Leader>a", ":Alpha<CR>", opts);
|
||||
-- LSP Functionality
|
||||
map("n", "<Leader>n", ":lua vim.diagnostic.goto_next()<CR>", opts)
|
||||
map("n", "<Leader>p", ":lua vim.diagnostic.goto_prev()<CR>", opts)
|
||||
map("n", "<Leader>e", ":lua vim.diagnostic.open_float()<CR>", opts)
|
||||
map("n", "gD", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
@@ -39,7 +40,7 @@ map({ "n", "v" }, "gr", "<cmd>Lspsaga lsp_finder<CR>", opts)
|
||||
map("n", "<Leader>u", ":UndotreeToggle<CR>", opts)
|
||||
|
||||
-- This is my [i]nspect section, [i]nspect [s]ymbols
|
||||
map("n", "<Leader>is", "<cmd>lua require('litee.lib.lsp.wrappers').buf_document_symbol()<CR>", opts)
|
||||
map("n", "<Leader>is", "<cmd>SymbolsOutline<cr>", opts)
|
||||
map("n", "<Leader>io", "<cmd>Lspsaga outline<CR>", opts)
|
||||
map("n", "<Leader>ip", ":TroubleToggle<CR>", opts)
|
||||
map({ "n", "v" }, "<Leader>t", require("max.configs.translate"), opts)
|
||||
@@ -88,13 +89,20 @@ map("n", "<A-S-J>", "yyp", opts)
|
||||
-- If i paste with p, the replaced content doesnt replace my clipboard
|
||||
map("v", "p", '"_dP', opts)
|
||||
|
||||
-- clear highlights after search
|
||||
map("n", "<leader>cl", ":noh<CR>", opts);
|
||||
map("n", "<leader>m", ":Mason<CR>", opts);
|
||||
map("n", "<leader>l", ":Lazy<CR>", opts);
|
||||
map("n", "<leader>so", ":so %<CR>", opts);
|
||||
|
||||
|
||||
-- Faster git merge
|
||||
map("n", "<Leader>gd", ":Gvdiffsplit!<CR>", opts)
|
||||
map("n", "<Leader>gdl", ":diffget //3<CR>", opts)
|
||||
map("n", "<Leader>gdh", ":diffget //2<CR>", opts)
|
||||
|
||||
-- Find file in NvimTree
|
||||
map("n", "<Leader>e", ":NvimTreeToggle<CR>", opts)
|
||||
map("n", "<Leader>j", ":NvimTreeToggle<CR>", opts)
|
||||
map("n", "<Leader>f", ":NvimTreeFindFile<CR><c-w>", opts)
|
||||
|
||||
-- I aint no weak boy
|
||||
|
@@ -25,6 +25,8 @@ vim.cmd([[set complete+=kspell]]) -- auto complete with spellcheck
|
||||
vim.cmd([[set completeopt=menuone,noselect]]) -- auto complete menu (It's pretty great)
|
||||
vim.cmd([[set nocompatible]]) -- Disable compatibility to old-time vi
|
||||
set.mouse = "a" -- Enable mouse support
|
||||
set.signcolumn = "yes"
|
||||
set.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
|
||||
-- Configure Folds
|
||||
vim.cmd([[set wildmode=list:longest,full]]) -- Command-line completion mode
|
||||
@@ -50,7 +52,7 @@ set.termguicolors = true -- set term gui colors (most terminals support this)
|
||||
set.laststatus = 3 -- Always display the status line
|
||||
set.title = true -- Show current txt that you editing
|
||||
set.relativenumber = true -- Vim’s absolute, relative and hybrid line numbers
|
||||
set.cursorline = false -- Enable highlighting of the current line
|
||||
set.cursorline = true -- Enable highlighting of the current line
|
||||
set.synmaxcol = 128
|
||||
vim.cmd("syntax sync minlines=256")
|
||||
set.mousescroll = "ver:1,hor:1"
|
||||
|
@@ -13,6 +13,7 @@ local plugins = {
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("max.configs.lualine")
|
||||
end,
|
||||
@@ -21,9 +22,11 @@ local plugins = {
|
||||
--------------------
|
||||
-- Layout Plugins --
|
||||
--------------------
|
||||
{ 'akinsho/bufferline.nvim', lazy = false, config = true },
|
||||
{ "shortcuts/no-neck-pain.nvim", cmd = "NoNeckPain", config = true },
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
lazy = false,
|
||||
config = true
|
||||
},
|
||||
{
|
||||
@@ -34,17 +37,10 @@ local plugins = {
|
||||
end,
|
||||
},
|
||||
{
|
||||
"ldelossa/litee.nvim",
|
||||
cmd = "InsertEnter",
|
||||
dependencies = {
|
||||
"ldelossa/litee-symboltree.nvim",
|
||||
"ldelossa/litee-calltree.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("max.configs.litee")
|
||||
end,
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
config = true,
|
||||
},
|
||||
{ "ethanholz/nvim-lastplace", event = "BufReadPre", config = true },
|
||||
{ "mbbill/undotree", lazy = false },
|
||||
{
|
||||
"petertriho/nvim-scrollbar",
|
||||
@@ -78,16 +74,15 @@ local plugins = {
|
||||
event = "BufReadPost",
|
||||
dependencies = 'kevinhwang91/promise-async',
|
||||
config = function()
|
||||
require('ufo').setup({
|
||||
provider_selector = function()
|
||||
return { 'treesitter', 'indent' }
|
||||
end
|
||||
})
|
||||
require("ufo").setup()
|
||||
|
||||
vim.o.foldcolumn = '1'
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
-- vim.o.statuscolumn = "%=%l%s%C"
|
||||
vim.o.statuscolumn = '%=%l%s%{foldlevel(v:lnum) > foldlevel(v:lnum - 1) ? (foldclosed(v:lnum) == -1 ? "" : "") : " " }'
|
||||
-- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -109,7 +104,7 @@ local plugins = {
|
||||
}, -- startup screen
|
||||
{
|
||||
"numToStr/Comment.nvim",
|
||||
event = "BufReadPre",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
@@ -119,13 +114,12 @@ local plugins = {
|
||||
---------------------
|
||||
"junegunn/fzf",
|
||||
{
|
||||
"ggandor/leap.nvim",
|
||||
|
||||
config = function()
|
||||
local leap = require("leap")
|
||||
leap.add_default_mappings()
|
||||
leap.setup({})
|
||||
end,
|
||||
"ggandor/flit.nvim",
|
||||
dependencies = {
|
||||
"ggandor/leap.nvim",
|
||||
},
|
||||
event = "VimEnter",
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
@@ -133,42 +127,28 @@ local plugins = {
|
||||
require("max.configs.telescope")
|
||||
end,
|
||||
},
|
||||
|
||||
---------------
|
||||
-- Lsp Setup --
|
||||
---------------
|
||||
|
||||
{ "glepnir/lspsaga.nvim",
|
||||
cmd = "Lspsaga"
|
||||
}, -- better windows for lsp replace, goto definition etc...
|
||||
{ "VonHeikemen/lsp-zero.nvim",
|
||||
{
|
||||
"glepnir/lspsaga.nvim",
|
||||
event = 'BufRead',
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
end
|
||||
},
|
||||
{ "neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"arkav/lualine-lsp-progress",
|
||||
"williamboman/mason.nvim",
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"onsails/lspkind.nvim",
|
||||
"rafamadriz/friendly-snippets",
|
||||
{ "lukas-reineke/lsp-format.nvim", config = true },
|
||||
},
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local lsp = require("lsp-zero")
|
||||
lsp.preset("recommended")
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
require("lsp-format").on_attach(client, bufnr)
|
||||
end)
|
||||
lsp.nvim_workspace()
|
||||
lsp.setup()
|
||||
vim.diagnostic.config { virtual_text = true }
|
||||
|
||||
require("max.configs.lsp")
|
||||
end },
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
@@ -182,16 +162,36 @@ local plugins = {
|
||||
-- Autocomplete --
|
||||
-------------------
|
||||
{ "tpope/vim-surround", lazy = false },
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer",
|
||||
"windwp/nvim-autopairs",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-emoji",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"zbirenbaum/copilot.lua",
|
||||
"zbirenbaum/copilot-cmp",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
config = function()
|
||||
require("max.configs.autocomplete")
|
||||
end
|
||||
},
|
||||
{
|
||||
"nat-418/boole.nvim",
|
||||
event = "BufReadPre",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("boole").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"gaoDean/autolist.nvim",
|
||||
event = "BufReadPre",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("autolist").setup({})
|
||||
end,
|
||||
@@ -204,6 +204,7 @@ local plugins = {
|
||||
event = "BufReadPost",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"JoosepAlviste/nvim-ts-context-commentstring"
|
||||
},
|
||||
config = function()
|
||||
require("max.configs.treesitter")
|
||||
|
59
configs/nvim/lua/max/theme/icons.lua
Normal file
59
configs/nvim/lua/max/theme/icons.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
local defaults = {
|
||||
-- colorscheme can be a string like `catppuccin` or a function that will load the colorscheme
|
||||
---@type string|fun()
|
||||
colorscheme = function()
|
||||
require("tokyonight").load()
|
||||
end,
|
||||
-- icons used by other plugins
|
||||
icons = {
|
||||
diagnostics = {
|
||||
Error = " ",
|
||||
Warn = " ",
|
||||
Hint = " ",
|
||||
Info = " ",
|
||||
},
|
||||
git = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
kinds = {
|
||||
Array = " ",
|
||||
Boolean = " ",
|
||||
Class = " ",
|
||||
Color = " ",
|
||||
Constant = " ",
|
||||
Constructor = " ",
|
||||
Enum = " ",
|
||||
EnumMember = " ",
|
||||
Event = " ",
|
||||
Field = " ",
|
||||
File = " ",
|
||||
Folder = " ",
|
||||
Function = " ",
|
||||
Interface = " ",
|
||||
Key = " ",
|
||||
Keyword = " ",
|
||||
Method = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Null = "ﳠ ",
|
||||
Number = " ",
|
||||
Object = " ",
|
||||
Operator = " ",
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
Value = " ",
|
||||
Variable = " ",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return defaults
|
Reference in New Issue
Block a user