Complete refactor + moved to [lsp-zero](https://github.com/VonHeikemen/lsp-zero.nvim)

This commit is contained in:
Kristofers Solo 2023-08-09 02:01:47 +03:00
parent 9e449312d7
commit 5871bcd430
71 changed files with 2023 additions and 2204 deletions

View File

@ -1,131 +0,0 @@
local status_ok, ccc = pcall(require, "ccc")
if not status_ok then
return
end
local ColorInput = require("ccc.input")
local convert = require("ccc.utils.convert")
local RgbHslInput = setmetatable({
name = "RGB/HSL",
max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 },
min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 },
bar_name = { "R", "G", "B", "H", "S", "L" },
}, { __index = ColorInput })
function RgbHslInput.format(n, i)
if i <= 3 then
-- RGB
n = n * 255
elseif i >= 5 then
-- S or L of HSL
n = n * 100
end
return ("%6d"):format(n)
end
function RgbHslInput.from_rgb(RGB)
local HSL = convert.rgb2hsl(RGB)
local R, G, B = unpack(RGB)
local H, S, L = unpack(HSL)
return { R, G, B, H, S, L }
end
function RgbHslInput.to_rgb(value)
return { value[1], value[2], value[3] }
end
function RgbHslInput:_set_rgb(RGB)
self.value[1] = RGB[1]
self.value[2] = RGB[2]
self.value[3] = RGB[3]
end
function RgbHslInput:_set_hsl(HSL)
self.value[4] = HSL[1]
self.value[5] = HSL[2]
self.value[6] = HSL[3]
end
function RgbHslInput:callback(index, new_value)
self.value[index] = new_value
local v = self.value
if index <= 3 then
local RGB = { v[1], v[2], v[3] }
local HSL = convert.rgb2hsl(RGB)
self:_set_hsl(HSL)
else
local HSL = { v[4], v[5], v[6] }
local RGB = convert.hsl2rgb(HSL)
self:_set_rgb(RGB)
end
end
ccc.setup({
pickers = {
ccc.picker.custom_entries({
bg = "#1a1b26",
bg_dark = "#16161e",
bg_float = "#16161e",
bg_highlight = "#292e42",
bg_popup = "#16161e",
bg_search = "#3d59a1",
bg_sidebar = "#16161e",
bg_statusline = "#16161e",
bg_visual = "#283457",
black = "#15161e",
blue = "#7aa2f7",
blue0 = "#3d59a1",
blue1 = "#2ac3de",
blue2 = "#0db9d7",
blue5 = "#89ddff",
blue6 = "#b4f9f8",
blue7 = "#394b70",
border = "#15161e",
border_highlight = "#27a1b9",
comment = "#565f89",
cyan = "#7dcfff",
dark3 = "#545c7e",
dark5 = "#737aa2",
delta_add = "#2c5a66",
delta_delete = "#713137",
diff_add = "#20303b",
diff_change = "#1f2231",
diff_delete = "#37222c",
diff_text = "#394b70",
error = "#db4b4b",
fg = "#c0caf5",
fg_dark = "#a9b1d6",
fg_float = "#c0caf5",
fg_gutter = "#3b4261",
fg_sidebar = "#a9b1d6",
git_add = "#449dab",
git_change = "#6183bb",
git_delete = "#914c54",
git_ignore = "#545c7e",
gitSigns_add = "#266d6a",
gitSigns_change = "#536c9e",
gitSigns_delete = "#b2555b",
green = "#9ece6a",
green1 = "#73daca",
green2 = "#41a6b5",
hint = "#1abc9c",
info = "#0db9d7",
magenta = "#bb9af7",
magenta2 = "#ff007c",
none = "NONE",
orange = "#ff9e64",
purple = "#9d7cd8",
red = "#f7768e",
red1 = "#db4b4b",
teal = "#1abc9c",
terminal_black = "#414868",
warning = "#e0af68",
yellow = "#e0af68",
}),
},
inputs = {
RgbHslInput,
},
})

View File

@ -1,21 +0,0 @@
local status_ok, cmake = pcall(require, "cmake-tools")
if not status_ok then
return
end
cmake.setup({
cmake_command = "cmake",
cmake_build_directory = "target/build/",
cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is "", this option will be activated
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" },
cmake_soft_link_compile_commands = true, -- if softlink compile commands json file
cmake_build_options = {},
cmake_console_size = 15, -- cmake output window height
cmake_console_position = "belowright", -- "belowright", "aboveleft", ...
cmake_show_console = "always", -- "always", "only_on_error"
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
cmake_variants_message = {
short = { show = true },
long = { show = true, max_length = 40 },
},
})

View File

@ -1,95 +0,0 @@
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
local luasnip_status_ok, luasnip = pcall(require, "luasnip")
if not luasnip_status_ok then
return
end
local kind_icons = {
Text = "󰉿",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "",
}
cmp.setup({
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-u>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<cr>"] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = "gh_issues" },
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "luasnip" },
{ name = "buffer" },
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
formatting = {
fields = { "abbr", "kind", "menu" },
format = function(entry, vim_item)
vim_item.kind = kind_icons[vim_item.kind]
vim_item.menu = ({
nvim_lsp = "[LSP]",
nvim_lua = "[api]",
luasnip = "[snip]",
buffer = "[buf]",
path = "[path]",
emoji = "[emoji]",
gh_issues = "[issues]",
})[entry.source.name]
return vim_item
end,
},
experimental = {
ghost_text = true,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
})

View File

@ -1,75 +0,0 @@
local plenary_status_ok, plenary = pcall(require, "plenary.job")
if not plenary_status_ok then
return
end
local source = {}
local enabled = true
source.new = function()
return setmetatable({ cache = {} }, { __index = source })
end
source.complete = function(self, _, callback)
if not enabled then
return
end
local bufnr = vim.api.nvim_get_current_buf()
-- This just makes sure that we only hit the GH API once per session.
--
-- You could remove this if you wanted, but this just makes it so we're
-- good programming citizens.
if not self.cache[bufnr] then
plenary
:new({
-- Uses `gh` executable to request the issues from the remote repository.
"gh",
"issue",
"list",
"--limit",
"1000",
"--json",
"title,number,body",
on_exit = function(job)
local result = job:result()
local parser_status_ok, parsed = pcall(vim.json.decode, table.concat(result, ""))
if not parser_status_ok then
enabled = false
return
end
local items = {}
for _, gh_item in ipairs(parsed) do
gh_item.body = string.gsub(gh_item.body or "", "\r", "")
table.insert(items, {
label = string.format("#%s", gh_item.number),
documentation = {
kind = "markdown",
value = string.format("# %s\n\n%s", gh_item.title, gh_item.body),
},
})
end
callback({ items = items, isIncomplete = false })
self.cache[bufnr] = items
end,
})
:start()
else
callback({ items = self.cache[bufnr], isIncomplete = false })
end
end
source.get_trigger_characters = function()
return { "#" }
end
source.is_available = function()
return vim.bo.filetype == "gitcommit"
end
require("cmp").register_source("gh_issues", source.new())

View File

@ -1,34 +0,0 @@
local status_ok, colorizer = pcall(require, "colorizer")
if not status_ok then
return
end
colorizer.setup({
filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue or blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = true, -- 0xAARRGGBB hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes for `mode`: foreground, background, virtualtext
mode = "background", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal
tailwind = true, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = {
enable = true,
parsers = { "css" },
}, -- Enable sass colors
virtualtext = "",
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
html = { names = true },
css = { names = true },
})

View File

@ -1,62 +0,0 @@
local status_ok, comment = pcall(require, "Comment")
if not status_ok then
return
end
comment.setup({
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = "gcc",
---Block-comment toggle keymap
block = "gbb",
},
-- -LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
---Line-comment keymap
line = "gc",
---Block-comment keymap
block = "gb",
},
---LHS of extra mappings
extra = {
---Add comment on the line above
above = "gcO",
---Add comment on the line below
below = "gco",
---Add comment at the end of line
eol = "gcA",
},
--- Enable keybindings
--- NOTE: If given `false` then the plugin won't create any mappings
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = true,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}`
extended = true,
},
---Function to call before (un)comment
-- pre_hook = function(ctx)
-- local U = require("Comment.utils")
--
-- local location = nil
-- if ctx.ctype == U.ctype.block then
-- location = require("ts_context_commentstring.utils").get_cursor_location()
-- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
-- location = require("ts_context_commentstring.utils").get_visual_start_location()
-- end
--
-- return require("ts_context_commentstring.internal").calculate_commentstring({
-- key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
-- location = location,
-- })
-- end,
})

View File

@ -1,144 +0,0 @@
local status_ok, crates = pcall(require, "crates")
if not status_ok then
return
end
crates.setup({
smart_insert = true,
insert_closing_quote = true,
avoid_prerelease = true,
autoload = true,
autoupdate = true,
loading_indicator = true,
date_format = "%d-%m-%Y",
thousands_separator = ".",
notification_title = "Crates",
disable_invalid_feature_diagnostic = false,
text = {
loading = "  Loading",
version = "  %s",
prerelease = "  %s",
yanked = "  %s",
nomatch = "  No match",
upgrade = "  %s",
error = "  Error fetching crate",
},
highlight = {
loading = "CratesNvimLoading",
version = "CratesNvimVersion",
prerelease = "CratesNvimPreRelease",
yanked = "CratesNvimYanked",
nomatch = "CratesNvimNoMatch",
upgrade = "CratesNvimUpgrade",
error = "CratesNvimError",
},
popup = {
autofocus = false,
copy_register = '"',
style = "minimal",
border = "none",
show_version_date = false,
show_dependency_version = true,
max_height = 30,
min_width = 20,
padding = 1,
text = {
title = " %s",
pill_left = "",
pill_right = "",
description = "%s",
created_label = " created ",
created = "%s",
updated_label = " updated ",
updated = "%s",
downloads_label = " downloads ",
downloads = "%s",
homepage_label = " homepage ",
homepage = "%s",
repository_label = " repository ",
repository = "%s",
documentation_label = " documentation ",
documentation = "%s",
crates_io_label = " crates.io ",
crates_io = "%s",
categories_label = " categories ",
keywords_label = " keywords ",
version = " %s",
prerelease = " %s",
yanked = " %s",
version_date = " %s",
feature = " %s",
enabled = " %s",
transitive = " %s",
normal_dependencies_title = " Dependencies",
build_dependencies_title = " Build dependencies",
dev_dependencies_title = " Dev dependencies",
dependency = " %s",
optional = " %s",
dependency_version = " %s",
loading = "",
},
highlight = {
title = "CratesNvimPopupTitle",
pill_text = "CratesNvimPopupPillText",
pill_border = "CratesNvimPopupPillBorder",
description = "CratesNvimPopupDescription",
created_label = "CratesNvimPopupLabel",
created = "CratesNvimPopupValue",
updated_label = "CratesNvimPopupLabel",
updated = "CratesNvimPopupValue",
downloads_label = "CratesNvimPopupLabel",
downloads = "CratesNvimPopupValue",
homepage_label = "CratesNvimPopupLabel",
homepage = "CratesNvimPopupUrl",
repository_label = "CratesNvimPopupLabel",
repository = "CratesNvimPopupUrl",
documentation_label = "CratesNvimPopupLabel",
documentation = "CratesNvimPopupUrl",
crates_io_label = "CratesNvimPopupLabel",
crates_io = "CratesNvimPopupUrl",
categories_label = "CratesNvimPopupLabel",
keywords_label = "CratesNvimPopupLabel",
version = "CratesNvimPopupVersion",
prerelease = "CratesNvimPopupPreRelease",
yanked = "CratesNvimPopupYanked",
version_date = "CratesNvimPopupVersionDate",
feature = "CratesNvimPopupFeature",
enabled = "CratesNvimPopupEnabled",
transitive = "CratesNvimPopupTransitive",
normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle",
build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle",
dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle",
dependency = "CratesNvimPopupDependency",
optional = "CratesNvimPopupOptional",
dependency_version = "CratesNvimPopupDependencyVersion",
loading = "CratesNvimPopupLoading",
},
keys = {
hide = { "q", "<esc>" },
open_url = { "<cr>" },
select = { "<cr>" },
select_alt = { "s" },
toggle_feature = { "<cr>" },
copy_value = { "yy" },
goto_item = { "gd", "K", "<C-LeftMouse>" },
jump_forward = { "<c-i>" },
jump_back = { "<c-o>", "<C-RightMouse>" },
},
},
src = {
insert_closing_quote = true,
text = {
prerelease = "  pre-release ",
yanked = "  yanked ",
},
coq = {
enabled = false,
name = "Crates",
},
},
null_ls = {
enabled = false,
name = "Crates",
},
})

View File

@ -1,65 +1,5 @@
local status_mason_dap_ok, mason_dap = pcall(require, "mason-nvim-dap") local dap = require("dap")
if not status_mason_dap_ok then local dapui = require("dapui")
return
end
local dap_status_ok, dap = pcall(require, "dap")
if not dap_status_ok then
return
end
local dap_ui_status_ok, dapui = pcall(require, "dapui")
if not dap_ui_status_ok then
return
end
local dap_install_status_ok, dap_install = pcall(require, "dap-install")
if not dap_install_status_ok then
return
end
mason_dap.setup({
automatic_installation = true,
automatic_setup = true,
})
-- add other configs here
dapui.setup({
layouts = {
{
elements = {
"scopes",
"breakpoints",
"stacs",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
-- sidebar = {
-- elements = {
-- {
-- id = "scopes",
-- size = 0.25, -- Can be float or integer > 1
-- },
-- { id = "breakpoints", size = 0.25 },
-- },
-- size = 40,
-- position = "right", -- Can be "left", "right", "top", "bottom"
-- },
-- tray = {
-- elements = {},
-- },
})
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })

View File

@ -1,14 +0,0 @@
local status_ok, gitsigns = pcall(require, "gitsigns")
if not status_ok then
return
end
gitsigns.setup({
signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
delete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
topdelete = { hl = "GitSignsDelete", text = "", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
changedelete = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
},
})

View File

@ -1,17 +0,0 @@
local status_ok, harpoon = pcall(require, "harpoon")
if not status_ok then
return
end
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
harpoon.setup()
local keymap = vim.keymap.set
local opts = { silent = true }
for i = 1, 12, 1 do
keymap("n", "<F" .. i .. ">", function()
ui.nav_file(i)
end)
end

View File

@ -1,8 +0,0 @@
local status_ok, hologram = pcall(require, "hologram")
if not status_ok then
return
end
hologram.setup({
auto_display = true,
})

View File

@ -1,13 +0,0 @@
vim.g.Illuminate_ftblacklist = { "alpha", "NvimTree" }
vim.api.nvim_set_keymap(
"n",
"<A-n>",
"<cmd>lua require('illuminate').next_reference{wrap=true}<cr>",
{ noremap = true }
)
vim.api.nvim_set_keymap(
"n",
"<A-p>",
"<cmd>lua require('illuminate').next_reference{reverse=true,wrap=true}<cr>",
{ noremap = true }
)

View File

@ -1,6 +0,0 @@
local status_ok, impatient = pcall(require, "impatient")
if not status_ok then
return
end
impatient.enable_profile()

View File

@ -1,80 +0,0 @@
local status_ok, indent_blankline = pcall(require, "indent_blankline")
if not status_ok then
return
end
local g = vim.g
local opt = vim.opt
local cmd = vim.cmd
g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
g.indent_blankline_filetype_exclude = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"NvimTree",
"Trouble",
}
g.indentLine_enabled = 1
g.indent_blankline_char = ""
g.indent_blankline_show_trailing_blankline_indent = false
g.indent_blankline_show_first_indent_level = true
g.indent_blankline_use_treesitter = true
g.indent_blankline_show_current_context = true
g.indent_blankline_context_patterns = {
"class",
"return",
"function",
"method",
"^if",
"^while",
"jsx_element",
"^for",
"^object",
"^table",
"block",
"arguments",
"if_statement",
"else_clause",
"jsx_element",
"jsx_self_closing_element",
"try_statement",
"catch_clause",
"import_statement",
"operation_type",
}
vim.wo.colorcolumn = "99999"
cmd([[highlight IndentBlanklineIndent1 guifg=#C678DD gui=nocombine]])
cmd([[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]])
cmd([[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]])
cmd([[highlight IndentBlanklineIndent6 guifg=#E06C75 gui=nocombine]])
opt.list = true
opt.listchars:append("space:⋅")
opt.listchars:append("eol:↴")
indent_blankline.setup({
char = "",
show_trailing_blankline_indent = false,
show_first_indent_level = true,
use_treesitter = true,
show_end_of_line = true,
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
buftype_exclude = { "terminal", "nofile" },
filetype_exclude = {
"help",
"packer",
"NvimTree",
},
})

314
after/plugin/lsp.lua Normal file
View File

@ -0,0 +1,314 @@
local lsp = require("lsp-zero").preset({
float_border = "rounded",
call_servers = "local",
configure_diagnostics = true,
setup_servers_on_start = true,
set_lsp_keymaps = {
preserve_mappings = false,
omit = {},
},
manage_nvim_cmp = {
set_sources = "recommended",
set_basic_mappings = false,
set_extra_mappings = false,
use_luasnip = true,
set_format = true,
documentation_window = true,
},
})
lsp.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings
-- to learn the available actions
lsp.default_keymaps({ buffer = bufnr })
local opts = { buffer = bufnr }
local bind = vim.keymap.set
bind("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", opts)
bind("n", "gd", "<cmd>lua require('telescope.builtin').lsp_definitions()<cr>", opts)
bind("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", opts)
bind("n", "gI", "<cmd>lua vim.lsp.buf.implementation()<cr>", opts)
bind("n", "gr", "<cmd>lua require('telescope.builtin').lsp_references()<cr>", opts)
bind("n", "gl", "<cmd>lua vim.diagnostic.open_float()<cr>", opts)
end)
lsp.ensure_installed({
"bashls",
"clangd",
"cmake",
"cssls",
"emmet_ls",
"html",
"jedi_language_server",
"jsonls",
"lua_ls",
"ruff_lsp",
"rust_analyzer",
"sqlls",
"tailwindcss",
"taplo",
"texlab",
"tsserver",
})
lsp.configure("clangd", {
capabilities = {
offsetEncoding = { "utf-16" },
},
on_attach = function()
require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints()
end,
})
lsp.configure("bashls", {
filetypes = {
"sh",
"bash",
"zsh",
},
})
lsp.configure("emmet_ls", {
filetypes = {
"html",
"htmldjango",
"typescriptreact",
"javascriptreact",
"css",
"sass",
"scss",
"less",
"eruby",
},
})
lsp.configure("texlab", {
settings = {
texlab = {
auxDirectory = ".",
bibtexFormatter = "texlab",
build = {
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
executable = "xelatex",
forwardSearchAfter = false,
onSave = false,
},
chktex = {
onEdit = false,
onOpenAndSave = false,
},
diagnosticsDelay = 0,
formatterLineLength = 120,
forwardSearch = {
args = {},
},
latexFormatter = "latexindent",
latexindent = {
modifyLineBreaks = false,
},
},
},
})
require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls({
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", "awesome", "client" },
},
-- 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,
},
root_pattern = {
".stylua.toml",
".luarc.json",
".luarc.jsonc",
".luacheckrc",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
format = {
enable = false,
},
},
},
}))
lsp.setup()
local null_ls = require("null-ls")
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local formatting = null_ls.builtins.formatting
-- https://github.com/prettier-solidity/prettier-plugin-solidity
local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({
sources = {
-- Here you can add tools not supported by mason.nvim
-- make sure the source name is supported by null-ls
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }),
formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }),
formatting.prettier.with({
extra_filetypes = { "toml" },
extra_args = {
"--no-semi",
"--double-quote",
"--no-bracket-spacing",
"--tab-width",
"4",
"--bracket-same-line",
"--html-whitespace-sensitivity",
"strict",
},
}),
formatting.remark.with({ extra_filetypes = { "vimwiki" } }),
formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }),
formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
},
})
-- See mason-null-ls.nvim's documentation for more details:
-- https://github.com/jay-babu/mason-null-ls.nvim#setup
require("mason-null-ls").setup({
ensure_installed = {
"cmake_lint",
"codespell",
"cpplint",
"luacheck",
"misspell",
"mypy",
"beautysh",
"cbfmt",
"clang_format",
"cmake_format",
"djlint",
"google_java_format",
"phpcbf",
"prettier",
"remark",
"markdown_toc",
"shellharden",
"shfmt",
"stylua",
"usort",
"yamlfmt",
},
automatic_installation = true,
handlers = {
-- Here you can add functions to register sources.
-- See https://github.com/jay-babu/mason-null-ls.nvim#handlers-usage
--
-- If left empty, mason-null-ls will use a "default handler"
-- to register all sources
},
})
local cmp = require("cmp")
local cmp_action = require("lsp-zero").cmp_action()
local luasnip = require("luasnip")
local kind_icons = {
Text = "󰉿",
Method = "󰆧",
Function = "󰊕",
Constructor = "",
Field = "󰜢",
Variable = "󰀫",
Class = "󰠱",
Interface = "",
Module = "",
Property = "󰜢",
Unit = "󰑭",
Value = "󰎠",
Enum = "",
Keyword = "󰌋",
Snippet = "",
Color = "󰏘",
File = "󰈙",
Reference = "󰈇",
Folder = "󰉋",
EnumMember = "",
Constant = "󰏿",
Struct = "󰙅",
Event = "",
Operator = "󰆕",
TypeParameter = "",
}
cmp.setup({
mapping = {
["<C-k>"] = cmp.mapping.select_prev_item(),
["<C-j>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-u>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
-- Accept currently selected item. If none selected, `select` first item.
-- Set `select` to `false` to only confirm explicitly selected items.
["<cr>"] = cmp.mapping.confirm({ select = true }),
},
sources = {
{ name = "gh_issues" },
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "crates" },
{ name = "path" },
{ name = "luasnip" },
{ name = "buffer" },
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
formatting = {
fields = { "abbr", "kind", "menu" },
format = function(entry, vim_item)
vim_item.kind = kind_icons[vim_item.kind]
vim_item.menu = ({
nvim_lsp = "[LSP]",
nvim_lua = "[api]",
luasnip = "[snip]",
buffer = "[buf]",
path = "[path]",
emoji = "[emoji]",
gh_issues = "[issues]",
})[entry.source.name]
return vim_item
end,
},
experimental = {
ghost_text = true,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
confirm_opts = {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
})
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({}))

View File

@ -1,24 +0,0 @@
local status_ok, lualine = pcall(require, "lualine")
if not status_ok then
return
end
lualine.setup({
options = {
globalstatus = true,
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "dashboard" },
always_divide_middle = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { "diff" },
lualine_x = { "lsp_progress", "diagnostics" },
lualine_y = { "filename" },
lualine_z = { "location", "progress" },
},
})

View File

@ -1,7 +1,4 @@
local status_ok, ls = pcall(require, "luasnip") local ls = require("luasnip")
if not status_ok then
return
end
require("luasnip/loaders/from_vscode").lazy_load() require("luasnip/loaders/from_vscode").lazy_load()
@ -89,23 +86,6 @@ end
ls.add_snippets(nil, { ls.add_snippets(nil, {
all = {}, all = {},
lua = {
s(
"status",
fmt(
[[
local status_ok, {} = pcall(require, "{}")
if not status_ok then
return
end
]],
{
i(1),
same(1),
}
)
),
},
rust = { rust = {
s( s(
"modtest", "modtest",
@ -201,14 +181,11 @@ ls.add_snippets(nil, {
]], ]],
{ {
i(1), i(1),
c( c(2, {
2, t("Kristofers Solo"),
{ t("Kristiāns Francis Cagulis, kc22015"),
t("Kristofers Solo"), t("Kristiāns Francis Cagulis"),
t("Kristiāns Francis Cagulis, kc22015"), }),
t("Kristiāns Francis Cagulis"),
}
),
i(0), i(0),
} }
) )

View File

@ -1,6 +0,0 @@
local status_ok, markdown_preview = pcall(require, "markdown-preview")
if not status_ok then
return
end
markdown_preview.setup({})

View File

@ -1,126 +0,0 @@
local status_ok, nvim_tree = pcall(require, "nvim-tree")
if not status_ok then
return
end
local function on_attach(bufnr)
local api_status_ok, api = pcall(require, "nvim-tree.api")
if not api_status_ok then
return
end
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
local keymap = vim.keymap.set
-- Default mappings. Feel free to modify or remove as you wish.
--
-- BEGIN_DEFAULT_ON_ATTACH
keymap("n", "<C-]>", api.tree.change_root_to_node, opts("CD"))
keymap("n", "<C-e>", api.node.open.replace_tree_buffer, opts("Open: In Place"))
keymap("n", "<C-k>", api.node.show_info_popup, opts("Info"))
keymap("n", "<C-r>", api.fs.rename_sub, opts("Rename: Omit Filename"))
keymap("n", "<C-t>", api.node.open.tab, opts("Open: New Tab"))
keymap("n", "v", api.node.open.vertical, opts("Open: Vertical Split"))
keymap("n", "x", api.node.open.horizontal, opts("Open: Horizontal Split"))
keymap("n", "<BS>", api.node.navigate.parent_close, opts("Close Directory"))
keymap("n", "<cr>", api.node.open.edit, opts("Open"))
keymap("n", "<Tab>", api.node.open.preview, opts("Open Preview"))
keymap("n", ">", api.node.navigate.sibling.next, opts("Next Sibling"))
keymap("n", "<", api.node.navigate.sibling.prev, opts("Previous Sibling"))
keymap("n", ".", api.node.run.cmd, opts("Run Command"))
keymap("n", "-", api.tree.change_root_to_parent, opts("Up"))
keymap("n", "a", api.fs.create, opts("Create"))
keymap("n", "bmv", api.marks.bulk.move, opts("Move Bookmarked"))
keymap("n", "B", api.tree.toggle_no_buffer_filter, opts("Toggle No Buffer"))
keymap("n", "c", api.fs.copy.node, opts("Copy"))
keymap("n", "C", api.tree.toggle_git_clean_filter, opts("Toggle Git Clean"))
keymap("n", "[c", api.node.navigate.git.prev, opts("Prev Git"))
keymap("n", "]c", api.node.navigate.git.next, opts("Next Git"))
keymap("n", "d", api.fs.remove, opts("Delete"))
keymap("n", "D", api.fs.trash, opts("Trash"))
keymap("n", "E", api.tree.expand_all, opts("Expand All"))
keymap("n", "e", api.fs.rename_basename, opts("Rename: Basename"))
keymap("n", "]e", api.node.navigate.diagnostics.next, opts("Next Diagnostic"))
keymap("n", "[e", api.node.navigate.diagnostics.prev, opts("Prev Diagnostic"))
keymap("n", "F", api.live_filter.clear, opts("Clean Filter"))
keymap("n", "f", api.live_filter.start, opts("Filter"))
keymap("n", "g?", api.tree.toggle_help, opts("Help"))
keymap("n", "gy", api.fs.copy.absolute_path, opts("Copy Absolute Path"))
keymap("n", "H", api.tree.toggle_hidden_filter, opts("Toggle Dotfiles"))
keymap("n", "I", api.tree.toggle_gitignore_filter, opts("Toggle Git Ignore"))
keymap("n", "J", api.node.navigate.sibling.last, opts("Last Sibling"))
keymap("n", "K", api.node.navigate.sibling.first, opts("First Sibling"))
keymap("n", "m", api.marks.toggle, opts("Toggle Bookmark"))
keymap("n", "o", api.node.open.edit, opts("Open"))
keymap("n", "O", api.node.open.no_window_picker, opts("Open: No Window Picker"))
keymap("n", "p", api.fs.paste, opts("Paste"))
keymap("n", "P", api.node.navigate.parent, opts("Parent Directory"))
keymap("n", "q", api.tree.close, opts("Close"))
keymap("n", "r", api.fs.rename, opts("Rename"))
keymap("n", "R", api.tree.reload, opts("Refresh"))
keymap("n", "s", api.node.run.system, opts("Run System"))
keymap("n", "S", api.tree.search_node, opts("Search"))
keymap("n", "U", api.tree.toggle_custom_filter, opts("Toggle Hidden"))
keymap("n", "W", api.tree.collapse_all, opts("Collapse"))
keymap("n", "x", api.fs.cut, opts("Cut"))
keymap("n", "y", api.fs.copy.filename, opts("Copy Name"))
keymap("n", "Y", api.fs.copy.relative_path, opts("Copy Relative Path"))
keymap("n", "<2-LeftMouse>", api.node.open.edit, opts("Open"))
keymap("n", "<2-RightMouse>", api.tree.change_root_to_node, opts("CD"))
-- You will need to insert "your code goes here" for any mappings with a custom action_cb
keymap("n", "l", api.node.open.edit, opts("Open"))
end
nvim_tree.setup({
on_attach = on_attach,
update_focused_file = {
enable = true,
update_cwd = true,
},
renderer = {
root_folder_modifier = ":t",
icons = {
glyphs = {
default = "",
symlink = "",
folder = {
arrow_open = "",
arrow_closed = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
untracked = "U",
deleted = "",
ignored = "",
},
},
},
},
diagnostics = {
enable = true,
show_on_dirs = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
view = {
width = 30,
-- height = 30,
side = "left",
},
})

View File

@ -1,124 +0,0 @@
local status_ok, oil = pcall(require, "oil")
if not status_ok then
return
end
oil.setup({
-- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns
columns = {
"icon",
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = "hide",
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = "no",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "n",
},
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
default_file_explorer = true,
-- Restore window options to previous values when leaving an oil buffer
restore_win_options = true,
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = false,
-- Deleted files will be removed with the `trash-put` command.
delete_to_trash = true,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
prompt_save_on_select_new_entry = true,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-L>"] = "actions.select_vsplit",
["C-J>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["."] = "actions.toggle_hidden",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = true,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
max_width = 0,
max_height = 0,
border = "rounded",
win_options = {
winblend = 10,
},
},
-- Configuration for the actions floating preview window
preview = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = "rounded",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = "rounded",
minimized_border = "none",
win_options = {
winblend = 0,
},
},
})

View File

@ -1,10 +0,0 @@
local status_ok, persistence = pcall(require, "persistence")
if not status_ok then
return
end
persistence.setup({
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
pre_save = nil, -- a function to call before saving the session
})

View File

@ -1,17 +0,0 @@
local status_ok, project = pcall(require, "project_nvim")
if not status_ok then
return
end
project.setup({
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
detection_methods = { "pattern" },
-- patterns used to detect root dir, when **"pattern"** is in detection_methods
patterns = { ".git", "package.json", ".venv", "Cargo.toml", "requirements.txt", "CMakeLists.txt" },
})
local tele_status_ok, telescope = pcall(require, "telescope")
if not tele_status_ok then
return
end
telescope.load_extension("projects")

View File

@ -1,14 +0,0 @@
local status_ok, tabnine = pcall(require, "tabnine")
if not status_ok then
return
end
tabnine.setup({
disable_auto_comment = true,
accept_keymap = "<Tab>",
dismiss_keymap = "<C-c>",
debounce_ms = 800,
suggestion_color = { gui = "#808080", cterm = 244 },
exclude_filetypes = { "TelescopePrompt" },
log_file_path = nil, -- absolute path to Tabnine log file,
})

View File

@ -1,89 +0,0 @@
local status_ok, telescope = pcall(require, "telescope")
if not status_ok then
return
end
local actions = require("telescope.actions")
telescope.setup({
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden",
},
prompt_prefix = "",
selection_caret = "",
path_display = { "smart" },
file_ignore_patterns = { ".git/", "node_modules", ".venv/" },
mappings = {
i = {
["<Down>"] = actions.cycle_history_next,
["<Up>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
},
},
pickers = {
find_files = {
hidden = true,
follow = true,
},
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
},
media_files = {
-- filetypes whitelist
filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "webm" },
find_cmd = "rg",
},
emoji = {
action = function(emoji)
-- argument emoji is a table.
-- {name="", value="", cagegory="", description=""}
vim.fn.setreg("*", emoji.value)
print([[Press p or "*p to paste this emoji]] .. emoji.value)
-- insert emoji when picked
-- vim.api.nvim_put({ emoji.value }, 'c', false, true)
end,
},
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
-- pseudo code / specification for writing custom displays, like the one
-- for "codeactions"
-- specific_opts = {
-- [kind] = {
-- make_indexed = function(items) -> indexed_items, width,
-- make_displayer = function(widths) -> displayer
-- make_display = function(displayer) -> function(e)
-- make_ordinal = function(e) -> string
-- },
-- -- for example to disable the custom builtin "codeactions" display
-- do the following
-- codeactions = false,
-- }
},
},
})
telescope.load_extension("fzf")
telescope.load_extension("media_files")
telescope.load_extension("emoji")
telescope.load_extension("ui-select")
telescope.load_extension("color_names")

View File

@ -1,69 +0,0 @@
local status_ok, todo = pcall(require, "todo-comments")
if not status_ok then
return
end
todo.setup({
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AD" },
test = { "Identifier", "#FF00FF" },
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
-- regex that will be used to match keywords.
-- don't replace the (KEYWORDS) placeholder
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
},
})

View File

@ -1,69 +0,0 @@
local status_ok, toggleterm = pcall(require, "toggleterm")
if not status_ok then
return
end
toggleterm.setup({
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
})
function _G.set_terminal_keymaps()
local opts = { noremap = true }
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
function _LAZYGIT_TOGGLE()
lazygit:toggle()
end
local node = Terminal:new({ cmd = "node", hidden = true })
function _NODE_TOGGLE()
node:toggle()
end
local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
function _NCDU_TOGGLE()
ncdu:toggle()
end
local btop = Terminal:new({ cmd = "btop", hidden = true })
function _BTOP_TOGGLE()
btop:toggle()
end
local python = Terminal:new({ cmd = "python", hidden = true })
function _PYTHON_TOGGLE()
python:toggle()
end
local rust = Terminal:new({ cmd = "cargo run", hidden = true })
function _CARGO_RUN()
rust:toggle()
end

View File

@ -1,59 +0,0 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = "all", -- one of "all" or a list of languages
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
highlight = {
enable = true,
disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
autopairs = {
enable = true,
},
autotag = {
enable = true,
filetypes = {
"html",
"htmldjango",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"svelte",
"vue",
"tsx",
"jsx",
"rescript",
"xml",
"php",
"markdown",
"glimmer",
"handlebars",
"hbs",
},
},
indent = { enable = true, disable = { "" } },
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {}, -- table of colour name strings
},
})

View File

@ -1,7 +1,4 @@
local status_ok, which_key = pcall(require, "which-key") local which_key = require("which-key")
if not status_ok then
return
end
local setup = { local setup = {
plugins = { plugins = {
@ -94,7 +91,7 @@ local vmappings = {
local mappings = { local mappings = {
[";"] = { vim.cmd.Alpha, "Dashboard" }, [";"] = { vim.cmd.Alpha, "Dashboard" },
["/"] = { "<Plug>(comment_toggle_linewise_current)", "Comment toggle current line" }, ["/"] = { "<Plug>(comment_toggle_linewise_current)", "Comment toggle current line" },
c = { vim.cmd.Bdelete, "Close Buffer" }, c = { vim.cmd.bdelete, "Close Buffer" },
f = { f = {
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown({previewer = false}))<cr>", "<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown({previewer = false}))<cr>",
"Find files", "Find files",
@ -106,7 +103,7 @@ local mappings = {
u = { vim.cmd.UndotreeToggle, "UndotreeToggle" }, u = { vim.cmd.UndotreeToggle, "UndotreeToggle" },
t = { vim.cmd.TagbarToggle, "Toggle Tagbar" }, t = { vim.cmd.TagbarToggle, "Toggle Tagbar" },
m = { require("harpoon.mark").add_file, "Add file to harpoon" }, m = { require("harpoon.mark").add_file, "Add file to harpoon" },
h = { require("harpoon.ui").toggle_quick_menu, "Add file to harpoon" }, h = { require("harpoon.ui").toggle_quick_menu, "Open harpoon menu" },
n = { vim.cmd.Oil, "Open Oil" }, n = { vim.cmd.Oil, "Open Oil" },
g = { g = {
name = "Git", name = "Git",
@ -133,16 +130,6 @@ local mappings = {
"Workspace Symbols", "Workspace Symbols",
}, },
e = { "<cmd>Telescope quickfix<cr>", "Telescope Quickfix" }, e = { "<cmd>Telescope quickfix<cr>", "Telescope Quickfix" },
R = {
name = "Rust",
e = { vim.cmd.RustExpandMacro, "Expand macro" },
c = { vim.cmd.RustOpenCargo, "Open cargo.toml" },
p = { vim.cmd.RustParentModule, "Parent module" },
h = { vim.cmd.RustHoverActions, "Hover actions" },
g = { vim.cmd.RustViewCrateGraph, "View create graph" },
d = { vim.cmd.RustOpenExternalDocs, "Open external docs" },
R = { vim.cmd.RustRunnables, "Open runnables" },
},
}, },
s = { s = {
name = "Search", name = "Search",
@ -164,17 +151,28 @@ local mappings = {
"Colorscheme with Preview", "Colorscheme with Preview",
}, },
}, },
-- T = { r = {
-- name = "Terminal", name = "Rust",
-- n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" }, e = { vim.cmd.RustExpandMacro, "Expand macro" },
-- u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" }, c = { vim.cmd.RustOpenCargo, "Open cargo.toml" },
-- b = { "<cmd>lua _BTOP_TOGGLE()<cr>", "Btop" }, p = { vim.cmd.RustParentModule, "Parent module" },
-- p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" }, h = { vim.cmd.RustHoverActions, "Hover actions" },
-- c = { "<cmd>lua _CARGO_RUN()<cr>", "Cargo run" }, g = { vim.cmd.RustViewCrateGraph, "View create graph" },
-- f = { "<cmd>ToggleTerm direction=float<cr>", "Float" }, d = { vim.cmd.RustOpenExternalDocs, "Open external docs" },
-- h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" }, R = { vim.cmd.RustRunnables, "Open runnables" },
-- v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" }, a = { vim.cmd.RustCodeAction, "Code action groups" },
-- }, },
T = {
name = "Terminal",
n = { "<cmd>lua _NODE_TOGGLE()<cr>", "Node" },
u = { "<cmd>lua _NCDU_TOGGLE()<cr>", "NCDU" },
b = { "<cmd>lua _BTOP_TOGGLE()<cr>", "Btop" },
p = { "<cmd>lua _PYTHON_TOGGLE()<cr>", "Python" },
c = { "<cmd>lua _CARGO_RUN()<cr>", "Cargo run" },
f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
},
L = { L = {
name = "Language settings", name = "Language settings",
c = { "<cmd>setlocal formatoptions-=cro<cr>", "Disable autocomment" }, c = { "<cmd>setlocal formatoptions-=cro<cr>", "Disable autocomment" },

View File

@ -1,65 +0,0 @@
local status_ok, zen_mode = pcall(require, "zen-mode")
if not status_ok then
return
end
zen_mode.setup({
window = {
backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
-- height and width can be:
-- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height
width = 120, -- width of the Zen window
height = 1, -- height of the Zen window
-- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply
options = {
signcolumn = "no", -- disable signcolumn
-- number = false, -- disable number column
-- relativenumber = false, -- disable relative numbers
cursorline = false, -- disable cursorline
cursorcolumn = false, -- disable cursor column
foldcolumn = "0", -- disable fold column
list = false, -- disable whitespace characters
},
},
plugins = {
-- disable some global vim options (vim.o...)
-- comment the lines to not apply the options
options = {
enabled = true,
ruler = false, -- disables the ruler text in the cmd line area
showcmd = false, -- disables the command in the last line of the screen
},
twilight = { enabled = true }, -- enable to start Twilight when zen mode opens
gitsigns = { enabled = false }, -- disables git signs
tmux = { enabled = false }, -- disables the tmux statusline
-- this will change the font size on kitty when in zen mode
-- to make this work, you need to set the following kitty options:
-- - allow_remote_control socket-only
-- - listen_on unix:/tmp/kitty
kitty = {
enabled = false,
font = "+4", -- font size increment
},
-- this will change the font size on alacritty when in zen mode
-- requires Alacritty Version 0.10.0 or higher
-- uses `alacritty msg` subcommand to change font size
alacritty = {
enabled = false,
font = "14", -- font size
},
-- this will change the font size on wezterm when in zen mode
-- See also the Plugins/Wezterm section in this projects README
wezterm = {
enabled = false,
-- can be either an absolute font size or the number of incremental steps
font = "+4", -- (10% increase per step)
},
},
-- callback where you can add custom code when the Zen window opens
on_open = function(win) end,
-- callback where you can add custom code when the Zen window closes
on_close = function() end,
})

View File

@ -15,22 +15,21 @@
"darkplus.nvim": { "branch": "master", "commit": "7c236649f0617809db05cd30fb10fed7fb01b83b" }, "darkplus.nvim": { "branch": "master", "commit": "7c236649f0617809db05cd30fb10fed7fb01b83b" },
"distant.nvim": { "branch": "master", "commit": "9dd21f8fa25795e56756e1ea27a1586ceee35582" }, "distant.nvim": { "branch": "master", "commit": "9dd21f8fa25795e56756e1ea27a1586ceee35582" },
"dracula.nvim": { "branch": "main", "commit": "9fe831e685a76e1a1898a694623b33247c4d036c" }, "dracula.nvim": { "branch": "main", "commit": "9fe831e685a76e1a1898a694623b33247c4d036c" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" }, "friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" },
"gitsigns.nvim": { "branch": "main", "commit": "287fffb410ce82d19da2d503a1f1570adf7b7874" }, "gitsigns.nvim": { "branch": "main", "commit": "287fffb410ce82d19da2d503a1f1570adf7b7874" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"hologram.nvim": { "branch": "main", "commit": "f5194f71ec1578d91b2e3119ff08e574e2eab542" }, "hologram.nvim": { "branch": "main", "commit": "f5194f71ec1578d91b2e3119ff08e574e2eab542" },
"impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" },
"indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" },
"kanagawa.nvim": { "branch": "master", "commit": "1749cea392acb7d1548a946fcee1e6f1304cd3cb" }, "kanagawa.nvim": { "branch": "master", "commit": "1749cea392acb7d1548a946fcee1e6f1304cd3cb" },
"lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "73bc33fe9ad5a1d4501536fdd4755b3aa18c3392" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" },
"mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" }, "mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" },
"mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" }, "mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" },
"melange-nvim": { "branch": "master", "commit": "e4958aa60ec6e1c5ecb487b9028da3a33e753b34" }, "melange-nvim": { "branch": "master", "commit": "11f35df3e091f35e966a335ed90b0d8a03851ffd" },
"mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
"nightfly": { "branch": "master", "commit": "903da3ef1e41c6c763c9f98de6f2f9dc193ca5e7" }, "nightfly": { "branch": "master", "commit": "903da3ef1e41c6c763c9f98de6f2f9dc193ca5e7" },
"nightfox.nvim": { "branch": "main", "commit": "a48f6d9a0273101df76eb25d2f5477baa277f935" }, "nightfox.nvim": { "branch": "main", "commit": "a48f6d9a0273101df76eb25d2f5477baa277f935" },
@ -41,10 +40,10 @@
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
"nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" }, "nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" },
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
"nvim-lspconfig": { "branch": "master", "commit": "3fe1e8de80b98c7a6b16f730711b5eafe84212e1" }, "nvim-lspconfig": { "branch": "master", "commit": "4b1a764c10c6c8679615fcb4f1e8b0f5513d900b" },
"nvim-startup.lua": { "branch": "main", "commit": "305b34f05173b9793a0e64c88696f52a2ae0d83e" },
"nvim-tree.lua": { "branch": "master", "commit": "904f95cd9db31d1800998fa428e78e418a50181d" }, "nvim-tree.lua": { "branch": "master", "commit": "904f95cd9db31d1800998fa428e78e418a50181d" },
"nvim-treesitter": { "branch": "master", "commit": "ae88851cac32415c8239a04b7ee44d8f7625e186" }, "nvim-treesitter": { "branch": "master", "commit": "ae88851cac32415c8239a04b7ee44d8f7625e186" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-ufo": { "branch": "main", "commit": "5be5b800b4f3512bca128f345e9c98574b5637c0" }, "nvim-ufo": { "branch": "main", "commit": "5be5b800b4f3512bca128f345e9c98574b5637c0" },
@ -74,15 +73,13 @@
"toggleterm.nvim": { "branch": "main", "commit": "12cba0a1967b4f3f31903484dec72a6100dcf515" }, "toggleterm.nvim": { "branch": "main", "commit": "12cba0a1967b4f3f31903484dec72a6100dcf515" },
"tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" }, "tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
"veil.nvim": { "branch": "main", "commit": "ec18376953b401d784756a47df38a75ece40f3e9" },
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
"vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" }, "vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" },
"vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" },
"vim-illuminate": { "branch": "master", "commit": "5ed17582a8e97bf0a0c617c3cf762e98f87b9859" }, "vim-illuminate": { "branch": "master", "commit": "5ed17582a8e97bf0a0c617c3cf762e98f87b9859" },
"vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" }, "vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" },
"vim-markdown": { "branch": "master", "commit": "cc82d88e2a791f54d2b6e2b26e41f743351ac947" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" },
"vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }
"zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" }
} }

View File

@ -1,13 +0,0 @@
return {
{
"hrsh7th/nvim-cmp",
-- event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-path", -- path completionsplu
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
},
}, -- The completion pluginpluguse "nvim-lua/plenary.nvim"
"saadparwaiz1/cmp_luasnip", -- snippet completions
}

167
lua/plugins/colorizer.lua Normal file
View File

@ -0,0 +1,167 @@
return {
{
"NvChad/nvim-colorizer.lua",
opts = {
filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue or blue
RRGGBBAA = true, -- #RRGGBBAA hex codes
AARRGGBB = true, -- 0xAARRGGBB hex codes
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = true, -- CSS hsl() and hsla() functions
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes for `mode`: foreground, background, virtualtext
mode = "background", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal
tailwind = true, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = {
enable = true,
parsers = { "css" },
}, -- Enable sass colors
virtualtext = "",
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},
html = { names = true },
css = { names = true },
},
},
{
"uga-rosa/ccc.nvim",
event = "VeryLazy",
config = function()
local ccc = require("ccc")
local ColorInput = require("ccc.input")
local convert = require("ccc.utils.convert")
local RgbHslInput = setmetatable({
name = "RGB/HSL",
max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 },
min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 },
bar_name = { "R", "G", "B", "H", "S", "L" },
}, { __index = ColorInput })
function RgbHslInput.format(n, i)
if i <= 3 then
-- RGB
n = n * 255
elseif i >= 5 then
-- S or L of HSL
n = n * 100
end
return ("%6d"):format(n)
end
function RgbHslInput.from_rgb(RGB)
local HSL = convert.rgb2hsl(RGB)
local R, G, B = unpack(RGB)
local H, S, L = unpack(HSL)
return { R, G, B, H, S, L }
end
function RgbHslInput.to_rgb(value)
return { value[1], value[2], value[3] }
end
function RgbHslInput:_set_rgb(RGB)
self.value[1] = RGB[1]
self.value[2] = RGB[2]
self.value[3] = RGB[3]
end
function RgbHslInput:_set_hsl(HSL)
self.value[4] = HSL[1]
self.value[5] = HSL[2]
self.value[6] = HSL[3]
end
function RgbHslInput:callback(index, new_value)
self.value[index] = new_value
local v = self.value
if index <= 3 then
local RGB = { v[1], v[2], v[3] }
local HSL = convert.rgb2hsl(RGB)
self:_set_hsl(HSL)
else
local HSL = { v[4], v[5], v[6] }
local RGB = convert.hsl2rgb(HSL)
self:_set_rgb(RGB)
end
end
ccc.setup({
pickers = {
ccc.picker.custom_entries({
bg = "#1a1b26",
bg_dark = "#16161e",
bg_float = "#16161e",
bg_highlight = "#292e42",
bg_popup = "#16161e",
bg_search = "#3d59a1",
bg_sidebar = "#16161e",
bg_statusline = "#16161e",
bg_visual = "#283457",
black = "#15161e",
blue = "#7aa2f7",
blue0 = "#3d59a1",
blue1 = "#2ac3de",
blue2 = "#0db9d7",
blue5 = "#89ddff",
blue6 = "#b4f9f8",
blue7 = "#394b70",
border = "#15161e",
border_highlight = "#27a1b9",
comment = "#565f89",
cyan = "#7dcfff",
dark3 = "#545c7e",
dark5 = "#737aa2",
delta_add = "#2c5a66",
delta_delete = "#713137",
diff_add = "#20303b",
diff_change = "#1f2231",
diff_delete = "#37222c",
diff_text = "#394b70",
error = "#db4b4b",
fg = "#c0caf5",
fg_dark = "#a9b1d6",
fg_float = "#c0caf5",
fg_gutter = "#3b4261",
fg_sidebar = "#a9b1d6",
git_add = "#449dab",
git_change = "#6183bb",
git_delete = "#914c54",
git_ignore = "#545c7e",
gitSigns_add = "#266d6a",
gitSigns_change = "#536c9e",
gitSigns_delete = "#b2555b",
green = "#9ece6a",
green1 = "#73daca",
green2 = "#41a6b5",
hint = "#1abc9c",
info = "#0db9d7",
magenta = "#bb9af7",
magenta2 = "#ff007c",
none = "NONE",
orange = "#ff9e64",
purple = "#9d7cd8",
red = "#f7768e",
red1 = "#db4b4b",
teal = "#1abc9c",
terminal_black = "#414868",
warning = "#e0af68",
yellow = "#e0af68",
}),
},
inputs = {
RgbHslInput,
},
})
end,
},
}

64
lua/plugins/comment.lua Normal file
View File

@ -0,0 +1,64 @@
return {
{
"numToStr/Comment.nvim",
lazy = false,
opts = {
---Add a space b/w comment and the line
padding = true,
---Whether the cursor should stay at its position
sticky = true,
---Lines to be ignored while (un)comment
ignore = nil,
---LHS of toggle mappings in NORMAL mode
toggler = {
---Line-comment toggle keymap
line = "gcc",
---Block-comment toggle keymap
block = "gbb",
},
-- -LHS of operator-pending mappings in NORMAL and VISUAL mode
opleader = {
---Line-comment keymap
line = "gc",
---Block-comment keymap
block = "gb",
},
---LHS of extra mappings
extra = {
---Add comment on the line above
above = "gcO",
---Add comment on the line below
below = "gco",
---Add comment at the end of line
eol = "gcA",
},
--- Enable keybindings
--- NOTE: If given `false` then the plugin won't create any mappings
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = true,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = true,
---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}`
extended = true,
},
---Function to call before (un)comment
-- pre_hook = function(ctx)
-- local U = require("Comment.utils")
--
-- local location = nil
-- if ctx.ctype == U.ctype.block then
-- location = require("ts_context_commentstring.utils").get_cursor_location()
-- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
-- location = require("ts_context_commentstring.utils").get_visual_start_location()
-- end
--
-- return require("ts_context_commentstring.internal").calculate_commentstring({
-- key = ctx.ctype == U.ctype.line and "__default" or "__multiline",
-- location = location,
-- })
-- end,
},
},
}

91
lua/plugins/cpp.lua Normal file
View File

@ -0,0 +1,91 @@
return {
{
"p00f/clangd_extensions.nvim",
opts = {
inlay_hints = {
inline = vim.fn.has("nvim-0.10") == 1,
-- Options other than `highlight' and `priority' only work
-- if `inline' is disabled
-- Only show inlay hints for the current line
only_current_line = false,
-- Event which triggers a refresh of the inlay hints.
-- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = { "CursorHold" },
-- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true,
-- prefix for parameter hints
parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = true,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 8,
-- The color of the hints
highlight = "Comment",
-- The highlight group priority for extmark
priority = 100,
},
ast = {
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
highlights = {
detail = "Comment",
},
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
},
},
},
{
"Civitasv/cmake-tools.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
cmake_command = "cmake",
cmake_build_directory = "target/build/",
cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is "", this option will be activated
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" },
cmake_soft_link_compile_commands = true, -- if softlink compile commands json file
cmake_build_options = {},
cmake_console_size = 15, -- cmake output window height
cmake_console_position = "belowright", -- "belowright", "aboveleft", ...
cmake_show_console = "always", -- "always", "only_on_error"
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
cmake_variants_message = {
short = { show = true },
long = { show = true, max_length = 40 },
},
},
},
}

View File

@ -1,10 +1,56 @@
return { return {
{ "rcarriga/nvim-dap-ui", event = "VeryLazy", dependencies = "jayp0521/mason-nvim-dap.nvim" }, {
"rcarriga/nvim-dap-ui",
event = "VeryLazy",
dependencies = { "jayp0521/mason-nvim-dap.nvim" },
opts = {
layouts = {
{
elements = {
"scopes",
"breakpoints",
"stacs",
"watches",
},
size = 40,
position = "left",
},
{
elements = {
"repl",
"console",
},
size = 10,
position = "bottom",
},
},
-- sidebar = {
-- elements = {
-- {
-- id = "scopes",
-- size = 0.25, -- Can be float or integer > 1
-- },
-- { id = "breakpoints", size = 0.25 },
-- },
-- size = 40,
-- position = "right", -- Can be "left", "right", "top", "bottom"
-- },
-- tray = {
-- elements = {},
-- },
},
},
{ {
"jayp0521/mason-nvim-dap.nvim", "jayp0521/mason-nvim-dap.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { dependencies = {
"williamboman/mason.nvim", {
"williamboman/mason.nvim",
opts = {
automatic_installation = true,
automatic_setup = true,
},
},
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
}, },
}, },

57
lua/plugins/fidget.lua Normal file
View File

@ -0,0 +1,57 @@
return {
{
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
opts = {
text = {
spinner = "pipe", -- animation shown when tasks are ongoing
done = "", -- character shown when all tasks are complete
commenced = "Started", -- message shown when task starts
completed = "Completed", -- message shown when task completes
},
align = {
bottom = true, -- align fidgets along bottom edge of buffer
right = true, -- align fidgets along right edge of buffer
},
timer = {
spinner_rate = 125, -- frame rate of spinner animation, in ms
fidget_decay = 2000, -- how long to keep around empty fidget, in ms
task_decay = 1000, -- how long to keep around completed task, in ms
},
window = {
relative = "win", -- where to anchor, either "win" or "editor"
blend = 0, -- &winblend for the window
zindex = nil, -- the zindex value for the window
border = "none", -- style of border for the fidget window
},
fmt = {
leftpad = true, -- right-justify text in fidget box
stack_upwards = true, -- list of tasks grows upwards
max_width = 0, -- maximum width of the fidget box
-- function to format fidget title
fidget = function(fidget_name, spinner)
return string.format("%s %s", spinner, fidget_name)
end,
-- function to format each task line
task = function(task_name, message, percentage)
return string.format(
"%s%s [%s]",
message,
percentage and string.format(" (%s%%)", percentage) or "",
task_name
)
end,
},
sources = { -- Sources to configure
["*"] = { -- Name of source
ignore = false, -- Ignore notifications from this source
},
},
debug = {
logging = false, -- whether to enable logging, for debugging
strict = false, -- whether to interpret LSP strictly
},
},
},
}

View File

@ -1,29 +1,48 @@
return { return {
{ "folke/lazy.nvim" }, { "folke/lazy.nvim" },
{ "nvim-lua/plenary.nvim" }, -- Useful lua functions used by lots of plugins { "nvim-lua/plenary.nvim" }, -- Useful lua functions used by lots of plugins
{ "windwp/nvim-autopairs" }, -- Autopairs, integrates with both cmp and treesitter {
{ "numToStr/Comment.nvim" }, "windwp/nvim-autopairs", -- Autopairs, integrates with both cmp and treesitter
{ "JoosepAlviste/nvim-ts-context-commentstring" }, opts = {
{ "nvim-tree/nvim-web-devicons", lazy = true }, check_ts = true, -- treesitter integration
{ "nvim-tree/nvim-tree.lua" }, disable_filetype = {
{ "moll/vim-bbye" }, "NvimTree",
"TelescopePrompt",
{ "nvim-lualine/lualine.nvim" }, "alpha",
{ "arkav/lualine-lsp-progress" }, "lazy",
},
{ "akinsho/toggleterm.nvim" }, },
{ "ahmedkhalf/project.nvim" }, },
{ "lewis6991/impatient.nvim" },
{ "lukas-reineke/indent-blankline.nvim" },
{ "goolord/alpha-nvim", lazy = true }, { "goolord/alpha-nvim", lazy = true },
{ "willothy/veil.nvim", lazy = true }, -- TODO: replace alphh with veil
{ "henriquehbr/nvim-startup.lua", lazy = true }, -- { "willothy/veil.nvim", lazy = true },
{ "andweeb/presence.nvim" }, {
"andweeb/presence.nvim",
opts = {
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
neovim_image_text = "The Only True Text Editor", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
-- client_id = "", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = false, -- Displays the current line number instead of the current project
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
{ "NvChad/nvim-colorizer.lua" }, -- Rich Presence text options
{ "uga-rosa/ccc.nvim", lazy = true }, editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
},
},
{ "alvan/vim-closetag" }, { "alvan/vim-closetag" },
{ "tpope/vim-surround" }, { "tpope/vim-surround" },
@ -31,39 +50,22 @@ return {
{ "preservim/tagbar" }, { "preservim/tagbar" },
{ "jghauser/mkdir.nvim", lazy = true }, { "jghauser/mkdir.nvim", lazy = true },
{ "mtdl9/vim-log-highlighting", lazy = true }, { "mtdl9/vim-log-highlighting", lazy = true },
{ "edluffy/hologram.nvim", lazy = true }, {
"edluffy/hologram.nvim",
lazy = true,
opts = {
auto_display = true,
},
},
{ "folke/which-key.nvim", lazy = true }, { "folke/which-key.nvim", lazy = true },
{ "folke/todo-comments.nvim", lazy = false },
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
module = "persistence",
},
{ "folke/zen-mode.nvim" },
{ "christoomey/vim-tmux-navigator" }, { "christoomey/vim-tmux-navigator" },
{ "ThePrimeagen/harpoon" },
{ "ThePrimeagen/vim-be-good", lazy = true }, { "ThePrimeagen/vim-be-good", lazy = true },
-- Vimwiki
{ "vimwiki/vimwiki" },
{ "epwalsh/obsidian.nvim", lazy = true },
{ "stevearc/oil.nvim" },
-- Git
{ "lewis6991/gitsigns.nvim" },
{ "rest-nvim/rest.nvim", lazy = true }, { "rest-nvim/rest.nvim", lazy = true },
{ "chipsenkbeil/distant.nvim", lazy = true }, { "chipsenkbeil/distant.nvim", lazy = true },
{
"iamcco/markdown-preview.nvim",
build = function()
vim.fn["mkdp#util#install"]()
end,
},
{ {
"kevinhwang91/nvim-ufo", "kevinhwang91/nvim-ufo",

35
lua/plugins/git.lua Normal file
View File

@ -0,0 +1,35 @@
return {
{
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
delete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
topdelete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
changedelete = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
},
},
},
}

15
lua/plugins/harpoon.lua Normal file
View File

@ -0,0 +1,15 @@
return {
{
"ThePrimeagen/harpoon",
opts = {},
config = function()
local ui = require("harpoon.ui")
local keymap = vim.keymap.set
for i = 1, 12, 1 do
keymap("n", "<F" .. i .. ">", function()
ui.nav_file(i)
end)
end
end,
},
}

View File

@ -0,0 +1,56 @@
return {
"RRethy/vim-illuminate",
config = function()
require("illuminate").configure({
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"alpha",
"NvimTree",
"dirvish",
"fugitive",
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
-- See `:help mode()` for possible values
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
-- See `:help mode()` for possible values
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- large_file_cutoff: number of lines at which to use large_file_config
-- The `under_cursor` option is disabled when this cutoff is hit
large_file_cutoff = nil,
-- large_file_config: config to use for large files (based on large_file_cutoff).
-- Supports the same keys passed to .configure
-- If nil, vim-illuminate will be disabled for large files.
large_file_overrides = nil,
-- min_count_to_highlight: minimum number of matches required to perform highlighting
min_count_to_highlight = 1,
})
local bind = vim.keymap.set
bind("n", "<A-n>", "<cmd>lua require('illuminate').goto_next_reference(wrap)<cr>", { noremap = true })
bind("n", "<A-p>", "<cmd>lua require('illuminate').goto_prev_reference(wrap)<cr>", { noremap = true })
end,
}

View File

@ -0,0 +1,83 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
config = function()
local g = vim.g
local opt = vim.opt
local cmd = vim.cmd
g.indent_blankline_buftype_exclude = { "terminal", "nofile" }
g.indent_blankline_filetype_exclude = {
"help",
"startify",
"dashboard",
"packer",
"neogitstatus",
"NvimTree",
"Trouble",
}
g.indentLine_enabled = 1
g.indent_blankline_char = ""
g.indent_blankline_show_trailing_blankline_indent = false
g.indent_blankline_show_first_indent_level = true
g.indent_blankline_use_treesitter = true
g.indent_blankline_show_current_context = true
g.indent_blankline_context_patterns = {
"class",
"return",
"function",
"method",
"^if",
"^while",
"jsx_element",
"^for",
"^object",
"^table",
"block",
"arguments",
"if_statement",
"else_clause",
"jsx_element",
"jsx_self_closing_element",
"try_statement",
"catch_clause",
"import_statement",
"operation_type",
}
vim.wo.colorcolumn = "99999"
cmd([[highlight IndentBlanklineIndent1 guifg=#C678DD gui=nocombine]])
cmd([[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]])
cmd([[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]])
cmd([[highlight IndentBlanklineIndent6 guifg=#E06C75 gui=nocombine]])
opt.list = true
opt.listchars:append("space:⋅")
opt.listchars:append("eol:↴")
end,
opts = {
char = "",
show_trailing_blankline_indent = false,
show_first_indent_level = true,
use_treesitter = true,
show_end_of_line = true,
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
buftype_exclude = { "terminal", "nofile" },
filetype_exclude = {
"help",
"lazy",
"NvimTree",
"alpha",
},
},
},
}

View File

@ -1,19 +1,45 @@
return { return {
"williamboman/mason.nvim", {
"williamboman/mason-lspconfig.nvim", "VonHeikemen/lsp-zero.nvim",
"neovim/nvim-lspconfig", -- enable LSP branch = "v2.x",
{ "jose-elias-alvarez/null-ls.nvim", event = "VeryLazy" }, -- for formatters and linters dependencies = {
"jayp0521/mason-null-ls.nvim", -- LSP Support
"RRethy/vim-illuminate", { "neovim/nvim-lspconfig" }, -- Required
{ "williamboman/mason.nvim" }, -- Optional
{ "williamboman/mason-lspconfig.nvim" }, -- Optional
-- Autocompletion
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- buffer completions
"hrsh7th/cmp-path", -- path completionsplu
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
},
}, -- Required
{ "hrsh7th/cmp-nvim-lsp" }, -- Required
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
},
}, -- Required
{ "saadparwaiz1/cmp_luasnip" },
},
},
{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
},
-- for formatters and linters
{ "nanotee/sqls.nvim", lazy = true }, { "nanotee/sqls.nvim", lazy = true },
-- C++
{ "p00f/clangd_extensions.nvim", lazy = true },
{ "Civitasv/cmake-tools.nvim", lazy = true },
-- Rust
{ "Saecki/crates.nvim", lazy = true },
{ "simrat39/rust-tools.nvim", lazy = true },
-- { "codota/tabnine-nvim", event = "VeryLazy", build = "./dl_binaries.sh" },
} }

26
lua/plugins/lualine.lua Normal file
View File

@ -0,0 +1,26 @@
return {
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = {
options = {
globalstatus = true,
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "dashboard" },
always_divide_middle = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = { "diff" },
lualine_x = { "lsp_progress", "diagnostics" },
lualine_y = { "filename" },
lualine_z = { "location", "progress" },
},
},
},
}

View File

@ -0,0 +1,10 @@
return {
-- {
-- "iamcco/markdown-preview.nvim",
-- event = "VeryLazy",
-- build = function()
-- vim.fn["mkdp#util#install"]()
-- end,
-- opts = {},
-- },
}

57
lua/plugins/nvim-tree.lua Normal file
View File

@ -0,0 +1,57 @@
return {
{
"nvim-tree/nvim-tree.lua",
event = "VeryLazy",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
update_focused_file = {
enable = true,
update_cwd = true,
},
renderer = {
root_folder_modifier = ":t",
icons = {
glyphs = {
default = "",
symlink = "",
folder = {
arrow_open = "",
arrow_closed = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
git = {
unstaged = "",
staged = "S",
unmerged = "",
renamed = "",
untracked = "U",
deleted = "",
ignored = "",
},
},
},
},
diagnostics = {
enable = true,
show_on_dirs = true,
icons = {
hint = "",
info = "",
error = "",
},
},
view = {
width = 30,
-- height = 30,
side = "left",
},
},
},
}

127
lua/plugins/oil.lua Normal file
View File

@ -0,0 +1,127 @@
return {
{
"stevearc/oil.nvim",
event = "VeryLazy",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
-- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns
columns = {
"icon",
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = "hide",
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = "no",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "n",
},
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`
default_file_explorer = true,
-- Restore window options to previous values when leaving an oil buffer
restore_win_options = true,
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = false,
-- Deleted files will be removed with the `trash-put` command.
delete_to_trash = true,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
prompt_save_on_select_new_entry = true,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-L>"] = "actions.select_vsplit",
["C-J>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-r>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["."] = "actions.toggle_hidden",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = true,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
return vim.startswith(name, ".")
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
max_width = 0,
max_height = 0,
border = "rounded",
win_options = {
winblend = 10,
},
},
-- Configuration for the actions floating preview window
preview = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = "rounded",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = "rounded",
minimized_border = "none",
win_options = {
winblend = 0,
},
},
},
},
}

View File

@ -0,0 +1,11 @@
return {
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
opts = {
dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved
options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving
pre_save = nil, -- a function to call before saving the session
},
},
}

19
lua/plugins/project.lua Normal file
View File

@ -0,0 +1,19 @@
return {
{
"ahmedkhalf/project.nvim",
dependenvies = {
"nvim-telescope/telescope.nvim",
},
config = function()
local project = require("project_nvim")
project.setup({
-- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project
detection_methods = { "pattern" },
-- patterns used to detect root dir, when **"pattern"** is in detection_methods
patterns = { ".git", "package.json", ".venv", "Cargo.toml", "requirements.txt", "CMakeLists.txt" },
})
local telescope = require("telescope")
telescope.load_extension("projects")
end,
},
}

314
lua/plugins/rust.lua Normal file
View File

@ -0,0 +1,314 @@
return {
{
"simrat39/rust-tools.nvim",
event = "VeryLazy",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
tools = {
-- how to execute terminal commands
-- options right now: termopen / quickfix
-- executor = require("rust-tools.executors").termopen,
-- callback to execute once rust-analyzer is done initializing the workspace
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
on_initialized = function()
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
end,
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = " <- ",
-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = " => ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- 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,
-- The color of the hints
highlight = "Comment",
},
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = {
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
},
-- Maximal width of the hover window. Nil means no max.
max_width = nil,
-- Maximal height of the hover window. Nil means no max.
max_height = nil,
-- whether the hover action window gets automatically focused
-- default: false
auto_focus = false,
},
-- settings for showing the crate graph based on graphviz and the dot
-- command
crate_graph = {
-- Backend used for displaying the graph
-- see: https://graphviz.org/docs/outputs/
-- default: x11
backend = "x11",
-- where to store the output, nil for no output stored (relative
-- path from pwd)
-- default: nil
output = nil,
-- true for all crates.io and external crates, false only the local
-- crates
-- default: true
full = true,
-- List of backends found on: https://graphviz.org/docs/outputs/
-- Is used for input validation and autocompletion
-- Last updated: 2021-08-26
enabled_graphviz_backends = {
"bmp",
"cgimage",
"canon",
"dot",
"gv",
"xdot",
"xdot1.2",
"xdot1.4",
"eps",
"exr",
"fig",
"gd",
"gd2",
"gif",
"gtk",
"ico",
"cmap",
"ismap",
"imap",
"cmapx",
"imap_np",
"cmapx_np",
"jpg",
"jpeg",
"jpe",
"jp2",
"json",
"json0",
"dot_json",
"xdot_json",
"pdf",
"pic",
"pct",
"pict",
"plain",
"plain-ext",
"png",
"pov",
"ps",
"ps2",
"psd",
"sgi",
"svg",
"svgz",
"tga",
"tiff",
"tif",
"tk",
"vml",
"vmlz",
"wbmp",
"webp",
"xlib",
"x11",
},
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
server = {
-- standalone file support
-- setting it to false may improve startup time
standalone = true,
}, -- rust-analyzer options
-- debugging stuff
dap = {
adapter = {
type = "executable",
command = "codelldb",
name = "rt_lldb",
},
},
},
},
},
{
"Saecki/crates.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
smart_insert = true,
insert_closing_quote = true,
avoid_prerelease = true,
autoload = true,
autoupdate = true,
loading_indicator = true,
date_format = "%d-%m-%Y",
thousands_separator = ".",
notification_title = "Crates",
disable_invalid_feature_diagnostic = false,
text = {
loading = "  Loading",
version = "  %s",
prerelease = "  %s",
yanked = "  %s",
nomatch = "  No match",
upgrade = "  %s",
error = "  Error fetching crate",
},
highlight = {
loading = "CratesNvimLoading",
version = "CratesNvimVersion",
prerelease = "CratesNvimPreRelease",
yanked = "CratesNvimYanked",
nomatch = "CratesNvimNoMatch",
upgrade = "CratesNvimUpgrade",
error = "CratesNvimError",
},
popup = {
autofocus = false,
copy_register = '"',
style = "minimal",
border = "none",
show_version_date = false,
show_dependency_version = true,
max_height = 30,
min_width = 20,
padding = 1,
text = {
title = " %s",
pill_left = "",
pill_right = "",
description = "%s",
created_label = " created ",
created = "%s",
updated_label = " updated ",
updated = "%s",
downloads_label = " downloads ",
downloads = "%s",
homepage_label = " homepage ",
homepage = "%s",
repository_label = " repository ",
repository = "%s",
documentation_label = " documentation ",
documentation = "%s",
crates_io_label = " crates.io ",
crates_io = "%s",
categories_label = " categories ",
keywords_label = " keywords ",
version = " %s",
prerelease = " %s",
yanked = " %s",
version_date = " %s",
feature = " %s",
enabled = " %s",
transitive = " %s",
normal_dependencies_title = " Dependencies",
build_dependencies_title = " Build dependencies",
dev_dependencies_title = " Dev dependencies",
dependency = " %s",
optional = " %s",
dependency_version = " %s",
loading = "",
},
highlight = {
title = "CratesNvimPopupTitle",
pill_text = "CratesNvimPopupPillText",
pill_border = "CratesNvimPopupPillBorder",
description = "CratesNvimPopupDescription",
created_label = "CratesNvimPopupLabel",
created = "CratesNvimPopupValue",
updated_label = "CratesNvimPopupLabel",
updated = "CratesNvimPopupValue",
downloads_label = "CratesNvimPopupLabel",
downloads = "CratesNvimPopupValue",
homepage_label = "CratesNvimPopupLabel",
homepage = "CratesNvimPopupUrl",
repository_label = "CratesNvimPopupLabel",
repository = "CratesNvimPopupUrl",
documentation_label = "CratesNvimPopupLabel",
documentation = "CratesNvimPopupUrl",
crates_io_label = "CratesNvimPopupLabel",
crates_io = "CratesNvimPopupUrl",
categories_label = "CratesNvimPopupLabel",
keywords_label = "CratesNvimPopupLabel",
version = "CratesNvimPopupVersion",
prerelease = "CratesNvimPopupPreRelease",
yanked = "CratesNvimPopupYanked",
version_date = "CratesNvimPopupVersionDate",
feature = "CratesNvimPopupFeature",
enabled = "CratesNvimPopupEnabled",
transitive = "CratesNvimPopupTransitive",
normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle",
build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle",
dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle",
dependency = "CratesNvimPopupDependency",
optional = "CratesNvimPopupOptional",
dependency_version = "CratesNvimPopupDependencyVersion",
loading = "CratesNvimPopupLoading",
},
keys = {
hide = { "q", "<esc>" },
open_url = { "<cr>" },
select = { "<cr>" },
select_alt = { "s" },
toggle_feature = { "<cr>" },
copy_value = { "yy" },
goto_item = { "gd", "K", "<C-LeftMouse>" },
jump_forward = { "<c-i>" },
jump_back = { "<c-o>", "<C-RightMouse>" },
},
},
src = {
insert_closing_quote = true,
text = {
prerelease = "  pre-release ",
yanked = "  yanked ",
},
},
null_ls = {
enabled = true,
name = "crates.nvim",
},
},
},
}

View File

@ -1,10 +0,0 @@
return {
{
"L3MON4D3/LuaSnip",
run = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets", -- a bunch of snippets to use
},
}, --snippet engine
-- { "codota/tabnine-nvim", build = "./dl_binaries.sh" },
}

View File

@ -1,9 +1,100 @@
return { return {
"nvim-telescope/telescope.nvim", {
"nvim-telescope/telescope-media-files.nvim", "nvim-telescope/telescope.nvim",
"xiyaowong/telescope-emoji.nvim", dependencies = {
"nvim-telescope/telescope-frecency.nvim", { "nvim-lua/plenary.nvim" },
"nvim-telescope/telescope-ui-select.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, { "nvim-telescope/telescope-media-files.nvim" },
"nat-418/telescope-color-names.nvim", { "xiyaowong/telescope-emoji.nvim" },
{ "nvim-telescope/telescope-frecency.nvim" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
{ "nat-418/telescope-color-names.nvim" },
},
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--hidden",
},
prompt_prefix = "",
selection_caret = "",
path_display = { "smart" },
file_ignore_patterns = { ".git/", "node_modules", ".venv/" },
mappings = {
i = {
["<Down>"] = actions.cycle_history_next,
["<Up>"] = actions.cycle_history_prev,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
},
},
},
pickers = {
find_files = {
hidden = true,
follow = true,
},
},
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
},
media_files = {
-- filetypes whitelist
filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "webm" },
find_cmd = "rg",
},
emoji = {
action = function(emoji)
-- argument emoji is a table.
-- {name="", value="", cagegory="", description=""}
vim.fn.setreg("*", emoji.value)
print([[Press p or "*p to paste this emoji]] .. emoji.value)
-- insert emoji when picked
-- vim.api.nvim_put({ emoji.value }, 'c', false, true)
end,
},
["ui-select"] = {
require("telescope.themes").get_dropdown({
-- even more opts
}),
-- pseudo code / specification for writing custom displays, like the one
-- for "codeactions"
-- specific_opts = {
-- [kind] = {
-- make_indexed = function(items) -> indexed_items, width,
-- make_displayer = function(widths) -> displayer
-- make_display = function(displayer) -> function(e)
-- make_ordinal = function(e) -> string
-- },
-- -- for example to disable the custom builtin "codeactions" display
-- do the following
-- codeactions = false,
-- }
},
},
})
telescope.load_extension("fzf")
telescope.load_extension("media_files")
telescope.load_extension("emoji")
telescope.load_extension("ui-select")
telescope.load_extension("color_names")
end,
},
} }

71
lua/plugins/todo.lua Normal file
View File

@ -0,0 +1,71 @@
return {
{
"folke/todo-comments.nvim",
event = "VeryLazy",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = "", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
WARN = { icon = "", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = "", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
TEST = { icon = "", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" },
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
-- regex that will be used to match keywords.
-- don't replace the (KEYWORDS) placeholder
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
},
},
},
}

View File

@ -0,0 +1,72 @@
return {
{
"akinsho/toggleterm.nvim",
config = function()
local toggleterm = require("toggleterm")
toggleterm.setup({
size = 20,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
})
function _G.set_terminal_keymaps()
local opts = { noremap = true }
vim.api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
vim.api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
function _LAZYGIT_TOGGLE()
lazygit:toggle()
end
local node = Terminal:new({ cmd = "node", hidden = true })
function _NODE_TOGGLE()
node:toggle()
end
local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
function _NCDU_TOGGLE()
ncdu:toggle()
end
local btop = Terminal:new({ cmd = "btop", hidden = true })
function _BTOP_TOGGLE()
btop:toggle()
end
local python = Terminal:new({ cmd = "python", hidden = true })
function _PYTHON_TOGGLE()
python:toggle()
end
local rust = Terminal:new({ cmd = "cargo run", hidden = true })
function _CARGO_RUN()
rust:toggle()
end
end,
},
}

View File

@ -1,11 +1,71 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
run = ":TSUpdate", build = ":TSUpdate",
dependencies = { dependencies = {
"nvim-treesitter/playground", "nvim-treesitter/playground",
"p00f/nvim-ts-rainbow", "p00f/nvim-ts-rainbow",
"mechatroner/rainbow_csv", "mechatroner/rainbow_csv",
"nvim-treesitter/nvim-treesitter-textobjects",
"JoosepAlviste/nvim-ts-context-commentstring",
}, },
config = function()
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = "all", -- one of "all" or a list of languages
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = true,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
-- ignore_install = { "" },
highlight = {
enable = true,
disable = {},
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
autopairs = {
enable = true,
},
autotag = {
enable = true,
filetypes = {
"html",
"htmldjango",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"svelte",
"vue",
"tsx",
"jsx",
"rescript",
"xml",
"php",
"markdown",
"glimmer",
"handlebars",
"hbs",
},
},
indent = { enable = true, disable = { "" } },
rainbow = {
enable = true,
-- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {}, -- table of colour name strings
},
})
end,
}, },
} }

31
lua/plugins/vimwiki.lua Normal file
View File

@ -0,0 +1,31 @@
return {
{ "vimwiki/vimwiki" },
{
"epwalsh/obsidian.nvim",
lazy = true,
event = { "BufReadPre " .. vim.fn.expand("~") .. "/vimwiki/**/*.md" },
dependencies = {
"nvim-lua/plenary.nvim",
"hrsh7th/nvim-cmp",
"nvim-telescope/telescope.nvim",
"preservim/vim-markdown",
},
opts = {
dir = "~/vimwiki/",
},
completion = {
-- If using nvim-cmp, otherwise set to false
nvim_cmp = true,
-- Trigger completion at 2 chars
min_chars = 2,
-- Where to put new notes created from completion. Valid options are
-- * "current_dir" - put new notes in same directory as the current buffer.
-- * "notes_subdir" - put new notes in the default notes subdirectory.
new_notes_location = "current_dir",
-- Whether to add the output of the node_id_func to new notes in autocompletion.
-- E.g. "[[Foo" completes to "[[foo|Foo]]" assuming "foo" is the ID of the note.
prepend_note_id = true,
},
},
}

View File

@ -95,11 +95,11 @@ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
end, end,
}) })
-- Run PackerSync on file save -- Run lazy on file save
vim.api.nvim_create_autocmd({ "BufWritePost" }, { -- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }), -- group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
pattern = { "**/lua/plugins/*" }, -- pattern = { "**/lua/plugins/*" },
callback = function() -- callback = function()
require("lazy").sync() -- require("lazy").sync()
end, -- end,
}) -- })

View File

@ -1,17 +0,0 @@
-- Setup nvim-cmp.
local status_ok, npairs = pcall(require, "nvim-autopairs")
if not status_ok then
return
end
npairs.setup({
check_ts = true, -- treesitter integration
disable_filetype = { "TelescopePrompt" },
})
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({}))

View File

@ -1,9 +1,6 @@
require("solo.options") require("solo.options")
require("solo.keymaps") require("solo.keymaps")
require("solo.vimwiki")
require("solo.plugin") require("solo.plugin")
require("solo.autocommands") require("solo.autocommands")
require("solo.alpha") require("solo.alpha")
require("solo.autopairs")
require("solo.autosave") require("solo.autosave")
require("solo.mason")

View File

@ -1,10 +1,10 @@
local keymap = vim.keymap.set local bind = vim.keymap.set
local opts = { silent = true } local opts = { silent = true }
--Remap space as leader key --Remap space as leader key
keymap("", "<Space>", "<Nop>", opts) bind("", "<Space>", "<Nop>", opts)
keymap("n", "q", "<Nop>", opts) bind("n", "q", "<Nop>", opts)
keymap("n", "Q", "<Nop>", opts) bind("n", "Q", "<Nop>", opts)
vim.g.mapleader = " " vim.g.mapleader = " "
-- Modes -- Modes
@ -16,80 +16,80 @@ vim.g.mapleader = " "
-- command_mode = "c", -- command_mode = "c",
-- Normal -- -- Normal --
keymap("n", "<C-d>", "<C-d>zz", opts) bind("n", "<C-d>", "<C-d>zz", opts)
keymap("n", "<C-u>", "<C-u>zz", opts) bind("n", "<C-u>", "<C-u>zz", opts)
keymap("n", "n", "nzzzv", opts) bind("n", "n", "nzzzv", opts)
keymap("n", "N", "Nzzzv", opts) bind("n", "N", "Nzzzv", opts)
-- Better window navigation with tmux -- Better window navigation with tmux
keymap("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>", opts) bind("n", "<C-h>", "<cmd>TmuxNavigateLeft<cr>", opts)
keymap("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>", opts) bind("n", "<C-j>", "<cmd>TmuxNavigateDown<cr>", opts)
keymap("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>", opts) bind("n", "<C-k>", "<cmd>TmuxNavigateUp<cr>", opts)
keymap("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>", opts) bind("n", "<C-l>", "<cmd>TmuxNavigateRight<cr>", opts)
-- Resize with arrows -- Resize with arrows
keymap("n", "<C-Up>", "<cmd>resize -2<cr>", opts) bind("n", "<C-Up>", "<cmd>resize -2<cr>", opts)
keymap("n", "<C-Down>", "<cmd>resize +2<cr>", opts) bind("n", "<C-Down>", "<cmd>resize +2<cr>", opts)
keymap("n", "<C-Left>", "<cmd>vertical resize -2<cr>", opts) bind("n", "<C-Left>", "<cmd>vertical resize -2<cr>", opts)
keymap("n", "<C-Right>", "<cmd>vertical resize +2<cr>", opts) bind("n", "<C-Right>", "<cmd>vertical resize +2<cr>", opts)
-- -- Navigate buffers -- -- Navigate buffers
-- keymap("n", "<S-l>", "<cmd>bnext<cr>", opts) -- bind("n", "<S-l>", "<cmd>bnext<cr>", opts)
-- keymap("n", "<S-h>", "<cmd>bprevious<cr>", opts) -- bind("n", "<S-h>", "<cmd>bprevious<cr>", opts)
-- Better paste -- Better paste
keymap("v", "p", '"_dP', opts) bind("v", "p", '"_dP', opts)
-- Move current line / block with Alt-j/k ala vscode -- Move current line / block with Alt-j/k ala vscode
keymap("n", "<A-j>", "<cmd>m .+1<cr>==", opts) bind("n", "<A-j>", "<cmd>m .+1<cr>==", opts)
keymap("n", "<A-k>", "<cmd>m .-2<cr>==", opts) bind("n", "<A-k>", "<cmd>m .-2<cr>==", opts)
-- QuickFix -- QuickFix
keymap("n", "]q", "<cmd>cnext<cr>", opts) bind("n", "]q", "<cmd>cnext<cr>", opts)
keymap("n", "[q", "<cmd>cprev<cr>", opts) bind("n", "[q", "<cmd>cprev<cr>", opts)
keymap("n", "<S-s>", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", {}) bind("n", "<S-s>", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", {})
keymap("n", "<S-j>", "mzJ`z") bind("n", "<S-j>", "mzJ`z")
-- Insert -- -- Insert --
-- Press jk fast to enter -- Press jk fast to enter
keymap("i", "jk", "<ESC>", opts) bind("i", "jk", "<ESC>", opts)
-- Move current line / block with Alt-j/k ala vscode. -- Move current line / block with Alt-j/k ala vscode.
keymap("i", "<A-j>", "<Esc><cmd>m .+1<cr>==gi", opts) bind("i", "<A-j>", "<Esc><cmd>m .+1<cr>==gi", opts)
keymap("i", "<A-k>", "<Esc><cmd>m .-2<cr>==gi", opts) bind("i", "<A-k>", "<Esc><cmd>m .-2<cr>==gi", opts)
-- navigation -- navigation
keymap("i", "<A-Up>", "<C-\\><C-N><C-w>k", opts) bind("i", "<A-Up>", "<C-\\><C-N><C-w>k", opts)
keymap("i", "<A-Down>", "<C-\\><C-N><C-w>j", opts) bind("i", "<A-Down>", "<C-\\><C-N><C-w>j", opts)
keymap("i", "<A-Left>", "<C-\\><C-N><C-w>h", opts) bind("i", "<A-Left>", "<C-\\><C-N><C-w>h", opts)
keymap("i", "<A-Right>", "<C-\\><C-N><C-w>l", opts) bind("i", "<A-Right>", "<C-\\><C-N><C-w>l", opts)
-- Visual -- -- Visual --
-- Stay in indent mode -- Stay in indent mode
keymap("v", "<", "<gv", opts) bind("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts) bind("v", ">", ">gv", opts)
-- keymap("v", "<A-j>", "<cmd>m '>+1<cr>gv=gv") -- bind("v", "<A-j>", "<cmd>m '>+1<cr>gv=gv")
-- keymap("v", "<A-k>", "<cmd>m '<-2<cr>gv=gv") -- bind("v", "<A-k>", "<cmd>m '<-2<cr>gv=gv")
-- Visual Block -- -- Visual Block --
-- Move current line / block with Alt-j/k ala vscode. -- Move current line / block with Alt-j/k ala vscode.
-- keymap("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts) -- bind("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts)
-- keymap("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts) -- bind("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts)
-- Command -- -- Command --
-- navigate tab completion with <c-j> and <c-k> -- navigate tab completion with <c-j> and <c-k>
-- runs conditionally -- runs conditionally
keymap("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true }) bind("c", "<C-j>", 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true })
keymap("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true }) bind("c", "<C-k>", 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true })
-- Terminal -- -- Terminal --
-- Terminal window navigation -- Terminal window navigation
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", opts) bind("t", "<C-h>", "<C-\\><C-N><C-w>h", opts)
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", opts) bind("t", "<C-j>", "<C-\\><C-N><C-w>j", opts)
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", opts) bind("t", "<C-k>", "<C-\\><C-N><C-w>k", opts)
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", opts) bind("t", "<C-l>", "<C-\\><C-N><C-w>l", opts)
keymap("n", "<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>") bind("n", "<C-b>", "<cmd>w!<cr><cmd>!compiler '%:p'<cr>")
keymap("n", "<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>") bind("n", "<C-o>", "<cmd>w!<cr><cmd>!opout '%:p'<cr>")

View File

@ -1,113 +0,0 @@
local M = {}
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not status_cmp_ok then
return
end
M.capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities)
M.setup = function()
local signs = {
{ name = "DiagnosticSignError", text = "" },
{ name = "DiagnosticSignWarn", text = "" },
{ name = "DiagnosticSignHint", text = "" },
{ name = "DiagnosticSignInfo", text = "" },
}
for _, sign in pairs(signs) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
end
local config = {
virtual_text = false, -- virtual text
signs = {
active = signs, -- show signs
},
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focusable = true,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
}
vim.diagnostic.config(config)
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
})
end
local function lsp_keymaps(bufnr)
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_buf_set_keymap
keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", opts)
keymap(bufnr, "n", "gd", "<cmd>lua require('telescope.builtin').lsp_definitions()<cr>", opts)
keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", opts)
keymap(bufnr, "n", "gI", "<cmd>lua vim.lsp.buf.implementation()<cr>", opts)
keymap(bufnr, "n", "gr", "<cmd>lua require('telescope.builtin').lsp_references()<cr>", opts)
keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float()<cr>", opts)
end
M.on_attach = function(client, bufnr)
lsp_keymaps(bufnr)
local status_ok, illuminate = pcall(require, "illuminate")
if not status_ok then
return
end
illuminate.configure({
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
"lsp",
"treesitter",
"regex",
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
"dirvish",
"fugitive",
"alpha",
"NvimTree",
},
-- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overridden by modes_denylist
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- max_file_lines: max number of lines in a file to illuminate
max_file_lines = nil,
})
illuminate.on_attach(client)
end
return M

View File

@ -1,8 +0,0 @@
local status_ok, _ = pcall(require, "mason-lspconfig")
if not status_ok then
return
end
require("solo.mason.mason-installer")
require("solo.mason.handlers").setup()
require("solo.mason.null-ls")

View File

@ -1,85 +0,0 @@
local status_ok, mason = pcall(require, "mason")
if not status_ok then
return
end
local status_lspconfig_ok, lspconfig = pcall(require, "lspconfig")
if not status_lspconfig_ok then
return
end
local status_mason_lspconfig_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
if not status_mason_lspconfig_ok then
return
end
local servers = {
"bashls",
"clangd",
"cmake",
"cssls",
"emmet_ls",
"html",
"jedi_language_server",
"jsonls",
"lua_ls",
"phpactor",
"ruff_lsp",
"rust_analyzer",
"sqlls",
"taplo",
"texlab",
"tsserver",
"tailwindcss",
}
mason.setup()
mason_lspconfig.setup({
ensure_installed = servers,
})
local on_attach = require("solo.mason.handlers").on_attach
local capabilities = require("solo.mason.handlers").capabilities
for _, server in pairs(servers) do
local opts = {
capabilities = capabilities,
on_attach = on_attach,
}
if server == "bashls" then
local bashls_opts = require("solo.mason.settings.bashls")
opts = vim.tbl_deep_extend("force", bashls_opts, opts)
end
if server == "lua_ls" then
local lua_ls_opts = require("solo.mason.settings.lua_ls")
opts = vim.tbl_deep_extend("force", lua_ls_opts, opts)
end
if server == "emmet_ls" then
local emmet_ls_opts = require("solo.mason.settings.emmet_ls")
opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts)
end
if server == "rust_analyzer" then
local rust_analyzer_opts = require("solo.mason.settings.rust_analyzer")
opts = vim.tbl_deep_extend("force", rust_analyzer_opts, opts)
require("rust-tools").setup(opts)
goto continue
end
if server == "clangd" then
local clangd_opts = require("solo.mason.settings.clangd")
opts = vim.tbl_deep_extend("force", clangd_opts, opts)
require("clangd_extensions").setup(opts)
goto continue
end
if server == "texlab" then
local texlab_opts = require("solo.mason.settings.texlab")
opts = vim.tbl_deep_extend("force", texlab_opts, opts)
end
lspconfig[server].setup(opts)
::continue::
end

View File

@ -1,60 +0,0 @@
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then
return
end
local mason_null_ls_status_ok, mason_null_ls = pcall(require, "mason-null-ls")
if not mason_null_ls_status_ok then
return
end
mason_null_ls.setup({
ensure_installed = {},
automatic_installation = true,
automatic_setup = true,
})
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics
-- https://github.com/prettier-solidity/prettier-plugin-solidity
null_ls.setup({
debug = false,
sources = {
diagnostics.cmake_lint,
diagnostics.codespell,
diagnostics.cpplint,
diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }),
diagnostics.misspell,
diagnostics.mypy,
formatting.beautysh,
formatting.black,
formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }),
formatting.clang_format,
formatting.cmake_format,
formatting.djlint,
formatting.google_java_format,
formatting.phpcbf,
formatting.prettier.with({
extra_filetypes = { "toml" },
extra_args = {
"--no-semi",
"--double-quote",
"--no-bracket-spacing",
"--tab-width",
"4",
"--bracket-same-line",
"--html-whitespace-sensitivity",
"strict",
},
}),
formatting.remark.with({ extra_filetypes = { "vimwiki" } }),
formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }),
formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
formatting.stylua,
formatting.usort,
formatting.yamlfmt,
},
})

View File

@ -1,7 +0,0 @@
return {
filetypes = {
"sh",
"bash",
"zsh",
},
}

View File

@ -1,71 +0,0 @@
return {
server = {
capabilities = {
offsetEncoding = { "utf-16" },
},
on_attach = require("solo.mason.handlers").on_attach,
},
extensions = {
-- defaults:
-- Automatically set inlay hints (type hints)
autoSetHints = true,
-- These apply to the default ClangdSetInlayHints command
inlay_hints = {
-- Only show inlay hints for the current line
only_current_line = false,
-- Event which triggers a refersh of the inlay hints.
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = "CursorHold",
-- whether to show parameter hints with the inlay hints or not
show_parameter_hints = true,
-- prefix for parameter hints
parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = true,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- 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,
-- The color of the hints
highlight = "Comment",
-- The highlight group priority for extmark
priority = 100,
},
ast = {
-- These require codicons (https://github.com/microsoft/vscode-codicons)
role_icons = {
type = "",
declaration = "",
expression = "",
specifier = "",
statement = "",
["template argument"] = "",
},
kind_icons = {
Compound = "",
Recovery = "",
TranslationUnit = "",
PackExpansion = "",
TemplateTypeParm = "",
TemplateTemplateParm = "",
TemplateParamObject = "",
},
highlights = {
detail = "Comment",
},
},
memory_usage = {
border = "none",
},
symbol_info = {
border = "none",
},
},
}

View File

@ -1,13 +0,0 @@
return {
filetypes = {
"html",
"htmldjango",
"typescriptreact",
"javascriptreact",
"css",
"sass",
"scss",
"less",
"eruby",
},
}

View File

@ -1,35 +0,0 @@
return {
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", "awesome", "client" },
},
-- 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,
},
root_pattern = {
".stylua.toml",
".luarc.json",
".luarc.jsonc",
".luacheckrc",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
format = {
enable = false,
},
},
},
}

View File

@ -1,105 +0,0 @@
return {
server = {
on_attach = require("solo.mason.handlers").on_attach,
capabilities = require("solo.mason.handlers").capabilities,
},
tools = {
-- how to execute terminal commands
-- options right now: termopen / quickfix
executor = require("rust-tools.executors").termopen,
-- callback to execute once rust-analyzer is done initializing the workspace
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
on_initialized = function()
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave", "BufWritePost" }, {
group = vim.api.nvim_create_augroup("InitializeRustAnalyzer", { clear = true }),
pattern = { "*.rs" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
end,
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = " <- ",
-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = " => ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- 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,
-- The color of the hints
highlight = "Comment",
},
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
hover_actions = {
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
{ "", "FloatBorder" },
},
-- Maximal width of the hover window. Nil means no max.
max_width = nil,
-- Maximal height of the hover window. Nil means no max.
max_height = nil,
-- whether the hover action window gets automatically focused
-- default: false
auto_focus = false,
},
-- settings for showing the crate graph based on graphviz and the dot
-- command
crate_graph = {
-- Backend used for displaying the graph
-- see: https://graphviz.org/docs/outputs/
-- default: x11
backend = "x11",
-- where to store the output, nil for no output stored (relative
-- path from pwd)
-- default: nil
output = nil,
-- true for all crates.io and external crates, false only the local
-- crates
-- default: true
full = true,
},
-- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
server = {
-- standalone file support
-- setting it to false may improve startup time
standalone = true,
}, -- rust-analyzer options
-- debugging stuff
dap = {
adapter = {
type = "executable",
command = "codelldb",
name = "rt_lldb",
},
},
},
}

View File

@ -1,27 +0,0 @@
return {
settings = {
texlab = {
auxDirectory = ".",
bibtexFormatter = "texlab",
build = {
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
executable = "xelatex",
forwardSearchAfter = false,
onSave = false,
},
chktex = {
onEdit = false,
onOpenAndSave = false,
},
diagnosticsDelay = 0,
formatterLineLength = 120,
forwardSearch = {
args = {},
},
latexFormatter = "latexindent",
latexindent = {
modifyLineBreaks = false,
},
},
},
}

View File

@ -40,6 +40,7 @@ local options = {
guifont = "JetBrainsMono NF:h11", -- the font used in graphical neovim applications guifont = "JetBrainsMono NF:h11", -- the font used in graphical neovim applications
spell = false, spell = false,
foldmethod = "manual", foldmethod = "manual",
breakindent = true, -- Enable break indent
} }
vim.opt.fillchars.eob = " " vim.opt.fillchars.eob = " "
@ -61,3 +62,17 @@ g.loaded_netrwPlugin = 1
vim.opt_local.suffixesadd:prepend(".lua") vim.opt_local.suffixesadd:prepend(".lua")
vim.opt_local.suffixesadd:prepend("init.lua") vim.opt_local.suffixesadd:prepend("init.lua")
vim.opt_local.path:prepend(vim.fn.stdpath("config") .. "/lua") vim.opt_local.path:prepend(vim.fn.stdpath("config") .. "/lua")
vim.g.vimwiki_list = {
{
path = "~/vimwiki",
syntax = "markdown",
ext = ".md",
},
}
vim.g.vimwiki_ext2syntax = {
[".md"] = "markdown",
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1

View File

@ -1,14 +0,0 @@
vim.g.vimwiki_list = {
{
path = "~/vimwiki",
syntax = "markdown",
ext = ".md",
},
}
vim.g.vimwiki_ext2syntax = {
[".md"] = "markdown",
[".markdown"] = "markdown",
[".mdown"] = "markdown",
}
vim.g.vimwiki_global_ext = 1