From 49e5fa571005da10d156d14f82e145afaf96214e Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 16 May 2025 22:33:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git/ignore | 2 + nvim/colors/neonxp.lua | 142 ++++++++++++++++++++++++++++ nvim/init.lua | 10 +- nvim/lazy-lock.json | 11 ++- nvim/lua/autocommands.lua | 25 ++--- nvim/lua/commands.lua | 6 ++ nvim/lua/keymaps.lua | 6 -- nvim/lua/lualine/themes/base16.lua | 128 +++++++++++++++++++++++++ nvim/lua/options.lua | 10 +- nvim/lua/plugins.lua | 4 +- nvim/lua/plugins/dap.lua | 138 ++++----------------------- nvim/lua/plugins/dapui.lua | 4 +- nvim/lua/plugins/lualine.lua | 3 +- nvim/lua/plugins/telescope.lua | 53 ++++++++--- nvim/lua/plugins/theme.lua | 21 ---- nvim/lua/plugins/tree.lua | 41 +++++++- nvim/lua/theme/asset/hsv-to-rgb.lua | 29 ++++++ nvim/lua/theme/colors.lua | 68 +++++++++++++ nvim/lua/theme/modifiers.lua | 16 ++++ zsh/zshrc | 4 +- 20 files changed, 529 insertions(+), 192 deletions(-) create mode 100644 nvim/colors/neonxp.lua create mode 100644 nvim/lua/commands.lua create mode 100644 nvim/lua/lualine/themes/base16.lua delete mode 100644 nvim/lua/plugins/theme.lua create mode 100644 nvim/lua/theme/asset/hsv-to-rgb.lua create mode 100644 nvim/lua/theme/colors.lua create mode 100644 nvim/lua/theme/modifiers.lua diff --git a/git/ignore b/git/ignore index fd81e8c..8d8a702 100644 --- a/git/ignore +++ b/git/ignore @@ -28,6 +28,8 @@ Thumbs.db # Ides .Idea +Session.vim + go.work go.work.sum diff --git a/nvim/colors/neonxp.lua b/nvim/colors/neonxp.lua new file mode 100644 index 0000000..1d7ab9f --- /dev/null +++ b/nvim/colors/neonxp.lua @@ -0,0 +1,142 @@ +local function SetHl(group, mod, fg, bg) + + local fmt="highlight %s gui=%s cterm=%s guifg=%s ctermfg=%s guibg=%s ctermbg=%s" + vim.cmd(fmt:format(group, mod[1], mod[2], fg[1], fg[2], bg[1], bg[2])) +end +local colors = require("theme.colors") +local mods = require("theme.modifiers") + +vim.cmd([[hi normal guibg=NONE ctermbg=NONE]]) + +-- VIM - INTERFACE +------------------ +SetHl("StatusLine", mods["bold"], colors["none"], colors["black_l"]) +SetHl("StatusLineNC", mods["none"], colors["none"], colors["black_l"]) +SetHl("TabLineSel", mods["bold"], colors["none"], colors["black_l"]) +SetHl("WinSeparator", mods["none"], colors["gray"], colors["none"]) +SetHl("Pmenu", mods["none"], colors["none"], colors["black_l"]) +SetHl("PmenuSel", mods["bold"], colors["none"], colors["black_l"]) +SetHl("PmenuThumb", mods["none"], colors["none"], colors["gray_dd"]) +SetHl("FloatBorder", mods["none"], colors["gray"], colors["none"]) + +-- VIM - GENERAL TEXT +--------------------- +SetHl("Visual", mods["bold"], colors["none"], colors["black_l"]) +SetHl("Normal", mods["none"], colors["white"], colors["none"]) +SetHl("NormalFloat", mods["none"], colors["white"], colors["none"]) +SetHl("NonText", mods["none"], colors["gray"], colors["none"]) +SetHl("SpecialKey", mods["none"], colors["gray"], colors["none"]) +SetHl("Conceal", mods["none"], colors["gray"], colors["none"]) +SetHl("Folded", mods["none"], colors["none"], colors["none"]) +SetHl("MatchParen", mods["bold"], colors["yellow_l"], colors["black_l"]) +SetHl("Search", mods["bold"], colors["yellow_l"], colors["black_l"]) +SetHl("CurSearch", mods["bold"], colors["chartreuse_l"], colors["black_l"]) +SetHl("CursorLine", mods["bold"], colors["none"], colors["black_ll"]) +SetHl("CursorColumn", mods["bold"], colors["none"], colors["black_l"]) +SetHl("ColorColumn", mods["bold"], colors["none"], colors["black_ll"]) + +-- VIM - INFO TEXT +------------------ +SetHl("LineNr", mods["italic"], colors["gray"], colors["none"]) +SetHl("SignColumn", mods["bold"], colors["gray"], colors["none"]) +SetHl("DiagnosticError", mods["none"], colors["red_l"], colors["none"]) +SetHl("DiagnosticWarn", mods["none"], colors["orange_l"], colors["none"]) +SetHl("DiagnosticOK", mods["none"], colors["green_l"], colors["none"]) +SetHl("DiagnosticInfo", mods["none"], colors["royal_l"], colors["none"]) +SetHl("DiffAdd", mods["none"], colors["green_l"], colors["black_l"]) +SetHl("DiffChange", mods["none"], colors["orange_l"], colors["black_l"]) +SetHl("DiffDelete", mods["none"], colors["red_l"], colors["black_l"]) +SetHl("DiffText", mods["none"], colors["royal_l"], colors["black_l"]) +SetHl("QuickFixLine", mods["none"], colors["royal_l"], colors["none"]) + +-- VIM - MESSAGE TEXT +--------------------- +SetHl("ErrorMsg", mods["none"], colors["red_l"], colors["none"]) +SetHl("WarningMsg", mods["none"], colors["orange_l"], colors["none"]) +SetHl("Title", mods["bold"], colors["white"], colors["none"]) +SetHl("ModeMsg", mods["none"], colors["turquoise_l"], colors["none"]) +SetHl("MoreMsg", mods["none"], colors["turquoise_l"], colors["none"]) +SetHl("Question", mods["none"], colors["royal_l"], colors["none"]) + +-- VIM - FILE SYSTEM +-------------------- +SetHl("Directory", mods["none"], colors["royal_l"], colors["none"]) +SetHl("netrwClassify", mods["none"], colors["royal_d"], colors["none"]) +SetHl("netrwExe", mods["none"], colors["turquoise_l"], colors["none"]) + +-- CODE - VIM GENERAL +--------------------- +SetHl("PreProc", mods["none"], colors["purple_l"], colors["none"]) +SetHl("PreCondit", mods["none"], colors["purple_l"], colors["none"]) +SetHl("Statement", mods["none"], colors["cyan_l"], colors["none"]) +SetHl("Type", mods["none"], colors["green_l"], colors["none"]) +SetHl("Identifier", mods["none"], colors["royal_l"], colors["none"]) +SetHl("Function", mods["none"], colors["turquoise_l"], colors["none"]) +SetHl("Delimiter", mods["none"], colors["gray_ll"], colors["none"]) +SetHl("Operator", mods["none"], colors["white"], colors["none"]) +SetHl("Constant", mods["none"], colors["white"], colors["none"]) +SetHl("Special", mods["none"], colors["white_dd"], colors["none"]) +SetHl("String", mods["italic"], colors["white"], colors["none"]) +SetHl("Comment", mods["italic"], colors["gray"], colors["none"]) +SetHl("SpecialComment", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("Todo", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("Debug", mods["italic"], colors["gray"], colors["none"]) +SetHl("Error", mods["none"], colors["red_l"], colors["none"]) +SetHl("Added", mods["none"], colors["green_l"], colors["none"]) +SetHl("Changed", mods["none"], colors["orange_l"], colors["none"]) +SetHl("Removed", mods["none"], colors["red_l"], colors["none"]) + +-- CODE - TREESITTER GENERAL +---------------------------- +SetHl("@variable", mods["none"], colors["royal_l"], colors["none"]) +SetHl("@constant", mods["none"], colors["royal_l"], colors["none"]) +SetHl("@function.builtin", mods["none"], colors["turquoise_l"], colors["none"]) +SetHl("@variable.builtin", mods["none"], colors["purple_l"], colors["none"]) +SetHl("@constant.builtin", mods["none"], colors["purple_l"], colors["none"]) + +-- CODE - TREESITTER BASH +------------------------- +SetHl("@variable.parameter.bash", mods["none"], colors["turquoise_d"], colors["none"]) +SetHl("@punctuation.special.bash", mods["none"], colors["royal_d"], colors["none"]) +SetHl("@character.special.bash", mods["none"], colors["purple_l"], colors["none"]) + +-- ADDON - LAZY +--------------- +SetHl("LazyH1", mods["bold"], colors["purple_l"], colors["none"]) +SetHl("LazyH2", mods["bold"], colors["turquoise_l"], colors["none"]) +SetHl("LazyComment", mods["none"], colors["turquoise_d"], colors["none"]) +SetHl("LazyButton", mods["none"], colors["white"], colors["none"]) +SetHl("LazyButtonActive", mods["none"], colors["turquoise_l"], colors["none"]) +SetHl("LazySpecial", mods["bold"], colors["turquoise_l"], colors["none"]) + +-- ADDON - LSPCMP +----------------- +SetHl("CmpItemKind", mods["italic"], colors["gray_l"], colors["none"]) +SetHl("CmpItemKindKeyword", mods["italic"], colors["cyan_l"], colors["none"]) +SetHl("CmpItemKindClass", mods["italic"], colors["yellow_l"], colors["none"]) +SetHl("CmpItemKindStruct", mods["italic"], colors["green_l"], colors["none"]) +SetHl("CmpItemKindEnum", mods["italic"], colors["salmon_l"], colors["none"]) +SetHl("CmpItemKindInterface", mods["italic"], colors["blue_l"], colors["none"]) +SetHl("CmpItemKindField", mods["italic"], colors["green_l"], colors["none"]) +SetHl("CmpItemKindUnit", mods["italic"], colors["salmon_l"], colors["none"]) +SetHl("CmpItemKindFile", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("CmpItemKindFunction", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("CmpItemKindMethod", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("CmpItemKindModule", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("CmpItemKindConstructor", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("CmpItemKindOperator", mods["italic"], colors["turquoise_l"], colors["none"]) +SetHl("CmpItemKindFolder", mods["italic"], colors["royal_l"], colors["none"]) +SetHl("CmpItemKindConstant", mods["italic"], colors["royal_l"], colors["none"]) +SetHl("CmpItemKindVariable", mods["italic"], colors["royal_l"], colors["none"]) +SetHl("CmpItemKindReference", mods["italic"], colors["royal_l"], colors["none"]) +SetHl("CmpItemKindParameter", mods["italic"], colors["royal_l"], colors["none"]) +SetHl("CmpItemKindEnumMember", mods["italic"], colors["royal_l"], colors["none"]) +SetHl("CmpItemKindSnippet", mods["italic"], colors["purple_l"], colors["none"]) + +-- ADDON - TELESCOPE +-------------------- +SetHl("TelescopeTitle", mods["bold"], colors["white"], colors["none"]) +SetHl("TelescopeBorder", mods["none"], colors["gray"], colors["none"]) +SetHl("TelescopePromptPrefix", mods["none"], colors["purple_l"], colors["none"]) + + diff --git a/nvim/init.lua b/nvim/init.lua index 2c2eb00..d4cea9c 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,7 +1,14 @@ 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 }) + 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" }, @@ -23,6 +30,7 @@ vim.cmd("filetype plugin indent on") require("options") require("plugins") require("keymaps") +require("commands") require("autocommands") require("lsp") require("dap") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index c2c4287..0049cd8 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,11 +1,12 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "auto-save.nvim": { "branch": "main", "commit": "29f793a3a7f98129387590269ffe3ad61ab5e509" }, + "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" }, + "conform.nvim": { "branch": "master", "commit": "2b2b30260203af3b93a7470ac6c8457ddd6e32d9" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "go.nvim": { "branch": "master", "commit": "37ec4d9be3edef64b725bfe29684e1fe019873bc" }, "goimpl.nvim": { "branch": "main", "commit": "2548d42c4db0645dea14f27e67c4b19b7030f1cf" }, @@ -21,17 +22,17 @@ "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, - "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" }, + "nvim-lspconfig": { "branch": "master", "commit": "5a137448fd921a0c5d3939cb75e60d21f64e4606" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-tree.lua": { "branch": "master", "commit": "e7d1b7dadc62fe2eccc17d814354b0a5688621ce" }, - "nvim-treesitter": { "branch": "master", "commit": "28d480e0624b259095e56f353ec911f9f2a0f404" }, + "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, "nvim-treesitter-context": { "branch": "master", "commit": "5c48b8ba1b0b7b25feb6e34e7eb293ea893aedc4" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "0e3be38005e9673d044e994b1e4b123adb040179" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "b0debd5c424969b4baeabdc8f54db3036c691732" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" }, - "onedark.nvim": { "branch": "master", "commit": "11de4da47f3e69cb70c3ae9816bd8af166cbe121" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "smartcolumn.nvim": { "branch": "main", "commit": "92f3773af80d674f1eb61e112dca79e2fa449fd1" }, + "telescope-project.nvim": { "branch": "master", "commit": "8e11df94419e444601c09828dadf70890484e443" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" } } diff --git a/nvim/lua/autocommands.lua b/nvim/lua/autocommands.lua index 48c94d9..1431693 100644 --- a/nvim/lua/autocommands.lua +++ b/nvim/lua/autocommands.lua @@ -88,23 +88,24 @@ vim.api.nvim_create_autocmd("BufEnter", { vim.api.nvim_create_autocmd({ "BufEnter", "BufAdd", "BufNew", "BufNewFile", "BufWinEnter" }, { group = vim.api.nvim_create_augroup("TS_FOLD_WORKAROUND", {}), callback = function() + vim.opt.foldlevelstart = 99 vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" end, }) vim.api.nvim_create_autocmd("FileType", { - pattern = "*", - callback = function(args) - local buf = args.buf - local ft = vim.bo[buf].filetype + pattern = "*", + callback = function(args) + local buf = args.buf + local ft = vim.bo[buf].filetype - if ft and ft ~= "" then - local has_parser, _ = pcall(vim.treesitter.language.get_lang, ft) - if has_parser then - pcall(vim.treesitter.start, buf, ft) - end - end - end + if ft and ft ~= "" then + local has_parser, _ = pcall(vim.treesitter.language.get_lang, ft) + if has_parser then + pcall(vim.treesitter.start, buf, ft) + end + end + end, }) vim.api.nvim_create_autocmd("User", { pattern = "TSUpdate", @@ -181,5 +182,5 @@ vim.api.nvim_create_autocmd("VimResized", { -- -- vim.api.nvim_create_autocmd("InsertLeave", { -- pattern = "*", --- command = "set relativenumber", +-- callback = "set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz", -- }) diff --git a/nvim/lua/commands.lua b/nvim/lua/commands.lua new file mode 100644 index 0000000..8a987b0 --- /dev/null +++ b/nvim/lua/commands.lua @@ -0,0 +1,6 @@ +vim.api.nvim_create_user_command("Lower", function() + vim.cmd([[normal! guaw]]) +end, { force = true }) +vim.api.nvim_create_user_command("Upper", function() + vim.cmd([[normal! gUaw]]) +end, { force = true }) diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua index c57ce97..44ec57a 100644 --- a/nvim/lua/keymaps.lua +++ b/nvim/lua/keymaps.lua @@ -44,19 +44,13 @@ end kmap("n", "tt", ":split:terminal:startinsert", { noremap = true, silent = true }) -- {{{ LSP функции -kmap("n", "e", vim.diagnostic.open_float, { noremap = true, silent = true, desc = "Show diagnostics" }) - kmap("n", "d[", vim.diagnostic.goto_prev, { noremap = true, silent = true, desc = "Previous diagnostic" }) kmap("n", "d]", vim.diagnostic.goto_next, { noremap = true, silent = true, desc = "Next diagnostic" }) kmap("n", "gD", vim.lsp.buf.declaration, { noremap = true, silent = true, desc = "Go to declaration" }) kmap("n", "gd", vim.lsp.buf.definition, { noremap = true, silent = true, desc = "Go to definition" }) -kmap("n", "D", vim.lsp.buf.type_definition, { noremap = true, silent = true, desc = "Type definition" }) -kmap("n", "gr", vim.lsp.buf.references, { noremap = true, silent = true, desc = "Find references" }) - kmap("n", "K", vim.lsp.buf.hover, { noremap = true, silent = true, desc = "Show documentation" }) -kmap("n", "gi", vim.lsp.buf.implementation, { noremap = true, silent = true, desc = "Go to implementation" }) kmap("n", "", vim.lsp.buf.signature_help, { noremap = true, silent = true, desc = "Signature help" }) kmap( diff --git a/nvim/lua/lualine/themes/base16.lua b/nvim/lua/lualine/themes/base16.lua new file mode 100644 index 0000000..03f4f35 --- /dev/null +++ b/nvim/lua/lualine/themes/base16.lua @@ -0,0 +1,128 @@ + +local modules = require('lualine_require').lazy_require { notices = 'lualine.utils.notices' } + +local function add_notice(notice) + modules.notices.add_notice('theme(base16): ' .. notice) +end + +local function setup(colors) + local theme = { + normal = { + a = { fg = colors.bg, bg = colors.normal }, + b = { fg = colors.light_fg, bg = colors.alt_bg }, + c = { fg = colors.fg, bg = colors.bg }, + }, + replace = { + a = { fg = colors.bg, bg = colors.replace }, + b = { fg = colors.light_fg, bg = colors.alt_bg }, + }, + insert = { + a = { fg = colors.bg, bg = colors.insert }, + b = { fg = colors.light_fg, bg = colors.alt_bg }, + }, + visual = { + a = { fg = colors.bg, bg = colors.visual }, + b = { fg = colors.light_fg, bg = colors.alt_bg }, + }, + inactive = { + a = { fg = colors.dark_fg, bg = colors.bg }, + b = { fg = colors.dark_fg, bg = colors.bg }, + c = { fg = colors.dark_fg, bg = colors.bg }, + }, + } + + theme.command = theme.normal + theme.terminal = theme.insert + + return theme +end + +local function setup_default() + return setup { + bg = '#282a2e', + alt_bg = '#373b41', + dark_fg = '#969896', + fg = '#b4b7b4', + light_fg = '#c5c8c6', + normal = '#81a2be', + insert = '#b5bd68', + visual = '#b294bb', + replace = '#de935f', + } +end + +local function setup_base16_nvim() + -- Continue to load nvim-base16 + local loaded, base16 = pcall(require, 'base16-colorscheme') + + if not loaded then + add_notice( + 'nvim-base16 is not currently present in your runtimepath, make sure it is properly installed,' + .. ' fallback to default colors.' + ) + + return nil + end + + if not base16.colors and not vim.env.BASE16_THEME then + add_notice( + 'nvim-base16 is not loaded yet, you should update your configuration to load it before lualine' + .. ' so that the colors from your colorscheme can be used, fallback to "tomorrow-night" theme.' + ) + elseif not base16.colors and not base16.colorschemes[vim.env.BASE16_THEME] then + add_notice( + 'The colorscheme "%s" defined by the environment variable "BASE16_THEME" is not handled by' + .. ' nvim-base16, fallback to "tomorrow-night" theme.' + ) + end + + local colors = base16.colors or base16.colorschemes[vim.env.BASE16_THEME or 'tomorrow-night'] + + return setup { + bg = colors.base01, + alt_bg = colors.base02, + dark_fg = colors.base03, + fg = colors.base04, + light_fg = colors.base05, + normal = colors.base0D, + insert = colors.base0B, + visual = colors.base0E, + replace = colors.base09, + } +end + +local function setup_base16_vim() + -- Check if tinted-theming/base16-vim is already loaded + if vim.g.base16_gui00 and vim.g.base16_gui0F then + return setup { + bg = vim.g.base16_gui01, + alt_bg = vim.g.base16_gui02, + dark_fg = vim.g.base16_gui03, + fg = vim.g.base16_gui04, + light_fg = vim.g.base16_gui05, + normal = vim.g.base16_gui0D, + insert = vim.g.base16_gui0B, + visual = vim.g.base16_gui0E, + replace = vim.g.base16_gui09, + } + end + + -- base16-vim has been renamed to tinted-vim along with colors + -- context: https://github.com/nvim-lualine/lualine.nvim/pull/1352 + if vim.g.tinted_gui00 and vim.g.tinted_gui0F then + return setup { + bg = vim.g.tinted_gui01, + alt_bg = vim.g.tinted_gui02, + dark_fg = vim.g.tinted_gui03, + fg = vim.g.tinted_gui04, + light_fg = vim.g.tinted_gui05, + normal = vim.g.tinted_gui0D, + insert = vim.g.tinted_gui0B, + visual = vim.g.tinted_gui0E, + replace = vim.g.tinted_gui09, + } + end + return nil +end + +return setup_base16_vim() or setup_base16_nvim() or setup_default() diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index c912b32..1b56650 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -32,15 +32,11 @@ local options = { scrolloff = 8, sidescrolloff = 8, syntax = "on", - foldmethod = "expr", - foldmarker = "{{{,}}}", - --foldexpr = "v:lua.vim.treesitter.foldexpr()", - foldexpr = "nvim_treesitter#foldexpr()", - foldlevelstart = 99, - foldenable = true, + foldenable = false, scrolloff = 999, so = vim.fn.floor(vim.fn.winheight(0) / 2), guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,i:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175", + langmap = "ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯЖ;ABCDEFGHIJKLMNOPQRSTUVWXYZ:,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz", } vim.opt.formatoptions:append({ r = true, o = true }) vim.opt.shortmess:append("c") @@ -56,3 +52,5 @@ vim.filetype.add({ templ = "templ", }, }) + +vim.cmd([[colorscheme neonxp]]) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 0f46ea6..2e6b946 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -5,7 +5,6 @@ require("lazy").setup({ build = "cd lua/fzy && make", }, { "neovim/nvim-lspconfig" }, - -- { "Snyssfx/goerr-nvim" }, { "lukas-reineke/indent-blankline.nvim", main = "ibl", @@ -33,7 +32,7 @@ require("lazy").setup({ current = "← ", below = "↖ ", }, - floating_window = false, + floating_window = true, }, }, { @@ -77,7 +76,6 @@ require("lazy").setup({ }, }, require("plugins.autosave"), - require("plugins.theme"), require("plugins.cmp"), require("plugins.treesitter"), require("plugins.tree"), diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua index 58cc7f9..da87df9 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -21,59 +21,8 @@ local function setup_go_configuration(dap, configs) type = "go", name = "Debug", request = "launch", - program = "${file}", - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug (Arguments)", - request = "launch", - program = "${file}", - args = get_arguments, - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug (Arguments & Build Flags)", - request = "launch", - program = "${file}", - args = get_arguments, - buildFlags = get_build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug Package", - request = "launch", - program = "${fileDirname}", - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Attach", - mode = "local", - request = "attach", - processId = filtered_pick_process, - buildFlags = configs.delve.build_flags, - }, - { - type = "go", - name = "Debug test", - request = "launch", - mode = "test", - program = "${file}", - buildFlags = configs.delve.build_flags, - outputMode = configs.delve.output_mode, - }, - { - type = "go", - name = "Debug test (go.mod)", - request = "launch", - mode = "test", - program = "./${relativeFileDirname}", + program = "${workspaceFolder}", + args = {}, buildFlags = configs.delve.build_flags, outputMode = configs.delve.output_mode, }, @@ -164,61 +113,40 @@ return { silent = true, }, { - "", + "", -- S-F5 + function() + require("dap").restart() + end, + silent = true, + }, + { + "", -- C-F5 + function() + require("dap").terminate() + end, + silent = true, + }, + { + "", function() require("dap").step_over() end, silent = true, }, { - "", + "", function() require("dap").step_into() end, silent = true, }, { - "", + "", -- S-F7 function() require("dap").step_out() end, silent = true, }, - { - "dc", - function() - require("dap").continue() - end, - silent = true, - }, - { - "so", - function() - require("dap").step_over() - end, - silent = true, - }, - { - "si", - function() - require("dap").step_into() - end, - silent = true, - }, - { - "st", - function() - require("dap").step_out() - end, - silent = true, - }, - { - "b", - function() - require("dap").toggle_breakpoint() - end, - silent = true, - }, { "", function() @@ -226,33 +154,5 @@ return { end, silent = true, }, - { - "B", - function() - require("dap").set_breakpoint() - end, - silent = true, - }, - { - "lp", - function() - require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) - end, - silent = true, - }, - { - "dr", - function() - require("dap").repl.open() - end, - silent = true, - }, - { - "dl", - function() - require("dap").run_last() - end, - silent = true, - }, }, } diff --git a/nvim/lua/plugins/dapui.lua b/nvim/lua/plugins/dapui.lua index b63e2ac..93df74b 100644 --- a/nvim/lua/plugins/dapui.lua +++ b/nvim/lua/plugins/dapui.lua @@ -6,7 +6,7 @@ return { }, keys = { { - "du", + "", function() require("dapui").toggle() end, @@ -27,7 +27,7 @@ return { silent = true, }, { - "ds", + "", function() local widgets = require("dap.ui.widgets") widgets.centered_float(widgets.scopes) diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index 19bcb8e..c35b162 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -1,9 +1,10 @@ +local colors = require("theme.colors") return { "nvim-lualine/lualine.nvim", opts = { options = { icons_enabled = true, - theme = "onedark", + theme = "auto", component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, disabled_filetypes = { diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 2348275..aabcd9c 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,19 +1,50 @@ return { "nvim-telescope/telescope.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - pickers = { - buffers = { - initial_mode = "normal", - }, - }, - defaults = { - file_ignore_patterns = { "vendor", "node_modules" }, - }, + 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 = { + [""] = actions.close, + }, + n = { + [""] = actions.close, + }, + }, + }, + }) + end, keys = { { "ff", "Telescope find_files", noremap = true, silent = true, desc = "Find files" }, { "fg", "Telescope live_grep", noremap = true, silent = true, desc = "Live grep" }, - { "fb", "Telescope buffers", noremap = true, silent = true, desc = "Find buffers" }, + { + "fb", + "Telescope current_buffer_fuzzy_fund", + noremap = true, + silent = true, + desc = "Find current file", + }, + { "", "Telescope buffers", noremap = true, silent = true, desc = "Find buffers" }, + { "gc", "Telescope git_commits", noremap = true, silent = true }, + { "gs", "Telescope git_status", noremap = true, silent = true }, + { "ch", "Telescope commands_history", noremap = true, silent = true }, + { "e", "Telescope diagnostics", noremap = true, silent = true }, + { "gi", "Telescope lsp_implementations", noremap = true, silent = true }, + { "gr", "Telescope lsp_references", noremap = true, silent = true }, }, } diff --git a/nvim/lua/plugins/theme.lua b/nvim/lua/plugins/theme.lua deleted file mode 100644 index 72a6f81..0000000 --- a/nvim/lua/plugins/theme.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - "navarasu/onedark.nvim", - priority = 1000, -- make sure to load this before all the other start plugins - config = function() - require("onedark").setup({ - style = "darker", - colors = { - bright_orange = "#ff8800", -- define a new color - }, - highlights = { - -- ["@lsp.type.keyword"] = { fg = "$green", fmt = "bold,underline" }, - -- ["@lsp.type.property"] = { fg = "$bright_orange", bg = "#00ff00", fmt = "bold" }, - -- ["@lsp.type.function"] = { fg = "#0000ff", sp = "$cyan", fmt = "underline,italic" }, - -- ["@lsp.type.method"] = { link = "@function" }, - -- To add language specific config - -- ["@lsp.type.variable.go"] = { fg = "none" }, - }, - }) - require("onedark").load() - end, -} diff --git a/nvim/lua/plugins/tree.lua b/nvim/lua/plugins/tree.lua index 4807024..94d1f11 100644 --- a/nvim/lua/plugins/tree.lua +++ b/nvim/lua/plugins/tree.lua @@ -1,18 +1,49 @@ +local HEIGHT_RATIO = 0.8 +local WIDTH_RATIO = 0.5 + return { "nvim-tree/nvim-tree.lua", dependencies = { "nvim-tree/nvim-web-devicons", }, opts = { + disable_netrw = true, + hijack_netrw = true, hijack_directories = { - enable = true, -- Перехватывать открытие директорий - auto_open = true, -- Автоматически открывать при старте + enable = true, + auto_open = true, }, sort = { sorter = "case_sensitive", }, view = { - width = 30, + -- width = 30, + float = { + enable = true, + open_win_config = function() + local screen_w = vim.opt.columns:get() + local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + local window_w = screen_w * WIDTH_RATIO + local window_h = screen_h * HEIGHT_RATIO + local window_w_int = math.floor(window_w) + local window_h_int = math.floor(window_h) + local center_x = (screen_w - window_w) / 2 + local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() + return { + border = "rounded", + relative = "editor", + row = center_y, + col = center_x, + width = window_w_int, + height = window_h_int, + } + end, + }, + width = function() + return math.floor(vim.opt.columns:get() * WIDTH_RATIO) + end, + adaptive_size = true, + centralize_selection = true, }, git = { enable = true, @@ -29,9 +60,11 @@ return { filters = { dotfiles = false, }, + sync_root_with_cwd = true, + respect_buf_cwd = true, update_focused_file = { enable = true, - update_root = false, + update_root = true, }, }, keys = { diff --git a/nvim/lua/theme/asset/hsv-to-rgb.lua b/nvim/lua/theme/asset/hsv-to-rgb.lua new file mode 100644 index 0000000..5a63f98 --- /dev/null +++ b/nvim/lua/theme/asset/hsv-to-rgb.lua @@ -0,0 +1,29 @@ +local function HsvToRgb(h, s, v) + + s = s / 100.0 + v = v / 100.0 + h = h / 60.0 + + local i = math.floor(h) % 6 + local f = h - math.floor(h) + local p = v * (1.0 - s) + local q = v * (1.0 - f * s) + local t = v * (1.0 - (1.0 - f) * s) + + local r, g, b = 0, 0, 0 + + if i == 0 then r, g, b = v, t, p + elseif i == 1 then r, g, b = q, v, p + elseif i == 2 then r, g, b = p, v, t + elseif i == 3 then r, g, b = p, q, v + elseif i == 4 then r, g, b = t, p, v + else r, g, b = v, p, q + end + + r = math.floor(r * 255 + 0.5) + g = math.floor(g * 255 + 0.5) + b = math.floor(b * 255 + 0.5) + + return string.format("#%02x%02x%02x", r, g, b) +end +return HsvToRgb diff --git a/nvim/lua/theme/colors.lua b/nvim/lua/theme/colors.lua new file mode 100644 index 0000000..6197328 --- /dev/null +++ b/nvim/lua/theme/colors.lua @@ -0,0 +1,68 @@ +local HsvToRgb = require("theme.asset.hsv-to-rgb") +local colors = { + + black = {HsvToRgb(0, 0, 0), 0},--0 Black + black_l = {HsvToRgb(0, 0, 10), 0}, + black_ll = {HsvToRgb(0, 0, 20), 0}, + + gray_dd = {HsvToRgb(0, 0, 30), 8},--8 DarkGray + gray_d = {HsvToRgb(0, 0, 40), 8}, + gray = {HsvToRgb(0, 0, 50), 7},--7 Gray + gray_l = {HsvToRgb(0, 0, 60), 7}, + gray_ll = {HsvToRgb(0, 0, 70), 7}, + + white_dd = {HsvToRgb(0, 0, 80), 15},--15 White + white_d = {HsvToRgb(0, 0, 90), 15}, + white = {HsvToRgb(0, 0, 100), 15}, + + red_d = {HsvToRgb(0, 100, 75), 12},--12 Red + red = {HsvToRgb(0, 100, 100), 12}, + red_l = {HsvToRgb(0, 75, 100), 12}, + + orange_d = {HsvToRgb(30, 100, 75), 4},--4 DarkRed + orange = {HsvToRgb(30, 100, 100), 4}, + orange_l = {HsvToRgb(30, 75, 100), 4}, + + yellow_d = {HsvToRgb(60, 100, 75), 14},--14 Yellow + yellow = {HsvToRgb(60, 100, 100), 14}, + yellow_l = {HsvToRgb(60, 75, 100), 14}, + + chartreuse_d = {HsvToRgb(90, 100, 75), 6},--6 DarkYellow + chartreuse = {HsvToRgb(90, 100, 100), 6}, + chartreuse_l = {HsvToRgb(90, 75, 100), 6}, + + green_d = {HsvToRgb(120, 100, 75), 10},--10 Green + green = {HsvToRgb(120, 100, 100), 10}, + green_l = {HsvToRgb(120, 75, 100), 10}, + + turquoise_d = {HsvToRgb(150, 100, 75), 2},--2 DarkGreen + turquoise = {HsvToRgb(150, 100, 100), 2}, + turquoise_l = {HsvToRgb(150, 75, 100), 2}, + + cyan_d = {HsvToRgb(180, 100, 75), 11},--11 Cyan + cyan = {HsvToRgb(180, 100, 100), 11}, + cyan_l = {HsvToRgb(180, 75, 100), 11}, + + royal_d = {HsvToRgb(210, 100, 75), 3},--3 DarkCyan + royal = {HsvToRgb(210, 100, 100), 3}, + royal_l = {HsvToRgb(210, 75, 100), 3}, + + blue_d = {HsvToRgb(240, 100, 75), 9},--9 Blue + blue = {HsvToRgb(240, 100, 100), 9}, + blue_l = {HsvToRgb(240, 75, 100), 9}, + + purple_d = {HsvToRgb(270, 100, 75), 1},--1 DarkBlue + purple = {HsvToRgb(270, 100, 100), 1}, + purple_l = {HsvToRgb(270, 75, 100), 1}, + + pink_d = {HsvToRgb(300, 100, 75), 13},--13 Magenta + pink = {HsvToRgb(300, 100, 100), 13}, + pink_l = {HsvToRgb(300, 75, 100), 13}, + + salmon_d = {HsvToRgb(330, 100, 75), 5},--5 DarkMagenta + salmon = {HsvToRgb(330, 100, 100), 5}, + salmon_l = {HsvToRgb(330, 75, 100), 5}, + + none = {"NONE", "NONE"} +} +return colors diff --git a/nvim/lua/theme/modifiers.lua b/nvim/lua/theme/modifiers.lua new file mode 100644 index 0000000..5f5b853 --- /dev/null +++ b/nvim/lua/theme/modifiers.lua @@ -0,0 +1,16 @@ +local mods = { + + bold = {"bold", "bold"}, + italic = {"italic", "italic"}, + underline = {"underline", "underline"}, + underdouble = {"underdouble", "underdouble"}, + underdoted = {"underdoted", "underdoted"}, + underdashed = {"underdashed", "underdashed"}, + undercurl = {"undercurl", "undercurl"}, + reverse = {"reverse", "reverse"}, + standout = {"standout", "standout"}, + altfont = {"altfont", "altfont"}, + strikethrough = {"strikethrough", "strikethrough"}, + none = {"NONE", "NONE"} +} +return mods diff --git a/zsh/zshrc b/zsh/zshrc index 9e473c4..3bf62db 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -13,6 +13,8 @@ source ~/.config/zsh/p10k/powerlevel10k.zsh-theme source ~/.config/zsh/conf.d/*.zsh source ~/.config/zsh/termsupport.zsh source ~/.config/zsh/title.zsh +foreground () { fg } +zle -N foreground antigen bundle zsh-users/zsh-syntax-highlighting antigen bundle zsh-users/zsh-history-substring-search @@ -146,7 +148,7 @@ bindkey "^[[1;5D" backward-word bindkey "^[[1;5C" forward-word bindkey "^H" backward-kill-word # delete previous word with ctrl+backspace bindkey "^[[Z" undo # Shift+tab undo last action - +bindkey "^z" foreground # ctrl + space accept suggestion bindkey "^ " autosuggest-accept # }}}