Перевёл dotfiles на stow

This commit is contained in:
Alexander Neonxp Kiryukhin 2025-06-09 13:43:45 +03:00
parent 27416cef99
commit 97af93b2a8
Signed by: NeonXP
SSH key fingerprint: SHA256:SVt7TjxbVc87m1QYaQziOJ0N3OCFURv2g76gD/UTTXI
169 changed files with 1256 additions and 100 deletions

View file

@ -0,0 +1,69 @@
return {
"okuuva/auto-save.nvim",
enabled = true,
cmd = "ASToggle", -- optional for lazy loading on command
event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events
opts = {
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
trigger_events = { -- See :h events
-- -- vim events that trigger an immediate save
-- -- I'm disabling this, as it's autosaving when I leave the buffer and
-- -- that's autoformatting stuff if on insert mode and following a tutorial
-- -- Re-enabling this to only save if NOT in insert mode in the condition below
-- immediate_save = { nil },
immediate_save = { "BufLeave", "FocusLost", "QuitPre", "VimSuspend" }, -- vim events that trigger an immediate save
-- vim events that trigger a deferred save (saves after `debounce_delay`)
defer_save = {
"InsertLeave",
"TextChanged",
{ "User", pattern = "VisualLeave" },
{ "User", pattern = "FlashJumpEnd" },
{ "User", pattern = "SnacksInputLeave" },
{ "User", pattern = "SnacksPickerInputLeave" },
},
cancel_deferred_save = {
"InsertEnter",
{ "User", pattern = "VisualEnter" },
{ "User", pattern = "FlashJumpStart" },
{ "User", pattern = "SnacksInputEnter" },
{ "User", pattern = "SnacksPickerInputEnter" },
},
},
-- function that takes the buffer handle and determines whether to save the current buffer or not
-- return true: if buffer is ok to be saved
-- return false: if it's not ok to be saved
-- if set to `nil` then no specific condition is applied
condition = function(buf)
-- Do not save when I'm in insert mode
-- Do NOT ADD VISUAL MODE HERE or the cancel_deferred_save wont' work
-- If I STAY in insert mode and switch to another app, like YouTube to
-- take notes, the BufLeave or FocusLost immediate_save will be ignored
-- and the save will not be triggered
local mode = vim.fn.mode()
if mode == "i" then
return false
end
-- Disable auto-save for the harpoon plugin, otherwise it just opens and closes
-- https://github.com/ThePrimeagen/harpoon/issues/434
--
-- don't save for `sql` file types
-- I do this so when working with dadbod the file is not saved every time
-- I make a change, and a SQL query executed
-- Run `:set filetype?` on a dadbod query to make sure of the filetype
local filetype = vim.bo[buf].filetype
if filetype == "harpoon" or filetype == "mysql" then
return false
end
return true
end,
write_all_buffers = true, -- write all buffers when the current one meets `condition`
noautocmd = false,
lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details
-- delay after which a pending save is executed (default 1000)
debounce_delay = 2000,
-- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable
debug = false,
},
}

View file

@ -0,0 +1,7 @@
return {
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
--@module "ibl"
--@type ibl.config
config = true,
}

View file

@ -0,0 +1,55 @@
local source_mapping = {
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
luasnip = "[Snip]",
path = "[Path]",
}
return {
"saghen/blink.cmp",
lazy = false,
version = "1.*",
dependencies = {
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
dependencies = { "rafamadriz/friendly-snippets" },
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load("./snippets")
end,
},
},
opts = {
keymap = {
preset = "enter",
},
completion = {
list = {
selection = {
preselect = false,
auto_insert = false,
},
},
ghost_text = {
enabled = true,
},
},
cmdline = {
keymap = {
preset = "inherit",
['<Tab>'] = { 'show', 'accept' },
},
completion = {
menu = { auto_show = false },
ghost_text = { enabled = true },
},
sources = { "cmdline" },
},
snippets = { preset = "luasnip" },
sources = {
default = { "lsp", "path", "snippets", "buffer", "codecompanion" },
},
},
}

View file

@ -0,0 +1,10 @@
return {
"m4xshen/smartcolumn.nvim",
opts = {
colorcolumn = "80",
disabled_filetypes = { "help", "text" },
custom_colorcolumn = {},
scope = "file",
editorconfig = true,
},
}

View file

@ -0,0 +1,35 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
css = { "prettier" },
html = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
graphql = { "prettier" },
lua = { "stylua" },
python = { "isort", "black" },
go = { "gofmt" },
templ = { "templ" },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 500,
},
},
keys = {
{
"<leader>mp",
function()
require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 })
end,
desc = "Format file or range (in visual mode)",
},
},
}

View file

@ -0,0 +1,3 @@
return {
"mfussenegger/nvim-dap",
}

View file

@ -0,0 +1,159 @@
local default_config = {
delve = {
path = "dlv",
initialize_timeout_sec = 20,
port = "${port}",
args = {},
build_flags = "",
-- Automatically handle the issue on delve Windows versions < 1.24.0
-- where delve needs to be run in attched mode or it will fail (actually crashes).
detached = vim.fn.has("win32") == 0,
output_mode = "remote",
cwd = nil,
},
tests = {
verbose = false,
},
}
local function setup_go_configuration(dap, configs)
local common_debug_configs = {
{
type = "go",
name = "Debug",
request = "launch",
program = "${workspaceFolder}",
args = {},
buildFlags = configs.delve.build_flags,
outputMode = configs.delve.output_mode,
},
}
if dap.configurations.go == nil then
dap.configurations.go = {}
end
for _, config in ipairs(common_debug_configs) do
table.insert(dap.configurations.go, config)
end
if configs == nil or configs.dap_configurations == nil then
return
end
for _, config in ipairs(configs.dap_configurations) do
if config.type == "go" then
table.insert(dap.configurations.go, config)
end
end
end
return {
"leoluz/nvim-dap-go",
dependencies = { "mfussenegger/nvim-dap" },
opts = true,
config = function()
local dap, dapui = require("dap"), require("dapui")
dap.adapters.go = {
type = "server",
port = "${port}",
executable = {
command = "dlv",
args = { "dap", "-l", "127.0.0.1:${port}" },
},
}
setup_go_configuration(dap, default_config)
dap.defaults.fallback.terminal_win_cmd = "enew | set filetype=dap-terminal"
dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end
vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" })
vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" })
vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" })
vim.fn.sign_define(
"DapBreakpoint",
{ text = "!", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
)
vim.fn.sign_define(
"DapBreakpointCondition",
{ text = "?", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
)
vim.fn.sign_define(
"DapBreakpointRejected",
{ text = "RJ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" }
)
vim.fn.sign_define(
"DapLogPoint",
{ text = "i", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" }
)
vim.fn.sign_define(
"DapStopped",
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
)
end,
keys = {
{
"<F5>",
function()
require("dap").continue()
end,
silent = true,
},
{
"<F17>", -- S-F5
function()
require("dap").restart()
end,
silent = true,
},
{
"<F29>", -- C-F5
function()
require("dap").terminate()
end,
silent = true,
},
{
"<F8>",
function()
require("dap").step_over()
end,
silent = true,
},
{
"<F7>",
function()
require("dap").step_into()
end,
silent = true,
},
{
"<F19>", -- S-F7
function()
require("dap").step_out()
end,
silent = true,
},
{
"<A-b>",
function()
require("dap").toggle_breakpoint()
end,
silent = true,
},
},
}

View file

@ -0,0 +1,73 @@
return {
"rcarriga/nvim-dap-ui",
dependencies = {
"mfussenegger/nvim-dap",
"nvim-neotest/nvim-nio",
},
keys = {
{
"<F6>",
function()
require("dapui").toggle()
end,
silent = true,
},
{
"<Leader>dh",
function()
require("dap.ui.widgets").hover()
end,
silent = true,
},
{
"<Leader>dp",
function()
require("dap.ui.widgets").preview()
end,
silent = true,
},
{
"<F9>",
function()
local widgets = require("dap.ui.widgets")
widgets.centered_float(widgets.scopes)
end,
silent = true,
},
},
opts = {
icons = {
expanded = "[-]",
collapsed = "[+]",
},
mappings = {
open = "o",
remove = "d",
edit = "e",
repl = "r",
toggle = "t",
},
expand_lines = vim.fn.has("nvim-0.7"),
layouts = {
{
elements = {
"repl",
},
size = 0.3,
position = "bottom",
},
},
floating = {
max_height = nil,
max_width = nil,
border = "single",
mappings = {
close = { "q", "<Esc>" },
},
},
windows = { indent = 1 },
render = {
max_type_length = nil,
},
},
}

View file

@ -0,0 +1,12 @@
return {
"ray-x/go.nvim",
dependencies = {
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = true,
event = { "CmdlineEnter" },
ft = { "go", "gomod" },
build = ':lua require("go.install").update_all_sync()',
}

View file

@ -0,0 +1,21 @@
return {
"edolphin-ydf/goimpl.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-lua/popup.nvim",
"nvim-telescope/telescope.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("telescope").load_extension("goimpl")
end,
keys = {
{
"<leader>im",
function()
require("telescope").extensions.goimpl.goimpl({})
end,
desc = "Generate stub for interface on a type for golang",
},
},
}

View file

@ -0,0 +1,5 @@
return {
"lukas-reineke/headlines.nvim",
dependencies = "nvim-treesitter/nvim-treesitter",
config = true,
}

View file

@ -0,0 +1,8 @@
return {
"nvimdev/lspsaga.nvim",
opts = {
lightbulb = {
enable = false,
},
},
}

View file

@ -0,0 +1,15 @@
return {
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = {
doc_lines = 1,
max_height = 3,
hint_prefix = "",
hint_prefix = {
above = "",
current = "",
below = "",
},
floating_window = true,
},
}

View file

@ -0,0 +1,44 @@
local colors = require("theme.colors")
return {
"nvim-lualine/lualine.nvim",
opts = {
options = {
icons_enabled = true,
theme = "nightfly",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
},
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff", "diagnostics" },
lualine_c = { "filename" },
lualine_x = { "filetype" },
lualine_y = { "progress", "location" },
lualine_z = { "lsp_status", "os.date('%H:%M')" },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {},
},
}

View file

@ -0,0 +1,34 @@
return {
name = "resize",
dir = "~/.config/nvim/lua/myplugins",
keys = {
{
"<C-A-Left>",
function()
require("myplugins.resize").ResizeLeft()
end,
silent = true,
},
{
"<C-A-Right>",
function()
require("myplugins.resize").ResizeRight()
end,
silent = true,
},
{
"<C-A-Up>",
function()
require("myplugins.resize").ResizeUp()
end,
silent = true,
},
{
"<C-A-Down>",
function()
require("myplugins.resize").ResizeDown()
end,
silent = true,
},
},
}

View file

@ -0,0 +1,50 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
local actions = require("telescope.actions")
require("telescope").setup({
extensions = {
project = {
sync_with_nvim_tree = true,
},
},
pickers = {
buffers = {
initial_mode = "normal",
},
},
defaults = {
file_ignore_patterns = { "vendor", "node_modules" },
mappings = {
i = {
["<F4>"] = actions.close,
},
n = {
["<F4>"] = actions.close,
},
},
},
})
end,
keys = {
{ "<leader>ff", "<cmd>Telescope find_files<CR>", noremap = true, silent = true, desc = "Find files" },
{ "<leader>fg", "<cmd>Telescope live_grep<CR>", noremap = true, silent = true, desc = "Live grep" },
{
"<leader>fb",
"<cmd>Telescope current_buffer_fuzzy_fund<CR>",
noremap = true,
silent = true,
desc = "Find current file",
},
{ "<F4>", "<cmd>Telescope buffers<CR>", noremap = true, silent = true, desc = "Find buffers" },
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", noremap = true, silent = true },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", noremap = true, silent = true },
{ "<leader>ch", "<cmd>Telescope commands_history<CR>", noremap = true, silent = true },
{ "<leader>e", "<cmd>Telescope diagnostics<CR>", noremap = true, silent = true },
{ "gi", "<cmd>Telescope lsp_implementations<CR>", noremap = true, silent = true },
{ "gr", "<cmd>Telescope lsp_references<CR>", noremap = true, silent = true },
},
}

View file

@ -0,0 +1,69 @@
return {
"phrmendes/todotxt.nvim",
cmd = { "TodoTxt", "DoneTxt" },
opts = {
todotxt = "/home/neonxp/Документы/todo.txt",
donetxt = "/home/neonxp/Документы/done.txt",
},
-- suggested keybindings
keys = {
{
"<leader>tp",
function() require("todotxt").cycle_priority() end,
desc = "todo.txt: cycle priority",
ft = "todotxt",
},
{
"<cr>",
function() require("todotxt").toggle_todo_state() end,
desc = "todo.txt: toggle task state",
ft = "todotxt",
},
{
"<leader>tn",
function() require("todotxt").capture_todo() end,
desc = "New entry",
},
{
"<leader>tt",
function() require("todotxt").toggle_todotxt() end,
desc = "Open",
},
{
"<leader>tr",
function() require("todotxt").move_done_tasks() end,
desc = "Move to done.txt",
ft = "todotxt",
},
{
"<leader>tss",
function() require("todotxt").sort_tasks() end,
desc = "Sort",
ft = "todotxt",
},
{
"<leader>tsd",
function() require("todotxt").sort_tasks_by_due_date() end,
desc = "Sort by due:date",
ft = "todotxt",
},
{
"<leader>tsP",
function() require("todotxt").sort_tasks_by_priority() end,
desc = "Sort by (priority)",
ft = "todotxt",
},
{
"<leader>tsc",
function() require("todotxt").sort_tasks_by_context() end,
desc = "Sort by @context",
ft = "todotxt",
},
{
"<leader>tsp",
function() require("todotxt").sort_tasks_by_project() end,
desc = "Sort by +project",
ft = "todotxt",
},
},
}

View file

@ -0,0 +1,54 @@
local WIDTH_RATIO = 0.25
return {
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
disable_netrw = true,
hijack_netrw = true,
sort = {
sorter = "case_sensitive",
},
view = {
width = function()
return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
end,
adaptive_size = true,
centralize_selection = true,
},
git = {
enable = true,
},
renderer = {
group_empty = true,
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
filters = {
dotfiles = false,
},
update_focused_file = {
enable = true,
},
},
keys = {
{
"<C-c>",
function()
local api = require("nvim-tree.api")
local global_cwd = vim.fn.getcwd(-1, -1)
api.tree.change_root(global_cwd)
end,
noremap = true,
silent = true,
desc = "Change tree root to CWD",
},
{ "<F3>", ":NvimTreeToggle<CR>", noremap = true, silent = true, desc = "Toggle file tree" },
},
}

View file

@ -0,0 +1,53 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
opts = {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
ensure_installed = "all",
ignore_install = { "gdhsader", "phpdoc", "org" },
indent = { enable = true },
auto_install = true,
sync_install = true,
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
textobjects = {
select = { enable = true, lookahead = true },
move = {
enable = true,
goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
goto_previous_start = {
["[f"] = "@function.outer",
["[c"] = "@class.outer",
["[a"] = "@parameter.inner",
},
goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" },
},
},
},
build = function()
require("nvim-treesitter.install").update({ with_sync = true })()
end,
dependencies = {
{ "nvim-treesitter/nvim-treesitter-textobjects" },
{
"nvim-treesitter/nvim-treesitter-context",
opts = {
enable = true,
mode = "topline",
line_numbers = true,
},
},
{ "windwp/nvim-ts-autotag" },
},
}