Compare commits
2 commits
41327778ea
...
78a85d5405
| Author | SHA1 | Date | |
|---|---|---|---|
| 78a85d5405 | |||
| 93027a59a2 |
19 changed files with 803 additions and 9 deletions
63
config/nvim_unstable/lua/aleidk/constants.lua
Normal file
63
config/nvim_unstable/lua/aleidk/constants.lua
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
return {
|
||||||
|
icons = {
|
||||||
|
misc = {
|
||||||
|
pint = " ",
|
||||||
|
},
|
||||||
|
dap = {
|
||||||
|
Stopped = { " ", "DiagnosticWarn", "DapStoppedLine" },
|
||||||
|
Breakpoint = " ",
|
||||||
|
BreakpointCondition = " ",
|
||||||
|
BreakpointRejected = { " ", "DiagnosticError" },
|
||||||
|
LogPoint = ".>",
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
Error = " ",
|
||||||
|
Warn = " ",
|
||||||
|
Hint = " ",
|
||||||
|
Info = " ",
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
added = " ",
|
||||||
|
modified = " ",
|
||||||
|
removed = " ",
|
||||||
|
branch = "",
|
||||||
|
},
|
||||||
|
kinds = {
|
||||||
|
Array = " ",
|
||||||
|
Boolean = " ",
|
||||||
|
Class = " ",
|
||||||
|
Color = " ",
|
||||||
|
Constant = " ",
|
||||||
|
Constructor = " ",
|
||||||
|
Copilot = " ",
|
||||||
|
Enum = " ",
|
||||||
|
EnumMember = " ",
|
||||||
|
Event = " ",
|
||||||
|
Field = " ",
|
||||||
|
File = " ",
|
||||||
|
Folder = " ",
|
||||||
|
Function = " ",
|
||||||
|
Interface = " ",
|
||||||
|
Key = " ",
|
||||||
|
Keyword = " ",
|
||||||
|
Method = " ",
|
||||||
|
Module = " ",
|
||||||
|
Namespace = " ",
|
||||||
|
Null = " ",
|
||||||
|
Number = " ",
|
||||||
|
Object = " ",
|
||||||
|
Operator = " ",
|
||||||
|
Package = " ",
|
||||||
|
Property = " ",
|
||||||
|
Reference = " ",
|
||||||
|
Snippet = " ",
|
||||||
|
String = " ",
|
||||||
|
Struct = " ",
|
||||||
|
Text = " ",
|
||||||
|
TypeParameter = " ",
|
||||||
|
Unit = " ",
|
||||||
|
Value = " ",
|
||||||
|
Variable = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -8,18 +8,16 @@ vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
|
||||||
{ desc = "Move cursor regardless of word wrap", expr = true, silent = true })
|
{ desc = "Move cursor regardless of word wrap", expr = true, silent = true })
|
||||||
vim.keymap.set("n", "J", "mzJ`z", { desc = "Keep cursor in column while joining lines", silent = true })
|
vim.keymap.set("n", "J", "mzJ`z", { desc = "Keep cursor in column while joining lines", silent = true })
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Keep cursor centered while junping", silent = true })
|
-- vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Keep cursor centered while junping", silent = true })
|
||||||
vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Keep cursor centered while junping", silent = true })
|
-- vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Keep cursor centered while junping", silent = true })
|
||||||
vim.keymap.set("n", "n", "nzzzv", { desc = "Keep cursor centered while searching", silent = true })
|
-- vim.keymap.set("n", "n", "nzzzv", { desc = "Keep cursor centered while searching", silent = true })
|
||||||
vim.keymap.set("n", "N", "Nzzzv", { desc = "Keep cursor centered while searching", silent = true })
|
-- vim.keymap.set("n", "N", "Nzzzv", { desc = "Keep cursor centered while searching", silent = true })
|
||||||
|
|
||||||
-- Utils
|
-- Utils
|
||||||
vim.keymap.set("n", "|", ":vs<CR>", { desc = "Create vsplit", silent = true })
|
vim.keymap.set("n", "|", ":vs<CR>", { desc = "Create vsplit", silent = true })
|
||||||
vim.keymap.set("n", "°", ":sp<CR>", { desc = "Create split", silent = true })
|
vim.keymap.set("n", "°", ":sp<CR>", { desc = "Create split", silent = true })
|
||||||
|
|
||||||
vim.keymap.set("v", "p", [["_dP]], { desc = "Paste without lossing yanked text", silent = true })
|
vim.keymap.set("v", "p", [["_dP]], { desc = "Paste without lossing yanked text", silent = true })
|
||||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move selection down", silent = true })
|
|
||||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move selection up", silent = true })
|
|
||||||
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", { desc = "Remove search highlight", silent = true })
|
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", { desc = "Remove search highlight", silent = true })
|
||||||
|
|
||||||
-- Buffer manipulation
|
-- Buffer manipulation
|
||||||
|
|
|
||||||
38
config/nvim_unstable/lua/aleidk/plugins/bookmarks.lua
Normal file
38
config/nvim_unstable/lua/aleidk/plugins/bookmarks.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
local function select_or_create(search)
|
||||||
|
local grapple = require("grapple")
|
||||||
|
|
||||||
|
if grapple.exists(search) then
|
||||||
|
grapple.select(search)
|
||||||
|
else
|
||||||
|
grapple.tag()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
"cbochs/grapple.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
cmd = "Grapple",
|
||||||
|
config = function()
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.load_extension("grapple")
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader><leader>a", "<cmd>Grapple toggle<cr>", desc = "Toggle bookmark for current file" },
|
||||||
|
{ "<leader><leader>D", "<cmd>Grapple reset<cr>", desc = "Delete all bookmarks" },
|
||||||
|
{ "<leader><leader>t", "<cmd>Grapple toggle_tags<cr>", desc = "Toggle bookmarks window" },
|
||||||
|
{ "<leader><leader>T", "<cmd>Grapple toggle_scopes<cr>", desc = "Toggle scopes window" },
|
||||||
|
{ "<leader><leader>n", "<cmd>Grapple cycle forward<cr>", desc = "Next bookmark" },
|
||||||
|
{ "<leader><leader>N", "<cmd>Grapple cycle backward<cr>", desc = "Prev bookmark" },
|
||||||
|
{ "<leader><leader>j", function() select_or_create({ index = 1 }) end, desc = "Go or create bookmark 1" },
|
||||||
|
{ "<leader><leader>k", function() select_or_create({ index = 2 }) end, desc = "Go or create bookmark 2" },
|
||||||
|
{ "<leader><leader>l", function() select_or_create({ index = 3 }) end, desc = "Go or create bookmark 3" },
|
||||||
|
{ "<leader><leader>ñ", function() select_or_create({ index = 4 }) end, desc = "Go or create bookmark 4" },
|
||||||
|
{ "<leader><leader>J", "<cmd>Grapple tag index=1<cr>", desc = "Override bookmark 1" },
|
||||||
|
{ "<leader><leader>K", "<cmd>Grapple tag index=2<cr>", desc = "Override bookmark 2" },
|
||||||
|
{ "<leader><leader>L", "<cmd>Grapple tag index=3<cr>", desc = "Override bookmark 3" },
|
||||||
|
{ "<leader><leader>Ñ", "<cmd>Grapple tag index=4<cr>", desc = "Override bookmark 4" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,10 @@ return { -- Change colors.none if not using a transparent background
|
||||||
mason = true,
|
mason = true,
|
||||||
noice = true,
|
noice = true,
|
||||||
notify = true,
|
notify = true,
|
||||||
|
mini = {
|
||||||
|
enabled = true,
|
||||||
|
indentscope_color = "",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
custom_highlights = function(colors)
|
custom_highlights = function(colors)
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
12
config/nvim_unstable/lua/aleidk/plugins/comments.lua
Normal file
12
config/nvim_unstable/lua/aleidk/plugins/comments.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"LudoPinelli/comment-box.nvim",
|
||||||
|
opts = {
|
||||||
|
outer_blank_lines = true,
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "gcb", function() require("comment-box").lcbox() end, { desc = "Create a comment box", mode = { "n", "v" }, } },
|
||||||
|
{ "gcl", function() require("comment-box").llline() end, { desc = "Create a comment line", mode = { "n", "v" }, } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
44
config/nvim_unstable/lua/aleidk/plugins/database.lua
Normal file
44
config/nvim_unstable/lua/aleidk/plugins/database.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
return {
|
||||||
|
"kristijanhusak/vim-dadbod-ui",
|
||||||
|
dependencies = {
|
||||||
|
{ "tpope/vim-dadbod", lazy = true },
|
||||||
|
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
"DBUI",
|
||||||
|
"DBUIToggle",
|
||||||
|
"DBUIAddConnection",
|
||||||
|
"DBUIFindBuffer",
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<Leader>ud", "<CMD>DBUIToggle<CR>", desc = "Toggle DB UI" },
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- Your DBUI configuration
|
||||||
|
vim.g.db_ui_use_nerd_fonts = 1
|
||||||
|
vim.g.db_ui_force_echo_notifications = 1
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = {
|
||||||
|
"sql",
|
||||||
|
"mysql",
|
||||||
|
"plsql",
|
||||||
|
},
|
||||||
|
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = {
|
||||||
|
"sql",
|
||||||
|
"mysql",
|
||||||
|
"plsql",
|
||||||
|
},
|
||||||
|
callback = function()
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
require("cmp").setup.buffer({
|
||||||
|
sources = { { name = "vim-dadbod-completion" }, { name = "buffer" } },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
15
config/nvim_unstable/lua/aleidk/plugins/doc-gen.lua
Normal file
15
config/nvim_unstable/lua/aleidk/plugins/doc-gen.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
"danymat/neogen",
|
||||||
|
opts = { snippet_engine = "luasnip" },
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
version = "*", -- stable releases
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"gcd",
|
||||||
|
function()
|
||||||
|
require("neogen").generate()
|
||||||
|
end,
|
||||||
|
desc = "Generate comment docstring",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
33
config/nvim_unstable/lua/aleidk/plugins/file-explorer.lua
Normal file
33
config/nvim_unstable/lua/aleidk/plugins/file-explorer.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
return {
|
||||||
|
"mikavilpas/yazi.nvim",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>E",
|
||||||
|
"<cmd>Yazi<cr>",
|
||||||
|
desc = "Open yazi at the current file",
|
||||||
|
},
|
||||||
|
-- {
|
||||||
|
-- -- Open in the current working directory
|
||||||
|
-- "<leader>E",
|
||||||
|
-- "<cmd>Yazi cwd<cr>",
|
||||||
|
-- desc = "Open the file manager in nvim's working directory",
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
-- if you want to open yazi instead of netrw, see below for more info
|
||||||
|
open_for_directories = true,
|
||||||
|
open_multiple_tabs = true,
|
||||||
|
floating_window_scaling_factor = 1,
|
||||||
|
keymaps = {
|
||||||
|
show_help = '<f1>',
|
||||||
|
open_file_in_vertical_split = '<c-v>',
|
||||||
|
open_file_in_horizontal_split = '<c-s>',
|
||||||
|
open_file_in_tab = '<c-t>',
|
||||||
|
grep_in_directory = '<c-w>',
|
||||||
|
cycle_open_buffers = '<tab>',
|
||||||
|
copy_relative_path_to_selected_files = '<c-y>',
|
||||||
|
send_to_quickfix_list = '<c-q>',
|
||||||
|
change_working_directory = "<c-\\>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
124
config/nvim_unstable/lua/aleidk/plugins/formatter.lua
Normal file
124
config/nvim_unstable/lua/aleidk/plugins/formatter.lua
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = { "BufWritePre" },
|
||||||
|
cmd = { "ConformInfo" },
|
||||||
|
opts = {
|
||||||
|
-- log_level = vim.log.levels.DEBUG,
|
||||||
|
|
||||||
|
-- See aviable formatters in: https://github.com/stevearc/conform.nvim#formatters
|
||||||
|
-- Formatters can be installed by mason
|
||||||
|
formatters_by_ft = {
|
||||||
|
-- Conform will run multiple formatters sequentially
|
||||||
|
-- Use a stop_after_first = true to run only the first available formatter
|
||||||
|
-- Use the "_" filetype to run formatters on filetypes that don't
|
||||||
|
-- have other formatters configured.
|
||||||
|
["_"] = { "trim_whitespace" },
|
||||||
|
blade = { "blade-formatter" },
|
||||||
|
css = { "biome" },
|
||||||
|
go = { "gofumpt", "goimports_reviser", "golines" },
|
||||||
|
html = { "djlint", "prettierd", stop_after_first = true },
|
||||||
|
htmldjango = { "djlint", stop_after_first = true },
|
||||||
|
javascript = { "biome" },
|
||||||
|
javascriptreact = { "biome" },
|
||||||
|
json = { "biome" },
|
||||||
|
jsonc = { "biome" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
markdown = { "markdownlint" },
|
||||||
|
nim = { "nimpretty" },
|
||||||
|
php = { "pint" },
|
||||||
|
python = { "ruff_format", "ruff_organize_imports" },
|
||||||
|
scss = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
sh = { "shfmt" },
|
||||||
|
toml = { "taplo" },
|
||||||
|
typescript = { "biome" },
|
||||||
|
typescriptreact = { "biome" },
|
||||||
|
xml = { "lemminx" },
|
||||||
|
zsh = { "shfmt" },
|
||||||
|
sql = { "sleek" }
|
||||||
|
},
|
||||||
|
formatters = {
|
||||||
|
djlint = {
|
||||||
|
prepend_args = {
|
||||||
|
"--format-css",
|
||||||
|
"--indent-css",
|
||||||
|
"2",
|
||||||
|
"--format-js",
|
||||||
|
"--indent-js",
|
||||||
|
"2",
|
||||||
|
"--indent",
|
||||||
|
"2",
|
||||||
|
"--preserve-blank-lines",
|
||||||
|
"--quiet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
format_on_save = function(bufnr)
|
||||||
|
-- Disable with a global or buffer-local variable
|
||||||
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
return { timeout_ms = 2000, lsp_fallback = true }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("conform").setup(opts)
|
||||||
|
|
||||||
|
local function toggleAutoFormat()
|
||||||
|
-- to make this global, change b to g
|
||||||
|
if vim.b.disable_autoformat == nil then
|
||||||
|
vim.b.disable_autoformat = true
|
||||||
|
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||||
|
print("Autoformat set to: " .. tostring(not vim.b.disable_autoformat))
|
||||||
|
end
|
||||||
|
|
||||||
|
MAP("n", "<leader>uf", toggleAutoFormat, "Toggle auto format")
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("Fmt", function(args)
|
||||||
|
local range = nil
|
||||||
|
if args.count ~= -1 then
|
||||||
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||||
|
range = {
|
||||||
|
start = { args.line1, 0 },
|
||||||
|
["end"] = { args.line2, end_line:len() },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local function callback(err, did_edit)
|
||||||
|
if not did_edit then
|
||||||
|
vim.notify("The file was not formatted:\n" .. tostring(err), vim.log.levels.ERROR)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if args.bang then
|
||||||
|
vim.cmd("w")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require("conform").format(
|
||||||
|
{
|
||||||
|
async = true,
|
||||||
|
lsp_format = "fallback",
|
||||||
|
range = range,
|
||||||
|
formatters = args.fargs
|
||||||
|
},
|
||||||
|
callback
|
||||||
|
)
|
||||||
|
end, {
|
||||||
|
range = true,
|
||||||
|
bang = true,
|
||||||
|
force = true,
|
||||||
|
desc = "Format the document",
|
||||||
|
nargs = '*',
|
||||||
|
-- complete = function()
|
||||||
|
-- local formatters = require('conform').formatters_by_ft
|
||||||
|
--
|
||||||
|
-- return vim.tbl_keys(formatters)
|
||||||
|
-- end
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
52
config/nvim_unstable/lua/aleidk/plugins/git.lua
Normal file
52
config/nvim_unstable/lua/aleidk/plugins/git.lua
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
local const = require("aleidk.constants")
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
opts = {
|
||||||
|
-- See `:help gitsigns.txt`
|
||||||
|
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
|
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
||||||
|
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||||
|
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||||
|
signs = {
|
||||||
|
add = { text = const.icons.git.added },
|
||||||
|
change = { text = const.icons.git.modified },
|
||||||
|
delete = { text = const.icons.git.removed },
|
||||||
|
topdelete = { text = const.icons.git.removed },
|
||||||
|
changedelete = { text = const.icons.git.removed },
|
||||||
|
untracked = { text = "▎" },
|
||||||
|
},
|
||||||
|
signs_staged = {
|
||||||
|
add = { text = const.icons.git.added },
|
||||||
|
change = { text = const.icons.git.modified },
|
||||||
|
delete = { text = const.icons.git.removed },
|
||||||
|
topdelete = { text = const.icons.git.removed },
|
||||||
|
changedelete = { text = const.icons.git.removed },
|
||||||
|
untracked = { text = "▎" },
|
||||||
|
},
|
||||||
|
on_attach = function(buffer)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
|
||||||
|
local function map(mode, l, r, desc)
|
||||||
|
vim.keymap.set(mode, "<leader>g" .. l, r, { buffer = buffer, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- stylua: ignore start
|
||||||
|
map("n", "j", gs.next_hunk, "Next Hunk")
|
||||||
|
map("n", "k", gs.prev_hunk, "Prev Hunk")
|
||||||
|
map({ "n", "v" }, "s", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||||
|
map({ "n", "v" }, "r", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||||
|
map("n", "u", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||||
|
map("n", "R", gs.reset_buffer, "Reset Buffer")
|
||||||
|
map("n", "<TAB>", gs.preview_hunk, "Preview Hunk")
|
||||||
|
map("n", "l", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||||
|
map("n", "L", gs.toggle_current_line_blame, "Toggle current line blame")
|
||||||
|
map("n", "d", gs.toggle_word_diff, "Toggle word diff")
|
||||||
|
map("n", "h", "<CMD>diffget<CR>", "Diff This with last commit")
|
||||||
|
map("n", "l", "<CMD>diffput<CR>", "Diff This with last commit")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
30
config/nvim_unstable/lua/aleidk/plugins/indent-blankline.lua
Normal file
30
config/nvim_unstable/lua/aleidk/plugins/indent-blankline.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
return {
|
||||||
|
-- Add indentation guides even on blank lines
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
main = "ibl",
|
||||||
|
opts = {
|
||||||
|
-- char = "▏",
|
||||||
|
indent = {
|
||||||
|
char = "│",
|
||||||
|
tab_char = "│",
|
||||||
|
},
|
||||||
|
scope = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
exclude = {
|
||||||
|
filetypes = {
|
||||||
|
"help",
|
||||||
|
"alpha",
|
||||||
|
"dashboard",
|
||||||
|
"neo-tree",
|
||||||
|
"Trouble",
|
||||||
|
"lazy",
|
||||||
|
"mason",
|
||||||
|
"notify",
|
||||||
|
"toggleterm",
|
||||||
|
"lazyterm",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
return {
|
return {
|
||||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||||
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||||
|
{
|
||||||
|
"ckolkey/ts-node-action",
|
||||||
|
dependencies = { "nvim-treesitter" },
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ls", function() require("ts-node-action").node_action() end, desc = "Node Action" }
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
config/nvim_unstable/lua/aleidk/plugins/linters.lua
Normal file
25
config/nvim_unstable/lua/aleidk/plugins/linters.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
return {
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
local lint = require("lint")
|
||||||
|
|
||||||
|
lint.linters.gitlint.stdin = true
|
||||||
|
lint.linters.gitlint.args = { "--contrib", "contrib-title-conventional-commits", "--msg-filename", "-" }
|
||||||
|
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
-- astro = { "eslint_d" },
|
||||||
|
python = { "ruff" },
|
||||||
|
sh = { "shellcheck" },
|
||||||
|
NeogitCommitMessage = { "gitlint" },
|
||||||
|
gitcommit = { "gitlint" },
|
||||||
|
markdown = { "markdownlint" },
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
|
callback = function()
|
||||||
|
require("lint").try_lint()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
15
config/nvim_unstable/lua/aleidk/plugins/markdown.lua
Normal file
15
config/nvim_unstable/lua/aleidk/plugins/markdown.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"MeanderingProgrammer/markdown.nvim",
|
||||||
|
name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim
|
||||||
|
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' }, -- if you use the mini.nvim suite
|
||||||
|
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
|
||||||
|
opts = {
|
||||||
|
file_types = { 'markdown', 'copilot-chat' },
|
||||||
|
sign = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
154
config/nvim_unstable/lua/aleidk/plugins/mini.lua
Normal file
154
config/nvim_unstable/lua/aleidk/plugins/mini.lua
Normal file
|
|
@ -0,0 +1,154 @@
|
||||||
|
return {
|
||||||
|
'echasnovski/mini.nvim',
|
||||||
|
version = '*',
|
||||||
|
dependencies = {
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('mini.icons').setup()
|
||||||
|
require('mini.bracketed').setup() -- [] movement for various stuff
|
||||||
|
require("mini.ai").setup({})
|
||||||
|
require('mini.cursorword').setup() -- Hightlight word under cursor
|
||||||
|
require('mini.extra').setup()
|
||||||
|
require('mini.jump').setup() -- Extend f, F, t, T
|
||||||
|
require('mini.surround').setup()
|
||||||
|
require('mini.operators').setup()
|
||||||
|
require('mini.pairs').setup()
|
||||||
|
require('mini.splitjoin').setup()
|
||||||
|
require("mini.align").setup({})
|
||||||
|
require('mini.animate').setup()
|
||||||
|
|
||||||
|
require('mini.files').setup() -- file explorer
|
||||||
|
vim.keymap.set("n", "<leader>e", ":lua MiniFiles.open(vim.api.nvim_buf_get_name(0))<CR>",
|
||||||
|
{ desc = "Integrated file explorer", silent = true })
|
||||||
|
|
||||||
|
require('mini.move').setup({
|
||||||
|
mappings = {
|
||||||
|
-- Move visual selection in Visual mode
|
||||||
|
left = 'H',
|
||||||
|
right = 'L',
|
||||||
|
down = 'J',
|
||||||
|
up = 'K',
|
||||||
|
|
||||||
|
-- Move current line in Normal mode
|
||||||
|
line_left = '',
|
||||||
|
line_right = '',
|
||||||
|
line_down = '',
|
||||||
|
line_up = '',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require('mini.comment').setup({
|
||||||
|
options = {
|
||||||
|
-- Whether to ignore blank lines when commenting
|
||||||
|
ignore_blank_line = true,
|
||||||
|
-- Whether to ignore blank lines in actions and textobject
|
||||||
|
start_of_line = true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local gen_loader = require('mini.snippets').gen_loader
|
||||||
|
require('mini.snippets').setup({
|
||||||
|
snippets = {
|
||||||
|
-- Load custom file with global snippets first (adjust for Windows)
|
||||||
|
gen_loader.from_file('~/.config/nvim-unstable/snippets/global.json'),
|
||||||
|
|
||||||
|
-- Load snippets based on current language by reading files from
|
||||||
|
-- "snippets/" subdirectories from 'runtimepath' directories.
|
||||||
|
gen_loader.from_lang(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local miniclue = require("mini.clue")
|
||||||
|
miniclue.setup({
|
||||||
|
triggers = {
|
||||||
|
-- Leader triggers
|
||||||
|
{ mode = "n", keys = "<Leader>" },
|
||||||
|
{ mode = "v", keys = "<Leader>" },
|
||||||
|
{ mode = "x", keys = "<Leader>" },
|
||||||
|
|
||||||
|
-- Built-in completion
|
||||||
|
{ mode = "i", keys = "<C-x>" },
|
||||||
|
|
||||||
|
-- `g` key
|
||||||
|
{ mode = "n", keys = "g" },
|
||||||
|
{ mode = "x", keys = "g" },
|
||||||
|
|
||||||
|
-- Marks
|
||||||
|
{ mode = "n", keys = "'" },
|
||||||
|
{ mode = "n", keys = "`" },
|
||||||
|
{ mode = "x", keys = "'" },
|
||||||
|
{ mode = "x", keys = "`" },
|
||||||
|
|
||||||
|
-- Registers
|
||||||
|
{ mode = "n", keys = '"' },
|
||||||
|
{ mode = "x", keys = '"' },
|
||||||
|
{ mode = "i", keys = "<C-r>" },
|
||||||
|
{ mode = "c", keys = "<C-r>" },
|
||||||
|
|
||||||
|
-- Window commands
|
||||||
|
{ mode = "n", keys = "<C-w>" },
|
||||||
|
|
||||||
|
-- `z` key
|
||||||
|
{ mode = "n", keys = "z" },
|
||||||
|
{ mode = "x", keys = "z" },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Add a "postkeys" value to activate those keys after others
|
||||||
|
clues = {
|
||||||
|
miniclue.gen_clues.builtin_completion(),
|
||||||
|
miniclue.gen_clues.g(),
|
||||||
|
miniclue.gen_clues.marks(),
|
||||||
|
miniclue.gen_clues.registers(),
|
||||||
|
miniclue.gen_clues.windows(),
|
||||||
|
miniclue.gen_clues.z(),
|
||||||
|
|
||||||
|
{ mode = "n", keys = "<Leader><Leader>", desc = "+Bookmarks" },
|
||||||
|
{ mode = "n", keys = "<Leader><Leader>n", postkeys = "<Leader><Leader>" },
|
||||||
|
{ mode = "n", keys = "<Leader><Leader>N", postkeys = "<Leader><Leader>" },
|
||||||
|
{ mode = "n", keys = "<Leader>b", desc = "+Buffers" },
|
||||||
|
{ mode = "n", keys = "<Leader>bh", postkeys = "<Leader>b" },
|
||||||
|
{ mode = "n", keys = "<Leader>bl", postkeys = "<Leader>b" },
|
||||||
|
{ mode = "n", keys = "<Leader>f", desc = "+Find" },
|
||||||
|
{ mode = "n", keys = "<Leader>g", desc = "+Git" },
|
||||||
|
{ mode = "n", keys = "<Leader>l", desc = "+LSP" },
|
||||||
|
{ mode = "n", keys = "<Leader>r", desc = "+Replace" },
|
||||||
|
{ mode = "n", keys = "<Leader>u", desc = "+UI & Config" },
|
||||||
|
{ mode = "n", keys = "<Leader>un", desc = "+Noice" },
|
||||||
|
{ mode = "n", keys = "<Leader>w", desc = "+Workspace" },
|
||||||
|
{ mode = "n", keys = "<Leader>p", desc = "+Run stuff" },
|
||||||
|
{ mode = "n", keys = "<Leader>z", desc = "+ZK" },
|
||||||
|
{ mode = "v", keys = "<Leader>z", desc = "+ZK" },
|
||||||
|
{ mode = "v", keys = "<Leader>a", desc = "+AI" },
|
||||||
|
{ mode = "n", keys = "<Leader>a", desc = "+AI" },
|
||||||
|
{ mode = "n", keys = "g?", desc = "+Print Debug" },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Clue window settings
|
||||||
|
window = {
|
||||||
|
-- Floating window config
|
||||||
|
config = {
|
||||||
|
width = "auto",
|
||||||
|
},
|
||||||
|
-- Delay before showing clue window
|
||||||
|
delay = 200,
|
||||||
|
-- Keys to scroll inside the clue window
|
||||||
|
scroll_down = "<C-d>",
|
||||||
|
scroll_up = "<C-u>",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local hipatterns = require('mini.hipatterns')
|
||||||
|
hipatterns.setup({
|
||||||
|
highlighters = {
|
||||||
|
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||||
|
fixme = { pattern = '%f[%w]()FIXME()%f[%W]', group = 'MiniHipatternsFixme' },
|
||||||
|
hack = { pattern = '%f[%w]()HACK()%f[%W]', group = 'MiniHipatternsHack' },
|
||||||
|
todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' },
|
||||||
|
note = { pattern = '%f[%w]()NOTE()%f[%W]', group = 'MiniHipatternsNote' },
|
||||||
|
|
||||||
|
-- Highlight hex color strings (`#rrggbb`) using that color
|
||||||
|
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
||||||
59
config/nvim_unstable/lua/aleidk/plugins/remote-sshfs.lua
Normal file
59
config/nvim_unstable/lua/aleidk/plugins/remote-sshfs.lua
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"nosduco/remote-sshfs.nvim",
|
||||||
|
dependencies = { "nvim-telescope/telescope.nvim" },
|
||||||
|
cmd = { "RemoteSSHFSConnect" },
|
||||||
|
config = function()
|
||||||
|
require("remote-sshfs").setup({})
|
||||||
|
require("telescope").load_extension("remote-sshfs")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"amitds1997/remote-nvim.nvim",
|
||||||
|
version = "*", -- Pin to GitHub releases
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim", -- For standard functions
|
||||||
|
"MunifTanjim/nui.nvim", -- To build the plugin UI
|
||||||
|
"nvim-telescope/telescope.nvim", -- For picking b/w different remote methods
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
remote = {
|
||||||
|
copy_dirs = {
|
||||||
|
data = {
|
||||||
|
base = vim.fn.stdpath("data"), -- Path from where data has to be copied. You can choose to copy entire path or subdirectories inside using `dirs`
|
||||||
|
dirs = { "lazy" }, -- Directories inside `base` to copy over. If this is set to string "*"; it means entire `base` should be copied over
|
||||||
|
compression = {
|
||||||
|
enabled = true, -- Should data be compressed before uploading
|
||||||
|
additional_opts = { "--exclude-vcs" }, -- Any arguments that can be passed to `tar` for compression can be specified here to improve your compression
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- cache = {
|
||||||
|
-- base = vim.fn.stdpath("cache"),
|
||||||
|
-- dirs = {},
|
||||||
|
-- compression = {
|
||||||
|
-- enabled = true,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
state = {
|
||||||
|
base = vim.fn.stdpath("state"),
|
||||||
|
dirs = {},
|
||||||
|
compression = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
client_callback = function(port, workspace_config)
|
||||||
|
local cmd = ("tmux new-window 'nvim --server localhost:%s --remote-ui' && tmux select-window -t:$"):format(port)
|
||||||
|
vim.fn.jobstart(cmd, {
|
||||||
|
detach = true,
|
||||||
|
on_exit = function(job_id, exit_code, event_type)
|
||||||
|
-- This function will be called when the job exits
|
||||||
|
print("Client", job_id, "exited with code", exit_code, "Event type:", event_type)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
config = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
93
config/nvim_unstable/lua/aleidk/plugins/trouble.lua
Normal file
93
config/nvim_unstable/lua/aleidk/plugins/trouble.lua
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
---@module 'trouble'
|
||||||
|
|
||||||
|
return {
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
cmd = { "Trouble" },
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>fD",
|
||||||
|
"<cmd>Trouble diagnostics open<cr>",
|
||||||
|
desc = "Find diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>fd",
|
||||||
|
"<cmd>Trouble diagnostics open filter.buf=0<cr>",
|
||||||
|
desc = "Find buffer diagnostics (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ll",
|
||||||
|
"<cmd>Trouble symbols open<cr>",
|
||||||
|
desc = "Symbols (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>li",
|
||||||
|
"<cmd>Trouble lsp open<cr>",
|
||||||
|
desc = "LSP info of node (Trouble)",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>fq",
|
||||||
|
"<cmd>Trouble qflist open<cr>",
|
||||||
|
desc = "Quickfix List (Trouble)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
---@type trouble.Window.opts
|
||||||
|
local win_opts = {
|
||||||
|
-- size = { width = 30, height = 0.5 },
|
||||||
|
minimal = true,
|
||||||
|
border = "rounded",
|
||||||
|
position = "bottom",
|
||||||
|
}
|
||||||
|
|
||||||
|
---@type trouble.Config
|
||||||
|
return {
|
||||||
|
focus = true,
|
||||||
|
|
||||||
|
---@type trouble.Window.opts
|
||||||
|
preview = {
|
||||||
|
type = "split",
|
||||||
|
relative = "win",
|
||||||
|
position = "top",
|
||||||
|
},
|
||||||
|
|
||||||
|
---@type table<string, trouble.Action.spec|false>
|
||||||
|
keys = {
|
||||||
|
["<s-cr>"] = "jump_close",
|
||||||
|
["<cr>"] = "jump",
|
||||||
|
["<2-leftmouse>"] = "jump",
|
||||||
|
["<c-v>"] = "jump_split_close",
|
||||||
|
["<c-s>"] = "jump_vsplit_close",
|
||||||
|
["v"] = "jump_split_close",
|
||||||
|
["s"] = "jump_vsplit_close",
|
||||||
|
["<c-k>"] = "cancel", -- hack to fool myself into thinking I move to the avobe window
|
||||||
|
["a"] = function(view, ctx)
|
||||||
|
-- TODO: this is not possible until this issue is solved
|
||||||
|
-- https://github.com/neovim/neovim/issues/31206
|
||||||
|
local trouble = require("trouble")
|
||||||
|
view:action("jump_only")
|
||||||
|
|
||||||
|
vim.lsp.buf.code_action()
|
||||||
|
|
||||||
|
trouble.focus(view, ctx)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
win = win_opts,
|
||||||
|
---@type table<string, trouble.Mode>
|
||||||
|
modes = {
|
||||||
|
symbols = {
|
||||||
|
focus = true,
|
||||||
|
win = win_opts
|
||||||
|
},
|
||||||
|
lsp_references = {
|
||||||
|
focus = true,
|
||||||
|
win = win_opts
|
||||||
|
},
|
||||||
|
lsp = {
|
||||||
|
focus = true,
|
||||||
|
win = win_opts
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
18
config/nvim_unstable/lua/aleidk/plugins/typescript-tools.lua
Normal file
18
config/nvim_unstable/lua/aleidk/plugins/typescript-tools.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
return {
|
||||||
|
"pmizio/typescript-tools.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||||
|
opts = {
|
||||||
|
init_options = {
|
||||||
|
preferences = {
|
||||||
|
disableSuggestions = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
settings = {
|
||||||
|
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
|
||||||
|
-- "remove_unused_imports"|"organize_imports") -- or string "all"
|
||||||
|
-- to include all supported code actions
|
||||||
|
-- specify commands exposed as code_actions
|
||||||
|
expose_as_code_action = "all",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
11
config/nvim_unstable/snippets/global.json
Normal file
11
config/nvim_unstable/snippets/global.json
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"Basic": { "prefix": "ba", "body": "T1=$1 T2=$2 T0=$0" },
|
||||||
|
"Placeholders": { "prefix": "pl", "body": "T1=${1:aa}\nT2=${2:<$1>}" },
|
||||||
|
"Choices": { "prefix": "ch", "body": "T1=${1|a,b|} T2=${2|c,d|}" },
|
||||||
|
"Linked": { "prefix": "li", "body": "T1=$1\n\tT1=$1" },
|
||||||
|
"Variables": { "prefix": "va", "body": "Runtime: $VIMRUNTIME\n" },
|
||||||
|
"Complex": {
|
||||||
|
"prefix": "co",
|
||||||
|
"body": ["T1=${1:$RANDOM}", "T3=${3:$1_${2:$1}}", "T2=$2"]
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue