From 1e969b43a046a0d00c98dd4ecea444b2fac3755b Mon Sep 17 00:00:00 2001 From: mirzaev Date: Thu, 18 Dec 2025 23:12:43 +0700 Subject: [PATCH] even cooler --- install.sh | 57 +----------- lazy-lock.json | 10 +- lua/keymaps/plugins.lua | 182 ++++++++----------------------------- lua/keymaps/system.lua | 15 +-- lua/plugins/bufferline.lua | 13 ++- lua/plugins/coq.lua | 28 +----- lua/plugins/diaglist.lua | 6 +- lua/plugins/kommentary.lua | 10 +- lua/plugins/lspconfig.lua | 8 +- lua/plugins/lualine.lua | 40 ++++---- lua/plugins/neo-tree.lua | 6 +- lua/plugins/reticle.lua | 4 +- lua/plugins/tagbar.lua | 6 +- lua/plugins/telescope.lua | 9 +- lua/plugins/trouble.lua | 113 ++--------------------- lua/settings/lazy.lua | 6 +- lua/settings/system.lua | 4 +- lua/trouble.lua | 56 ++++++++++++ 18 files changed, 180 insertions(+), 393 deletions(-) create mode 100644 lua/trouble.lua diff --git a/install.sh b/install.sh index be75cb6..35da9b9 100755 --- a/install.sh +++ b/install.sh @@ -24,12 +24,6 @@ if test (string match -ri "ru" "$LANG") set_color -b red yellow; echo -n "[mirzaev/nvim] "; set_color brcyan; echo -n "[ИНФОРМАЦИЯ] "; set_color -o white; echo "Формат: install.sh [флаги]"; echo; set_color normal; set_color yellow; echo -n " -u "; set_color cyan; echo -n "--update "; set_color -d white; echo "Обновить все зависимости"; set_color normal; set_color yellow; echo -n " -f "; set_color cyan; echo -n "--force "; set_color -d white; echo "Не просить подтверждения"; set_color normal; set_color yellow; echo -n " -v "; set_color cyan; echo -n "--verbose "; set_color -d white; echo "Подключить TTY к буферу вывода"; set_color normal; set_color yellow; echo -n " -h "; set_color cyan; echo -n "--help "; set_color -d white; echo "Прислать это сообщение"; echo; set_color normal; set_color white; echo -n "Этот установщик работает только для "; set_color yellow; echo -n "fish "; set_color white; echo -n "и "; set_color red; echo -n "ubuntu"; case NVIM_NOT_INSTALLED set_color yellow; echo -n "[mirzaev/nvim] "; set_color red; echo -n "[ОШИБКА] "; set_color white; echo "NeoVim не установлен"; - case PACKER_INSTALL - set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить Packer? (\"wbthomason/packer.nvim\") (y/N) "; - case PACKER_EXISTS - set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Packer уже установлен. Переустановить? (y/N) "; - case PACKER_INSTALLED - set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[РАБОТА] "; set_color white; echo "Установлен Packer"; case LSP_INTELEPHENSE_INSTALL set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[ЗАДАЧА] "; set_color white; echo "Установить LSP-сервер для PHP? (\"bmewburn/vscode-intelephense\") (y/N) "; case LSP_INTELEPHENSE_INSTALLED @@ -87,12 +81,6 @@ else set_color yellow; echo -n "[mirzaev/nvim] "; set_color brcyan; echo -n "[INFORMATION] "; set_color -o white; echo "Format: install.sh [flags]"; echo; set_color normal; set_color yellow; echo -n " -u "; set_color cyan; echo -n "--update "; set_color -d white; echo "Update all dependencies"; set_color normal; set_color yellow; echo -n " -f "; set_color cyan; echo -n "--force "; set_color -d white; echo "Do not ask for confirmations"; set_color normal; set_color yellow; echo -n " -v "; set_color cyan; echo -n "--verbose "; set_color -d white; echo "Connect TTY to the output buffer"; set_color normal; set_color yellow; echo -n " -h "; set_color cyan; echo -n "--help "; set_color -d white; echo "Send this message"; set_color normal; set_color white; echo; echo -n "This installer only works with "; set_color yellow; echo -n "fish "; set_color white; echo -n "and "; set_color red; echo "ubuntu"; case NVIM_NOT_INSTALLED set_color yellow; echo -n "[mirzaev/nvim] "; set_color red; echo -n "[ERROR] "; set_color white; echo "NeoVim is not installed"; - case PACKER_INSTALL - set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install Packer? (\"wbthomason/packer.nvim\") (y/N) "; - case PACKER_EXISTS - set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Packer already installed. Reinstall? (y/N) "; - case PACKER_INSTALLED - set_color yellow; echo -n "[mirzaev/nvim] "; set_color green; echo -n "[WORK] "; set_color white; echo "Installed Packer"; case LSP_INTELEPHENSE_INSTALL set_color yellow; echo -n "[mirzaev/nvim] "; set_color blue; echo -n "[TASK] "; set_color white; echo "Install the LSP-server for PHP? (\"bmewburn/vscode-intelephense\") (y/N) "; case LSP_INTELEPHENSE_INSTALLED @@ -178,7 +166,7 @@ if set -q _flag_update fnm install $NODEJS_VERSION # need to rewrite in the future (бляяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяя) - sudo apt install -y npm python3-venv python3-pip rubygems ruby-dev pkg-config + sudo apt install -y npm python3-venv python3-pip rubygems ruby-dev pkg-config lua5.4 luarocks python3 -m pip install --upgrade pip pip install --upgrade pynvim sudo gem install neovim @@ -191,49 +179,6 @@ end # Initializing the virtual environment for Python packages python3 -m venv ~/.local --system-site-packages -if not set -q _flag_force - # Installation request - set RESPONSE (read -n 1 -p "print PACKER_INSTALL") - bind -e y -end - -if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE") - if test -d ~/.local/share/nvim/site/pack/packer/start/packer.nvim - # Найден репозиторий "wbthomason/packer.nvim" - - if not set -q _flag_force - # Installation request - set RESPONSE (read -n 1 -p "print PACKER_EXISTS") - bind -e y - end - - if set -q _flag_force; or test (string match -ri 'y' "$RESPONSE") - # Запрошена переустановка - - begin - # Деинициализация старого репозитория - rm -rf ~/.local/share/nvim/site/pack/packer/start/packer.nvim - - # Инициализация репозитория - git clone --depth 1 https://github.com/wbthomason/packer.nvim\ - ~/.local/share/nvim/site/pack/packer/start/packer.nvim - end &> $output - - print PACKER_INSTALLED - end - else - # Не найден репозиторий "wbthomason/packer.nvim" - - begin - # Инициализация репозитория - git clone --depth 1 https://github.com/wbthomason/packer.nvim\ - ~/.local/share/nvim/site/pack/packer/start/packer.nvim - end &> $output - - print PACKER_INSTALLED - end -end - if not set -q _flag_force # Installation request set RESPONSE (read -n 1 -p "print LSP_INTELEPHENSE_INSTALL") diff --git a/lazy-lock.json b/lazy-lock.json index 138bd8f..6b9e85f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,7 +9,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, "jsctags": { "branch": "master", "commit": "22d3fb848c429d4704dc3a8946bc3a4423a8e4a4" }, "kommentary": { "branch": "main", "commit": "d5a111a3bc4109a8f913a5863c9092b3b3801482" }, - "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, "lspkind-nvim": { "branch": "master", "commit": "3ddd1b4edefa425fda5a9f95a4f25578727c0bb3" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, @@ -18,21 +18,21 @@ "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, "nginx.vim": { "branch": "master", "commit": "cffaec54f0c7f9518de053634413a20e90eac825" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "d9e44e54384e5b0f3536339c65484f2e41b528e3" }, + "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-lint": { "branch": "master", "commit": "c47b71d146a0b638f46672e6704c322369385df6" }, - "nvim-lspconfig": { "branch": "master", "commit": "0d7d33e40f0c27f57cb29654ed78cab17d705e68" }, + "nvim-lspconfig": { "branch": "master", "commit": "c4f67bf85b01a57e3c130352c0a0e453ab8cd5b9" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "main", "commit": "d0bf5ff2b00939eab39c6572aec7cf232f843b1f" }, + "nvim-treesitter": { "branch": "main", "commit": "4fc09bee78e91bf4ba471cdab4bf9dfa37fde51c" }, "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, "phpctags": { "branch": "master", "commit": "5ed731eb86227d416977b0a1fd06e77e58363818" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "reticle.nvim": { "branch": "main", "commit": "66bfa2b1c28fd71bb8ae4e871e0cd9e9c509ea86" }, "tagbar": { "branch": "master", "commit": "7bfffca1f121afb7a9e38747500bf5270e006bb1" }, "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, - "telescope.nvim": { "branch": "master", "commit": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2" }, + "telescope.nvim": { "branch": "master", "commit": "3d757e586ff0bfc85bdb7b46c9d3d932147a0cde" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-fish": { "branch": "master", "commit": "50b95cbbcd09c046121367d49039710e9dc9c15f" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, diff --git a/lua/keymaps/plugins.lua b/lua/keymaps/plugins.lua index 67f14c9..28b592b 100644 --- a/lua/keymaps/plugins.lua +++ b/lua/keymaps/plugins.lua @@ -1,52 +1,3 @@ ---[[ nvim-neo-tree/neo-tree ]] --- Открыть интерфейс с древовидным отображением файлов -vim.keymap.set({ 'n', 'i', 'v', 't' }, '', 'Neotree toggle', { noremap = true }) - - --- [[ folke/trouble.nvim ]] -vim.keymap.set({ 'n', 'i', 'v', 't' }, '', 'Trouble diagnostics toggle focus=false filter.buf=0', { noremap = true }) - - ---[[ onsails/diaglist.nvim ]] --- Открыть интерфейс диагностики -vim.keymap.set('n', 'dw', 'lua require(\'diaglist\').open_all_diagnostics()', { noremap = true }) -vim.keymap.set('n', 'd0', 'lua require(\'diaglist\').open_buffer_diagnostics()', { noremap = true }) - - ---[[ noib3/nvim-cokeline ]] --- Переключение вкладок -vim.keymap.set('n', '', '(cokeline-focus-next)', { noremap = true, silent = true }) -vim.keymap.set('n', '', '(cokeline-focus-prev)', { noremap = true, silent = true }) - - ---[[ neovim/nvim-lspconfig ]] --- Диагностика -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { noremap = true, silent = true }) -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { noremap = true, silent = true }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { noremap = true, silent = true }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { noremap = true, silent = true }) - --- Инициализация только после того, как LSP-сервер подключится к текущему буферу -lspconfig_on_attach = function(client, bufnr) - -- Активация завершения - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - -- vim.keymap.set({ 'n', 'v', 't' }, 'F', function() vim.lsp.buf.format { async = true } end, { noremap = true, silent = true, buffer = bufnr }) - - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', '', vim.lsp.buf.signature_help, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, - { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'ca', vim.lsp.buf.code_action, { noremap = true, silent = true, buffer = bufnr }) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, { noremap = true, silent = true, buffer = bufnr }) -end - -- Formatting vim.keymap.set({ 'n', 'v', 't' }, 'F', function() if (vim.bo.filetype == 'nginx') then @@ -65,63 +16,46 @@ vim.keymap.set({ 'n', 'v', 't' }, 'F', function() -- vim.api.nvim_exec('PrettierAsync', false) end end, - { noremap = true, silent = true, buffer = bufnr }) + { noremap = true, silent = true, buffer = bufnr } +) --[[ lewis6991/gitsigns.nvim ]] -- Инициализация только после того, как LSP-сервер подключится к текущему буферу -gitsigns_on_attach = function(bufnr) - -- Инициализация ярлыка - local gs = package.loaded.gitsigns - - -- Навигация - vim.keymap.set('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true, buffer = bufnr }) - - -- Навигация - vim.keymap.set('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true, buffer = bufnr }) - - vim.keymap.set('n', 'hs', 'Gitsigns stage_hunk', { buffer = bufnr }) - vim.keymap.set('v', 'hs', 'Gitsigns stage_hunk', { buffer = bufnr }) - vim.keymap.set('n', 'hr', 'Gitsigns reset_hunk', { buffer = bufnr }) - vim.keymap.set('v', 'hr', 'Gitsigns reset_hunk', { buffer = bufnr }) - vim.keymap.set('n', 'hS', gs.stage_buffer, { buffer = bufnr }) - vim.keymap.set('n', 'hu', gs.undo_stage_hunk, { buffer = bufnr }) - vim.keymap.set('n', 'hR', gs.reset_buffer, { buffer = bufnr }) - vim.keymap.set('n', 'hp', gs.preview_hunk, { buffer = bufnr }) - vim.keymap.set('n', 'hb', function() gs.blame_line { full = true } end, { buffer = bufnr }) - vim.keymap.set('n', 'tb', gs.toggle_current_line_blame, { buffer = bufnr }) - vim.keymap.set('n', 'hd', gs.diffthis, { buffer = bufnr }) - vim.keymap.set('n', 'hD', function() gs.diffthis('~') end, { buffer = bufnr }) - vim.keymap.set('n', 'td', gs.toggle_deleted, { buffer = bufnr }) - - vim.keymap.set('o', 'ih', 'Gitsigns select_hunk', { buffer = bufnr }) - vim.keymap.set('x', 'ih', 'Gitsigns select_hunk', { buffer = bufnr }) -end - - ---[[ nvim-telescope/telescope.nvim ]] --- Инициализация ярлыка -local builtin = require('telescope.builtin') - --- Поиск файла -vim.keymap.set('n', 'ff', builtin.find_files, { noremap = true, silent = true }) - --- grep -vim.keymap.set('n', 'fg', builtin.live_grep, { noremap = true, silent = true }) - --- Буферы? -vim.keymap.set('n', 'fb', builtin.buffers, { noremap = true, silent = true }) - --- Помощь -vim.keymap.set('n', 'fh', builtin.help_tags, { noremap = true, silent = true }) - +-- gitsigns_on_attach = function(bufnr) +-- -- Инициализация ярлыка +-- local gs = package.loaded.gitsigns +-- +-- -- Навигация +-- vim.keymap.set('n', ']c', function() +-- if vim.wo.diff then return ']c' end +-- vim.schedule(function() gs.next_hunk() end) +-- return '' +-- end, { expr = true, buffer = bufnr }) +-- +-- -- Навигация +-- vim.keymap.set('n', '[c', function() +-- if vim.wo.diff then return '[c' end +-- vim.schedule(function() gs.prev_hunk() end) +-- return '' +-- end, { expr = true, buffer = bufnr }) +-- +-- vim.keymap.set('n', 'hs', 'Gitsigns stage_hunk', { buffer = bufnr }) +-- vim.keymap.set('v', 'hs', 'Gitsigns stage_hunk', { buffer = bufnr }) +-- vim.keymap.set('n', 'hr', 'Gitsigns reset_hunk', { buffer = bufnr }) +-- vim.keymap.set('v', 'hr', 'Gitsigns reset_hunk', { buffer = bufnr }) +-- vim.keymap.set('n', 'hS', gs.stage_buffer, { buffer = bufnr }) +-- vim.keymap.set('n', 'hu', gs.undo_stage_hunk, { buffer = bufnr }) +-- vim.keymap.set('n', 'hR', gs.reset_buffer, { buffer = bufnr }) +-- vim.keymap.set('n', 'hp', gs.preview_hunk, { buffer = bufnr }) +-- vim.keymap.set('n', 'hb', function() gs.blame_line { full = true } end, { buffer = bufnr }) +-- vim.keymap.set('n', 'tb', gs.toggle_current_line_blame, { buffer = bufnr }) +-- vim.keymap.set('n', 'hd', gs.diffthis, { buffer = bufnr }) +-- vim.keymap.set('n', 'hD', function() gs.diffthis('~') end, { buffer = bufnr }) +-- vim.keymap.set('n', 'td', gs.toggle_deleted, { buffer = bufnr }) +-- +-- vim.keymap.set('o', 'ih', 'Gitsigns select_hunk', { buffer = bufnr }) +-- vim.keymap.set('x', 'ih', 'Gitsigns select_hunk', { buffer = bufnr }) +-- end --[[ mfussenegger/nvim-dap ]] vim.keymap.set('n', '', function() require('dap').continue() end) @@ -147,45 +81,3 @@ vim.keymap.set('n', 'ds', function() local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.scopes) end) - - ---[[ windwp/nvim-autopairs ]] --- Переназначение стандартных сочетаний клавиш для "ms-jpq/coq_nvim" ---vim.keymap.set('i', '', [[pumvisible() ? "" : ""]], {expr = true, noremap = true}) ---vim.keymap.set('i', '', [[pumvisible() ? "" : ""]], {expr = true, noremap = true}) ---vim.keymap.set('i', '', [[pumvisible() ? "" : ""]], {expr = true, noremap = true}) ---vim.keymap.set('i', '', [[pumvisible() ? "" : ""]], {expr = true, noremap = true}) - -_G.PairIT = function() - local autopairs = { - ['('] = ')', - ['['] = ']', - ['{'] = '}', - ['<'] = '>', - [ [=[']=] ] = [=[']=], - [ [=["]=] ] = [=["]=], - } - local set_pairs = vim.keymap.set - for k, v in pairs(autopairs) do - set_pairs('i', k, function() - return k .. v .. '' - end, { expr = true, noremap = true }) - end -end - - ---[[ b3nj5m1n/kommentary ]] -vim.keymap.set('n', 'cic', 'kommentary_line_increase', { noremap = true, silent = true }) -vim.keymap.set('n', 'ci', 'kommentary_motion_increase', { noremap = true, silent = true }) -vim.keymap.set('x', 'ci', 'kommentary_visual_increase', { noremap = true, silent = true }) -vim.keymap.set('n', 'cdc', 'kommentary_line_decrease', { noremap = true, silent = true }) -vim.keymap.set('n', 'cd', 'kommentary_motion_decrease', { noremap = true, silent = true }) -vim.keymap.set('x', 'cd', 'kommentary_visual_decrease', { noremap = true, silent = true }) - - ---[[ preservim/tagbar ]] -vim.keymap.set({ 'n', 'i', 'v', 't' }, '', 'TagbarToggle', { noremap = true, silent = true }) - - ---[[ simrat39/symbols-outline.nvim ]] -vim.keymap.set({ 'n', 'i', 'v', 't' }, '', 'SymbolsOutline', { noremap = true, silent = true }) diff --git a/lua/keymaps/system.lua b/lua/keymaps/system.lua index 6f2d335..59795a2 100644 --- a/lua/keymaps/system.lua +++ b/lua/keymaps/system.lua @@ -1,12 +1,8 @@ --- Выход из режима "ВСТАВКА" (insert) -vim.keymap.set('i', '', '', {noremap = true, silent = true}) +-- Offset +vim.keymap.set({'i', 'v', 't'}, '', '>', {noremap = true, silent = true}) +vim.keymap.set({'i', 'v', 't'}, '', '<', {noremap = true, silent = true}) --- Быстрый сдвиг текста в режиме 'ВСТАВКА' (insert) --- (надо будет проработать в визуальном режиме на множество строк) -vim.keymap.set({'i', 'v', 't'}, '', '>', {noremap = true, silent = true}) -vim.keymap.set({'i', 'v', 't'}, '', '<', {noremap = true, silent = true}) - --- Отключение стрелок +-- Disabling arrows vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) @@ -19,6 +15,3 @@ vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = t vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) vim.keymap.set({'n', 'i', 'v', 't'}, '', '', {noremap = true, silent = true}) - --- Быстрое форматирование всего документа -vim.keymap.set({'n', 'v', 't'}, 'F', '1GVG=', {noremap = true, silent = true}) diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index c8c75e8..ae92864 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -2,8 +2,13 @@ return { 'akinsho/bufferline.nvim', enabled = true, - lazy = false, - priority = 40, + lazy = true, + event = 'BufReadPre', + keys = { + { '', 'BufferLineCycleNext', mode = { 'n' }, desc = 'Move to the next tab', noremap = true, silent = true }, + { '', 'BufferLineCyclePrev', mode = { 'n' }, desc = 'Move to the previous tab', noremap = true, silent = true }, + { '', 'lua require("bufferline").go_to(vim.fn.input("Enter tab number: "), true)', mode = { 'n' }, desc = 'Move to the tab', noremap = true, silent = true }, + }, version = '*', dependencies = { -- @@ -12,7 +17,7 @@ return { opts = { options = { themable = true, - numbers = 'buffer_id', + numbers = 'ordinal', -- close_command = 'bdelete! %d', -- right_mouse_command = 'bdelete! %d', -- left_mouse_command = 'buffer %d', @@ -44,7 +49,7 @@ return { persist_buffer_sort = true, move_wraps_at_ends = false, -- separator_style = 'slant' | 'slope' | 'thick' | 'thin' | { 'any', 'any' }, - separator_style = 'thin', + separator_style = 'default', enforce_regular_tabs = false, always_show_bufferline = true, auto_toggle_bufferline = true, diff --git a/lua/plugins/coq.lua b/lua/plugins/coq.lua index f2d19b0..c24a6f7 100644 --- a/lua/plugins/coq.lua +++ b/lua/plugins/coq.lua @@ -3,6 +3,7 @@ return { 'ms-jpq/coq_nvim', enabled = true, lazy = false, + priority = 30, branch = 'coq', dependencies = { -- Quickstart configs for Nvim LSP @@ -20,30 +21,3 @@ return { } end, } - --- ---[[ { - 'neovim/nvim-lspconfig', - lazy = false, - dependencies = { - -- Fast as FUCK nvim completion - { 'ms-jpq/coq_nvim', branch = 'coq' }, - - -- 9000+ Snippets - { 'ms-jpq/coq.artifacts', branch = 'artifacts' }, - - -- Lua & third party sources. Need to **configure separately** - { 'ms-jpq/coq.thirdparty', branch = '3p' } - }, - - init = function() - vim.g.coq_settings = { - auto_start = 'shut-up', - -- Your COQ settings here - } - end, - - config = function() - -- Your LSP settings here - end, -} ]] diff --git a/lua/plugins/diaglist.lua b/lua/plugins/diaglist.lua index 21e79c8..baad034 100644 --- a/lua/plugins/diaglist.lua +++ b/lua/plugins/diaglist.lua @@ -1,9 +1,13 @@ -- Live render workspace diagnostics in quickfix with -- current buf errors on top, buffer diagnostics in loclist +-- @todo удалить и заменить на трабл return { 'onsails/diaglist.nvim', - enabled = true, + enabled = false, lazy = true, + keys = { + { '', 'lua require(\'diaglist\').open_all_diagnostics()', mode = { 'n', 'i', 'v', 't' }, desc = 'Open all diagnostics (diaglist)', noremap = true, silent = true }, + }, opts = { debug = false, debounce_ms = 150 diff --git a/lua/plugins/kommentary.lua b/lua/plugins/kommentary.lua index 33fe514..8f59223 100644 --- a/lua/plugins/kommentary.lua +++ b/lua/plugins/kommentary.lua @@ -2,5 +2,13 @@ return { 'b3nj5m1n/kommentary', enabled = true, - lazy = true + lazy = true, + keys = { + { 'gcc', 'kommentary_line_default', mode = 'n', desc = 'Comment', noremap = true, silent = true }, + { 'gc', 'kommentary_motion_default', mode = 'n', desc = 'Comment', noremap = true, silent = true }, + { 'gc', 'kommentary_visual_default', mode = 'v', desc = 'Comment', noremap = true, silent = true }, + }, + config = function() + vim.g.kommentary_create_default_mappings = false + end } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 7706cf7..ad5766c 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -134,7 +134,9 @@ vim.lsp.config( vim.lsp.enable('jsonls') -- Инициализация 'luals/lua-language-server' (LSP-сервер для Lua) ---[[ vim.lsp.config.lua_ls.setup({ + vim.lsp.config( + 'lua_ls', + { settings = { Lua = { runtime = { @@ -158,6 +160,8 @@ vim.lsp.enable('jsonls') on_attach = lspconfig_on_attach, coq.lsp_ensure_capabilities(), capabilities = capabilities -})]] +} +) +vim.lsp.enable('lua_ls') end, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 502010b..eee91ec 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -61,25 +61,7 @@ return { fmt = nil, on_click = nil, }, - lualine_b = { - 'branch', - 'diff', - { - 'diagnostics', - sources = { 'coc' }, - sections = { 'error', 'warn', 'info', 'hint' }, - diagnostics_color = { - error = 'DiagnosticError', - warn = 'DiagnosticWarn', - info = 'DiagnosticInfo', - hint = 'DiagnosticHint', - }, - symbols = {error = 'E', warn = 'W', info = 'I', hint = 'H'}, - colored = true, - update_in_insert = false, - always_visible = false - } - }, + lualine_b = {'branch', 'diff'}, lualine_c = {'filename', 'lsp_progress'}, lualine_x = { FugitiveStatusline, 'encoding', 'fileformat', 'filetype'}, -- lualine_x = { FugitiveHead, 'encoding', 'fileformat', 'filetype'}, @@ -101,5 +83,23 @@ return { 'lazy', 'nvim-dap-ui', 'trouble', - 'neo-tree'} + 'neo-tree' + }, + -- config = function() + -- local trouble = require("trouble") + -- local symbols = trouble.statusline({ + -- mode = "lsp_document_symbols", + -- groups = {}, + -- title = false, + -- filter = { range = true }, + -- format = "{kind_icon}{symbol.name:Normal}", + -- -- The following line is needed to fix the background color + -- -- Set it to the lualine section you want to use + -- hl_group = "lualine_c_normal", + -- }) + -- table.insert(opts.sections.lualine_c, { + -- symbols.get, + -- cond = symbols.has, + -- }) + -- end } diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 080ab70..4bb6c77 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -3,8 +3,10 @@ return { 'nvim-neo-tree/neo-tree.nvim', enabled = true, - lazy = false, - priority = 60, + lazy = true, + keys = { + { '', 'Neotree toggle', mode = { 'n', 'i', 'v', 't' }, desc = 'NeoTree toggle', noremap = true, silent = true }, + }, branch = 'v3.x', dependencies = { -- Lua functions diff --git a/lua/plugins/reticle.lua b/lua/plugins/reticle.lua index 0a04336..8e57e71 100644 --- a/lua/plugins/reticle.lua +++ b/lua/plugins/reticle.lua @@ -4,7 +4,5 @@ return { 'tummetott/reticle.nvim', enabled = true, lazy = true, - event = 'VeryLazy', - opts = { - }, + event = 'VeryLazy' } diff --git a/lua/plugins/tagbar.lua b/lua/plugins/tagbar.lua index c82d5df..eee7912 100644 --- a/lua/plugins/tagbar.lua +++ b/lua/plugins/tagbar.lua @@ -2,8 +2,10 @@ return { 'preservim/tagbar', enabled = true, - lazy = false, - priority = 40, + lazy = true, + keys = { + { '', 'TagbarToggle', mode = { 'n', 'i', 'v', 't' }, desc = 'Tagbar toggle', noremap = true, silent = true }, + }, dependencies = { -- An enhanced ctags compatible index generator written in pure PHP { 'vim-php/phpctags' }, diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 56e802d..13b38ce 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -4,7 +4,12 @@ return { 'nvim-telescope/telescope.nvim', enabled = true, lazy = true, - tag = 'v0.2.0', + keys = { + { '', 'Telescope find_files', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope find', noremap = true, silent = true }, + { '', 'Telescope live_grep', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope grep', noremap = true, silent = true }, + { '', 'Telescope buffers', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope buffers', noremap = true, silent = true }, + { '?', 'Telescope help_tags', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope help', noremap = true, silent = true }, + }, dependencies = { -- Functions for Telescope { 'nvim-lua/plenary.nvim' }, @@ -13,7 +18,7 @@ return { { 'nvim-telescope/telescope-dap.nvim' } }, opts = { - exteinsiions = { + exteinsions = { dap = {} } }, diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index a3b9a69..4693e81 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -4,112 +4,11 @@ return { 'folke/trouble.nvim', enabled = true, - lazy = false, - priority = 20, - dependencies = { - -- Nvim Treesitter configurations and abstraction layer - { 'nvim-treesitter/nvim-treesitter' }, - - -- Provides Nerd Font icons (glyphs) for use by neovim plugins - { 'nvim-tree/nvim-web-devicons' } - }, - opts = { - position = 'bottom', -- position of the list can be: bottom, top, left, right - height = 10, -- height of the trouble list when position is top or bottom - width = 50, -- width of the list when position is left or right - icons = true, -- use devicons for filenames - mode = 'workspace_diagnostics', -- 'workspace_diagnostics', 'document_diagnostics', 'quickfix', 'lsp_references', 'loclist' - fold_open = '', -- icon used for open folds - fold_closed = '', -- icon used for closed folds - group = true, -- group results by file - padding = true, -- add an extra new line on top of the list - action_keys = { - -- key mappings for actions in the trouble list - -- map to {} to remove a mapping, for example: - -- close = {}, - close = 'q', -- close the list - cancel = '', -- cancel the preview and get back to your last window / buffer / cursor - refresh = 'r', -- manually refresh - jump = { '', '' }, -- jump to the diagnostic or open / close folds - open_split = { '' }, -- open buffer in new split - open_vsplit = { '' }, -- open buffer in new vsplit - open_tab = { '' }, -- open buffer in new tab - jump_close = { 'o' }, -- jump to the diagnostic and close the list - toggle_mode = 'm', -- toggle between 'workspace' and 'document' diagnostics mode - toggle_preview = 'P', -- toggle auto_preview - hover = 'K', -- opens a small popup with the full multiline message - preview = 'p', -- preview the diagnostic location - close_folds = { 'zM', 'zm' }, -- close all folds - open_folds = { 'zR', 'zr' }, -- open all folds - toggle_fold = { 'zA', 'za' }, -- toggle fold of current file - previous = 'k', -- previous item - next = 'j' -- next item - }, - indent_lines = true, -- add an indent guide below the fold icons - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = false, -- automatically close the list when you have no diagnostics - auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window - auto_fold = false, -- automatically fold a file trouble list at creation - auto_jump = { 'lsp_definitions' }, -- for the given modes, automatically jump if there is only a single result - signs = { - -- icons / text used for a diagnostic - error = '', - warning = '', - hint = '', - information = '', - other = '﫠' - }, - use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client - }, - config = function() --- Initializing Telescope -local telescope = require('telescope') -local telescope_actions = require('telescope.actions') -local telescope_open = require('trouble.sources.telescope').open - --- Use this to add more results without clearing the trouble list -local add_to_trouble = require('trouble.sources.telescope').add - -telescope.setup({ - defaults = { - mappings = { - i = { [''] = telescope_open }, - n = { [''] = telescope_open }, - }, - }, -}) -end, + lazy = true, cmd = 'Trouble', - keys = { - { - 'xx', - 'Trouble diagnostics toggle', - desc = 'Diagnostics (Trouble)', - }, - { - 'xX', - 'Trouble diagnostics toggle filter.buf=0', - desc = 'Buffer Diagnostics (Trouble)', - }, - { - 'cs', - 'Trouble symbols toggle focus=false', - desc = 'Symbols (Trouble)', - }, - { - 'cl', - 'Trouble lsp toggle focus=false win.position=right', - desc = 'LSP Definitions / references / ... (Trouble)', - }, - { - 'xL', - 'Trouble loclist toggle', - desc = 'Location List (Trouble)', - }, - { - 'xQ', - 'Trouble qflist toggle', - desc = 'Quickfix List (Trouble)', - }, - } + keys = { + { '', 'Trouble diagnostics toggle', mode = { 'n', 'i', 'v', 't' }, desc = 'Diagnostics (Trouble)', noremap = true, silent = true }, + }, + opts = {}, + config = function() end } diff --git a/lua/settings/lazy.lua b/lua/settings/lazy.lua index 40c5861..168ffad 100644 --- a/lua/settings/lazy.lua +++ b/lua/settings/lazy.lua @@ -29,9 +29,9 @@ require('lazy').setup({ -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. - install = { - colorscheme = { 'flexoki' } - }, + -- install = { + -- colorscheme = { 'flexoki' } + -- }, -- Automatically check for plugin updates checker = { diff --git a/lua/settings/system.lua b/lua/settings/system.lua index b0941f3..949084c 100644 --- a/lua/settings/system.lua +++ b/lua/settings/system.lua @@ -1,6 +1,6 @@ -- Leader button -vim.g.mapleader = " " -vim.g.maplocalleader = "\\" +vim.g.mapleader = ' ' +vim.g.maplocalleader = '\\' -- Использовать системный буфер обмена vim.opt.clipboard = 'unnamedplus' diff --git a/lua/trouble.lua b/lua/trouble.lua new file mode 100644 index 0000000..6f3fc9a --- /dev/null +++ b/lua/trouble.lua @@ -0,0 +1,56 @@ +-- 🚦 A pretty diagnostics, references, telescope results, +-- quickfix and location list to help you solve +-- all the trouble your code is causing +return { + 'folke/trouble.nvim', + enabled = true, + lazy = false, + cmd = 'Trouble', + keys = { + { '', 'Trouble diagnostics toggle', mode = { 'n', 'i', 'v', 't' }, desc = 'Diagnostics (Trouble)', noremap = true, silent = true }, + }, + dependencies = { + -- Nvim Treesitter configurations and abstraction layer + { 'nvim-treesitter/nvim-treesitter' }, + + -- Provides Nerd Font icons (glyphs) for use by neovim plugins + { 'nvim-tree/nvim-web-devicons' } + }, + opts = { + + auto_close = true, -- auto close when there are no items + auto_open = true, -- auto open when there are items + position = 'bottom', -- position of the list can be: bottom, top, left, right + auto_preview = true, -- automatically open preview when on an item + auto_refresh = true, -- auto refresh when open + auto_jump = false, -- auto jump to the item when there's only one + focus = false, -- Focus the window when opened + restore = true, -- restores the last location in the list when opening + follow = true, -- Follow the current item + indent_guides = true, -- show indent guides + max_items = 200, -- limit number of items that can be displayed per section + multiline = true, -- render multi-line messages + pinned = false, -- When pinned, the opened trouble window will be bound to the current buffer + warn_no_results = true, -- show a warning when there are no results + open_no_results = false, -- open the trouble window when there are no results + -- use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client + }, + config = function() +-- Initializing Telescope +local telescope = require('telescope') +local telescope_actions = require('telescope.actions') +local telescope_open = require('trouble.sources.telescope').open + +-- Use this to add more results without clearing the trouble list +local add_to_trouble = require('trouble.sources.telescope').add + +telescope.setup({ + defaults = { + mappings = { + i = { [''] = telescope_open }, + n = { [''] = telescope_open }, + }, + }, +}) +end +}