feat(nvim): use LazySpec[]
for plugins instead of after/plugins
This commit is contained in:
parent
e738954f46
commit
b2725c93e4
39 changed files with 1011 additions and 1000 deletions
|
@ -1,27 +0,0 @@
|
||||||
local present, autodm = pcall(require, "auto-dark-mode")
|
|
||||||
|
|
||||||
if not (present and vim.fn.has("mac") == 1) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local update_neovide_background = function()
|
|
||||||
if not vim.g.neovide then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local ctp_present, ctp = pcall(require, "catppuccin.palettes")
|
|
||||||
if ctp_present then
|
|
||||||
vim.g.neovide_background_color = ctp.get_palette().base
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
autodm.setup({
|
|
||||||
set_dark_mode = function()
|
|
||||||
vim.api.nvim_set_option("background", "dark")
|
|
||||||
update_neovide_background()
|
|
||||||
end,
|
|
||||||
set_light_mode = function()
|
|
||||||
vim.api.nvim_set_option("background", "light")
|
|
||||||
update_neovide_background()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
autodm.init()
|
|
|
@ -1,96 +0,0 @@
|
||||||
local present, bufferline = pcall(require, "bufferline")
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local ctp_present, ctp =
|
|
||||||
pcall(require, "catppuccin.groups.integrations.bufferline")
|
|
||||||
local ctp_bufferline
|
|
||||||
if not ctp_present then
|
|
||||||
ctp_bufferline = {}
|
|
||||||
else
|
|
||||||
ctp_bufferline = ctp.get()
|
|
||||||
end
|
|
||||||
|
|
||||||
local v = vim.version()
|
|
||||||
local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch)
|
|
||||||
|
|
||||||
bufferline.setup({
|
|
||||||
highlights = ctp_bufferline,
|
|
||||||
options = {
|
|
||||||
show_close_icon = false,
|
|
||||||
show_buffer_close_icons = false,
|
|
||||||
offsets = {
|
|
||||||
{
|
|
||||||
filetype = "NvimTree",
|
|
||||||
text = " neovim " .. vStr,
|
|
||||||
text_align = "left",
|
|
||||||
separator = "║",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
left_mouse_command = "buffer %d",
|
|
||||||
middle_mouse_command = "bdelete! %d",
|
|
||||||
right_mouse_command = nil,
|
|
||||||
indicator = { icon = "‣" },
|
|
||||||
numbers = function(tab)
|
|
||||||
local roman = {
|
|
||||||
"Ⅰ",
|
|
||||||
"Ⅱ",
|
|
||||||
"Ⅲ",
|
|
||||||
"Ⅳ",
|
|
||||||
"Ⅴ",
|
|
||||||
"Ⅵ",
|
|
||||||
"Ⅶ",
|
|
||||||
"Ⅷ",
|
|
||||||
"Ⅸ",
|
|
||||||
"Ⅹ",
|
|
||||||
"Ⅺ",
|
|
||||||
"Ⅻ",
|
|
||||||
"XⅢ",
|
|
||||||
"XⅣ",
|
|
||||||
"ⅩⅤ",
|
|
||||||
"ⅩⅥ",
|
|
||||||
"ⅩⅦ",
|
|
||||||
"ⅩⅧ",
|
|
||||||
"ⅩⅨ",
|
|
||||||
"ⅩⅩ",
|
|
||||||
}
|
|
||||||
|
|
||||||
return string.format("%s ", roman[tab.ordinal])
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local nmap = function(key, cmd)
|
|
||||||
vim.api.nvim_set_keymap("n", key, cmd, { noremap = true, silent = true })
|
|
||||||
end
|
|
||||||
|
|
||||||
-- hop between buffers in order of the bar
|
|
||||||
nmap("<A-,>", "<Cmd>BufferLineCyclePrev<CR>")
|
|
||||||
nmap("<A-.>", "<Cmd>BufferLineCycleNext<CR>")
|
|
||||||
-- Re-order to previous/next
|
|
||||||
nmap("<A-<>", "<Cmd>BufferLineMovePrev<CR>")
|
|
||||||
nmap("<A->>", "<Cmd>BufferLineMoveNext<CR>")
|
|
||||||
-- Goto buffer in position...
|
|
||||||
nmap("<A-1>", "<Cmd>BufferLineGoToBuffer 1<CR>")
|
|
||||||
nmap("<A-2>", "<Cmd>BufferLineGoToBuffer 2<CR>")
|
|
||||||
nmap("<A-3>", "<Cmd>BufferLineGoToBuffer 3<CR>")
|
|
||||||
nmap("<A-4>", "<Cmd>BufferLineGoToBuffer 4<CR>")
|
|
||||||
nmap("<A-5>", "<Cmd>BufferLineGoToBuffer 5<CR>")
|
|
||||||
nmap("<A-6>", "<Cmd>BufferLineGoToBuffer 6<CR>")
|
|
||||||
nmap("<A-7>", "<Cmd>BufferLineGoToBuffer 7<CR>")
|
|
||||||
nmap("<A-8>", "<Cmd>BufferLineGoToBuffer 8<CR>")
|
|
||||||
nmap("<A-9>", "<Cmd>BufferLineGoToBuffer 9<CR>")
|
|
||||||
nmap("<A-0>", "<Cmd>BufferLineGoToBuffer -1<CR>")
|
|
||||||
-- Pin/unpin buffer
|
|
||||||
nmap("<A-p>", "<Cmd>BufferLineTogglePin<CR>")
|
|
||||||
-- Close buffer
|
|
||||||
nmap("<A-x>", "<Cmd>bdelete<CR>")
|
|
||||||
nmap("<A-X>", "<Cmd>bdelete!<CR>")
|
|
||||||
-- create new buffer
|
|
||||||
nmap("<A-c>", "<Cmd>enew<CR>")
|
|
||||||
-- pick buffer
|
|
||||||
nmap("<A-space>", "<Cmd>BufferLinePick<CR>")
|
|
||||||
-- Sort automatically by...
|
|
||||||
nmap("<Space>bd", "<Cmd>BufferLineSortByDirectory<CR>")
|
|
||||||
nmap("<Space>bl", "<Cmd>BufferLineSortByExtension<CR>")
|
|
|
@ -1,99 +0,0 @@
|
||||||
vim.g.catppuccin_flavour = "mocha"
|
|
||||||
local present, catppuccin = pcall(require, "catppuccin")
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
catppuccin.setup({
|
|
||||||
transparent_background = true,
|
|
||||||
dim_inactive = {
|
|
||||||
enable = true,
|
|
||||||
shade = "dark",
|
|
||||||
percentage = 0.15,
|
|
||||||
},
|
|
||||||
styles = {
|
|
||||||
comments = { "italic" },
|
|
||||||
conditionals = { "italic" },
|
|
||||||
},
|
|
||||||
integrations = {
|
|
||||||
treesitter = true,
|
|
||||||
native_lsp = {
|
|
||||||
enabled = true,
|
|
||||||
virtual_text = {
|
|
||||||
errors = { "italic" },
|
|
||||||
hints = { "italic" },
|
|
||||||
warnings = { "italic" },
|
|
||||||
information = { "italic" },
|
|
||||||
},
|
|
||||||
underlines = {
|
|
||||||
errors = { "undercurl" },
|
|
||||||
hints = { "undercurl" },
|
|
||||||
warnings = { "undercurl" },
|
|
||||||
information = { "undercurl" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
cmp = true,
|
|
||||||
lsp_trouble = true,
|
|
||||||
nvimtree = true,
|
|
||||||
which_key = true,
|
|
||||||
indent_blankline = {
|
|
||||||
enabled = true,
|
|
||||||
colored_indent_levels = true,
|
|
||||||
},
|
|
||||||
navic = {
|
|
||||||
enabled = true,
|
|
||||||
custom_bg = "NONE",
|
|
||||||
},
|
|
||||||
gitsigns = true,
|
|
||||||
lightspeed = true,
|
|
||||||
markdown = true,
|
|
||||||
neogit = true,
|
|
||||||
symbols_outline = true,
|
|
||||||
ts_rainbow = true,
|
|
||||||
vimwiki = true,
|
|
||||||
},
|
|
||||||
highlight_overrides = {
|
|
||||||
all = function(colors)
|
|
||||||
return {
|
|
||||||
-- custom selection highlight
|
|
||||||
Selection = { bg = colors.surface1, fg = colors.text },
|
|
||||||
-- borders
|
|
||||||
FloatBorder = { fg = colors.overlay0 },
|
|
||||||
LspInfoBorder = { link = "FloatBorder" },
|
|
||||||
NvimTreeWinSeparator = { link = "FloatBorder" },
|
|
||||||
WhichKeyBorder = { link = "FloatBorder" },
|
|
||||||
-- telescope
|
|
||||||
TelescopeBorder = { link = "FloatBorder" },
|
|
||||||
TelescopeTitle = { fg = colors.text },
|
|
||||||
TelescopeSelection = { link = "Selection" },
|
|
||||||
TelescopeSelectionCaret = { link = "Selection" },
|
|
||||||
-- pmenu
|
|
||||||
PmenuSel = { link = "Selection" },
|
|
||||||
-- bufferline
|
|
||||||
BufferLineTabSeparator = { link = "FloatBorder" },
|
|
||||||
BufferLineSeparator = { link = "FloatBorder" },
|
|
||||||
BufferLineOffsetSeparator = { link = "FloatBorder" },
|
|
||||||
--
|
|
||||||
FidgetTitle = { fg = colors.subtext1 },
|
|
||||||
FidgetTask = { fg = colors.subtext0 },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
mocha = function(colors)
|
|
||||||
return {
|
|
||||||
Selection = { bg = "#121212", fg = colors.text },
|
|
||||||
Comment = { fg = colors.surface2, style = { "italic" } },
|
|
||||||
InlayHint = { fg = colors.surface0, style = { "italic" } },
|
|
||||||
WinSeparator = { fg = colors.surface2 },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
color_overrides = {
|
|
||||||
mocha = {
|
|
||||||
base = "#000000",
|
|
||||||
crust = "#010101",
|
|
||||||
mantle = "#020202",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_command("colorscheme catppuccin")
|
|
|
@ -1,29 +0,0 @@
|
||||||
local present, colorizer = pcall(require, "colorizer")
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
colorizer.setup({
|
|
||||||
user_default_options = {
|
|
||||||
RGB = true,
|
|
||||||
RRGGBB = true,
|
|
||||||
names = false,
|
|
||||||
RRGGBBAA = true,
|
|
||||||
AARRGGBB = false,
|
|
||||||
rgb_fn = false,
|
|
||||||
hsl_fn = false,
|
|
||||||
css = false,
|
|
||||||
css_fn = false,
|
|
||||||
mode = "background",
|
|
||||||
tailwind = "both",
|
|
||||||
sass = { enable = true },
|
|
||||||
virtualtext = " ",
|
|
||||||
},
|
|
||||||
buftypes = {
|
|
||||||
"*",
|
|
||||||
"!dashboard",
|
|
||||||
"!lazy",
|
|
||||||
"!popup",
|
|
||||||
"!prompt",
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,32 +0,0 @@
|
||||||
local present, copilot = pcall(require, "copilot")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
copilot.setup({
|
|
||||||
panel = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
suggestion = {
|
|
||||||
enabled = true,
|
|
||||||
auto_trigger = true,
|
|
||||||
debounce = 75,
|
|
||||||
keymap = {
|
|
||||||
accept = "<C-J>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filetypes = {
|
|
||||||
yaml = true,
|
|
||||||
markdown = false,
|
|
||||||
help = false,
|
|
||||||
gitcommit = false,
|
|
||||||
gitrebase = false,
|
|
||||||
hgcommit = false,
|
|
||||||
svn = false,
|
|
||||||
cvs = false,
|
|
||||||
["."] = false,
|
|
||||||
},
|
|
||||||
copilot_node_command = "node",
|
|
||||||
server_opts_overrides = {},
|
|
||||||
})
|
|
|
@ -1,19 +0,0 @@
|
||||||
local present, fidget = pcall(require, "fidget")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
fidget.setup({
|
|
||||||
text = {
|
|
||||||
spinner = "dots",
|
|
||||||
done = "",
|
|
||||||
commenced = "init",
|
|
||||||
completed = "done",
|
|
||||||
},
|
|
||||||
window = { blend = 0 },
|
|
||||||
sources = {
|
|
||||||
["copilot"] = { ignore = true },
|
|
||||||
["null-ls"] = { ignore = true },
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,143 +0,0 @@
|
||||||
local p1, wk = pcall(require, "which-key")
|
|
||||||
local p2, gs = pcall(require, "gitsigns")
|
|
||||||
|
|
||||||
if not (p1 and p2) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
gs.setup({
|
|
||||||
on_attach = function(bufnr)
|
|
||||||
-- Gitsigns
|
|
||||||
wk.register({
|
|
||||||
["<leader>h"] = {
|
|
||||||
name = "+Gitsigns",
|
|
||||||
s = { "<cmd>Gitsigns stage_hunk<CR>", "Stage Hunk" },
|
|
||||||
r = { "<cmd>Gitsigns reset_hunk<CR>", "Reset Hunk" },
|
|
||||||
},
|
|
||||||
}, { mode = { "n", "v" } })
|
|
||||||
|
|
||||||
wk.register({
|
|
||||||
["<leader>h"] = {
|
|
||||||
name = "+Gitsigns",
|
|
||||||
s = { gs.stage_buffer, "Stage Buffer" },
|
|
||||||
u = { gs.undo_stage_hunk, "Undo Stage Hunk" },
|
|
||||||
R = { gs.reset_buffer, "Reset Buffer" },
|
|
||||||
p = { gs.preview_hunk, "Preview Hunk" },
|
|
||||||
b = {
|
|
||||||
function()
|
|
||||||
gs.blame_line({ full = true })
|
|
||||||
end,
|
|
||||||
"Blame line",
|
|
||||||
},
|
|
||||||
d = { gs.diffthis, "Diff current buffer" },
|
|
||||||
D = {
|
|
||||||
function()
|
|
||||||
gs.diffthis("~")
|
|
||||||
end,
|
|
||||||
"Diff against last commit",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
wk.register({
|
|
||||||
["<leader>t"] = {
|
|
||||||
name = "+Toggle settings",
|
|
||||||
b = { gs.toggle_current_line_blame, "Toggle blame lines" },
|
|
||||||
d = { gs.toggle_deleted, "Toggle deleted lines" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
wk.register({
|
|
||||||
["[c"] = {
|
|
||||||
function()
|
|
||||||
if vim.wo.diff then
|
|
||||||
return "]c"
|
|
||||||
end
|
|
||||||
vim.schedule(function()
|
|
||||||
gs.next_hunk()
|
|
||||||
end)
|
|
||||||
return "<Ignore>"
|
|
||||||
end,
|
|
||||||
"Go to Next Hunk",
|
|
||||||
},
|
|
||||||
["]c"] = {
|
|
||||||
function()
|
|
||||||
if vim.wo.diff then
|
|
||||||
return "[c"
|
|
||||||
end
|
|
||||||
vim.schedule(function()
|
|
||||||
gs.prev_hunk()
|
|
||||||
end)
|
|
||||||
return "<Ignore>"
|
|
||||||
end,
|
|
||||||
"Go to Previous Hunk",
|
|
||||||
},
|
|
||||||
}, { expr = true })
|
|
||||||
|
|
||||||
-- Text object
|
|
||||||
wk.register({
|
|
||||||
["ih"] = { ":<C-U>Gitsigns select_hunk<CR>", "Select inside Hunk" },
|
|
||||||
}, { mode = { "o", "x" } })
|
|
||||||
end,
|
|
||||||
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 = "x",
|
|
||||||
numhl = "GitSignsChangeNr",
|
|
||||||
linehl = "GitSignsChangeLn",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
linehl = false,
|
|
||||||
numhl = false,
|
|
||||||
signcolumn = true,
|
|
||||||
word_diff = false,
|
|
||||||
watch_gitdir = { enable = false, interval = 1000, follow_files = true },
|
|
||||||
attach_to_untracked = true,
|
|
||||||
-- current line highlighting
|
|
||||||
current_line_blame = false,
|
|
||||||
current_line_blame_opts = {
|
|
||||||
delay = 1000,
|
|
||||||
ignore_whitespace = true,
|
|
||||||
virt_text = true,
|
|
||||||
virt_text_pos = "eol",
|
|
||||||
},
|
|
||||||
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
|
|
||||||
-- perf
|
|
||||||
max_file_length = 40000,
|
|
||||||
sign_priority = 6,
|
|
||||||
update_debounce = 100,
|
|
||||||
-- use the included status formatter
|
|
||||||
status_formatter = nil,
|
|
||||||
preview_config = {
|
|
||||||
border = "single",
|
|
||||||
style = "minimal",
|
|
||||||
relative = "cursor",
|
|
||||||
row = 0,
|
|
||||||
col = 1,
|
|
||||||
},
|
|
||||||
yadm = { enable = false },
|
|
||||||
})
|
|
|
@ -1,17 +0,0 @@
|
||||||
local present, indent_blankline = pcall(require, "indent_blankline")
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
indent_blankline.setup({
|
|
||||||
space_char_blankline = " ",
|
|
||||||
})
|
|
||||||
vim.g.indent_blankline_filetype_exclude = {
|
|
||||||
"dashboard",
|
|
||||||
"fugitive",
|
|
||||||
"help",
|
|
||||||
"lazy",
|
|
||||||
"NvimTree",
|
|
||||||
"neogitstatus",
|
|
||||||
"Trouble",
|
|
||||||
}
|
|
|
@ -1,101 +0,0 @@
|
||||||
local present, lualine = pcall(require, "lualine")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local navic_present, navic = pcall(require, "nvim-navic")
|
|
||||||
|
|
||||||
if navic_present then
|
|
||||||
navic.setup({
|
|
||||||
icons = {
|
|
||||||
File = " ",
|
|
||||||
Module = " ",
|
|
||||||
Namespace = " ",
|
|
||||||
Package = " ",
|
|
||||||
Class = " ",
|
|
||||||
Method = " ",
|
|
||||||
Property = " ",
|
|
||||||
Field = " ",
|
|
||||||
Constructor = " ",
|
|
||||||
Enum = " ",
|
|
||||||
Interface = " ",
|
|
||||||
Function = " ",
|
|
||||||
Variable = " ",
|
|
||||||
Constant = " ",
|
|
||||||
String = " ",
|
|
||||||
Number = " ",
|
|
||||||
Boolean = " ",
|
|
||||||
Array = " ",
|
|
||||||
Object = " ",
|
|
||||||
Key = " ",
|
|
||||||
Null = " ",
|
|
||||||
EnumMember = " ",
|
|
||||||
Struct = " ",
|
|
||||||
Event = " ",
|
|
||||||
Operator = " ",
|
|
||||||
TypeParameter = " ",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function navic_available()
|
|
||||||
return navic_present and navic.is_available()
|
|
||||||
end
|
|
||||||
|
|
||||||
local function navic_get_location()
|
|
||||||
if not navic_available() then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
return navic.get_location()
|
|
||||||
end
|
|
||||||
|
|
||||||
local config = {
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = "auto",
|
|
||||||
component_separators = { left = "", right = "" },
|
|
||||||
section_separators = { left = "", right = "" },
|
|
||||||
disabled_filetypes = {
|
|
||||||
statusline = {},
|
|
||||||
winbar = {},
|
|
||||||
},
|
|
||||||
ignore_focus = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
globalstatus = true,
|
|
||||||
refresh = {
|
|
||||||
statusline = 1000,
|
|
||||||
tabline = 1000,
|
|
||||||
winbar = 1000,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {
|
|
||||||
{
|
|
||||||
"mode",
|
|
||||||
fmt = function(str)
|
|
||||||
return " " .. str
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lualine_b = {
|
|
||||||
{ "branch", icon = "" },
|
|
||||||
"diff",
|
|
||||||
"diagnostics",
|
|
||||||
},
|
|
||||||
lualine_c = {
|
|
||||||
{ navic_get_location, condition = navic_available },
|
|
||||||
"searchcount",
|
|
||||||
"lsp_progress",
|
|
||||||
},
|
|
||||||
lualine_x = { "filetype" },
|
|
||||||
lualine_y = { "progress" },
|
|
||||||
lualine_z = { "location" },
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
winbar = {},
|
|
||||||
inactive_winbar = {},
|
|
||||||
extensions = {},
|
|
||||||
}
|
|
||||||
|
|
||||||
lualine.setup(config)
|
|
|
@ -1,5 +0,0 @@
|
||||||
local present, neogit = pcall(require, "neogit")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
|
@ -1,11 +0,0 @@
|
||||||
local present, neorg = pcall(require, "neorg")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
neorg.setup({
|
|
||||||
load = {
|
|
||||||
["core.defaults"] = {},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,9 +0,0 @@
|
||||||
local ap_present, ap = pcall(require, "nvim-autopairs")
|
|
||||||
local cmp_present, cmp = pcall(require, "cmp")
|
|
||||||
if not ap_present or cmp_present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
ap.setup()
|
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
|
|
@ -1,23 +0,0 @@
|
||||||
local present, nvimtree = pcall(require, "nvim-tree")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
nvimtree.setup({
|
|
||||||
renderer = {
|
|
||||||
indent_markers = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
actions = {
|
|
||||||
file_popup = {
|
|
||||||
open_win_config = {
|
|
||||||
border = "double",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,108 +0,0 @@
|
||||||
local present, presence = pcall(require, "presence")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
function string.starts(self, str)
|
|
||||||
return self:find("^" .. str) ~= nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local home = vim.fn.expand("$HOME") .. "/Code/"
|
|
||||||
|
|
||||||
local blacklist = {
|
|
||||||
[vim.fn.resolve(home .. "work")] = "Using nvim at work.",
|
|
||||||
[vim.fn.resolve(home .. "freelance")] = "Using nvim to freelance.",
|
|
||||||
[vim.fn.resolve(vim.fn.stdpath("config"))] = "Configuring nvim. ("
|
|
||||||
.. require("lazy").stats().count
|
|
||||||
.. " plugins)",
|
|
||||||
}
|
|
||||||
|
|
||||||
local conceal = function(activity, info)
|
|
||||||
local cur_file = vim.fn.expand("%:p")
|
|
||||||
for k, v in pairs(blacklist) do
|
|
||||||
if cur_file:starts(k) then
|
|
||||||
return v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if info ~= nil then
|
|
||||||
return activity .. " " .. info
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local v = vim.version()
|
|
||||||
local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch)
|
|
||||||
|
|
||||||
presence:setup({
|
|
||||||
-- General options
|
|
||||||
auto_update = true,
|
|
||||||
debounce_timeout = 10,
|
|
||||||
neovim_image_text = "Neovim " .. vStr,
|
|
||||||
-- Main image display (either "neovim" or "file")
|
|
||||||
main_image = "file",
|
|
||||||
show_time = false,
|
|
||||||
buttons = function(buffer, repo_url)
|
|
||||||
local concealed = conceal()
|
|
||||||
if concealed then
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
label = "View my config",
|
|
||||||
url = "https://github.com/nekowinston/dotfiles",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
label = "View the repository",
|
|
||||||
url = repo_url,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
file_assets = {
|
|
||||||
["k8s.yaml"] = {
|
|
||||||
"Kubernetes",
|
|
||||||
"https://avatars.githubusercontent.com/u/13629408",
|
|
||||||
},
|
|
||||||
["Chart.yaml"] = {
|
|
||||||
"Helm Chart",
|
|
||||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
|
||||||
},
|
|
||||||
["helmfile.yaml"] = {
|
|
||||||
"helmfile",
|
|
||||||
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
|
||||||
},
|
|
||||||
["prisma"] = {
|
|
||||||
"Prisma",
|
|
||||||
"https://avatars.githubusercontent.com/u/17219288",
|
|
||||||
},
|
|
||||||
["bu"] = {
|
|
||||||
"Butane Config",
|
|
||||||
"https://avatars.githubusercontent.com/u/3730757",
|
|
||||||
},
|
|
||||||
["ign"] = {
|
|
||||||
"CoreOS Ignition",
|
|
||||||
"https://avatars.githubusercontent.com/u/3730757",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- Rich Presence text options
|
|
||||||
editing_text = function(s)
|
|
||||||
return conceal("Editing", s)
|
|
||||||
end,
|
|
||||||
reading_text = function(s)
|
|
||||||
return conceal("Reading", s)
|
|
||||||
end,
|
|
||||||
file_explorer_text = function(s)
|
|
||||||
return conceal("Browsing", s)
|
|
||||||
end,
|
|
||||||
workspace_text = function(s)
|
|
||||||
local concealed = conceal()
|
|
||||||
if s ~= nil and not concealed then
|
|
||||||
return "Working on " .. s
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
git_commit_text = "Committing changes",
|
|
||||||
plugin_manager_text = "Managing Plugins",
|
|
||||||
})
|
|
|
@ -1,24 +0,0 @@
|
||||||
local present, telescope = pcall(require, "telescope")
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
pcall(telescope.load_extension, "fzf")
|
|
||||||
pcall(telescope.load_extension, "asynctasks")
|
|
||||||
pcall(telescope.load_extension, "file_browser")
|
|
||||||
pcall(telescope.load_extension, "project")
|
|
||||||
|
|
||||||
telescope.setup({
|
|
||||||
defaults = {
|
|
||||||
selection_caret = "▶ ",
|
|
||||||
borderchars = { "═", "║", "═", "║", "╔", "╗", "╝", "╚" },
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
fzf = {
|
|
||||||
fuzzy = true,
|
|
||||||
override_generic_sorter = true,
|
|
||||||
override_file_sorter = true,
|
|
||||||
case_mode = "smart_case",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,57 +0,0 @@
|
||||||
local present, treesitter = pcall(require, "nvim-treesitter.configs")
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local parsers = require("nvim-treesitter.parsers")
|
|
||||||
|
|
||||||
local parser_config = parsers.get_parser_configs()
|
|
||||||
parser_config.gotmpl = {
|
|
||||||
install_info = {
|
|
||||||
url = "https://github.com/ngalaiko/tree-sitter-go-template",
|
|
||||||
files = { "src/parser.c" },
|
|
||||||
},
|
|
||||||
filetype = "gotmpl",
|
|
||||||
used_by = { "gohtmltmpl", "gotexttmpl", "gotmpl", "yaml", "helm" },
|
|
||||||
}
|
|
||||||
|
|
||||||
local ft_to_parser = parsers.filetype_to_parsername
|
|
||||||
ft_to_parser.helm = "gotmpl"
|
|
||||||
|
|
||||||
treesitter.setup({
|
|
||||||
auto_install = true,
|
|
||||||
ignore_install = {
|
|
||||||
"phpdoc",
|
|
||||||
},
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
rainbow = {
|
|
||||||
enable = true,
|
|
||||||
extended_mode = true,
|
|
||||||
max_file_lines = 8192,
|
|
||||||
},
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"css",
|
|
||||||
"dockerfile",
|
|
||||||
"go",
|
|
||||||
"html",
|
|
||||||
"javascript",
|
|
||||||
"json",
|
|
||||||
"lua",
|
|
||||||
"markdown",
|
|
||||||
"python",
|
|
||||||
"regex",
|
|
||||||
"rust",
|
|
||||||
"scss",
|
|
||||||
"toml",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.o.foldmethod = "expr"
|
|
||||||
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
|
|
||||||
vim.o.foldenable = false
|
|
|
@ -1,51 +0,0 @@
|
||||||
local present, wk = pcall(require, "which-key")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
wk.setup({
|
|
||||||
key_labels = {
|
|
||||||
["<space>"] = "␣",
|
|
||||||
["<leader>"] = "␣",
|
|
||||||
["<cr>"] = " ",
|
|
||||||
["<tab>"] = " ",
|
|
||||||
["<esc>"] = "⎋ ",
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
border = "double",
|
|
||||||
margin = { 0, 0, 0, 0 },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Telescope
|
|
||||||
wk.register({
|
|
||||||
["<leader>f"] = {
|
|
||||||
name = "+Telescope",
|
|
||||||
b = { "<cmd>Telescope buffers<cr>", "File Browser" },
|
|
||||||
d = { "<cmd>Telescope find_files<cr>", "Find File" },
|
|
||||||
g = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
|
|
||||||
h = { "<cmd>Telescope help_tags<cr>", "Help Tags" },
|
|
||||||
p = { "<cmd>Telescope project<cr>", "Project" },
|
|
||||||
r = { "<cmd>Telescope asynctasks all<cr>", "Run Asynctasks" },
|
|
||||||
s = {
|
|
||||||
function()
|
|
||||||
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
|
|
||||||
require("telescope.builtin").find_files({ cwd = confpath })
|
|
||||||
end,
|
|
||||||
"Find in config",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- clipboard
|
|
||||||
wk.register({
|
|
||||||
["<leader>"] = {
|
|
||||||
y = { '"+y', "Copy to clipboard" },
|
|
||||||
p = { '"+p', "Paste from clipboard" },
|
|
||||||
db = { "<cmd>DBUIToggle<cr>", "Toggle DBUI" },
|
|
||||||
gd = { "<cmd>Gvdiff!<CR>", "Git Diff" },
|
|
||||||
ng = { "<cmd>Neogit<cr>", "Neogit" },
|
|
||||||
sl = { "<cmd>SessionLoad<cr>", "Load Session" },
|
|
||||||
},
|
|
||||||
}, { mode = { "n", "v" } })
|
|
|
@ -17,7 +17,7 @@
|
||||||
"fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" },
|
"fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
|
"friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" },
|
"gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" },
|
||||||
"go.nvim": { "branch": "master", "commit": "f80661a7109373aedee491acd8ddadc57e5c60aa" },
|
"go.nvim": { "branch": "master", "commit": "44130d73565cc123436ce7317bab4edce40a8886" },
|
||||||
"guihua.lua": { "branch": "master", "commit": "a19ac4447021f21383fadd7a9e1fc150d0b67e1f" },
|
"guihua.lua": { "branch": "master", "commit": "a19ac4447021f21383fadd7a9e1fc150d0b67e1f" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" },
|
"lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" },
|
||||||
|
|
|
@ -1,151 +1,4 @@
|
||||||
require("config.autocmds")
|
require("config.autocmds")
|
||||||
require("config.mappings")
|
require("config.mappings")
|
||||||
require("config.options")
|
require("config.options")
|
||||||
|
require("config.plugins").setup({ { import = "plugins" } })
|
||||||
local plugins = {
|
|
||||||
{ "catppuccin/nvim", name = "catppuccin" },
|
|
||||||
"pocco81/true-zen.nvim",
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
"akinsho/bufferline.nvim",
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"SmiteshP/nvim-navic",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"luukvbaal/stabilize.nvim",
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
build = function()
|
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
"nvim-treesitter/playground",
|
|
||||||
"windwp/nvim-ts-autotag",
|
|
||||||
"HiPhish/nvim-ts-rainbow2",
|
|
||||||
-- syntax
|
|
||||||
{
|
|
||||||
"wuelnerdotexe/vim-astro",
|
|
||||||
config = function()
|
|
||||||
vim.g.astro_typescript = "enable"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
"noahtheduke/vim-just",
|
|
||||||
|
|
||||||
{ "numtostr/comment.nvim", opts = {} },
|
|
||||||
"gpanders/editorconfig.nvim",
|
|
||||||
"ggandor/lightspeed.nvim",
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
"nvchad/nvim-colorizer.lua",
|
|
||||||
{ "kylechui/nvim-surround", opts = {} },
|
|
||||||
{ "folke/todo-comments.nvim", opts = {} },
|
|
||||||
"jamessan/vim-gnupg",
|
|
||||||
{
|
|
||||||
"dhruvasagar/vim-table-mode",
|
|
||||||
config = function()
|
|
||||||
vim.cmd([[autocmd FileType markdown let g:table_mode_corner='|']])
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
"f-person/auto-dark-mode.nvim",
|
|
||||||
|
|
||||||
-- git
|
|
||||||
"tpope/vim-fugitive",
|
|
||||||
"TimUntersberger/neogit",
|
|
||||||
|
|
||||||
-- databases
|
|
||||||
"tpope/vim-dadbod",
|
|
||||||
"kristijanhusak/vim-dadbod-completion",
|
|
||||||
{
|
|
||||||
"kristijanhusak/vim-dadbod-ui",
|
|
||||||
config = function()
|
|
||||||
vim.g.db_ui_use_nerd_fonts = true
|
|
||||||
vim.g.db_ui_win_position = "right"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
"skywind3000/asyncrun.vim",
|
|
||||||
"skywind3000/asynctasks.vim",
|
|
||||||
|
|
||||||
-- telescope
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
build = "make",
|
|
||||||
},
|
|
||||||
"GustavoKatel/telescope-asynctasks.nvim",
|
|
||||||
"nvim-telescope/telescope-file-browser.nvim",
|
|
||||||
"nvim-telescope/telescope-project.nvim",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"pwntester/octo.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
},
|
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- nvimtree
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"nvim-tree/nvim-tree.lua",
|
|
||||||
|
|
||||||
"stevearc/dressing.nvim",
|
|
||||||
|
|
||||||
-- discord
|
|
||||||
"andweeb/presence.nvim",
|
|
||||||
{ "iamcco/markdown-preview.nvim", build = "cd app && yarn install" },
|
|
||||||
|
|
||||||
"towolf/vim-helm",
|
|
||||||
-- LSP
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
-- completion
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-cmdline",
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
"hrsh7th/cmp-vsnip",
|
|
||||||
"hrsh7th/vim-vsnip",
|
|
||||||
"petertriho/cmp-git",
|
|
||||||
"onsails/lspkind.nvim",
|
|
||||||
"rafamadriz/friendly-snippets",
|
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
"nvim-lua/lsp-status.nvim",
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
"barreiroleo/ltex-extra.nvim",
|
|
||||||
"b0o/schemastore.nvim",
|
|
||||||
"hallerpatrick/py_lsp.nvim",
|
|
||||||
"simrat39/rust-tools.nvim",
|
|
||||||
{ "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" } },
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
dependencies = {
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
"theHamsta/nvim-dap-virtual-text",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("lsp")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- lua github copilot
|
|
||||||
"zbirenbaum/copilot.lua",
|
|
||||||
|
|
||||||
{ "nvim-neorg/neorg", build = ":Neorg sync-parsers" },
|
|
||||||
}
|
|
||||||
|
|
||||||
require("config.plugins").setup(plugins)
|
|
||||||
|
|
33
home/apps/neovim/lua/plugins/auto-dark-mode.lua
Normal file
33
home/apps/neovim/lua/plugins/auto-dark-mode.lua
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"f-person/auto-dark-mode.nvim",
|
||||||
|
config = function()
|
||||||
|
local autodm = require("auto-dark-mode")
|
||||||
|
if vim.fn.has("mac") ~= 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_neovide_background = function()
|
||||||
|
if not vim.g.neovide then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local ctp_present, ctp = pcall(require, "catppuccin.palettes")
|
||||||
|
if ctp_present then
|
||||||
|
vim.g.neovide_background_color = ctp.get_palette().base
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
autodm.setup({
|
||||||
|
set_dark_mode = function()
|
||||||
|
vim.api.nvim_set_option("background", "dark")
|
||||||
|
update_neovide_background()
|
||||||
|
end,
|
||||||
|
set_light_mode = function()
|
||||||
|
vim.api.nvim_set_option("background", "light")
|
||||||
|
update_neovide_background()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
autodm.init()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
15
home/apps/neovim/lua/plugins/auto-pairs.lua
Normal file
15
home/apps/neovim/lua/plugins/auto-pairs.lua
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local ap = require("nvim-autopairs")
|
||||||
|
local cmp = require("cmp")
|
||||||
|
ap.setup()
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
100
home/apps/neovim/lua/plugins/bufferline.lua
Normal file
100
home/apps/neovim/lua/plugins/bufferline.lua
Normal file
|
@ -0,0 +1,100 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "catppuccin/nvim", name = "catppuccin" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local bufferline = require("bufferline")
|
||||||
|
local ctp = require("catppuccin.groups.integrations.bufferline").get()
|
||||||
|
|
||||||
|
local v = vim.version()
|
||||||
|
local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch)
|
||||||
|
|
||||||
|
bufferline.setup({
|
||||||
|
highlights = ctp,
|
||||||
|
options = {
|
||||||
|
show_close_icon = false,
|
||||||
|
show_buffer_close_icons = false,
|
||||||
|
offsets = {
|
||||||
|
{
|
||||||
|
filetype = "NvimTree",
|
||||||
|
text = " neovim " .. vStr,
|
||||||
|
text_align = "left",
|
||||||
|
separator = "║",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
left_mouse_command = "buffer %d",
|
||||||
|
middle_mouse_command = "bdelete! %d",
|
||||||
|
right_mouse_command = nil,
|
||||||
|
indicator = { icon = "‣" },
|
||||||
|
numbers = function(tab)
|
||||||
|
local roman = {
|
||||||
|
"Ⅰ",
|
||||||
|
"Ⅱ",
|
||||||
|
"Ⅲ",
|
||||||
|
"Ⅳ",
|
||||||
|
"Ⅴ",
|
||||||
|
"Ⅵ",
|
||||||
|
"Ⅶ",
|
||||||
|
"Ⅷ",
|
||||||
|
"Ⅸ",
|
||||||
|
"Ⅹ",
|
||||||
|
"Ⅺ",
|
||||||
|
"Ⅻ",
|
||||||
|
"XⅢ",
|
||||||
|
"XⅣ",
|
||||||
|
"ⅩⅤ",
|
||||||
|
"ⅩⅥ",
|
||||||
|
"ⅩⅦ",
|
||||||
|
"ⅩⅧ",
|
||||||
|
"ⅩⅨ",
|
||||||
|
"ⅩⅩ",
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.format("%s ", roman[tab.ordinal])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local nmap = function(key, cmd)
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"n",
|
||||||
|
key,
|
||||||
|
cmd,
|
||||||
|
{ noremap = true, silent = true }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- hop between buffers in order of the bar
|
||||||
|
nmap("<A-,>", "<Cmd>BufferLineCyclePrev<CR>")
|
||||||
|
nmap("<A-.>", "<Cmd>BufferLineCycleNext<CR>")
|
||||||
|
-- Re-order to previous/next
|
||||||
|
nmap("<A-<>", "<Cmd>BufferLineMovePrev<CR>")
|
||||||
|
nmap("<A->>", "<Cmd>BufferLineMoveNext<CR>")
|
||||||
|
-- Goto buffer in position...
|
||||||
|
nmap("<A-1>", "<Cmd>BufferLineGoToBuffer 1<CR>")
|
||||||
|
nmap("<A-2>", "<Cmd>BufferLineGoToBuffer 2<CR>")
|
||||||
|
nmap("<A-3>", "<Cmd>BufferLineGoToBuffer 3<CR>")
|
||||||
|
nmap("<A-4>", "<Cmd>BufferLineGoToBuffer 4<CR>")
|
||||||
|
nmap("<A-5>", "<Cmd>BufferLineGoToBuffer 5<CR>")
|
||||||
|
nmap("<A-6>", "<Cmd>BufferLineGoToBuffer 6<CR>")
|
||||||
|
nmap("<A-7>", "<Cmd>BufferLineGoToBuffer 7<CR>")
|
||||||
|
nmap("<A-8>", "<Cmd>BufferLineGoToBuffer 8<CR>")
|
||||||
|
nmap("<A-9>", "<Cmd>BufferLineGoToBuffer 9<CR>")
|
||||||
|
nmap("<A-0>", "<Cmd>BufferLineGoToBuffer -1<CR>")
|
||||||
|
-- Pin/unpin buffer
|
||||||
|
nmap("<A-p>", "<Cmd>BufferLineTogglePin<CR>")
|
||||||
|
-- Close buffer
|
||||||
|
nmap("<A-x>", "<Cmd>bdelete<CR>")
|
||||||
|
nmap("<A-X>", "<Cmd>bdelete!<CR>")
|
||||||
|
-- create new buffer
|
||||||
|
nmap("<A-c>", "<Cmd>enew<CR>")
|
||||||
|
-- pick buffer
|
||||||
|
nmap("<A-space>", "<Cmd>BufferLinePick<CR>")
|
||||||
|
-- Sort automatically by...
|
||||||
|
nmap("<Space>bd", "<Cmd>BufferLineSortByDirectory<CR>")
|
||||||
|
nmap("<Space>bl", "<Cmd>BufferLineSortByExtension<CR>")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
101
home/apps/neovim/lua/plugins/catppuccin.lua
Normal file
101
home/apps/neovim/lua/plugins/catppuccin.lua
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
config = function()
|
||||||
|
require("catppuccin").setup({
|
||||||
|
transparent_background = true,
|
||||||
|
dim_inactive = {
|
||||||
|
enable = true,
|
||||||
|
shade = "dark",
|
||||||
|
percentage = 0.15,
|
||||||
|
},
|
||||||
|
styles = {
|
||||||
|
comments = { "italic" },
|
||||||
|
conditionals = { "italic" },
|
||||||
|
},
|
||||||
|
integrations = {
|
||||||
|
treesitter = true,
|
||||||
|
native_lsp = {
|
||||||
|
enabled = true,
|
||||||
|
virtual_text = {
|
||||||
|
errors = { "italic" },
|
||||||
|
hints = { "italic" },
|
||||||
|
warnings = { "italic" },
|
||||||
|
information = { "italic" },
|
||||||
|
},
|
||||||
|
underlines = {
|
||||||
|
errors = { "undercurl" },
|
||||||
|
hints = { "undercurl" },
|
||||||
|
warnings = { "undercurl" },
|
||||||
|
information = { "undercurl" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cmp = true,
|
||||||
|
lsp_trouble = true,
|
||||||
|
nvimtree = true,
|
||||||
|
which_key = true,
|
||||||
|
indent_blankline = {
|
||||||
|
enabled = true,
|
||||||
|
colored_indent_levels = true,
|
||||||
|
},
|
||||||
|
navic = {
|
||||||
|
enabled = true,
|
||||||
|
custom_bg = "NONE",
|
||||||
|
},
|
||||||
|
gitsigns = true,
|
||||||
|
lightspeed = true,
|
||||||
|
markdown = true,
|
||||||
|
neogit = true,
|
||||||
|
symbols_outline = true,
|
||||||
|
ts_rainbow = true,
|
||||||
|
vimwiki = true,
|
||||||
|
},
|
||||||
|
highlight_overrides = {
|
||||||
|
all = function(colors)
|
||||||
|
return {
|
||||||
|
-- custom selection highlight
|
||||||
|
Selection = { bg = colors.surface1, fg = colors.text },
|
||||||
|
-- borders
|
||||||
|
FloatBorder = { fg = colors.overlay0 },
|
||||||
|
LspInfoBorder = { link = "FloatBorder" },
|
||||||
|
NvimTreeWinSeparator = { link = "FloatBorder" },
|
||||||
|
WhichKeyBorder = { link = "FloatBorder" },
|
||||||
|
-- telescope
|
||||||
|
TelescopeBorder = { link = "FloatBorder" },
|
||||||
|
TelescopeTitle = { fg = colors.text },
|
||||||
|
TelescopeSelection = { link = "Selection" },
|
||||||
|
TelescopeSelectionCaret = { link = "Selection" },
|
||||||
|
-- pmenu
|
||||||
|
PmenuSel = { link = "Selection" },
|
||||||
|
-- bufferline
|
||||||
|
BufferLineTabSeparator = { link = "FloatBorder" },
|
||||||
|
BufferLineSeparator = { link = "FloatBorder" },
|
||||||
|
BufferLineOffsetSeparator = { link = "FloatBorder" },
|
||||||
|
--
|
||||||
|
FidgetTitle = { fg = colors.subtext1 },
|
||||||
|
FidgetTask = { fg = colors.subtext0 },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
mocha = function(colors)
|
||||||
|
return {
|
||||||
|
Selection = { bg = "#121212", fg = colors.text },
|
||||||
|
Comment = { fg = colors.surface2, style = { "italic" } },
|
||||||
|
InlayHint = { fg = colors.surface0, style = { "italic" } },
|
||||||
|
WinSeparator = { fg = colors.surface2 },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
color_overrides = {
|
||||||
|
mocha = {
|
||||||
|
base = "#000000",
|
||||||
|
crust = "#010101",
|
||||||
|
mantle = "#020202",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd.colorscheme("catppuccin")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
29
home/apps/neovim/lua/plugins/colorizer.lua
Normal file
29
home/apps/neovim/lua/plugins/colorizer.lua
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvchad/nvim-colorizer.lua",
|
||||||
|
opts = {
|
||||||
|
user_default_options = {
|
||||||
|
RGB = true,
|
||||||
|
RRGGBB = true,
|
||||||
|
names = false,
|
||||||
|
RRGGBBAA = true,
|
||||||
|
AARRGGBB = false,
|
||||||
|
rgb_fn = false,
|
||||||
|
hsl_fn = false,
|
||||||
|
css = false,
|
||||||
|
css_fn = false,
|
||||||
|
mode = "background",
|
||||||
|
tailwind = "both",
|
||||||
|
sass = { enable = true },
|
||||||
|
virtualtext = " ",
|
||||||
|
},
|
||||||
|
buftypes = {
|
||||||
|
"*",
|
||||||
|
"!dashboard",
|
||||||
|
"!lazy",
|
||||||
|
"!popup",
|
||||||
|
"!prompt",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
31
home/apps/neovim/lua/plugins/copilot.lua
Normal file
31
home/apps/neovim/lua/plugins/copilot.lua
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
opts = {
|
||||||
|
panel = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
suggestion = {
|
||||||
|
enabled = true,
|
||||||
|
auto_trigger = true,
|
||||||
|
debounce = 75,
|
||||||
|
keymap = {
|
||||||
|
accept = "<C-J>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = {
|
||||||
|
yaml = true,
|
||||||
|
markdown = false,
|
||||||
|
help = false,
|
||||||
|
gitcommit = false,
|
||||||
|
gitrebase = false,
|
||||||
|
hgcommit = false,
|
||||||
|
svn = false,
|
||||||
|
cvs = false,
|
||||||
|
["."] = false,
|
||||||
|
},
|
||||||
|
copilot_node_command = "node",
|
||||||
|
server_opts_overrides = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
11
home/apps/neovim/lua/plugins/databases.lua
Normal file
11
home/apps/neovim/lua/plugins/databases.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
return {
|
||||||
|
"tpope/vim-dadbod",
|
||||||
|
"kristijanhusak/vim-dadbod-completion",
|
||||||
|
{
|
||||||
|
"kristijanhusak/vim-dadbod-ui",
|
||||||
|
config = function()
|
||||||
|
vim.g.db_ui_use_nerd_fonts = true
|
||||||
|
vim.g.db_ui_win_position = "right"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
20
home/apps/neovim/lua/plugins/editor.lua
Normal file
20
home/apps/neovim/lua/plugins/editor.lua
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
return {
|
||||||
|
-- TODO: remove in nvim 0.9 because of upstream merge
|
||||||
|
"luukvbaal/stabilize.nvim",
|
||||||
|
-- zen mode
|
||||||
|
"pocco81/true-zen.nvim",
|
||||||
|
-- respect project settings
|
||||||
|
"gpanders/editorconfig.nvim",
|
||||||
|
-- best hop
|
||||||
|
"ggandor/lightspeed.nvim",
|
||||||
|
-- run tasks
|
||||||
|
"skywind3000/asyncrun.vim",
|
||||||
|
"skywind3000/asynctasks.vim",
|
||||||
|
-- ui
|
||||||
|
"stevearc/dressing.nvim",
|
||||||
|
-- highlight todo/fixme/etc
|
||||||
|
{ "folke/todo-comments.nvim", opts = {} },
|
||||||
|
-- pretty much default nvim at this point
|
||||||
|
{ "kylechui/nvim-surround", opts = {} },
|
||||||
|
{ "numtostr/comment.nvim", opts = {} },
|
||||||
|
}
|
18
home/apps/neovim/lua/plugins/fidget.lua
Normal file
18
home/apps/neovim/lua/plugins/fidget.lua
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"j-hui/fidget.nvim",
|
||||||
|
opts = {
|
||||||
|
text = {
|
||||||
|
spinner = "dots",
|
||||||
|
done = "",
|
||||||
|
commenced = "init",
|
||||||
|
completed = "done",
|
||||||
|
},
|
||||||
|
window = { blend = 0 },
|
||||||
|
sources = {
|
||||||
|
["copilot"] = { ignore = true },
|
||||||
|
["null-ls"] = { ignore = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
154
home/apps/neovim/lua/plugins/git.lua
Normal file
154
home/apps/neovim/lua/plugins/git.lua
Normal file
|
@ -0,0 +1,154 @@
|
||||||
|
return {
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
{ "TimUntersberger/neogit", opts = {} },
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
config = function()
|
||||||
|
local present, wk = pcall(require, "which-key")
|
||||||
|
|
||||||
|
if not present then
|
||||||
|
vim.notify("which-key not found")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local gs = require("gitsigns")
|
||||||
|
|
||||||
|
gs.setup({
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
-- Gitsigns
|
||||||
|
wk.register({
|
||||||
|
["<leader>h"] = {
|
||||||
|
name = "+Gitsigns",
|
||||||
|
s = { "<cmd>Gitsigns stage_hunk<CR>", "Stage Hunk" },
|
||||||
|
r = { "<cmd>Gitsigns reset_hunk<CR>", "Reset Hunk" },
|
||||||
|
},
|
||||||
|
}, { mode = { "n", "v" } })
|
||||||
|
|
||||||
|
wk.register({
|
||||||
|
["<leader>h"] = {
|
||||||
|
name = "+Gitsigns",
|
||||||
|
s = { gs.stage_buffer, "Stage Buffer" },
|
||||||
|
u = { gs.undo_stage_hunk, "Undo Stage Hunk" },
|
||||||
|
R = { gs.reset_buffer, "Reset Buffer" },
|
||||||
|
p = { gs.preview_hunk, "Preview Hunk" },
|
||||||
|
b = {
|
||||||
|
function()
|
||||||
|
gs.blame_line({ full = true })
|
||||||
|
end,
|
||||||
|
"Blame line",
|
||||||
|
},
|
||||||
|
d = { gs.diffthis, "Diff current buffer" },
|
||||||
|
D = {
|
||||||
|
function()
|
||||||
|
gs.diffthis("~")
|
||||||
|
end,
|
||||||
|
"Diff against last commit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
wk.register({
|
||||||
|
["<leader>t"] = {
|
||||||
|
name = "+Toggle settings",
|
||||||
|
b = { gs.toggle_current_line_blame, "Toggle blame lines" },
|
||||||
|
d = { gs.toggle_deleted, "Toggle deleted lines" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
wk.register({
|
||||||
|
["[c"] = {
|
||||||
|
function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
return "]c"
|
||||||
|
end
|
||||||
|
vim.schedule(function()
|
||||||
|
gs.next_hunk()
|
||||||
|
end)
|
||||||
|
return "<Ignore>"
|
||||||
|
end,
|
||||||
|
"Go to Next Hunk",
|
||||||
|
},
|
||||||
|
["]c"] = {
|
||||||
|
function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
return "[c"
|
||||||
|
end
|
||||||
|
vim.schedule(function()
|
||||||
|
gs.prev_hunk()
|
||||||
|
end)
|
||||||
|
return "<Ignore>"
|
||||||
|
end,
|
||||||
|
"Go to Previous Hunk",
|
||||||
|
},
|
||||||
|
}, { expr = true })
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
wk.register({
|
||||||
|
["ih"] = { ":<C-U>Gitsigns select_hunk<CR>", "Select inside Hunk" },
|
||||||
|
}, { mode = { "o", "x" } })
|
||||||
|
end,
|
||||||
|
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 = "x",
|
||||||
|
numhl = "GitSignsChangeNr",
|
||||||
|
linehl = "GitSignsChangeLn",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
linehl = false,
|
||||||
|
numhl = false,
|
||||||
|
signcolumn = true,
|
||||||
|
word_diff = false,
|
||||||
|
watch_gitdir = { enable = false, interval = 1000, follow_files = true },
|
||||||
|
attach_to_untracked = true,
|
||||||
|
-- current line highlighting
|
||||||
|
current_line_blame = false,
|
||||||
|
current_line_blame_opts = {
|
||||||
|
delay = 1000,
|
||||||
|
ignore_whitespace = true,
|
||||||
|
virt_text = true,
|
||||||
|
virt_text_pos = "eol",
|
||||||
|
},
|
||||||
|
current_line_blame_formatter = "<author>, <author_time:%R> - <summary> | <abbrev_sha>",
|
||||||
|
-- perf
|
||||||
|
max_file_length = 40000,
|
||||||
|
sign_priority = 6,
|
||||||
|
update_debounce = 100,
|
||||||
|
-- use the included status formatter
|
||||||
|
status_formatter = nil,
|
||||||
|
preview_config = {
|
||||||
|
border = "single",
|
||||||
|
style = "minimal",
|
||||||
|
relative = "cursor",
|
||||||
|
row = 0,
|
||||||
|
col = 1,
|
||||||
|
},
|
||||||
|
yadm = { enable = false },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
19
home/apps/neovim/lua/plugins/indent-blankline.lua
Normal file
19
home/apps/neovim/lua/plugins/indent-blankline.lua
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
config = function()
|
||||||
|
require("indent_blankline").setup({
|
||||||
|
space_char_blankline = " ",
|
||||||
|
})
|
||||||
|
vim.g.indent_blankline_filetype_exclude = {
|
||||||
|
"dashboard",
|
||||||
|
"fugitive",
|
||||||
|
"help",
|
||||||
|
"lazy",
|
||||||
|
"NvimTree",
|
||||||
|
"neogitstatus",
|
||||||
|
"Trouble",
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
37
home/apps/neovim/lua/plugins/lsp.lua
Normal file
37
home/apps/neovim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
-- completion
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-vsnip",
|
||||||
|
"hrsh7th/vim-vsnip",
|
||||||
|
"petertriho/cmp-git",
|
||||||
|
"onsails/lspkind.nvim",
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
"nvim-lua/lsp-status.nvim",
|
||||||
|
"barreiroleo/ltex-extra.nvim",
|
||||||
|
"b0o/schemastore.nvim",
|
||||||
|
"hallerpatrick/py_lsp.nvim",
|
||||||
|
"simrat39/rust-tools.nvim",
|
||||||
|
{ "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" } },
|
||||||
|
{
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
dependencies = {
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("lsp")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"towolf/vim-helm",
|
||||||
|
}
|
95
home/apps/neovim/lua/plugins/lualine.lua
Normal file
95
home/apps/neovim/lua/plugins/lualine.lua
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
{
|
||||||
|
"SmiteshP/nvim-navic",
|
||||||
|
opts = {
|
||||||
|
icons = {
|
||||||
|
File = " ",
|
||||||
|
Module = " ",
|
||||||
|
Namespace = " ",
|
||||||
|
Package = " ",
|
||||||
|
Class = " ",
|
||||||
|
Method = " ",
|
||||||
|
Property = " ",
|
||||||
|
Field = " ",
|
||||||
|
Constructor = " ",
|
||||||
|
Enum = " ",
|
||||||
|
Interface = " ",
|
||||||
|
Function = " ",
|
||||||
|
Variable = " ",
|
||||||
|
Constant = " ",
|
||||||
|
String = " ",
|
||||||
|
Number = " ",
|
||||||
|
Boolean = " ",
|
||||||
|
Array = " ",
|
||||||
|
Object = " ",
|
||||||
|
Key = " ",
|
||||||
|
Null = " ",
|
||||||
|
EnumMember = " ",
|
||||||
|
Struct = " ",
|
||||||
|
Event = " ",
|
||||||
|
Operator = " ",
|
||||||
|
TypeParameter = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local lualine = require("lualine")
|
||||||
|
local navic = require("nvim-navic")
|
||||||
|
|
||||||
|
local config = {
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = "auto",
|
||||||
|
component_separators = { left = "", right = "" },
|
||||||
|
section_separators = { left = "", right = "" },
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = {},
|
||||||
|
winbar = {},
|
||||||
|
},
|
||||||
|
ignore_focus = {},
|
||||||
|
always_divide_middle = true,
|
||||||
|
globalstatus = true,
|
||||||
|
refresh = {
|
||||||
|
statusline = 1000,
|
||||||
|
tabline = 1000,
|
||||||
|
winbar = 1000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {
|
||||||
|
{
|
||||||
|
"mode",
|
||||||
|
fmt = function(str)
|
||||||
|
return " " .. str
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
lualine_b = {
|
||||||
|
{ "branch", icon = "" },
|
||||||
|
"diff",
|
||||||
|
"diagnostics",
|
||||||
|
},
|
||||||
|
lualine_c = {
|
||||||
|
{ navic.get_location, condition = navic.is_available },
|
||||||
|
"searchcount",
|
||||||
|
"lsp_progress",
|
||||||
|
},
|
||||||
|
lualine_x = { "filetype" },
|
||||||
|
lualine_y = { "progress" },
|
||||||
|
lualine_z = { "location" },
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
winbar = {},
|
||||||
|
inactive_winbar = {},
|
||||||
|
extensions = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
lualine.setup(config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
10
home/apps/neovim/lua/plugins/natural-language.lua
Normal file
10
home/apps/neovim/lua/plugins/natural-language.lua
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"dhruvasagar/vim-table-mode",
|
||||||
|
config = function()
|
||||||
|
vim.cmd([[autocmd FileType markdown let g:table_mode_corner='|']])
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"jamessan/vim-gnupg",
|
||||||
|
{ "iamcco/markdown-preview.nvim", build = "cd app && yarn install" },
|
||||||
|
}
|
11
home/apps/neovim/lua/plugins/neorg.lua
Normal file
11
home/apps/neovim/lua/plugins/neorg.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-neorg/neorg",
|
||||||
|
build = ":Neorg sync-parsers",
|
||||||
|
opts = {
|
||||||
|
load = {
|
||||||
|
["core.defaults"] = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
25
home/apps/neovim/lua/plugins/nvim-tree.lua
Normal file
25
home/apps/neovim/lua/plugins/nvim-tree.lua
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
opts = {
|
||||||
|
renderer = {
|
||||||
|
indent_markers = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
file_popup = {
|
||||||
|
open_win_config = {
|
||||||
|
border = "double",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
111
home/apps/neovim/lua/plugins/presence.lua
Normal file
111
home/apps/neovim/lua/plugins/presence.lua
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"andweeb/presence.nvim",
|
||||||
|
config = function()
|
||||||
|
local presence = require("presence")
|
||||||
|
|
||||||
|
function string.starts(self, str)
|
||||||
|
return self:find("^" .. str) ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local home = vim.fn.expand("$HOME") .. "/Code/"
|
||||||
|
|
||||||
|
local blacklist = {
|
||||||
|
[vim.fn.resolve(home .. "work")] = "Using nvim at work.",
|
||||||
|
[vim.fn.resolve(home .. "freelance")] = "Using nvim to freelance.",
|
||||||
|
[vim.fn.resolve(vim.fn.stdpath("config"))] = "Configuring nvim. ("
|
||||||
|
.. require("lazy").stats().count
|
||||||
|
.. " plugins)",
|
||||||
|
}
|
||||||
|
|
||||||
|
local conceal = function(activity, info)
|
||||||
|
local cur_file = vim.fn.expand("%:p")
|
||||||
|
for k, v in pairs(blacklist) do
|
||||||
|
if cur_file:starts(k) then
|
||||||
|
return v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if info ~= nil then
|
||||||
|
return activity .. " " .. info
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local v = vim.version()
|
||||||
|
local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch)
|
||||||
|
|
||||||
|
presence:setup({
|
||||||
|
-- General options
|
||||||
|
auto_update = true,
|
||||||
|
debounce_timeout = 10,
|
||||||
|
neovim_image_text = "Neovim " .. vStr,
|
||||||
|
-- Main image display (either "neovim" or "file")
|
||||||
|
main_image = "file",
|
||||||
|
show_time = false,
|
||||||
|
buttons = function(buffer, repo_url)
|
||||||
|
local concealed = conceal()
|
||||||
|
if concealed then
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
label = "View my config",
|
||||||
|
url = "https://github.com/nekowinston/dotfiles",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
label = "View the repository",
|
||||||
|
url = repo_url,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
file_assets = {
|
||||||
|
["k8s.yaml"] = {
|
||||||
|
"Kubernetes",
|
||||||
|
"https://avatars.githubusercontent.com/u/13629408",
|
||||||
|
},
|
||||||
|
["Chart.yaml"] = {
|
||||||
|
"Helm Chart",
|
||||||
|
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||||
|
},
|
||||||
|
["helmfile.yaml"] = {
|
||||||
|
"helmfile",
|
||||||
|
"https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png",
|
||||||
|
},
|
||||||
|
["prisma"] = {
|
||||||
|
"Prisma",
|
||||||
|
"https://avatars.githubusercontent.com/u/17219288",
|
||||||
|
},
|
||||||
|
["bu"] = {
|
||||||
|
"Butane Config",
|
||||||
|
"https://avatars.githubusercontent.com/u/3730757",
|
||||||
|
},
|
||||||
|
["ign"] = {
|
||||||
|
"CoreOS Ignition",
|
||||||
|
"https://avatars.githubusercontent.com/u/3730757",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Rich Presence text options
|
||||||
|
editing_text = function(s)
|
||||||
|
return conceal("Editing", s)
|
||||||
|
end,
|
||||||
|
reading_text = function(s)
|
||||||
|
return conceal("Reading", s)
|
||||||
|
end,
|
||||||
|
file_explorer_text = function(s)
|
||||||
|
return conceal("Browsing", s)
|
||||||
|
end,
|
||||||
|
workspace_text = function(s)
|
||||||
|
local concealed = conceal()
|
||||||
|
if s ~= nil and not concealed then
|
||||||
|
return "Working on " .. s
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
git_commit_text = "Committing changes",
|
||||||
|
plugin_manager_text = "Managing Plugins",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
60
home/apps/neovim/lua/plugins/telescope.lua
Normal file
60
home/apps/neovim/lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
config = function()
|
||||||
|
local telescope = require("telescope")
|
||||||
|
|
||||||
|
pcall(telescope.load_extension, "fzf")
|
||||||
|
pcall(telescope.load_extension, "asynctasks")
|
||||||
|
pcall(telescope.load_extension, "file_browser")
|
||||||
|
pcall(telescope.load_extension, "project")
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
selection_caret = "▶ ",
|
||||||
|
borderchars = {
|
||||||
|
"═",
|
||||||
|
"║",
|
||||||
|
"═",
|
||||||
|
"║",
|
||||||
|
"╔",
|
||||||
|
"╗",
|
||||||
|
"╝",
|
||||||
|
"╚",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true,
|
||||||
|
override_generic_sorter = true,
|
||||||
|
override_file_sorter = true,
|
||||||
|
case_mode = "smart_case",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "make",
|
||||||
|
},
|
||||||
|
"GustavoKatel/telescope-asynctasks.nvim",
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
"nvim-telescope/telescope-project.nvim",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- octo extension
|
||||||
|
{
|
||||||
|
"pwntester/octo.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
75
home/apps/neovim/lua/plugins/tree-sitter.lua
Normal file
75
home/apps/neovim/lua/plugins/tree-sitter.lua
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = function()
|
||||||
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
|
end,
|
||||||
|
config = function()
|
||||||
|
local treesitter = require("nvim-treesitter.configs")
|
||||||
|
local parsers = require("nvim-treesitter.parsers")
|
||||||
|
|
||||||
|
local parser_config = parsers.get_parser_configs()
|
||||||
|
parser_config.gotmpl = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/ngalaiko/tree-sitter-go-template",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
filetype = "gotmpl",
|
||||||
|
used_by = { "gohtmltmpl", "gotexttmpl", "gotmpl", "yaml", "helm" },
|
||||||
|
}
|
||||||
|
|
||||||
|
local ft_to_parser = parsers.filetype_to_parsername
|
||||||
|
ft_to_parser.helm = "gotmpl"
|
||||||
|
|
||||||
|
treesitter.setup({
|
||||||
|
auto_install = true,
|
||||||
|
ignore_install = {
|
||||||
|
"phpdoc",
|
||||||
|
},
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
rainbow = {
|
||||||
|
enable = true,
|
||||||
|
extended_mode = true,
|
||||||
|
max_file_lines = 8192,
|
||||||
|
},
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"css",
|
||||||
|
"dockerfile",
|
||||||
|
"go",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"markdown",
|
||||||
|
"python",
|
||||||
|
"regex",
|
||||||
|
"rust",
|
||||||
|
"scss",
|
||||||
|
"toml",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.o.foldmethod = "expr"
|
||||||
|
vim.o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
|
vim.o.foldenable = false
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"nvim-treesitter/playground",
|
||||||
|
"windwp/nvim-ts-autotag",
|
||||||
|
"HiPhish/nvim-ts-rainbow2",
|
||||||
|
|
||||||
|
-- not treesitter, but close enough
|
||||||
|
{
|
||||||
|
"wuelnerdotexe/vim-astro",
|
||||||
|
config = function()
|
||||||
|
vim.g.astro_typescript = "enable"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
"noahtheduke/vim-just",
|
||||||
|
}
|
54
home/apps/neovim/lua/plugins/which-key.lua
Normal file
54
home/apps/neovim/lua/plugins/which-key.lua
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
|
||||||
|
wk.setup({
|
||||||
|
key_labels = {
|
||||||
|
["<space>"] = "␣",
|
||||||
|
["<leader>"] = "␣",
|
||||||
|
["<cr>"] = " ",
|
||||||
|
["<tab>"] = " ",
|
||||||
|
["<esc>"] = "⎋ ",
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
border = "double",
|
||||||
|
margin = { 0, 0, 0, 0 },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
wk.register({
|
||||||
|
["<leader>f"] = {
|
||||||
|
name = "+Telescope",
|
||||||
|
b = { "<cmd>Telescope buffers<cr>", "File Browser" },
|
||||||
|
d = { "<cmd>Telescope find_files<cr>", "Find File" },
|
||||||
|
g = { "<cmd>Telescope live_grep<cr>", "Live Grep" },
|
||||||
|
h = { "<cmd>Telescope help_tags<cr>", "Help Tags" },
|
||||||
|
p = { "<cmd>Telescope project<cr>", "Project" },
|
||||||
|
r = { "<cmd>Telescope asynctasks all<cr>", "Run Asynctasks" },
|
||||||
|
s = {
|
||||||
|
function()
|
||||||
|
local confpath = vim.fn.resolve(vim.fn.stdpath("config"))
|
||||||
|
require("telescope.builtin").find_files({ cwd = confpath })
|
||||||
|
end,
|
||||||
|
"Find in config",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- clipboard
|
||||||
|
wk.register({
|
||||||
|
["<leader>"] = {
|
||||||
|
y = { '"+y', "Copy to clipboard" },
|
||||||
|
p = { '"+p', "Paste from clipboard" },
|
||||||
|
db = { "<cmd>DBUIToggle<cr>", "Toggle DBUI" },
|
||||||
|
gd = { "<cmd>Gvdiff!<CR>", "Git Diff" },
|
||||||
|
ng = { "<cmd>Neogit<cr>", "Neogit" },
|
||||||
|
sl = { "<cmd>SessionLoad<cr>", "Load Session" },
|
||||||
|
},
|
||||||
|
}, { mode = { "n", "v" } })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Reference in a new issue