From aaf079c4f469bfc6f9a3c2b55da46e347ca2cd61 Mon Sep 17 00:00:00 2001 From: fox Date: Sat, 11 Oct 2025 22:41:24 +0500 Subject: [PATCH] add --- nvim/.gitignore | 8 ++++ nvim/.neoconf.json | 15 ++++++++ nvim/init.lua | 23 +++++++++++ nvim/lazy-lock.json | 21 +++++++++++ nvim/lua/config/binds.lua | 5 +++ nvim/lua/config/lazy.lua | 12 ++++++ nvim/lua/config/options.lua | 39 +++++++++++++++++++ nvim/lua/plugins/alpha.lua | 9 +++++ nvim/lua/plugins/autoclose.lua | 8 ++++ nvim/lua/plugins/barbar.lua | 17 +++++++++ nvim/lua/plugins/base16.lua | 34 +++++++++++++++++ nvim/lua/plugins/colorizer.lua | 8 ++++ nvim/lua/plugins/lsp.lua | 9 +++++ nvim/lua/plugins/lualine.lua | 67 +++++++++++++++++++++++++++++++++ nvim/lua/plugins/neotree.lua | 12 ++++++ nvim/lua/plugins/noice.lua | 20 ++++++++++ nvim/lua/plugins/telescope.lua | 8 ++++ nvim/lua/plugins/toggleterm.lua | 10 +++++ nvim/lua/plugins/treesitter.lua | 29 ++++++++++++++ nvim/lua/plugins/yuck.lua | 3 ++ 20 files changed, 357 insertions(+) create mode 100644 nvim/.gitignore create mode 100644 nvim/.neoconf.json create mode 100644 nvim/init.lua create mode 100644 nvim/lazy-lock.json create mode 100644 nvim/lua/config/binds.lua create mode 100644 nvim/lua/config/lazy.lua create mode 100644 nvim/lua/config/options.lua create mode 100644 nvim/lua/plugins/alpha.lua create mode 100644 nvim/lua/plugins/autoclose.lua create mode 100644 nvim/lua/plugins/barbar.lua create mode 100644 nvim/lua/plugins/base16.lua create mode 100644 nvim/lua/plugins/colorizer.lua create mode 100644 nvim/lua/plugins/lsp.lua create mode 100644 nvim/lua/plugins/lualine.lua create mode 100644 nvim/lua/plugins/neotree.lua create mode 100644 nvim/lua/plugins/noice.lua create mode 100644 nvim/lua/plugins/telescope.lua create mode 100644 nvim/lua/plugins/toggleterm.lua create mode 100644 nvim/lua/plugins/treesitter.lua create mode 100644 nvim/lua/plugins/yuck.lua diff --git a/nvim/.gitignore b/nvim/.gitignore new file mode 100644 index 0000000..cc5457a --- /dev/null +++ b/nvim/.gitignore @@ -0,0 +1,8 @@ +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/nvim/.neoconf.json b/nvim/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..841b80d --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,23 @@ +-- 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.opt.termguicolors = true + + +-- Load default configs +require("config.lazy") +require("config.options") +require("config.binds") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..4d45a68 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,21 @@ +{ + "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" }, + "autoclose.nvim": { "branch": "main", "commit": "3f86702b54a861a17d7994b2e32a7c648cb12fb1" }, + "barbar.nvim": { "branch": "master", "commit": "549ee11d97057eae207bafa2c23c315942cca097" }, + "base16-nvim": { "branch": "master", "commit": "0f2863e28d66a65129b6a277e0652736f9ad4fad" }, + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lua-language-server": { "branch": "master", "commit": "24b9faa66332fca9f0df6e552ae9f3ca24c01821" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f1deac7ecec88c28a250d890ba7bb35843e69cbd" }, + "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-lspconfig": { "branch": "master", "commit": "3e89e4973d784e1c966517e528b3a30395403fa7" }, + "nvim-notify": { "branch": "master", "commit": "397c7c1184745fca649e5104de659e6392ef5a4d" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" } +} diff --git a/nvim/lua/config/binds.lua b/nvim/lua/config/binds.lua new file mode 100644 index 0000000..dbe1e80 --- /dev/null +++ b/nvim/lua/config/binds.lua @@ -0,0 +1,5 @@ +vim.keymap.set('n', 'mn', ':Neotree dir=./', { desc = "Open NeoTree" }) +vim.keymap.set('n', 'mt', ':ToggleTerm size=15', { desc = "Terminal" }) + + + diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..acf7c93 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,12 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + checker = { + enabled = true, + notify = false, + }, +}) + diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..46f25b4 --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,39 @@ +-- Нумерация строки +vim.opt.number = true + +-- Табуляция +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true + +-- Подсветка текущей строки +vim.opt.cursorline = true + +-- Прокрутка +vim.opt.scrolloff = 5 +vim.opt.sidescrolloff = 5 + +vim.opt.list = true +vim.opt.listchars = { + tab = '→ ', + trail = '·', + nbsp = '␣', + extends = '❯', + precedes = '❮' +} +vim.opt.fillchars = { eob = " " } + +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.incsearch = true +vim.opt.hlsearch = true +vim.opt.wrapscan = true +vim.opt.inccommand = "split" + +-- Выкл netrw для nvim-tree +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +vim.g.barbar_auto_setup = false + diff --git a/nvim/lua/plugins/alpha.lua b/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..002af24 --- /dev/null +++ b/nvim/lua/plugins/alpha.lua @@ -0,0 +1,9 @@ +return { + { + 'goolord/alpha-nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require'alpha'.setup(require'alpha.themes.startify'.config) + end + }, +} diff --git a/nvim/lua/plugins/autoclose.lua b/nvim/lua/plugins/autoclose.lua new file mode 100644 index 0000000..908903a --- /dev/null +++ b/nvim/lua/plugins/autoclose.lua @@ -0,0 +1,8 @@ +return { + { + "m4xshen/autoclose.nvim", + config = function() + require("autoclose").setup() + end + }, +} diff --git a/nvim/lua/plugins/barbar.lua b/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..70220d3 --- /dev/null +++ b/nvim/lua/plugins/barbar.lua @@ -0,0 +1,17 @@ +return { + { + "romgrk/barbar.nvim", + config = function() + require('barbar').setup({ + animation = true, + auto_hide = true, + tabpages = true, + clickable = true, + focus_on_close = 'left', + highlight_alternate = false, + highlight_inactive_file_icons = false, + highlight_visible = true, + }) + end + } +} diff --git a/nvim/lua/plugins/base16.lua b/nvim/lua/plugins/base16.lua new file mode 100644 index 0000000..625d539 --- /dev/null +++ b/nvim/lua/plugins/base16.lua @@ -0,0 +1,34 @@ +return { + { + "RRethy/base16-nvim", + config = function() + require('base16-colorscheme').setup({ + base00 = '#1d1d1d', + base01 = '#2a2a2a', + base02 = '#303030', + base03 = '#606060', -- comments 383838 + base04 = '#9a9996', + base05 = '#c0bfbc', + base06 = '#deddda', + base07 = '#f6f5f4', + base08 = '#ed333b', + base09 = '#ff7800', + base0A = '#ffa348', + base0B = '#57e389', + base0C = '#5bc8af', + base0D = '#62a0ea', + base0E = '#dc8add', + base0F = '#f66151', + }) + require('base16-colorscheme').with_config({ + telescope = true, + indentblankline = true, + notify = true, + ts_rainbow = true, + cmp = true, + illuminate = true, + dapui = true, + }) + end + } +} diff --git a/nvim/lua/plugins/colorizer.lua b/nvim/lua/plugins/colorizer.lua new file mode 100644 index 0000000..43b6d87 --- /dev/null +++ b/nvim/lua/plugins/colorizer.lua @@ -0,0 +1,8 @@ +return { + { + "norcalli/nvim-colorizer.lua", + config = function() + require'colorizer'.setup() + end + }, +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..905112a --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,9 @@ +return { + { + "neovim/nvim-lspconfig", + config = function() + require'lspconfig'.nil_ls.setup{} + end + }, + { "LuaLS/lua-language-server" } +} diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..e346fac --- /dev/null +++ b/nvim/lua/plugins/lualine.lua @@ -0,0 +1,67 @@ +return { + { + "nvim-lualine/lualine.nvim", + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('lualine').setup({ + options = { + globalstatus = true, + icons_enabled = true, + always_divide_middle = true, + theme = 'base16', + component_separators = { left = '', right = '', }, + section_separators = {left = '', right = '', }, + }, + sections = { + lualine_a = { + { + "mode", + separator = { left = "", right = "" }, + padding = 1, + }, + }, + lualine_b = { + { + "diagnostics", + separator = { right = "" }, + color = { bg = "#404040" }, + padding = 1.2, + sections = { + "error", + "warn", + "hint", + }, + }, + }, + lualine_c = { + 'buffers', + 'diff' + }, + lualine_x = { + 'encoding', + 'progress' + }, + lualine_y = { + { + 'fileformat', + separator = { left = "", right = "" }, + padding = 1.2, + }, + { + 'hostname', + padding = { + left = 0.1, + right = 1.8, + }, + }, + { + 'lsp_status', + padding = 2, + }, + }, + lualine_z = {''}, + }, + }) + end + } +} diff --git a/nvim/lua/plugins/neotree.lua b/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..835ede8 --- /dev/null +++ b/nvim/lua/plugins/neotree.lua @@ -0,0 +1,12 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", + }, + lazy = false, + }, +} diff --git a/nvim/lua/plugins/noice.lua b/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..816a7c6 --- /dev/null +++ b/nvim/lua/plugins/noice.lua @@ -0,0 +1,20 @@ +return { + { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + notify = { + enabled = false, + }, + messages = { + enabled = false, + }, + }) + end + }, +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..783ddb2 --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,8 @@ +return { + { + "nvim-telescope/telescope.nvim", + config = function() + require('telescope').setup() + end + }, +} diff --git a/nvim/lua/plugins/toggleterm.lua b/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..960efdd --- /dev/null +++ b/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,10 @@ +return { + { + "akinsho/toggleterm.nvim", + version = "*", + config = true, + config = function() + require('toggleterm').setup() + end + }, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..7ab98db --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,29 @@ +return { + { "nvim-treesitter/nvim-treesitter", + branch = 'master', + lazy = false, + build = ":TSUpdate", + config = function() + require'nvim-treesitter.configs'.setup({ + ensure_installed = { + "nix", + "yuck", + "css", + "scss", + "javascript", + "go", + "json", + "lua", + "c", + "cpp", + }, + auto_install = true, + ignore_install = {}, + hightlight = { + enable = true, + disable = {}, + }, + }) + end + } +} diff --git a/nvim/lua/plugins/yuck.lua b/nvim/lua/plugins/yuck.lua new file mode 100644 index 0000000..e1be327 --- /dev/null +++ b/nvim/lua/plugins/yuck.lua @@ -0,0 +1,3 @@ +return { + { "elkowar/yuck.vim" } +}