fix: fixed conflicts + moving to yadm

This commit is contained in:
2026-02-20 17:21:21 +03:00
parent 03128d0bcf
commit b5f443916b
553 changed files with 704 additions and 256 deletions
+14
View File
@@ -0,0 +1,14 @@
do
local neovim_options = {
expandtab = true,
number = true,
relativenumber = true,
shiftwidth = 2,
tabstop = 2,
termguicolors = true,
}
for k, v in pairs(neovim_options) do
vim.opt[k] = v
end
end
+18
View File
@@ -0,0 +1,18 @@
vim.cmd([[
tnoremap <C-h> <C-\\><C-o><C-w>h
tnoremap <C-k> <C-\\><C-o><C-w>k
tnoremap <C-l> <C-\\><C-o><C-w>l
tnoremap <C-j> <C-\\><C-o><C-w>j
nnoremap <C-h> <C-w>h
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
nnoremap <C-j> <C-w>j
nnoremap <Space> @q
nnoremap <C-Space> 
vnoremap <C-Space> 
vnoremap <leader>e :!sh<CR>
nnoremap ' @q
]])
+28
View File
@@ -0,0 +1,28 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{ import = "plugins" },
},
install = { colorscheme = { "habamax" } },
checker = { enabled = false },
})
+24
View File
@@ -0,0 +1,24 @@
vim.opt.clipboard = "unnamedplus"
vim.g.clipboard = {
name = "osc 52",
copy = {
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
},
paste = {
["+"] = function()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end,
["*"] = function()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end,
},
}
vim.opt.fixeol = true
vim.opt.list = true
vim.opt.listchars = {
trail = "·",
tab = " ",
}
+52
View File
@@ -0,0 +1,52 @@
-- source https://github.com/neovim/nvim-lspconfig/issues/500#issuecomment-877293306
local export = {}
local function shorten_path(path)
if not path or #path <= 1 then
return path or "/"
end
local last_slash = path:match(".*/()")
if last_slash and last_slash > 1 then
return path:sub(1, last_slash - 2)
else
return "/"
end
end
function export.get_python_path()
local util = require("lspconfig/util")
local path = util.path
workspace = vim.fn.expand("%:p")
-- Use activated virtualenv.
if vim.env.VIRTUAL_ENV then
return path.join(vim.env.VIRTUAL_ENV, "bin", "python")
end
local match = vim.fn.glob(path.join(workspace, ".venv"))
if match ~= "" then
return path.join(workspace, ".venv", "bin", "python")
end
-- Find and use virtualenv via poetry in workspace directory.
while workspace ~= "" do
if workspace ~= "" then
local match = vim.fn.glob(path.join(workspace, "poetry.lock"))
if match ~= "" then
vim.api.nvim_set_current_dir(workspace)
local venv = vim.fn.trim(vim.fn.system("poetry env info -p 2> /dev/null"))
if venv ~= "" then
return path.join(venv, "bin", "python")
end
end
end
workspace = shorten_path(workspace)
end
-- Fallback to system Python.
return vim.fn.exepath("python3") or vim.fn.exepath("python") or "python"
end
return export
+7
View File
@@ -0,0 +1,7 @@
return {
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("nvim-autopairs").setup({})
end,
}
+27
View File
@@ -0,0 +1,27 @@
return {
"lukas-reineke/indent-blankline.nvim",
config = function()
local highlight = {
-- "RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require("ibl.hooks")
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
-- vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
require("ibl").setup({ indent = { highlight = highlight } })
end,
}
+17
View File
@@ -0,0 +1,17 @@
return {
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
require("catppuccin").setup({
flavour = "auto", -- latte, frappe, macchiato, mocha
background = { -- :h background
light = "latte",
dark = "mocha",
},
transparent_background = true,
})
vim.cmd.colorscheme("catppuccin")
end,
}
+33
View File
@@ -0,0 +1,33 @@
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
},
config = function()
local cmp = require("cmp")
cmp.setup({
mapping = {
["<A-d>"] = cmp.mapping(function(fallback)
if cmp.visible_docs() then
cmp.close_docs()
elseif cmp.visible() then
cmp.open_docs()
else
fallback()
end
end),
["<A-j>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }),
["<A-k>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }),
["<C-Space>"] = cmp.mapping.complete(),
["<Tab>"] = cmp.mapping.confirm({ select = true }),
},
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
sources = { { name = "nvim_lsp" }, { name = "buffer" } },
})
end,
}
+9
View File
@@ -0,0 +1,9 @@
return {
"numToStr/Comment.nvim",
config = function()
local comment = require("Comment")
comment.setup({
opleader = { line = "|" },
})
end,
}
+75
View File
@@ -0,0 +1,75 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<leader>F",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
},
opts = {
-- Defined formatters
formatters_by_ft = {
lua = { "stylua" },
sh = { "shfmt" },
python = { "better_ruff", "ruff_format" },
go = { "gofmt" },
html = { "prettierd", "prettier", stop_after_first = true },
css = { "prettierd", "prettier", stop_after_first = true },
javascript = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier_f", stop_after_first = true },
jsonc = { "prettierd_f", "prettier_f", stop_after_first = true },
markdown = { "prettierd", "prettier", stop_after_first = true },
},
-- Custom formatters
formatters = {
better_ruff = {
command = "ruff",
args = {
"check",
"--unfixable",
"F401",
"--fix",
"--select",
"I",
-- "F", "E", "W", "C90", "I", "S", "BLE", "T20", "ERA"
"--stdin-filename",
"$FILENAME",
"-",
},
stdin = true,
},
prettierd = {
args = { "--tab-width", "2" },
},
prettier = {
args = { "--tab-width", "2" },
},
prettierd_f = {
command = "prettierd",
args = { "--tab-width", "4" },
stdin = true,
},
prettier_f = {
command = "prettier",
args = { "--tab-width", "4" },
stdin = true,
},
},
format_on_save = { timeout_ms = 5000, lsp_fallback = true },
},
init = function()
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}
+43
View File
@@ -0,0 +1,43 @@
return {
{
"mfussenegger/nvim-dap",
config = function()
local dap = require("dap")
vim.keymap.set("n", "<F5>", dap.continue, opts)
vim.keymap.set("n", "<s-F5>", dap.stop, opts)
vim.keymap.set("n", "<F9>", dap.toggle_breakpoint, opts)
end,
},
{
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
config = function()
local dap, dapui = require("dap"), require("dapui")
dapui.setup()
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
end,
},
{
"mfussenegger/nvim-dap-python",
dependencies = {
"mfussenegger/nvim-dap",
},
config = function()
local python_utils = require("functions.python")
local python_path = python_utils.get_python_path()
require("dap-python").setup(python_path)
end,
},
}
@@ -0,0 +1,14 @@
return {
"tpope/vim-fugitive",
config = function()
vim.keymap.set("n", "<leader>p", function()
vim.cmd.Git("pull --rebase")
end, opts)
vim.keymap.set("n", "<leader>P", function()
vim.cmd.Git("push")
end, opts)
vim.keymap.set("n", "<leader>G", function()
vim.cmd.Git()
end, opts)
end,
}
+53
View File
@@ -0,0 +1,53 @@
return {
"akinsho/flutter-tools.nvim",
lazy = false,
dependencies = {
"nvim-lua/plenary.nvim",
"stevearc/dressing.nvim",
},
config = function()
require("flutter-tools").setup({
lsp = {
settings = {
showtodos = true,
completefunctioncalls = true,
analysisexcludedfolders = {
vim.fn.expand("$Home/.pub-cache"),
},
renamefileswithclasses = "prompt",
updateimportsonrename = true,
enablesnippets = false,
},
},
})
end,
}
-- return {
-- "akinsho/flutter-tools.nvim",
-- lazy = false,
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "stevearc/dressing.nvim",
-- },
-- config = function()
-- require("flutter-tools").setup({
-- flutter_path = nil,
-- flutter_lookup_cmd = "asdf where flutter",
-- fvm = false,
-- widget_guides = { enabled = true },
-- lsp = {
-- settings = {
-- showtodos = true,
-- completefunctioncalls = true,
-- analysisexcludedfolders = {
-- vim.fn.expand("$Home/.pub-cache"),
-- },
-- renamefileswithclasses = "prompt",
-- updateimportsonrename = true,
-- enablesnippets = false,
-- },
-- },
-- })
-- end,
-- }
+56
View File
@@ -0,0 +1,56 @@
function number_switch(harpoon)
for i = 1, 9, 1 do
vim.keymap.set("n", "<leader>" .. i, function()
harpoon:list():select(i)
end)
end
end
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
settings = {
save_on_toggle = false,
save_on_change = true,
excluded_filetypes = { "harpoon" },
},
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
},
config = function()
local harpoon = require("harpoon")
harpoon:setup()
local harpoon_extensions = require("harpoon.extensions")
harpoon:extend(harpoon_extensions.builtins.highlight_current_file())
vim.keymap.set("n", "<leader>h", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end)
vim.keymap.set("n", "<leader>H", function()
harpoon:list():add()
end)
vim.keymap.set("n", "<leader>l", function()
harpoon:list():remove()
end)
vim.keymap.set("n", "<leader>L", function()
harpoon:list():clear()
end)
vim.keymap.set("n", "<M-h>", function()
harpoon:list():prev()
end)
vim.keymap.set("n", "<M-l>", function()
harpoon:list():next()
end)
number_switch(harpoon)
end,
}
+51
View File
@@ -0,0 +1,51 @@
return {
"neovim/nvim-lspconfig",
config = function()
vim.keymap.set("n", "gd", function()
vim.lsp.buf.definition()
end, opts)
vim.keymap.set("n", "gr", function()
vim.lsp.buf.references()
end, opts)
vim.keymap.set("n", "<C-i>", function()
vim.diagnostic.open_float()
end, opts)
vim.keymap.set("n", "K", function()
vim.lsp.buf.hover()
end, opts)
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("v", "<leader>ca", vim.lsp.buf.code_action, opts)
local python_utils = require("functions.python")
local python_path = python_utils.get_python_path()
vim.lsp.config("ruff", {
root_markers = { ".git" },
settings = { interpreter = python_path },
})
vim.lsp.enable("ruff")
vim.lsp.config("basedpyright", {
root_markers = { ".git" },
python = { pythonPath = python_path },
settings = {
basedpyright = {
analysis = {
typeCheckingMode = "standard",
diagnosticSeverityOverrides = {
reportUnusedImport = "none",
},
},
},
},
})
vim.lsp.enable("basedpyright")
vim.lsp.config("bashls", {
cmd = { "bash-language-server", "start" },
filetypes = { "bash", "sh" },
})
vim.lsp.enable("bashls")
end,
}
+7
View File
@@ -0,0 +1,7 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("lualine").setup()
end,
}
+27
View File
@@ -0,0 +1,27 @@
return {
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
local tree = require("neo-tree")
tree.setup({
document_symbols = {
custom_kinds = {},
},
window = {
width = 30,
mappings = {
["l"] = "open",
["h"] = "close_node",
["<Right>"] = "open",
["<Left>"] = "close_node",
},
},
})
vim.keymap.set("n", "<F2>", "<CMD>Neotree toggle<CR>")
end,
}
@@ -0,0 +1,5 @@
return {
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" },
opts = {},
}
+14
View File
@@ -0,0 +1,14 @@
return {
-- "crispgm/nvim-tabline",
-- config = true,
-- require("tabline").setup({
-- show_index = true,
-- show_modify = true,
-- show_icon = true,
-- fnamemodify = ":t",
-- modify_indicator = "*",
-- no_name = "Без вымени",
-- brackets = { "[", "]" },
-- inactive_tab_max_length = 0,
-- }),
}
+19
View File
@@ -0,0 +1,19 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"gbprod/yanky.nvim",
},
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, opts)
vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts)
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
require("yanky").setup()
require("telescope").load_extension("yank_history")
vim.keymap.set("n", "<leader>fy", function()
vim.cmd.Telescope("yank_history")
end, opts)
end,
}
+26
View File
@@ -0,0 +1,26 @@
return {
"nvim-treesitter/nvim-treesitter",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"python",
"go",
"kotlin",
"dart",
"lua",
"bash",
"json",
"yaml",
"markdown",
},
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
})
end,
}
+3
View File
@@ -0,0 +1,3 @@
return {
"lambdalisue/vim-suda",
}