From ef68252f89606483b8194146af68cf08fdcd5f8b Mon Sep 17 00:00:00 2001 From: StepanovPlaton Date: Tue, 26 Dec 2023 02:13:22 +0400 Subject: [PATCH] 25.12.23 --- .bashrc | 5 + .config/bspwm/bspwmrc | 6 + .config/numen/current_mode | 1 + .config/numen/phrases.phrases | 13 +- .config/numen/startup.phrases | 2 + .config/nvim/init.lua | 18 +- .config/nvim/lazy-lock.json | 42 +++-- .config/nvim/lua/base.lua | 33 ++-- .config/nvim/lua/keymaps.lua | 88 ++------- .config/nvim/lua/plugins.lua | 117 +----------- .config/nvim/lua/plugins/buffer_manager.lua | 14 ++ .config/nvim/lua/plugins/colors.lua | 6 + .config/nvim/lua/plugins/colorscheme.lua | 51 ++++++ .config/nvim/lua/plugins/comment.lua | 8 + .config/nvim/lua/plugins/git.lua | 43 +++++ .config/nvim/lua/plugins/lsp.lua | 191 ++++++++++++++++++++ .config/nvim/lua/plugins/neotree.lua | 16 ++ .config/nvim/lua/plugins/rus.lua | 6 + .config/nvim/lua/plugins/status_line.lua | 14 ++ .config/nvim/lua/plugins/surround.lua | 8 + .config/nvim/lua/plugins/telescope.lua | 48 +++++ .config/nvim/lua/plugins/terminal.lua | 18 ++ .config/nvim/lua/plugins/todo_comments.lua | 16 ++ .config/nvim/lua/plugins/treesitter.lua | 31 ++++ .config/nvim/lua/plugins/trouble.lua | 20 ++ .config/polybar/config.ini | 13 +- .config/sxhkd/sxhkdrc | 17 ++ .xinitrc | 12 +- 28 files changed, 630 insertions(+), 227 deletions(-) create mode 100644 .config/numen/current_mode create mode 100644 .config/numen/startup.phrases create mode 100644 .config/nvim/lua/plugins/buffer_manager.lua create mode 100644 .config/nvim/lua/plugins/colors.lua create mode 100644 .config/nvim/lua/plugins/colorscheme.lua create mode 100644 .config/nvim/lua/plugins/comment.lua create mode 100644 .config/nvim/lua/plugins/git.lua create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/neotree.lua create mode 100644 .config/nvim/lua/plugins/rus.lua create mode 100644 .config/nvim/lua/plugins/status_line.lua create mode 100644 .config/nvim/lua/plugins/surround.lua create mode 100644 .config/nvim/lua/plugins/telescope.lua create mode 100644 .config/nvim/lua/plugins/terminal.lua create mode 100644 .config/nvim/lua/plugins/todo_comments.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua create mode 100644 .config/nvim/lua/plugins/trouble.lua diff --git a/.bashrc b/.bashrc index c3afccf..1626c8e 100644 --- a/.bashrc +++ b/.bashrc @@ -17,3 +17,8 @@ alias dmenu_wal='dmenu_run -nb "$color0" -nf "$color15" -sb "$color1" -sf "$colo #export SUDO_ASKPASS=".scripts/dpass.sh" #alias sudo="sudo -A" + +alias numen_full="numen ~/.config/numen/phrases.phrases --phraselog=phrases.txt" + + +export PATH="~/.scripts:$PATH" diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 4561504..dda2550 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -19,6 +19,12 @@ bspc config focused_border_color "$color2" bspc config top_padding 30 +telegram-desktop -startintray & +bspc rule -a TelegramDesktop desktop='^5' + +bspc rule -a St_float state=pseudo_tiled +st -c St_float -e /bin/bash -c "ufetch && /bin/bash" & + # bspc rule -a Gimp desktop='^8' state=floating follow=on # bspc rule -a Chromium desktop='^2' # bspc rule -a mplayer2 state=floating diff --git a/.config/numen/current_mode b/.config/numen/current_mode new file mode 100644 index 0000000..b963b47 --- /dev/null +++ b/.config/numen/current_mode @@ -0,0 +1 @@ +[R] diff --git a/.config/numen/phrases.phrases b/.config/numen/phrases.phrases index dd578b4..ca8cd81 100644 --- a/.config/numen/phrases.phrases +++ b/.config/numen/phrases.phrases @@ -3,13 +3,16 @@ left: run bspc node -f west up: run bspc node -f north down: run bspc node -f south -git commit: run git commit -m "`date`+'%Y-%m-%d %H:%M:%S'" -git push: run git push -git commit and push: run git commit -m "`date`+'%Y-%m-%d %H:%M:%S'" \ +git status: type git status +git commit: type git commit -m "`date`+'%Y-%m-%d %H:%M:%S'" +git push: type git push +git commit and push: type git commit -m "`date`+'%Y-%m-%d %H:%M:%S'" \ run git push mute: run pactl set-sink-mute @DEFAULT_SINK@ toggle -power off: run export SUDOASKPASS=".scripts/dpass.sh" && sudo -A poweroff -reboot: run export SUDOASKPASS=".scripts/dpass.sh" && sudo -A reboot +power off: run export SUDO_ASKPASS=".scripts/dpass.sh" && sudo -A poweroff +reboot: run export SUDO_ASKPASS=".scripts/dpass.sh" && sudo -A reboot +deactivate: run pkill numen +bye: run echo load $HOME/.config/numen/startup.phrases | numenc && echo "[R]" > ~/.config/numen/current_mode diff --git a/.config/numen/startup.phrases b/.config/numen/startup.phrases new file mode 100644 index 0000000..40c57f2 --- /dev/null +++ b/.config/numen/startup.phrases @@ -0,0 +1,2 @@ +enable voice assistant: run echo load $HOME/.config/numen/phrases.phrases | numenc && echo "[W]" > ~/.config/numen/current_mode +deactivate: run pkill numen diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d698ea5..cec4466 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,3 +1,17 @@ -require("plugins") -require("base") +-- Установка lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + require("keymaps") +require("lazy").setup("plugins") +require("base") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index b588260..a412520 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,20 +1,40 @@ { + "LuaSnip": { "branch": "master", "commit": "57c9f5c31b3d712376c704673eac8e948c82e9c1" }, + "buffer_manager.nvim": { "branch": "main", "commit": "4fa47504a23d9a94216f02b1d84f7b0a2dbe2b72" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "coq.artifacts": { "branch": "artifacts", "commit": "e7202d1a1b5cfa91446d5b7a035f915934e4d713" }, + "coq.thirdparty": { "branch": "3p", "commit": "f110ee91f1b2b897ab0026da347396756953ca41" }, + "coq_nvim": { "branch": "coq", "commit": "72df7bf4528ae8130e29b496aaecb4bfd8ab7c6b" }, + "fidget.nvim": { "branch": "main", "commit": "eb9fccf7fda8b641814f31d47926202f229980b3" }, "gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, + "gruvbox.nvim": { "branch": "main", "commit": "f0e029a3989691eb38cfa9272b75251c62a00821" }, "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, - "lightline.vim": { "branch": "master", "commit": "1c6b455c0445b8bc1c4c16ba569a43c6348411cc" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9453e3d6cd2ca45d96e20f343e8f1b927364b630" }, - "mason-registry": { "branch": "main", "commit": "600111e66cbf10da94c1ccc3af1445d86e01ab44" }, + "lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "788499e735c6e71ba25c08e7df159e8dbf94c6ec" }, + "mason-registry": { "branch": "main", "commit": "a23adcb7eb14513739c9d5fe52814611f158bebd" }, "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "230ff118613fa07138ba579b89d13ec2201530b9" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "77d9f484b88fd380386b46ed9206e5374d69d9d8" }, + "none-ls.nvim": { "branch": "main", "commit": "e7382de51b4cf629e56f1fa18192e716e5ba8145" }, "nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, - "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, - "nvim-lspconfig": { "branch": "master", "commit": "f451052bd6804e9e5ccd0ac874d7df8d3d4c55b9" }, - "nvim-treesitter": { "branch": "master", "commit": "78d75bce03f218ee30aedb6e24e3ec1189a3e9ff" }, - "nvim-web-devicons": { "branch": "master", "commit": "8b2e5ef9eb8a717221bd96cb8422686d65a09ed5" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, + "nvim-surround": { "branch": "main", "commit": "633a0ab03159569a66b65671b0ffb1a6aed6cf18" }, + "nvim-treesitter": { "branch": "master", "commit": "27f68c0b6a87cbad900b3d016425450af8268026" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" }, + "nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "8e0543365fe5781c9babea7db89ef06bcff3716d" }, + "telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" }, + "toggleterm.nvim": { "branch": "main", "commit": "cbd041d91b90cd3c02df03fe6133208888f8e008" }, + "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" }, - "vim-plugin-ruscmd": { "branch": "master", "commit": "e952abbea092e420b128936a0c284fb522612c3a" }, - "wal.vim": { "branch": "master", "commit": "c72ba0d18946f29aab9c95eb6975d321c68b3681" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "vim-css-color": { "branch": "master", "commit": "6cc65734bc7105d9677ca54e2255fcbc953ba6bf" }, + "vim-plugin-ruscmd": { "branch": "master", "commit": "e952abbea092e420b128936a0c284fb522612c3a" } } \ No newline at end of file diff --git a/.config/nvim/lua/base.lua b/.config/nvim/lua/base.lua index 0b378ed..dc89175 100644 --- a/.config/nvim/lua/base.lua +++ b/.config/nvim/lua/base.lua @@ -7,10 +7,6 @@ local opt = vim.opt -- global/buffer/windows-scoped options -- Главные ----------------------------------------------------------- --- Командная клавиша -vim.keymap.set("n", " ", "", { silent = true, remap = false }) -g.mapleader = " " - -- Откллючить поддержку со старым vi g.nocompatible = true -- Не делать бекап файла @@ -19,6 +15,8 @@ g.nowritebackup = true -- Кодировка по умолчанию g.encoding = "utf-8" +-- Буфер обмена с системой (нужен xclip) +opt.clipboard = "unnamed,unnamedplus" -- Разделитель на 80 символов opt.colorcolumn = '80' -- Словари рус eng @@ -39,16 +37,25 @@ opt.scrolloff = 10 opt.showmatch = true -- Всегда показывать столбец для значков opt.signcolumn = "yes" +-- Скрыть командную строку по умолчанию +opt.cmdheight = 0 +-- Не создавать swap файл +opt.swapfile = false + +-- Отключить стандартный проводник +-- g.loaded_netrw = 1 +-- g.loaded_netrwPlugin = 1 ----------------------------------------------------------- -- Цветовая схема ----------------------------------------------------------- -opt.termguicolors = false -- Нужно для поддежки pywal +-- Нужно для поддежки pywal +-- opt.termguicolors = false -- Устанавливаем тему из pywal -cmd([[ -highlight ColorColumn ctermbg=16 -]]) +-- cmd([[ +-- highlight ColorColumn ctermbg=16 +-- ]]) ----------------------------------------------------------- -- Табы и отступы @@ -69,15 +76,15 @@ opt.tabstop = 4 opt.smartindent = true -- Не автокомментировать новые строки -cmd [[au BufEnter * set fo-=c fo-=r fo-=o]] +cmd([[au BufEnter * set fo-=c fo-=r fo-=o]]) -- Удалить маркер длинны строки для выбранных типов файлов -cmd [[autocmd FileType text,markdown,html,xhtml,javascript setlocal cc=0]] +cmd([[autocmd FileType text,markdown,html,xhtml,javascript setlocal cc=0]]) -- 2 пробела для выбранных типов файлов -cmd [[ +cmd([[ autocmd FileType xml,html,xhtml,css,scss,javascript,lua,yaml,htmljinja setlocal shiftwidth=2 tabstop=2 -]] +]]) ----------------------------------------------------------- -- Полезные фишки @@ -92,6 +99,6 @@ autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "norm exec([[ augroup YankHighlight autocmd! -autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=700} +autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=300} augroup end ]], false) diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua index 72b8b86..d1c1a08 100644 --- a/.config/nvim/lua/keymaps.lua +++ b/.config/nvim/lua/keymaps.lua @@ -3,17 +3,16 @@ local default_opts = { noremap = true, silent = true } local function map(mode, l, r, opts) opts = opts or default_opts opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) + vim.keymap.set(mode, l, r, opts) end -local gs = package.loaded.gitsigns - ----------------------------------------------------------- -- Базовые ----------------------------------------------------------- --- Системный буфер обмена --- map('v', '', '"+y', {}) +-- Командная клавиша +vim.keymap.set("n", " ", "", { silent = true, remap = false }) +vim.g.mapleader = " " -- 'Нажимает' на ESC при быстром нажатии jj map('i', 'оо', '') @@ -25,89 +24,24 @@ map('', '', ':echoe "Use j"', {noremap = true, silent = false}) map('', '', ':echoe "Use h"', {noremap = true, silent = false}) map('', '', ':echoe "Use l"', {noremap = true, silent = false}) --- Автоформат + сохранение по CTRL-s , как в нормальном, так и в insert режиме --- map('n', '', ':Autoformat:w', default_opts) --- map('i', '', ':Autoformat:w', default_opts) +map('n', "", "h") +map('n', "", "j") +map('n', "", "k") +map('n', "", "l") --- Переключение вкладок с помощью TAB или shift-tab (akinsho/bufferline.nvim) --- map('n', '', ':BufferLineCycleNext', default_opts) --- map('n', '', ':BufferLineCyclePrev', default_opts) - --- Пролистнуть на страницу вниз / вверх (как в браузерах) --- map('n', '', ' zz', default_opts) --- map('n', '', ' zz', default_opts) - --- " Переводчик рус -> eng --- map('v', 't', '(VTranslate)', {}) - ------------------------------------------------------------ --- Плагины ------------------------------------------------------------ - --- telescope -local builtin = -map('n', 'ff', require('telescope.builtin').find_files) -map('n', 'fg', require('telescope.builtin').live_grep) --- vim.keymap.set('n', 'fb', builtin.buffers, {}) --- vim.keymap.set('n', 'fh', builtin.help_tags, {}) - --- NeoTree -map('n', 't', ':Neotree toggle') - --- GitSigns -map('n', ']c', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' -end, {expr=true}) - -map('n', '[c', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' -end, {expr=true}) - -map('n', 'gs', gs.stage_hunk) -map('n', 'gr', gs.reset_hunk) --- map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) --- map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) -map('n', 'gS', gs.stage_buffer) -map('n', 'gu', gs.undo_stage_hunk) --- map('n', 'hR', gs.reset_buffer) -map('n', 'gp', gs.preview_hunk) -map('n', 'gb', function() gs.blame_line{full=true} end) --- map('n', 'tb', gs.toggle_current_line_blame) -map('n', 'gd', gs.diffthis) -map('n', 'gD', function() gs.diffthis('~') end) -map('n', 'gtd', gs.toggle_deleted) +map('n', 'st', ':set invlist') ----------------------------------------------------------- -- F1 .. F12 ----------------------------------------------------------- + -- По F1 очищаем последний поиск с подсветкой map('n', '', ':nohl') - --- перечитать конфигурацию nvim -map('n', '', ':so ~/.config/nvim/init.lua:so ~/.config/nvim/lua/plugins.lua:so ~/.config/nvim/lua/base.lua:so ~/.config/nvim/lua/keymaps.lua', { noremap = true }) - --- Открыть всю nvim конфигурацию для редактирования -map('n', '', ':e ~/.config/nvim/init.lua:e ~/.config/nvim/lua/plugins.lua:e ~/.config/nvim/lua/base.lua:e ~/.config/nvim/lua/keymaps.lua', { noremap = true }) - --- Поиск слова под курсором -map('n', '', [[lua require('telescope.builtin').grep_string()]]) - --- Поиск слова в модальном окошке -map('n', '', [[lua require('telescope.builtin').live_grep()]]) +map('n', 'nh', ':nohl') -- разные вариации нумераций строк, можно переключаться map('n', '', ':exec &nu==&rnu? "se nu!" : "se rnu!"') --- дерево файлов. -map('n', '', ':NvimTreeRefresh:NvimTreeToggle') - --- Показ дерева классов и функций, плагин majutsushi/tagbar -map('n', '', ':TagbarToggle') - -- Проверка орфографии для русского и английского языка map('n', '', ':set spell!') map('i', '', ':set spell!') diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index c665879..a564707 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -1,116 +1 @@ --- Установка lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - -- Загрука темы из pywal - { "dylanaraps/wal.vim", - priority = 1000, - config = function() - vim.cmd([[colorscheme wal]]) - end, - }, - - -- Подсветка синтаксиса - { "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function () - local configs = require("nvim-treesitter.configs") - configs.setup({ - ensure_installed = { - "html", "markdown", "latex", - "css", "scss", -- "less", not found - "javascript", -- "jsx", not found - "typescript", "tsx", - "python", "lua", - "vim", "vimdoc", "query", - "bash", - "c", - "json", "yaml", - }, - sync_install = false, - highlight = { enable = true }, - incremental_selection = { enable = true }, - indent = { enable = true }, - }) - end - }, - - { 'neovim/nvim-lspconfig', - dependencies = { - 'williamboman/mason.nvim', - 'mason-org/mason-registry', - 'williamboman/mason-lspconfig.nvim', - 'jose-elias-alvarez/null-ls.nvim', - }, - config = function() - local lspconfig = require('lspconfig') - require("mason").setup() - require("mason-lspconfig").setup() - require("null-ls").setup() - end, - }, - - -- Диалоговое окно поиска - { 'nvim-telescope/telescope.nvim', tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim' }, - lazy = true, - }, - - -- Файловый менеджер - -- ? в окне проводника для горячих клавиш - { - 'nvim-neo-tree/neo-tree.nvim', - lazy = true, - cmd = 'Neotree', - branch = "v3.x", - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', - 'MunifTanjim/nui.nvim', - -- '3rd/image.nvim', - }, - }, - - -- Строка состояния - -- (можно конфигурировать, пока не разобрался) - { 'itchyny/lightline.vim' }, - - -- Быстрое комментирование - -- gcc - закоментировать строку - -- (VISUAL) gc - закоментировать выделенные строки - { 'tpope/vim-commentary' }, - - -- Поддержка git - { 'lewis6991/gitsigns.nvim', - config = function() - require('gitsigns').setup() - end - }, - - -- Поддержка русского языка в командном режиме - { 'powerman/vim-plugin-ruscmd' }, - - -- Подсветка комбинаций клавиш - { "folke/which-key.nvim", - config = function() - -- Временно отключен - -- Плохо выглядит с pywal base16-gruvbox-hard - -- require('which-key').setup() - end - }, -}, { - defaults = { - lazy = false - } -}) +return {} diff --git a/.config/nvim/lua/plugins/buffer_manager.lua b/.config/nvim/lua/plugins/buffer_manager.lua new file mode 100644 index 0000000..0a6c033 --- /dev/null +++ b/.config/nvim/lua/plugins/buffer_manager.lua @@ -0,0 +1,14 @@ +return { + { + "j-morano/buffer_manager.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = {}, + keys = { + { "b", function() require("buffer_manager.ui").toggle_quick_menu() end }, + { "", function() require("buffer_manager.ui").nav_prev() end }, + { "", function() require("buffer_manager.ui").nav_next() end } + } + } +} diff --git a/.config/nvim/lua/plugins/colors.lua b/.config/nvim/lua/plugins/colors.lua new file mode 100644 index 0000000..8508983 --- /dev/null +++ b/.config/nvim/lua/plugins/colors.lua @@ -0,0 +1,6 @@ +return { + -- Подсветка цвета (не только в css) + { + "ap/vim-css-color" + } +} diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..b3c85ed --- /dev/null +++ b/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,51 @@ +return { + -- { + -- -- Загрука темы из pywal + -- "dylanaraps/wal.vim", + -- config = function() + -- vim.cmd([[colorscheme wal]]) + -- end, + -- } + + { + -- Отличная тема, но слишком яркий фон + "ellisonleao/gruvbox.nvim", + lazy = false, + priority = 1000, + config = function() + vim.o.background = "dark" + vim.cmd([[colorscheme gruvbox]]) + end + } + + -- { + -- "RRethy/nvim-base16", + -- config = function() + -- vim.cmd([[colorscheme base16-gruvbox-dark-hard]]) + -- end + -- } + + -- { + -- "nanotech/jellybeans.vim", + -- lazy = false, + -- priority = 1000, + -- config = function() + -- vim.cmd([[colorscheme jellybeans]]) + -- end + -- } + + -- { + -- "junegunn/seoul256.vim", + -- config = function() + -- vim.g.seoul256_background = 233 + -- vim.cmd([[colorscheme seoul256]]) + -- end + -- } + + -- { + -- "Mofiqul/vscode.nvim", + -- config = function() + -- require("vscode").load("dark") + -- end + -- } +} diff --git a/.config/nvim/lua/plugins/comment.lua b/.config/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..df1ef11 --- /dev/null +++ b/.config/nvim/lua/plugins/comment.lua @@ -0,0 +1,8 @@ +return { + -- Быстрое комментирование + -- gcc - закоментировать строку + -- (VISUAL) gc - закоментировать выделенные строки + { + "tpope/vim-commentary" + } +} diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..eb5c2e1 --- /dev/null +++ b/.config/nvim/lua/plugins/git.lua @@ -0,0 +1,43 @@ +return { + -- Поддержка git + { + "lewis6991/gitsigns.nvim", + config = function() + require('gitsigns').setup() + + local function map(mode, l, r, opts) + opts = opts or { noremap = true, silent = true } + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + local gs = package.loaded.gitsigns + + map('n', ']c', function() + if vim.wo.diff then return ']c' end + vim.schedule(function() gs.next_hunk() end) + return '' + end, {expr=true}) + + map('n', '[c', function() + if vim.wo.diff then return '[c' end + vim.schedule(function() gs.prev_hunk() end) + return '' + end, {expr=true}) + + -- map('n', 'gs', gs.stage_hunk) + -- map('n', 'gr', gs.reset_hunk) + -- map('v', 'hs', function() gs.stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end) + -- map('v', 'hr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end) + -- map('n', 'gS', gs.stage_buffer) + -- map('n', 'gu', gs.undo_stage_hunk) + -- map('n', 'hR', gs.reset_buffer) + -- map('n', 'gp', gs.preview_hunk) + -- map('n', 'gb', function() gs.blame_line{full=true} end) + -- map('n', 'tb', gs.toggle_current_line_blame) + -- map('n', 'gd', gs.diffthis) + -- map('n', 'gD', function() gs.diffthis('~') end) + -- map('n', 'gtd', gs.toggle_deleted) + end + } +} diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..4daac37 --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,191 @@ +return { + { + "williamboman/mason.nvim", + dependencies = { + "mason-org/mason-registry", + }, + opts = {} + }, + { + "williamboman/mason-null-ls.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvimtools/none-ls.nvim", + }, + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + source = { + -- null_ls.builtins.diagnostics.eslint_d, + -- null_ls.builtins.code_actions.eslint_d, + null_ls.builtins.diagnostics.stylelint, + null_ls.builtins.formatting.prettier, + null_ls.builtins.code_actions.gitsigns, + null_ls.builtins.formatting.autopep8, + null_ls.builtins.diagnostics.pycodestyle, + null_ls.builtins.diagnostics.pydocstyle, + }, + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = vim.api.nvim_create_augroup("LspFormatting", {}), + buffer = bufnr, + callback = function() vim.lsp.buf.format({ async = false }) end, + }) + end + end, + }) + require("mason-null-ls").setup({ + ensure_installed = nil, + automatic_installation = true, + handlers = {} + }) + end + }, + { + "j-hui/fidget.nvim", + opts = {} + }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + }, + config = function() + local luasnip = require("luasnip") + local cmp = require("cmp") + + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() + elseif has_words_before() then cmp.complete() + else fallback() end + end, { "i", "s" }), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then cmp.select_prev_item() + elseif luasnip.jumpable(-1) then luasnip.jump(-1) + else fallback() end + end, { "i", "s" }), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }, + -- mapping = cmp.mapping.preset.insert({ + -- [''] = cmp.mapping.scroll_docs(-4), + -- [''] = cmp.mapping.scroll_docs(4), + -- [''] = cmp.mapping.complete(), + -- [''] = cmp.mapping.abort(), + -- [''] = cmp.mapping.confirm({ select = true }), + -- }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + }, { + { name = 'buffer' }, + }) + }) + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources( + {{ name = 'git' }}, + {{ name = 'buffer' }} + ) + }) + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = {{ name = 'buffer' }} + }) + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources( + {{ name = 'path' }}, + {{ name = 'cmdline' }} + ) + }) + end, + }, + { + "neovim/nvim-lspconfig", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "williamboman/mason-lspconfig.nvim", + -- "ms-jpq/coq_nvim", + -- "ms-jpq/coq.artifacts", + -- "ms-jpq/coq.thirdparty" + "hrsh7th/cmp-nvim-lsp", + }, + keys = { + { "lh", vim.lsp.buf.hover }, + { "lr", vim.lsp.buf.rename }, + { "lf", function() vim.lsp.buf.format({async = true}) end}, + { "lgr", vim.lsp.buf.references }, + { "lgi", vim.lsp.buf.implementation }, + { "lsh", vim.lsp.buf.signature_help }, + + { "ldj", vim.diagnostic.goto_next }, + { "ldk", vim.diagnostic.goto_prev }, + + { "lgd", vim.lsp.buf.definition }, + { "lgtd", vim.lsp.buf.type_definition }, + + { "law", vim.lsp.buf.add_workspace_folder }, + { "ldw", vim.lsp.buf.remove_workspace_folder }, + { "llw", function() + print(vim.inspect(vim.lsp.buf.list_workplace_folders())) + end }, + + { "lca", vim.lsp.buf.code_action }, + }, + config = function() + local lspconfig = require("lspconfig") + local mason_lspconfig = require("mason-lspconfig") + + local LSP_SERVERS = { + "tsserver", + "html", + "cssls", + "tailwindcss", + "pyright" + } + + mason_lspconfig.setup({ + ensure_installed = LSP_SERVERS, + automatic_installation = true, + }) + + local capabilities = require("cmp_nvim_lsp").default_capabilities() + for _, server in pairs(LSP_SERVERS) do + if server ~= "tsserver" then + lspconfig[server].setup( + { + capabilities = capabilities, + on_attach = on_attach, + } + ) + end + end + lspconfig["tsserver"].setup( + { + capabilities = capabilities, + on_attach = function(client) + client.resolved_capabilities.document_formatting = false + end, + } + ) + end, + }, +} diff --git a/.config/nvim/lua/plugins/neotree.lua b/.config/nvim/lua/plugins/neotree.lua new file mode 100644 index 0000000..3ccb2b2 --- /dev/null +++ b/.config/nvim/lua/plugins/neotree.lua @@ -0,0 +1,16 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + cmd = "Neotree", + keys = { + { "f", ":Neotree toggle" } + }, + } +} + diff --git a/.config/nvim/lua/plugins/rus.lua b/.config/nvim/lua/plugins/rus.lua new file mode 100644 index 0000000..83aac40 --- /dev/null +++ b/.config/nvim/lua/plugins/rus.lua @@ -0,0 +1,6 @@ +return { + -- Поддержка русского языка в командном режиме + { + "powerman/vim-plugin-ruscmd" + } +} diff --git a/.config/nvim/lua/plugins/status_line.lua b/.config/nvim/lua/plugins/status_line.lua new file mode 100644 index 0000000..bd76c0c --- /dev/null +++ b/.config/nvim/lua/plugins/status_line.lua @@ -0,0 +1,14 @@ +return { + -- Строка состояния + -- (можно конфигурировать, пока не разобрался) + -- { + -- "itchyny/lightline.vim" + -- } + + -- Лучше выглядит и кастомизируется + { + "nvim-lualine/lualine.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = {} + } +} diff --git a/.config/nvim/lua/plugins/surround.lua b/.config/nvim/lua/plugins/surround.lua new file mode 100644 index 0000000..de12c85 --- /dev/null +++ b/.config/nvim/lua/plugins/surround.lua @@ -0,0 +1,8 @@ +return { + { + "kylechui/nvim-surround", + config = function() + require("nvim-surround").setup() + end + }, +} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..a661528 --- /dev/null +++ b/.config/nvim/lua/plugins/telescope.lua @@ -0,0 +1,48 @@ +return { + { + -- Диалоговое окно поиска + "nvim-telescope/telescope.nvim", tag = "0.1.5", + -- event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-ui-select.nvim", + "nvim-telescope/telescope-file-browser.nvim", + "nvim-telescope/telescope-symbols.nvim" + }, + keys = { + { "tff", "Telescope find_files" }, + { "tg", "Telescope live_grep" }, + { "tb", "Telescope buffers" }, + { "th", "Telescope help_tags" }, + + { "tfb", "Telescope file_browser" }, + { "ts", "Telescope symbols" } + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + telescope.setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}) + }, + ["file_browser"] = { + theme = "ivy", + }, + ["symbols"] = {} + }, + pickers = { + buffers = { + mappings = { + i = { [""] = actions.delete_buffer + actions.move_to_top }, + n = { [""] = actions.delete_buffer + actions.move_to_top } + } + } + } + }) + + telescope.load_extension("file_browser") + telescope.load_extension("ui-select") + end, + } +} diff --git a/.config/nvim/lua/plugins/terminal.lua b/.config/nvim/lua/plugins/terminal.lua new file mode 100644 index 0000000..6c24785 --- /dev/null +++ b/.config/nvim/lua/plugins/terminal.lua @@ -0,0 +1,18 @@ +return { + { + "akinsho/toggleterm.nvim", + version = "*", + config = true, + keys = { + { "T", "ToggleTerm" }, + { "Tf", "ToggleTerm direction=float" }, + { "Th", "ToggleTerm direction=horizontal" }, + { "Tv", "ToggleTerm direction=vertical" }, + { "", [[]], mode = "t" }, + { "", "ToggleTerm", mode = "t" }, + { "", false, mode = "t" }, + { "c", [[:bd!]], mode = "t" } + } + } + +} diff --git a/.config/nvim/lua/plugins/todo_comments.lua b/.config/nvim/lua/plugins/todo_comments.lua new file mode 100644 index 0000000..bbdf2ba --- /dev/null +++ b/.config/nvim/lua/plugins/todo_comments.lua @@ -0,0 +1,16 @@ +return { + { + "folke/todo-comments.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "folke/trouble.nvim" + }, + opts = {}, + config = function() + require("todo-comments").setup() + end, + keys = { + { "Ct", "TroubleToggle todo" } + } + } +} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..4c0c741 --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,31 @@ +return { + { + -- Подсветка синтаксиса + "nvim-treesitter/nvim-treesitter", + dependencies = { + "windwp/nvim-ts-autotag", + }, + build = ":TSUpdate", + config = function () + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { + "html", "markdown", "latex", + "css", "scss", -- "less", not found + "javascript", -- "jsx", not found + "typescript", "tsx", + "python", "lua", + "vim", "vimdoc", "query", + "bash", + "c", + "json", "yaml", + }, + sync_install = false, + highlight = { enable = true }, + incremental_selection = { enable = true }, + indent = { enable = true }, + autotag = { enable = true } + }) + end + } +} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..6072c0c --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,20 @@ +return { + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + keys = { + { "tt", "TroubleToggle" }, + { "tc", "TroubleClose" }, + + { "ttw", "TroubleToggle workspace_diagnostics" }, + { "ttd", "TroubleToggle document_diagnostics" }, + + { "ttf", "TroubleToggle quickfix" }, + { "ttl", "TroubleToggle loclist" }, + + { "tlr", "TroubleToggle lsp_references" }, + { "tld", "TroubleToggle lsp_definitions" }, + { "tltd", "TroubleToggle lsp_type_definitions" }, + } + } +} diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini index cac1e45..3b11c43 100644 --- a/.config/polybar/config.ini +++ b/.config/polybar/config.ini @@ -27,7 +27,7 @@ module-margin = 1 font-0 = CodeNewRoman Nerd Font Mono:pixelsize=10;3 modules-left = xworkspaces -modules-right = pulseaudio xkeyboard date systray +modules-right = pulseaudio xkeyboard date numen systray cursor-click = pointer cursor-scroll = ns-resize @@ -88,6 +88,17 @@ type = internal/tray format-margin = 0pt tray-spacing = 2pt +[module/numen] +type = custom/script +exec = [[ $(pgrep numen) ]] && cat ~/.config/numen/current_mode || echo "" +interval = 1 +click-left = pkill numen + +; [module/weather] +; type = custom/script +; exec = curl -s -H "Accept-Language: ru" wttr.in/Samara?format="%c+%t+%m" +; interval = 1 + [settings] screenchange-reload = true pseudo-transparency = true diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 80e6fc1..3540c38 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -1,3 +1,20 @@ +# +# Screenshots +# +Print + screenshot_dir_name="$HOME/Data/Pictures/Screen Shots/$(date +"%Y-%m-%d")"; \ + screenshot_file_name="$(date +"%Y-%m-%d_%H%M%S")"; \ + mkdir -p "$screenshot_dir_name"; \ + maim -sq "$screenshot_dir_name/$screenshot_file_name".png; \ + xclip -selection clipboard -t image/png -i "$screenshot_dir_name/$screenshot_file_name".png + +shift + Print + screenshot_dir_name="$HOME/Data/Pictures/Screen Shots/$(date +"%Y-%m-%d")"; \ + screenshot_file_name="$(date +"%Y-%m-%d_%H%M%S")_FS"; \ + mkdir -p "$screenshot_dir_name"; \ + maim -q "$screenshot_dir_name/$screenshot_file_name".png; \ + xclip -selection clipboard -t image/png -i "$screenshot_dir_name/$screenshot_file_name".png + # # wm independent hotkeys # diff --git a/.xinitrc b/.xinitrc index 61265da..0cec1fa 100644 --- a/.xinitrc +++ b/.xinitrc @@ -2,7 +2,8 @@ setxkbmap -option grp:ctrl_shift_toggle us,ru libinput-gestures & -wal --theme base16-gruvbox-hard +# wal --theme base16-gruvbox-hard +wal --theme ~/.config/colorschemes/vscode.json polybar -r & @@ -10,7 +11,14 @@ picom & pactl -- set-sink-volume 0 25% -numen ~/.config/numen/phrases.phrases --phraselog=phrases.txt & +numen ~/.config/numen/startup.phrasess.txt & +echo "[R]" > ~/.config/numen/current_mode + +conky -c ~/.config/conky/conky.conf & +conky -c ~/.config/conky/weather.conf & +conky -c ~/.config/conky/icon.conf & + +[ ! -s ~/.config/mpd/pid ] && mpd ~/.config/mpd/mpd.conf && mpc stop exec sxhkd -c ~/.config/sxhkd/sxhkdrc & exec bspwm