mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2026-02-04 06:42:05 +00:00
Removed unnecessary plugins
This commit is contained in:
131
after/plugin/ccc.lua
Normal file
131
after/plugin/ccc.lua
Normal file
@@ -0,0 +1,131 @@
|
||||
if not pcall(require, "ccc") then
|
||||
return
|
||||
end
|
||||
|
||||
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,
|
||||
},
|
||||
})
|
||||
67
after/plugin/clang-extension.lua
Normal file
67
after/plugin/clang-extension.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
if not pcall(require, "clangd_extensions") then
|
||||
return
|
||||
end
|
||||
|
||||
require("clangd_extensions").setup({
|
||||
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",
|
||||
},
|
||||
})
|
||||
31
after/plugin/cloak.lua
Normal file
31
after/plugin/cloak.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
if not pcall(require, "cloak") then
|
||||
return
|
||||
end
|
||||
|
||||
require("cloak").setup({
|
||||
enabled = true,
|
||||
cloak_character = "*",
|
||||
-- The applied highlight group (colors) on the cloaking, see `:h highlight`.
|
||||
highlight_group = "Comment",
|
||||
-- Applies the length of the replacement characters for all matched
|
||||
-- patterns, defaults to the length of the matched pattern.
|
||||
cloak_length = nil, -- Provide a number if you want to hide the true length of the value.
|
||||
-- Wether it should try every pattern to find the best fit or stop after the first.
|
||||
try_all_patterns = true,
|
||||
patterns = {
|
||||
{
|
||||
-- Match any file starting with '.env'.
|
||||
-- This can be a table to match multiple file patterns.
|
||||
file_pattern = { ".env*" },
|
||||
-- Match an equals sign and any character after it.
|
||||
-- This can also be a table of patterns to cloak,
|
||||
-- example: cloak_pattern = { ':.+', '-.+' } for yaml files.
|
||||
cloak_pattern = "=.+",
|
||||
-- A function, table or string to generate the replacement.
|
||||
-- The actual replacement will contain the 'cloak_character'
|
||||
-- where it doesn't cover the original text.
|
||||
-- If left empty the legacy behavior of keeping the first character is retained.
|
||||
replace = nil,
|
||||
},
|
||||
},
|
||||
})
|
||||
20
after/plugin/cmake-tools.lua
Normal file
20
after/plugin/cmake-tools.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
if not pcall(require, "cmake-tools") then
|
||||
return
|
||||
end
|
||||
|
||||
require("cmake-tools").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 },
|
||||
},
|
||||
})
|
||||
33
after/plugin/colorizer.lua
Normal file
33
after/plugin/colorizer.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
if not pcall(require, "colorizer") then
|
||||
return
|
||||
end
|
||||
|
||||
require("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 },
|
||||
})
|
||||
61
after/plugin/comment.lua
Normal file
61
after/plugin/comment.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
if not pcall(require, "Comment") then
|
||||
return
|
||||
end
|
||||
|
||||
require("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,
|
||||
})
|
||||
139
after/plugin/crates.lua
Normal file
139
after/plugin/crates.lua
Normal file
@@ -0,0 +1,139 @@
|
||||
if not pcall(require, "crates") then
|
||||
return
|
||||
end
|
||||
|
||||
require("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 ",
|
||||
},
|
||||
},
|
||||
null_ls = {
|
||||
enabled = true,
|
||||
name = "crates.nvim",
|
||||
},
|
||||
})
|
||||
@@ -1,6 +1,38 @@
|
||||
if not pcall(require, "dap") then
|
||||
return
|
||||
end
|
||||
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
vim.keymap.set("n", "<leader>dd", function()
|
||||
dap.toggle_breakpoint()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dc", function()
|
||||
dap.continue()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>di", function()
|
||||
dap.step_into()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dp", function()
|
||||
dap.step_over()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dO", function()
|
||||
dap.step_out()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dI", function()
|
||||
dap.repl.open()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dk", function()
|
||||
dap.terminate()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dl", function()
|
||||
dap.run_last()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>du", function()
|
||||
dapui.toggle()
|
||||
end)
|
||||
|
||||
vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
|
||||
15
after/plugin/git-worktree.lua
Normal file
15
after/plugin/git-worktree.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
vim.keymap.set("n", "<leader>wc", function()
|
||||
require("telescope").extensions.git_worktree.git_worktrees()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>wn", function()
|
||||
require("telescope").extensions.git_worktree.create_git_worktree()
|
||||
end)
|
||||
|
||||
local Worktree = require("git-worktree")
|
||||
|
||||
Worktree.on_tree_change(function(op, metadata)
|
||||
if op == Worktree.Operations.Switch then
|
||||
print("Switched from " .. metadata.prev_path .. " to " .. metadata.path)
|
||||
end
|
||||
end)
|
||||
37
after/plugin/gitsigns.lua
Normal file
37
after/plugin/gitsigns.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
if not pcall(require, "gitsigns") then
|
||||
return
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>gb", function()
|
||||
vim.cmd.Gitsigns("blame_line")
|
||||
end)
|
||||
|
||||
require("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",
|
||||
},
|
||||
},
|
||||
})
|
||||
21
after/plugin/harpoon.lua
Normal file
21
after/plugin/harpoon.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
if not pcall(require, "harpoon") then
|
||||
return
|
||||
end
|
||||
|
||||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<F1>", function()
|
||||
ui.nav_file(1)
|
||||
end)
|
||||
vim.keymap.set("n", "<F2>", function()
|
||||
ui.nav_file(2)
|
||||
end)
|
||||
vim.keymap.set("n", "<F3>", function()
|
||||
ui.nav_file(3)
|
||||
end)
|
||||
vim.keymap.set("n", "<F4>", function()
|
||||
ui.nav_file(4)
|
||||
end)
|
||||
54
after/plugin/illuminate.lua
Normal file
54
after/plugin/illuminate.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
if not pcall(require, "illuminate") then
|
||||
return
|
||||
end
|
||||
|
||||
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 })
|
||||
30
after/plugin/indent-blankline.lua
Normal file
30
after/plugin/indent-blankline.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
if not pcall(require, "indent_blankline") then
|
||||
return
|
||||
end
|
||||
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars:append("space:⋅")
|
||||
vim.opt.listchars:append("eol:↴")
|
||||
|
||||
require("indent_blankline").setup({
|
||||
char = "▎",
|
||||
show_trailing_blankline_indent = true,
|
||||
show_first_indent_level = true,
|
||||
use_treesitter = true,
|
||||
show_end_of_line = true,
|
||||
space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
show_current_context_start = false,
|
||||
buftype_exclude = { "terminal", "nofile" },
|
||||
filetype_exclude = {
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"help",
|
||||
"lazy",
|
||||
"neogitstatus",
|
||||
"packer",
|
||||
"startify",
|
||||
},
|
||||
})
|
||||
1
after/plugin/lazygit.lua
Normal file
1
after/plugin/lazygit.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>gg", vim.cmd.LazyGit)
|
||||
@@ -1,3 +1,7 @@
|
||||
if not pcall(require, "lsp-zero") then
|
||||
return
|
||||
end
|
||||
|
||||
local lsp = require("lsp-zero").preset({
|
||||
float_border = "rounded",
|
||||
call_servers = "local",
|
||||
@@ -5,7 +9,7 @@ local lsp = require("lsp-zero").preset({
|
||||
setup_servers_on_start = true,
|
||||
set_lsp_keymaps = {
|
||||
preserve_mappings = false,
|
||||
omit = { "<F2>", "<F3>" },
|
||||
omit = { "<F2>", "<F3>", "<F4>" },
|
||||
},
|
||||
manage_nvim_cmp = {
|
||||
set_sources = "recommended",
|
||||
@@ -22,14 +26,22 @@ lsp.on_attach(function(client, bufnr)
|
||||
-- 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)
|
||||
vim.keymap.set("n", "gd", function()
|
||||
vim.lsp.buf.definition()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gD", function()
|
||||
vim.lsp.buf.declaration()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "K", function()
|
||||
vim.lsp.buf.hover()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gi", function()
|
||||
vim.lsp.buf.implementation()
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gr", "<cmd>lua require('telescope.builtin').lsp_references()<cr>", opts)
|
||||
vim.keymap.set("n", "gl", function()
|
||||
vim.diagnostic.open_float()
|
||||
end, opts)
|
||||
end)
|
||||
|
||||
lsp.ensure_installed({
|
||||
@@ -43,7 +55,6 @@ lsp.ensure_installed({
|
||||
"jsonls",
|
||||
"lua_ls",
|
||||
"ruff_lsp",
|
||||
"rust_analyzer",
|
||||
"sqlls",
|
||||
"tailwindcss",
|
||||
"taplo",
|
||||
@@ -176,10 +187,10 @@ null_ls.setup({
|
||||
"strict",
|
||||
},
|
||||
}),
|
||||
formatting.remark.with({ extra_filetypes = { "vimwiki" } }),
|
||||
-- formatting.remark.with({ extra_filetypes = { "vimwiki" } }), -- FIX: indentation level
|
||||
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.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
|
||||
-- formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -193,7 +204,6 @@ require("mason-null-ls").setup({
|
||||
"luacheck",
|
||||
"misspell",
|
||||
"mypy",
|
||||
"beautysh",
|
||||
"cbfmt",
|
||||
"clang_format",
|
||||
"cmake_format",
|
||||
@@ -203,8 +213,6 @@ require("mason-null-ls").setup({
|
||||
"prettier",
|
||||
"remark",
|
||||
"markdown_toc",
|
||||
"shellharden",
|
||||
"shfmt",
|
||||
"stylua",
|
||||
"usort",
|
||||
"yamlfmt",
|
||||
|
||||
61
after/plugin/lualine.lua
Normal file
61
after/plugin/lualine.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
if not pcall(require, "lualine") then
|
||||
return
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "|", right = "|" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = { "dashboard" },
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = false,
|
||||
globalstatus = true,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
--[[ Available components
|
||||
|
||||
`branch` (git branch)
|
||||
`buffers` (shows currently available buffers)
|
||||
`diagnostics` (diagnostics count from your preferred source)
|
||||
`diff` (git diff status)
|
||||
`encoding` (file encoding)
|
||||
`fileformat` (file format)
|
||||
`filename`
|
||||
`filesize`
|
||||
`filetype`
|
||||
`hostname`
|
||||
`location` (location in file in line:column format)
|
||||
`mode` (vim mode)
|
||||
`progress` (%progress in file)
|
||||
`searchcount` (number of search matches when hlsearch is active)
|
||||
`selectioncount` (number of selected characters or lines)
|
||||
`tabs` (shows currently available tabs)
|
||||
`windows` (shows currently available windows) ]]
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = { "filename", "diff" },
|
||||
lualine_x = { "diagnostics", "encoding", "filetype", "filesize" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
@@ -1,3 +1,7 @@
|
||||
if not pcall(require, "luasnip") then
|
||||
return
|
||||
end
|
||||
|
||||
local ls = require("luasnip")
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
37
after/plugin/obsidian.lua
Normal file
37
after/plugin/obsidian.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
if not pcall(require, "obsidian") then
|
||||
return
|
||||
end
|
||||
|
||||
require("obsidian").setup({
|
||||
dir = "~/obsidian",
|
||||
notes_subdir = "university",
|
||||
|
||||
completion = {
|
||||
nvim_cmp = true,
|
||||
min_chars = 2,
|
||||
new_notes_location = "current_dir",
|
||||
prepend_note_id = true,
|
||||
},
|
||||
|
||||
mappings = {
|
||||
["gf"] = require("obsidian.mapping").gf_passthrough(),
|
||||
},
|
||||
|
||||
templates = {
|
||||
subdir = "university/templates",
|
||||
date_format = "%Y.%m.%d",
|
||||
time_format = "%H:%M:%S",
|
||||
},
|
||||
|
||||
backlinks = {
|
||||
height = 10,
|
||||
wrap = true,
|
||||
},
|
||||
|
||||
follow_url_func = function(url)
|
||||
vim.fn.jobstart({ "xdg-open", url })
|
||||
end,
|
||||
use_advanced_uri = true,
|
||||
open_app_foreground = false,
|
||||
open_notes_in = "current",
|
||||
})
|
||||
12
after/plugin/project.lua
Normal file
12
after/plugin/project.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
if not pcall(require, "project_nvim") then
|
||||
return
|
||||
end
|
||||
|
||||
require("project_nvim").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")
|
||||
170
after/plugin/rust-tools.lua
Normal file
170
after/plugin/rust-tools.lua
Normal file
@@ -0,0 +1,170 @@
|
||||
if not pcall(require, "rust-tools") then
|
||||
return
|
||||
end
|
||||
|
||||
require("rust-tools").setup({
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
1
after/plugin/tagbar.lua
Normal file
1
after/plugin/tagbar.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>t", vim.cmd.TagbarToggle)
|
||||
100
after/plugin/telescope.lua
Normal file
100
after/plugin/telescope.lua
Normal file
@@ -0,0 +1,100 @@
|
||||
if not pcall(require, "telescope") then
|
||||
return
|
||||
end
|
||||
|
||||
local builtin = require("telescope.builtin")
|
||||
local themes = require("telescope.themes")
|
||||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
builtin.find_files(themes.get_dropdown({ previewer = false }))
|
||||
end, {})
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
|
||||
vim.keymap.set("n", "<leader>t", "<cmd>Telescope live_grep<cr>")
|
||||
vim.keymap.set("n", "<leader>qf", "<cmd>Telescope quickfix<cr>")
|
||||
vim.keymap.set("n", "<leader>d", "<cmd>Telescope diagnostics<cr>")
|
||||
|
||||
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")
|
||||
telescope.load_extension("git_worktree")
|
||||
telescope.load_extension("lazygit")
|
||||
59
after/plugin/treesitter.lua
Normal file
59
after/plugin/treesitter.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
if not pcall(require, "nvim-treesitter") then
|
||||
return
|
||||
end
|
||||
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = { "cpp", "lua", "rust", "python", "markdown", "markdown_inline" }, -- 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")
|
||||
-- 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 = { "markdown" },
|
||||
},
|
||||
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
|
||||
},
|
||||
})
|
||||
1
after/plugin/undotree.lua
Normal file
1
after/plugin/undotree.lua
Normal file
@@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
@@ -1,213 +0,0 @@
|
||||
local which_key = require("which-key")
|
||||
|
||||
local setup = {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on " and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20, -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = true, -- adds help for motions
|
||||
text_objects = true, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true, -- bindings for prefixed with g
|
||||
},
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
-- operators = { gc = "Comments" },
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn"t effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it"s label
|
||||
group = "+", -- symbol prepended to a group
|
||||
},
|
||||
popup_mappings = {
|
||||
scroll_down = "<c-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<c-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left", -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = true, -- enable this to hide mappings for which you didn"t specify a label
|
||||
hidden = { "<silent>", "<cmd>", "<Cmd>", "<cr>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = { "j", "k" },
|
||||
v = { "j", "k" },
|
||||
},
|
||||
}
|
||||
|
||||
local opts = {
|
||||
mode = "n", -- NORMAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
local vopts = {
|
||||
mode = "v", -- VISUAL mode
|
||||
prefix = "<leader>",
|
||||
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
|
||||
silent = true, -- use `silent` when creating keymaps
|
||||
noremap = true, -- use `noremap` when creating keymaps
|
||||
nowait = true, -- use `nowait` when creating keymaps
|
||||
}
|
||||
-- NOTE: Prefer using : over <cmd> as the latter avoids going back in normal-mode.
|
||||
-- see https://neovim.io/doc/user/map.html#:map-cmd
|
||||
local vmappings = {
|
||||
["/"] = { "<Plug>(comment_toggle_linewise_visual)", "Comment toggle linewise (visual)" },
|
||||
}
|
||||
|
||||
local mappings = {
|
||||
[";"] = { vim.cmd.Alpha, "Dashboard" },
|
||||
["/"] = { "<Plug>(comment_toggle_linewise_current)", "Comment toggle current line" },
|
||||
c = { vim.cmd.bdelete, "Close Buffer" },
|
||||
f = {
|
||||
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown({previewer = false}))<cr>",
|
||||
"Find files",
|
||||
},
|
||||
e = { vim.cmd.NvimTreeToggle, "Explorer" },
|
||||
F = { "<cmd>Telescope live_grep theme=ivy<cr>", "Find Text" },
|
||||
P = { "<cmd>lua require('telescope').extensions.projects.projects()<cr>", "Projects" },
|
||||
b = { "<cmd>Telescope buffers<cr>", "Find Buffers" },
|
||||
u = { vim.cmd.UndotreeToggle, "UndotreeToggle" },
|
||||
t = { vim.cmd.TagbarToggle, "Toggle Tagbar" },
|
||||
m = { require("harpoon.mark").add_file, "Add file to harpoon" },
|
||||
h = { require("harpoon.ui").toggle_quick_menu, "Open harpoon menu" },
|
||||
n = { vim.cmd.Oil, "Open Oil" },
|
||||
g = {
|
||||
name = "Git",
|
||||
g = { "<cmd>lua _LAZYGIT_TOGGLE()<cr>", "Lazygit" },
|
||||
l = { "<cmd>lua require('gitsigns').blame_line()<cr>", "Blame" },
|
||||
},
|
||||
l = {
|
||||
name = "LSP",
|
||||
a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
|
||||
d = { "<cmd>Telescope diagnostics bufnr=0 theme=get_ivy<cr>", "Buffer Diagnostics" },
|
||||
w = {
|
||||
"<cmd>Telescope diagnostics<cr>",
|
||||
"Workspace Diagnostics",
|
||||
},
|
||||
j = { "<cmd>lua vim.diagnostic.goto_next()<cr>", "Next Diagnostic" },
|
||||
k = {
|
||||
"<cmd>lua vim.diagnostic.goto_prev()<cr>",
|
||||
"Prev Diagnostic",
|
||||
},
|
||||
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
|
||||
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
|
||||
S = {
|
||||
"<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
|
||||
"Workspace Symbols",
|
||||
},
|
||||
e = { "<cmd>Telescope quickfix<cr>", "Telescope Quickfix" },
|
||||
},
|
||||
s = {
|
||||
name = "Search",
|
||||
b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
|
||||
c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
|
||||
f = { "<cmd>Telescope find_files<cr>", "Find File" },
|
||||
h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
|
||||
H = { "<cmd>Telescope highlights<cr>", "Find highlight groups" },
|
||||
M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
|
||||
r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
|
||||
R = { "<cmd>Telescope registers<cr>", "Registers" },
|
||||
t = { "<cmd>Telescope live_grep<cr>", "Text" },
|
||||
k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
|
||||
C = { "<cmd>Telescope commands<cr>", "Commands" },
|
||||
T = { "<cmd>TodoTelescope<cr>", "Todo" },
|
||||
m = { "<cmd>lua require('telescope').extensions.media_files.media_files()<cr>", "Media" },
|
||||
p = {
|
||||
"<cmd>lua require('telescope.builtin').colorscheme({enable_preview = true})<cr>",
|
||||
"Colorscheme with Preview",
|
||||
},
|
||||
},
|
||||
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" },
|
||||
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 = {
|
||||
name = "Language settings",
|
||||
c = { "<cmd>setlocal formatoptions-=cro<cr>", "Disable autocomment" },
|
||||
C = { "<cmd>setlocal formatoptions=cro<cr>", "Enable autocomment" },
|
||||
s = { "<cmd>setlocal spell!<cr>", "Toggle spellchecker" },
|
||||
e = { "<cmd>setlocal spell spelllang=en_us<cr>", "Enable English spellchecker" },
|
||||
l = { "<cmd>setlocal spell spelllang=lv_LV<cr>", "Enable Lavian spellchecker" },
|
||||
I = { "<cmd>setlocal autoindent<cr>", "Enable autoindent" },
|
||||
i = { "<cmd>setlocal noautoindent<cr>", "Disable autoindent" },
|
||||
},
|
||||
d = {
|
||||
name = "DAP",
|
||||
d = { "<cmd>lua require('dap').toggle_breakpoint()<cr>", "Set breakpoint" },
|
||||
t = { "<cmd>lua require('dapui').toggle()<cr>", "Toggle DAP-UI" },
|
||||
c = { "<cmd>lua require('dap').continue()<cr>", "Launch debug sessions and resume execution" },
|
||||
i = { "<cmd>lua require('dap').step_into()<cr>", "Step into code" },
|
||||
o = { "<cmd>lua require('dap').step_over()<cr>", "Step over code" },
|
||||
O = { "<cmd>lua require('dap').step_out()<cr>", "Step out of code" },
|
||||
r = { "<cmd>lua require('dap').repl.open()<cr>", "Inspect state" },
|
||||
T = { "<cmd>lua require('dap').terminate()<cr>", "Terminate" },
|
||||
l = { "<cmd>lua require('dap').run_last()<cr>", "Run last" },
|
||||
},
|
||||
w = {
|
||||
name = "VimWiki",
|
||||
w = { "<Plug>VimwikiIndex", "Open index file" },
|
||||
t = { "<Plug>VimwikiTabIndex", "Open index file in new tab" },
|
||||
s = { "<Plug>VimwikiUISelect", "Display list of wikis" },
|
||||
i = { "<Plug>VimwikiDiaryIndex", "Open diary index" },
|
||||
h = { "<Plug>Vimwiki2HTML", "Convert file to HTML" },
|
||||
H = { "<Plug>Vimwiki2HTMLBrowse", "Convert file to HTML and open in browser" },
|
||||
n = { "<Plug>VimwikiGoto", "Goto link provided by an argument" },
|
||||
d = { "<Plug>VimwikiDeleteFile", "Rename file" },
|
||||
r = { "<Plug>VimwikiRenameFile", "Delete file" },
|
||||
},
|
||||
}
|
||||
|
||||
which_key.setup(setup)
|
||||
which_key.register(mappings, opts, vopts, vmappings)
|
||||
Reference in New Issue
Block a user