Актуализировал от буливея
This commit is contained in:
parent
1162196c64
commit
ce68e64f15
32 changed files with 445 additions and 239 deletions
|
@ -70,9 +70,8 @@
|
|||
| `Super + B` | Browser LibreWolf. Основа | Да |
|
||||
| `Super + Shift + B` | Browser Firefox. Паблик активность | Да |
|
||||
| `Super + Shift + Ctrl + B` | Browser Chromium. Пусть будет | Да |
|
||||
| `Super + N` | Note taking app (obsidian) | Да |
|
||||
| `Super + E` | Explorer. Thunar file manager | Да |
|
||||
| `Super + I` | IDE, text editor, NeoVim | Да |
|
||||
| `Super + I` | IDE, text editor | Да |
|
||||
| `Super + M` | Monitor of resources (btop) | Да |
|
||||
| `Super + G` | Goals. Todo manager. Task tracker | Да |
|
||||
| `Super + Shift + C` | Color picker. Получить hex в буфер обмена | Да |
|
||||
|
@ -112,6 +111,7 @@
|
|||
|
||||
- [Копия man page для bspwm с доп инфой](./modules/home-manager/wm/bspwm/bspwm.md)
|
||||
- [Описание плагинов для mpv](./modules/home-manager/mpv/README.md)
|
||||
- [NeoVim config](./nvim/README.md)
|
||||
|
||||
## Проблемы
|
||||
|
||||
|
@ -229,6 +229,8 @@ font = lib.mkForce "JetBrainsMono Nerd Font 11";
|
|||
ip a
|
||||
```
|
||||
|
||||
В бутменю биоса надо ставить не ссд диск, а `nixos boot`. У меня иначе не работало
|
||||
|
||||
## Нюансы с JetBrains Toolbox
|
||||
|
||||
В стоке тулбокс может всегда разлогинивать. Я не проверял, сразу сделал как просили на вики, чтоб это исправить.
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"x-scheme-handler/unknown" = [ "librewolf.desktop" ];
|
||||
# Images
|
||||
"image/*" = [ "qview.desktop" "imv.desktop" ];
|
||||
"image/avif" = [ "qview.desktop" "imv.desktop" ];
|
||||
"image/avif" = [ "imv.desktop" "qview.desktop" ];
|
||||
"image/gif" = [ "qview.desktop" "imv.desktop" ];
|
||||
"image/jpeg" = [ "qview.desktop" "imv.desktop" ]; # Обычный jpeg, прогрузка сверху вниз
|
||||
"image/pjpeg" = [ "qview.desktop" "imv.desktop" ]; # Сначала размытый и постепенной лучше видно, для медленного инета
|
||||
|
@ -90,7 +90,7 @@
|
|||
associations.added = { # Дополнительные приложения для нужного файла. Будет в меню "Открыть с помощью"
|
||||
# Images
|
||||
"image/*" = [ "qview.desktop" "imv.desktop" ];
|
||||
"image/avif" = [ "qview.desktop" "imv.desktop" ];
|
||||
"image/avif" = [ "imv.desktop" "qview.desktop" ];
|
||||
"image/gif" = [ "qview.desktop" "imv.desktop" ];
|
||||
"image/jpeg" = [ "qview.desktop" "imv.desktop" ]; # Обычный jpeg, прогрузка сверху вниз
|
||||
"image/pjpeg" = [ "qview.desktop" "imv.desktop" ]; # Сначала размытый и постепенной лучше видно, для медленного инета
|
||||
|
|
6
flake.lock
generated
6
flake.lock
generated
|
@ -263,11 +263,11 @@
|
|||
},
|
||||
"nixpkgs2": {
|
||||
"locked": {
|
||||
"lastModified": 1733392399,
|
||||
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
|
||||
"lastModified": 1736344531,
|
||||
"narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661",
|
||||
"rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
imports = [
|
||||
./ranger/ranger.nix
|
||||
|
||||
#./gui/vscode.nix
|
||||
./gui/vscode.nix
|
||||
|
||||
./imv/imv.nix
|
||||
./mpv/mpv.nix
|
||||
|
|
|
@ -22,11 +22,9 @@
|
|||
upg = "sudo nixos-rebuild switch --impure --upgrade --flake ${flakeDir}"; # Обновить пакеты, но не репозиторий во fleke.lock
|
||||
|
||||
# Обновить все flake inputs до последних версий. Возможно это аналог "sudo pacman -Sy" на Arch Linux
|
||||
upd = "nix flake update --recreate-lock-file ${flakeDir}";
|
||||
|
||||
# Update Single flake input. Требует дописать имя инпута после команды
|
||||
# Для my-lib.url надо писать `upds my-lib`
|
||||
upds = "nix flake lock --update-input";
|
||||
# Если после upd дописать название инпута из flake.nix, то обновится только указанный инпут
|
||||
# Например `upd nixpkgs2` для обновления анстабле репы
|
||||
upd = "sudo nix flake update --flake ${flakeDir}";
|
||||
|
||||
# Garbage collector. Удалить все не используемые пакеты (например после обновы)
|
||||
grb = "sudo nix-collect-garbage -d";
|
||||
|
@ -104,4 +102,4 @@
|
|||
zsh-you-should-use # Напомнит, если у написанной команды есть алиас
|
||||
zsh-nix-shell # zsh plugin that lets you use zsh in nix-shell shell
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,8 @@
|
|||
state = "floating";
|
||||
};
|
||||
in { # А тут правила окон
|
||||
"Screenkey" = { manage = false; };
|
||||
# "Screenkey" = { manage = false; };
|
||||
# "Screenkey" = floating;
|
||||
"gcolor3" = floating;
|
||||
"obs" = floating;
|
||||
"steam" = floating;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
./sound.nix
|
||||
./stylix.nix
|
||||
./virtualisation.nix
|
||||
./vr.nix
|
||||
./xserver.nix
|
||||
];
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 388 KiB After Width: | Height: | Size: 388 KiB |
|
@ -57,6 +57,7 @@
|
|||
};
|
||||
# Ниже настройки для минимальной задержки в играх (например osu!stable через wine)
|
||||
# quantum — устанавливает размер буфера (чем меньше значение, тем ниже задержка, но выше нагрузка на процессор).
|
||||
# Можно посчитать теоретическую задержку в секундах, поделив quantum на rate (48/48000 будет 1мс)
|
||||
# Если со звуком есть проблемы (щелчки, прерывания), попробуйте увеличить значение (64, 128, 256) или просто удалить эту настройку
|
||||
# По умолчанию я закомментировал настройку, чтоб у людей не было проблем
|
||||
# "92-low-latency" = {
|
||||
|
@ -66,4 +67,4 @@
|
|||
# };
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,10 +87,10 @@
|
|||
|
||||
# gdk-pixbuf-query-loaders | grep avif
|
||||
# ls /run/current-system/sw/lib/gdk-pixbuf-2.0/2.10.0/loaders/
|
||||
gdk-pixbuf.modulePackages = with pkgs; [
|
||||
webp-pixbuf-loader
|
||||
libavif
|
||||
];
|
||||
# gdk-pixbuf.modulePackages = with pkgs; [
|
||||
# webp-pixbuf-loader
|
||||
# libavif
|
||||
# ];
|
||||
|
||||
steam = {
|
||||
enable = true;
|
||||
|
@ -139,7 +139,7 @@
|
|||
gnumake # ?
|
||||
cmake-language-server # CMake LSP
|
||||
cmake # ?
|
||||
bear # Tool that generates a compilation database for clang tooling
|
||||
# bear # Tool that generates a compilation database for clang tooling
|
||||
# boost # Collection of C++ libraries
|
||||
|
||||
# Rust
|
||||
|
@ -216,8 +216,9 @@
|
|||
wget
|
||||
curl
|
||||
git
|
||||
xclip # Для работы буфера обмена
|
||||
xclip # Буфер обмена
|
||||
ffmpeg_7 # Обработка видео. Нужен всегда и везде как зависимость
|
||||
# imlib2Full # Image manipulation library
|
||||
imagemagick # Обработка изображений. Мб тоже нужен всегда
|
||||
vips # В 4 раза быстрее imagemagick?
|
||||
tree # Структура файлов в терминале
|
||||
|
@ -303,13 +304,12 @@
|
|||
###################
|
||||
|
||||
ranger # Terminal file manager
|
||||
# nautilus # Gnome file manager
|
||||
xfce.thunar # GUI file manager (допы выше в `programs` и `services`)
|
||||
xfce.catfish # File searching (for Thunar)
|
||||
xfce.exo # Мб надо, чтоб терминал открывать в каталоге
|
||||
ffmpegthumbnailer # A lightweight video thumbnailer
|
||||
gnome-epub-thumbnailer # Thumbnailer for EPub and MOBI books
|
||||
nufraw-thumbnailer # Thumbnailer for .raw images from digital cameras
|
||||
# nufraw-thumbnailer # Thumbnailer for .raw images from digital cameras
|
||||
# mcomix # Comic book reader and image viewer. Thumbnailer for .crb comicbook archives (требует mupdf, который крашит систему)
|
||||
f3d # Fast and minimalist 3D viewer using VTK. Thumbnailer for 3D files, including glTF, stl, step, ply, obj, fbx.
|
||||
openscad # 3D model previews (stl, off, dxf, scad, csg). Этот именно для ranger, но мб пригодится и в других местах
|
||||
|
@ -331,7 +331,7 @@
|
|||
gdk-pixbuf.dev # Library for image loading and manipulation
|
||||
libwebp # .webp support
|
||||
libavif # AVIF format support
|
||||
libheif # HEIF format support
|
||||
# libheif # HEIF format support
|
||||
libgsf # .odf support
|
||||
libjxl # JPEG-XL format support
|
||||
libraw # RAW format support
|
||||
|
@ -379,7 +379,7 @@
|
|||
# steam # Мб не надо сюда писать, раз через programs.steam редачу
|
||||
# heroic # A Native GOG, Epic, and Amazon Games Launcher for Linux, Windows and Mac
|
||||
# lutris # Запускать игры не из стима
|
||||
bottles # Минималистичная альтернатива lutris
|
||||
# bottles # Минималистичная альтернатива lutris
|
||||
|
||||
# Мб зависимости
|
||||
steam-run # На всякий случай
|
||||
|
@ -461,7 +461,7 @@
|
|||
vial # GUI для qmk, если клавиатура поддерживает
|
||||
fontconfig
|
||||
zlib
|
||||
google-fonts
|
||||
# google-fonts
|
||||
libva-utils # Проверяет работоспособность VAAPI?
|
||||
clinfo # Проверяет работоспособность OpenCL?
|
||||
libsecret # Хранить и получать аккаунты у приложений. Например для jetbrains toolbox
|
||||
|
|
169
nvim/README.md
169
nvim/README.md
|
@ -2,6 +2,15 @@
|
|||
|
||||
Тут будет лежать мой конфиг nvim. Я хочу, чтоб он был отдельно от nix конфигов, чтоб не надо было ничего ребилдить.
|
||||
|
||||
Первый запуск конфига может быть долгим. Не прерывай этот процесс, пока не появится меню плагин манагера
|
||||
|
||||
Для выбора варианта из автокомплита надо жать ctrl+y, а не enter. Это можно исправить в конфиге, но я решил оставить так, как советует разраб kickstart.nvim, потому что я часто был в ситуации, когда готовая ide даёт мне вариант, но он мне не нужен, я уже написал свой, и мне надо перейти на новую строку, я жму enter и получаю комплит, который мне не нужен, мне новая строка нужна была.
|
||||
|
||||
Вкладки как в vscode я решил не делать, тут есть более удобный инструмент для этого. Например два раза нажать пробел в нормал моде, откроется меню буферов, тоесть файлов, которые в данный момент открыты. Отображаются они в порядке последнего открытия. Ныне открытый файл там не отображается. Это аналог ctrl+tab в vscode. Можно легко и быстро переключаться между "вкладками". Если надо искать что-то среди файлов проекта, то можно нажать пробел sf, от слов search files. В целом пробел+s это поиск чего-то. Подсказки на экране скажут поиск чего будет происходить. Grep поиск это поиск по содержимому всех файлов проекта.
|
||||
https://medium.com/@jogarcia/you-dont-need-tabs-in-neovim-c6ba5ee44e3e
|
||||
|
||||
Если будут проблемы с сессиями, то можно написать `:SessionDelete`. Для выхода из проекта лучше использовать `:qa`, а не `:q`, чтоб закрыть все буферы и не ломать сессии
|
||||
|
||||
Конфиг сделан для NixOS. Я не знаю работает ли он в других дистрибутивах.
|
||||
|
||||
Сайт с топами плагинов и тем - https://dotfyle.com/neovim/colorscheme/top
|
||||
|
@ -12,7 +21,7 @@ LSP list - https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.txt
|
|||
|
||||
> ⚠️ **Warning**: Некоторых lsp в mason не существует и их надо качать отдельно. Или они не работают в NixOS, если их качать через mason. Такие lsp я настроил отдельно и скачал как пакет. Из конфига mason я их удалил. **Не скачай случайно эти lsp через mason руками, когда они уже настроены как отдельный пакет**. Это же касается форматтеров и линтеров. Их я стараюсь качать как системный пакет, а не через mason.
|
||||
|
||||
> ⚠️ **Warning**: Возможно в будущем я вообще перестану что либо качать через mason, используя его только как поиск разных инструментов для нужного мне языка. Так что лучше ничего не качать через него
|
||||
> ⚠️ **Warning**: Я вообще перестал качать что либо через mason, используя его только как поиск разных инструментов для нужного мне языка. Так что лучше ничего не качать через него.
|
||||
|
||||
## Установка
|
||||
На новом пк руками делаю симлинк в `~/.config/nvim`.
|
||||
|
@ -21,6 +30,9 @@ LSP list - https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.txt
|
|||
ln -s ~/nixos-private-dots/nvim ~/.config/nvim
|
||||
```
|
||||
### Зависимости
|
||||
|
||||
Для работы этого конфига надо установить некоторые пакеты в систему. Часть из них я напишу ниже, часть находится в `packages.nix` в категории `программирование`
|
||||
|
||||
Это мне пришлось скачать для работы конфига на NixOS с нужными мне инструментами:
|
||||
- `neovim`
|
||||
- `git`
|
||||
|
@ -30,35 +42,8 @@ ln -s ~/nixos-private-dots/nvim ~/.config/nvim
|
|||
- `xclip` на X11 или `wl-clipboard` на Wayland
|
||||
- `tree-sitter`
|
||||
- Любой nerd font
|
||||
- C/C++:
|
||||
- `gcc`
|
||||
- `gnumake`
|
||||
- `rocmPackages.llvm.clang`
|
||||
- `ccls` (lsp, нет в mason)
|
||||
- Lua:
|
||||
- `lua5_1`
|
||||
- `luajit`
|
||||
- `luajitPackages.luarocks` (package manager)
|
||||
- `lua-language-server` (lsp, из mason не работает на NixOS)
|
||||
- `stylua` (formatter, из mason не работает на NixOS)
|
||||
- Rust:
|
||||
- `rustup` и потом запустить `rustup default stable` + `rustup component add rust-analyzer` в терминале
|
||||
- `rust-analyzer` (lsp)
|
||||
- JS/TS:
|
||||
- `nodejs_23` для npm (package manager)
|
||||
- Python:
|
||||
- `python3Full`
|
||||
- `python3Packages.pip` (package manager)
|
||||
- `ruff` (linter/formatter, из mason не работает на NixOS)
|
||||
- Golang:
|
||||
- `go`
|
||||
- `golangci-lint` (linter)
|
||||
- `templ` (HTML UI in Go)
|
||||
- Nix:
|
||||
- `nixd` (lsp, нет в mason)
|
||||
- Bash:
|
||||
- `shellcheck` (linter)
|
||||
- `shfmt` (formatter)
|
||||
|
||||
Пакеты для разных языков могут часть меняться, так что ищем в `packages.nix`
|
||||
|
||||
Чтоб понять есть ли проблемы с конфигом, может какие-то пакеты отсутствуют, можно запустить `:healthcheck`.
|
||||
|
||||
|
@ -68,15 +53,125 @@ ln -s ~/nixos-private-dots/nvim ~/.config/nvim
|
|||
|
||||
### Мои бинды
|
||||
|
||||
|Бинд|Действие|
|
||||
|-|-|
|
||||
|1|2|
|
||||
Все бинды можно искать прям в neovim, если нажать `Space s k`, тоесть `S`earch `K`eymaps
|
||||
|
||||
### Были изначально в kickstart.nvim
|
||||
Я не помню откуда эти бинды, может они есть в стоке, а может нет, но они полезные.
|
||||
|
||||
| Bind | Description |
|
||||
| -------------- | ---------------------------------- |
|
||||
| `K` | Hover documentation |
|
||||
| `ctrl+o` | Go back |
|
||||
| `ctrl+i` | Go forward (if you went backwards) |
|
||||
| `p` | Paste from nvim register |
|
||||
| `ctrl+shift+v` | Paste from system clipboard |
|
||||
| `y` | Yank(copy) to nvim register |
|
||||
| `space y` | Yank(copy) to system clipboard |
|
||||
| `d` | Delete(copy) to nvim register |
|
||||
| `space d` | Delete(copy) to system clipboard |
|
||||
| `alt + up/down/j/k` | Move lines in visual mode |
|
||||
| `[d` | Go to previous `D`iagnostic message |
|
||||
| `]d` | Go to next `D`iagnostic message |
|
||||
| `space e` | Show diagnostic `E`rror message |
|
||||
| `space q` | Open diagnostic `Q`uickfix |
|
||||
|
||||
|
||||
Бинды в таблице ниже нажимаются без пробела перед ними. Просто бинд
|
||||
|
||||
| Bind | Description | File |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
||||
| <nobr>`esc esc`</nobr> | Exit terminal mode (This won't work in all terminal emulators/tmux/etc. Try your own mapping or use `<C-\><C-n>` to exit terminal mode) | settings.lua |
|
||||
| `esc` | Creal highlights on search when pressing Esc in normal mode | settings.lua |
|
||||
| `gp` | `G`oto context (`p`arent) | treesitter.lua |
|
||||
| `gd` | `G`oto `D`efinition | lsp.lua |
|
||||
| `gr` | `G`oto `R`eferences | lsp.lua |
|
||||
| `gI` | `G`oto `I`mplementation | lsp.lua |
|
||||
| `gD` | `G`oto `D`eclaration. This is not Goto Definition, this is Goto Declaration. For example, in C this would take you to the header | lsp.lua |
|
||||
| `gc` | Toggle Comment from mini-comment plugin | - |
|
||||
| `\` | Toggle file tree | file-tree.lua |
|
||||
|
||||
Перед каждым из биндов в нижней таблице надо нажать `leader`, что есть `space`, пробел.
|
||||
|
||||
| Bind | Description | File |
|
||||
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
|
||||
| `tt` | `T`oggle `T`erminal | terminal.lua |
|
||||
| `gta` | `G`o `T`ag `A`dd. Add json tags for struct | golang.lua |
|
||||
| `gtr` | `G`o `T`ag `R`emove. Remove json tags for struct | golang.lua |
|
||||
| `gfs` | `G`o `F`ill `S`truct | golang.lua |
|
||||
| `gfc` | `G`o `F`ill Switch `C`ase | golang.lua |
|
||||
| `gie` | `G`o `I`f `E`rr | golang.lua |
|
||||
| `gfp` | `G`o `F`ix `P`lurals | golang.lua |
|
||||
| `D` | Type `D`efinition. Jump to the typo of the word under your cursor. Useful when you're not sure what type a variable is and you want to see the definition of its *type*, not where it was *defined*. | lsp.lua |
|
||||
| `ds` | `D`ocument `S`ymbols. Fuzzy find all the symbols in your current document. Symbols are things like variables, funckions, types, etc. | lsp.lua |
|
||||
| `ws` | `W`orkspace `S`ymbols. Fuzzy find all the symbols in your currend workspace. Similar to document symbols, except searches over you entire project | lsp.lua |
|
||||
| `rn` | `R`e`n`ame. Rename the variable under your cursor. Most Language Servers support renaming across files, etc. | lsp.lua |
|
||||
| `ca` | `C`ode `A`ction. Execute a code action, usually your cursor needs to be on top of an error or a suggestion from your LSP for this to activate | lsp.lua |
|
||||
| `sh` | `S`earch `H`elp | health.lua |
|
||||
| `sk` | `S`earch `K`eymaps | health.lua |
|
||||
| `sf` | `S`earch `F`iles | health.lua |
|
||||
| `ss` | `S`earch `S`elect Telescope | health.lua |
|
||||
| `sw` | `S`earch current `W`ord | health.lua |
|
||||
| `sg` | `S`earch by `G`rep | health.lua |
|
||||
| `sd` | `S`earch `D`iagnostics | health.lua |
|
||||
| `sr` | `S`earch `R`esume | health.lua |
|
||||
| `s.` | `S`earch Recent Files ("." for repeat) | health.lua |
|
||||
| `space` | Find existing buffers. Аналог перелючения между вкладками | health.lua |
|
||||
| `/` | Fuzzily search in current buffer | health.lua |
|
||||
| `s/` | `S`earch `/` in Open Files. Live Grep in Open Files | health.lua |
|
||||
| `sn` | `S`earch `N`eovim files. Shortcut for searching your Neovim configuration files | health.lua |
|
||||
| `st` | `S`earch `T`hemes | health.lua |
|
||||
| `q` | Open diagnostic `Q`uicfix list | settings.lua |
|
||||
| `f` | `F`ormat buffer | autoformat.lua |
|
||||
|
||||
|
||||
### Git
|
||||
|
||||
Бинды начинаются с буквы `h`. Типо "Git `H`unk"
|
||||
|
||||
Без пробела
|
||||
|
||||
| Bind | Description | File |
|
||||
| ---- | ----------------------------- | ------------ |
|
||||
| `]c` | Jump to next git `C`hange | gitsigns.lua |
|
||||
| `[c` | Jump to previous git `C`hange | gitsigns.lua |
|
||||
Visual mode. С пробелом
|
||||
|
||||
| Bind | Description | File |
|
||||
| ---- | ---------------- | ------------ |
|
||||
| `hs` | `S`tage git hunk | gitsigns.lua |
|
||||
| `hr` | `R`eset git hunk | gitsigns.lua |
|
||||
Normal mode. С пробелом
|
||||
|
||||
| Bind | Description | File |
|
||||
| ---- | ------------------------------ | ------------ |
|
||||
| `hs` | Git `S`tage hunk | gitsigns.lua |
|
||||
| `hr` | Git `R`eset hunk | gitsigns.lua |
|
||||
| `hS` | Git `S`tage buffer | gitsigns.lua |
|
||||
| `hu` | Git `U`ndo stage hunk | gitsigns.lua |
|
||||
| `hR` | Git `R`eset buffer | gitsigns.lua |
|
||||
| `hp` | Git `P`review hunk | gitsigns.lua |
|
||||
| `hb` | Git `B`lame line | gitsigns.lua |
|
||||
| `hd` | Git `D`iff against index | gitsigns.lua |
|
||||
| `hD` | Git `D`iff against last commit | gitsigns.lua |
|
||||
| `td` | `T`oggle git show `B`lame line | gitsigns.lua |
|
||||
| `tD` | `T`oggle git show `D`eleted | gitsigns.lua |
|
||||
### Debug
|
||||
|
||||
Без пробела
|
||||
|
||||
| Bind | Description | File |
|
||||
| ---- | ------------------------------ | --------- |
|
||||
| `F5` | Debug: Start/Continue | debug.lua |
|
||||
| `F1` | Debug: Step Into | debug.lua |
|
||||
| `F2` | Debug: Step Over | debug.lua |
|
||||
| `F3` | Debug: Step Out | debug.lua |
|
||||
| `F7` | Debug: See last session rusult | debug.lua |
|
||||
С пробелом
|
||||
|
||||
| Bind | Description | File |
|
||||
| ---- | -------------------------- | --------- |
|
||||
| `b` | Debug: Toggle `B`reakpoint | debug.lua |
|
||||
| `B` | Debug: Set `B`reakpoint | debug.lua |
|
||||
|
||||
|Бинд|Действие|
|
||||
|-|-|
|
||||
|1|2|
|
||||
|
||||
## Нюансы работы LSP/Linter/Formatter
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
-- [[ Базовые настройки. Не плагины ]]
|
||||
require 'kickstart.settings'
|
||||
require 'custom.plugins.terminal'
|
||||
require 'custom.terminal'
|
||||
|
||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||
-- git clone https://github.com/folke/lazy.nvim.git ~/.local/share/nvim/lazy/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'
|
||||
|
@ -77,7 +78,7 @@ require('lazy').setup({
|
|||
require 'kickstart.plugins.autopairs',
|
||||
|
||||
-- Browse the file system
|
||||
require 'kickstart.plugins.neo-tree',
|
||||
require 'kickstart.plugins.file-tree',
|
||||
|
||||
-------------------------------------
|
||||
-- Установил руками под свои нужды --
|
||||
|
@ -89,6 +90,12 @@ require('lazy').setup({
|
|||
-- Feature-Rich Go Plugin for Neovim
|
||||
require 'custom.plugins.golang',
|
||||
|
||||
-- Automated session manager
|
||||
require 'custom.plugins.sessions',
|
||||
|
||||
-- Plugins for git
|
||||
require 'custom.plugins.git',
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- This is the easiest way to modularize your config.
|
||||
--
|
||||
|
|
|
@ -1,52 +1,56 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
||||
"catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
|
||||
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||
"auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" },
|
||||
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" },
|
||||
"edge": { "branch": "master", "commit": "5b5a0683be0d9d8023a874ebf7e230095f4e1bae" },
|
||||
"everforest": { "branch": "master", "commit": "44c2659ffb6d26a994346974b4d12e988f43e5e5" },
|
||||
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"edge": { "branch": "master", "commit": "12ff979b43e3660053e14cd65101d5928e56f422" },
|
||||
"everforest": { "branch": "master", "commit": "84fbfc99c9853408682f104063a7ef4465dae46a" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
|
||||
"go.nvim": { "branch": "master", "commit": "c6d5ca26377d01c4de1f7bff1cd62c8b43baa6bc" },
|
||||
"gruvbox-material": { "branch": "master", "commit": "fca2ff9ba627bbf172548eb52fcbb03f99ba34e9" },
|
||||
"gruvbox-material": { "branch": "master", "commit": "e41451337d33997aff4c078a83165a9f66e2d38d" },
|
||||
"guihua.lua": { "branch": "master", "commit": "d783191eaa75215beae0c80319fcce5e6b3beeda" },
|
||||
"image.nvim": { "branch": "master", "commit": "b3e1af829a56bb038e5f81bf97798a2950064b62" },
|
||||
"image.nvim": { "branch": "master", "commit": "f1163cc2f6fff5b0de7c23c7502eee0df23a3e0e" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "ad3dddecd606746374ba4807324a08331dfca23c" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "18ae5771b22d8f913ef541c827a8180b4cb12c8a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" },
|
||||
"luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
|
||||
"luvit-meta": { "branch": "main", "commit": "55709f183b0742a7e4f47688c284f81148ad4dc0" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.nvim": { "branch": "main", "commit": "7ebfab26d77a4b9b05aaae565907e7fa4b2ee154" },
|
||||
"mini.nvim": { "branch": "main", "commit": "b1af49d98233180c6045e81f4aef5b663d032b62" },
|
||||
"monokai-pro.nvim": { "branch": "master", "commit": "6c15e36834a624a32f46c6db8f9fc063995b24b6" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "7557f26defd093c4e9bc17f28b08403f706f5a44" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "595ffb8f291fc4a9bef3201a28b7c0379a41cdee" },
|
||||
"nordic.nvim": { "branch": "main", "commit": "1ee4044077059b34eacd18d93613495a602c131f" },
|
||||
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" },
|
||||
"nvim-dap": { "branch": "master", "commit": "567da83810dd9da32f9414d941bc6848715fc102" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
|
||||
"nvim-dap": { "branch": "master", "commit": "0e673accbb512e1e191dfb4fecea89cc38c1bcdd" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
|
||||
"nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9f2c279cf9abe584f03bfeb37c6658d68e3ff49d" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" },
|
||||
"nvim-lint": { "branch": "master", "commit": "dfa45de973c3ce7bd1b9a6d346f896a68ad07e44" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" },
|
||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "3b8dee4293567b0b9a87360842af14669f60dd13" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "622a4a6ba76d1de52b72a965159213ae655b4ac7" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "d0dd7ce5a9d0be1f28086e818e52fdc5c78975df" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "1933318b98940b3e98ccbcd2828ae88c1bce8494" },
|
||||
"sonokai": { "branch": "master", "commit": "fd42b20963c34dfc1744ac31f6a6efe78f4edad2" },
|
||||
"rustaceanvim": { "branch": "master", "commit": "0a1876b970ab946be3f4d341e9d743a5d62d646a" },
|
||||
"sonokai": { "branch": "master", "commit": "836ad3994d3d0eaea68126cabddf6319508584e8" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" }
|
||||
"which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" }
|
||||
}
|
||||
|
|
5
nvim/lua/custom/plugins/git.lua
Normal file
5
nvim/lua/custom/plugins/git.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
{
|
||||
'sindrets/diffview.nvim',
|
||||
},
|
||||
}
|
|
@ -2,17 +2,23 @@
|
|||
|
||||
return {
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
'ray-x/go.nvim',
|
||||
dependencies = { -- optional packages
|
||||
'ray-x/guihua.lua',
|
||||
'neovim/nvim-lspconfig',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
require('go').setup()
|
||||
vim.keymap.set({ 'n' }, '<leader>gta', ':GoAddTag<CR>', { desc = '[G]o [T]ag [A]dd' })
|
||||
vim.keymap.set({ 'n' }, '<leader>gtr', ':GoRmTag<CR>', { desc = '[G]o [T]ag [R]emove' })
|
||||
vim.keymap.set({ 'n' }, '<leader>gfs', ':GoFillStruct<CR>', { desc = '[G]o [F]ill [S]truct' })
|
||||
vim.keymap.set({ 'n' }, '<leader>gfc', ':GoFillSwitch<CR>', { desc = '[G]o [F]ill Switch [C]ase' })
|
||||
vim.keymap.set({ 'n' }, '<leader>gie', ':GoIfErr<CR>', { desc = '[G]o [I]f [E]rr' })
|
||||
vim.keymap.set({ 'n' }, '<leader>gfp', ':GoFixPlurals<CR>', { desc = '[G]o [F]ix [P]lurals' })
|
||||
end,
|
||||
event = {"CmdlineEnter"},
|
||||
ft = {"go", 'gomod'},
|
||||
event = { 'CmdlineEnter' },
|
||||
ft = { 'go', 'gomod' },
|
||||
-- build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
16
nvim/lua/custom/plugins/sessions.lua
Normal file
16
nvim/lua/custom/plugins/sessions.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
-- A small automated session manager for Neovim
|
||||
|
||||
return {
|
||||
{
|
||||
'rmagatti/auto-session',
|
||||
lazy = false,
|
||||
|
||||
---enables autocomplete for opts
|
||||
---@module "auto-session"
|
||||
---@type AutoSession.Config
|
||||
opts = {
|
||||
suppressed_dirs = { '~/', '~/Projects', '~/Downloads', '/' },
|
||||
-- log_level = 'debug',
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
|
||||
|
||||
local state = {
|
||||
floating = {
|
||||
buf = -1,
|
||||
win = -1,
|
||||
}
|
||||
}
|
||||
|
||||
local function create_floating_window(opts)
|
||||
opts = opts or {}
|
||||
local width = opts.width or math.floor(vim.o.columns * 0.8)
|
||||
local height = opts.height or math.floor(vim.o.lines * 0.8)
|
||||
|
||||
-- Calculate the position to center the window
|
||||
local col = math.floor((vim.o.columns - width) / 2)
|
||||
local row = math.floor((vim.o.lines - height) / 2)
|
||||
|
||||
-- Create a buffer
|
||||
local buf = nil
|
||||
if vim.api.nvim_buf_is_valid(opts.buf) then
|
||||
buf = opts.buf
|
||||
else
|
||||
buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer
|
||||
end
|
||||
|
||||
-- Define window configuration
|
||||
local win_config = {
|
||||
relative = "editor",
|
||||
width = width,
|
||||
height = height,
|
||||
col = col,
|
||||
row = row,
|
||||
style = "minimal", -- No borders or extra UI elements
|
||||
border = "rounded",
|
||||
}
|
||||
|
||||
-- Create the floating window
|
||||
local win = vim.api.nvim_open_win(buf, true, win_config)
|
||||
|
||||
return { buf = buf, win = win }
|
||||
end
|
||||
|
||||
local toggle_terminal = function()
|
||||
if not vim.api.nvim_win_is_valid(state.floating.win) then
|
||||
state.floating = create_floating_window { buf = state.floating.buf }
|
||||
if vim.bo[state.floating.buf].buftype ~= "terminal" then
|
||||
vim.cmd.terminal()
|
||||
end
|
||||
else
|
||||
vim.api.nvim_win_hide(state.floating.win)
|
||||
end
|
||||
end
|
||||
|
||||
-- Example usage:
|
||||
-- Create a floating window with default dimensions
|
||||
vim.api.nvim_create_user_command("Floaterminal", toggle_terminal, {})
|
||||
vim.keymap.set({ "n", "t" }, "<leader>tt", toggle_terminal, { desc = '[T]oggle [T]erminal' })
|
56
nvim/lua/custom/terminal.lua
Normal file
56
nvim/lua/custom/terminal.lua
Normal file
|
@ -0,0 +1,56 @@
|
|||
local state = {
|
||||
floating = {
|
||||
buf = -1,
|
||||
win = -1,
|
||||
},
|
||||
}
|
||||
|
||||
local function create_floating_window(opts)
|
||||
opts = opts or {}
|
||||
local width = opts.width or math.floor(vim.o.columns * 0.8)
|
||||
local height = opts.height or math.floor(vim.o.lines * 0.8)
|
||||
|
||||
-- Calculate the position to center the window
|
||||
local col = math.floor((vim.o.columns - width) / 2)
|
||||
local row = math.floor((vim.o.lines - height) / 2)
|
||||
|
||||
-- Create a buffer
|
||||
local buf = nil
|
||||
if vim.api.nvim_buf_is_valid(opts.buf) then
|
||||
buf = opts.buf
|
||||
else
|
||||
buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer
|
||||
end
|
||||
|
||||
-- Define window configuration
|
||||
local win_config = {
|
||||
relative = 'editor',
|
||||
width = width,
|
||||
height = height,
|
||||
col = col,
|
||||
row = row,
|
||||
style = 'minimal', -- No borders or extra UI elements
|
||||
border = 'rounded',
|
||||
}
|
||||
|
||||
-- Create the floating window
|
||||
local win = vim.api.nvim_open_win(buf, true, win_config)
|
||||
|
||||
return { buf = buf, win = win }
|
||||
end
|
||||
|
||||
local toggle_terminal = function()
|
||||
if not vim.api.nvim_win_is_valid(state.floating.win) then
|
||||
state.floating = create_floating_window { buf = state.floating.buf }
|
||||
if vim.bo[state.floating.buf].buftype ~= 'terminal' then
|
||||
vim.cmd.terminal()
|
||||
end
|
||||
else
|
||||
vim.api.nvim_win_hide(state.floating.win)
|
||||
end
|
||||
end
|
||||
|
||||
-- Example usage:
|
||||
-- Create a floating window with default dimensions
|
||||
vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {})
|
||||
vim.keymap.set({ 'n', 't' }, '<leader>tt', toggle_terminal, { desc = '[T]oggle [T]erminal' })
|
|
@ -70,4 +70,5 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ return {
|
|||
-- `friendly-snippets` contains a variety of premade snippets.
|
||||
-- See the README about individual language/framework/plugin snippets:
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
-- {
|
||||
-- 'rafamadriz/friendly-snippets',
|
||||
-- config = function()
|
||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
'rafamadriz/friendly-snippets',
|
||||
config = function()
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
|
@ -44,6 +44,7 @@ return {
|
|||
luasnip.config.setup {}
|
||||
|
||||
cmp.setup {
|
||||
preselect = cmp.PreselectMode.None,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
|
@ -56,25 +57,38 @@ return {
|
|||
--
|
||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
-- (enabled by default in nvim-cmp)
|
||||
-- Select the [n]ext item
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- ['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- Select the [p]revious item
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- Scroll the documentation window [b]ack / [f]orward
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- Accept ([y]es) the completion.
|
||||
-- This will auto-import if your LSP supports it.
|
||||
-- This will expand snippets if the LSP sent a snippet.
|
||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
-- ['<C-y>'] = cmp.mapping.confirm { select = true },
|
||||
|
||||
-- If you prefer more traditional completion keymaps,
|
||||
-- you can uncomment the following lines
|
||||
--['<CR>'] = cmp.mapping.confirm { select = true },
|
||||
--['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
-- ['<CR>'] = cmp.mapping.confirm { select = true },
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- Allows Up arrow to fall back without interacting with cmp
|
||||
['<Up>'] = cmp.mapping(function(fallback)
|
||||
cmp.close()
|
||||
fallback()
|
||||
end, { 'i', 'c' }),
|
||||
|
||||
-- Allows Up arrow to fall back without interacting with cmp
|
||||
['<Down>'] = cmp.mapping(function(fallback)
|
||||
cmp.close()
|
||||
fallback()
|
||||
end, { 'i', 'c' }),
|
||||
|
||||
-- Scroll the documentation window [b]ack / [f]orward
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
|
||||
-- Manually trigger a completion from nvim-cmp.
|
||||
-- Generally you don't need this, because nvim-cmp will display
|
||||
|
@ -116,4 +130,4 @@ return {
|
|||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,11 +10,11 @@ return {
|
|||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
{ -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
"3rd/image.nvim",
|
||||
'3rd/image.nvim',
|
||||
build = false, -- so that it doesn't build the rock
|
||||
opts = {
|
||||
backend = "ueberzug", -- or "kitty"
|
||||
processor = "magick_cli", -- or "magick_rock"
|
||||
backend = 'ueberzug', -- or "kitty"
|
||||
processor = 'magick_cli', -- or "magick_rock"
|
||||
},
|
||||
},
|
||||
},
|
|
@ -92,7 +92,8 @@ return {
|
|||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
-- Symbols are things like variables, functions, types, etc.
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
-- Было <leader>ds [D]ocument [S]ymbols
|
||||
map('<leader>S', require('telescope.builtin').lsp_document_symbols, 'Document [S]ymbols')
|
||||
|
||||
-- Fuzzy find all the symbols in your current workspace.
|
||||
-- Similar to document symbols, except searches over your entire project.
|
||||
|
@ -153,12 +154,12 @@ return {
|
|||
|
||||
-- Change diagnostic symbols in the sign column (gutter)
|
||||
if vim.g.have_nerd_font then
|
||||
local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
|
||||
local diagnostic_signs = {}
|
||||
for type, icon in pairs(signs) do
|
||||
diagnostic_signs[vim.diagnostic.severity[type]] = icon
|
||||
end
|
||||
vim.diagnostic.config { signs = { text = diagnostic_signs } }
|
||||
local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
|
||||
local diagnostic_signs = {}
|
||||
for type, icon in pairs(signs) do
|
||||
diagnostic_signs[vim.diagnostic.severity[type]] = icon
|
||||
end
|
||||
vim.diagnostic.config { signs = { text = diagnostic_signs } }
|
||||
end
|
||||
|
||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||
|
@ -178,17 +179,18 @@ return {
|
|||
-- - on_attach (func): Функция, которая вызывается, когда LSP подключается к буферу
|
||||
-- - settings (table): Override the default settings passed when initializing the server.
|
||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||
local servers = { -- WARN: Качает через mason. Может не работать в NixOS. Оставил для других OS на будущее
|
||||
-- See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- taplo
|
||||
}
|
||||
local servers =
|
||||
{ -- WARN: Качает через mason. Может не работать в NixOS. Оставил для других OS на будущее
|
||||
-- See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
--
|
||||
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- taplo
|
||||
}
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
local lspconfig = require 'lspconfig'
|
||||
|
||||
-- Nix
|
||||
lspconfig.nixd.setup {}
|
||||
|
@ -231,7 +233,6 @@ return {
|
|||
end,
|
||||
}
|
||||
|
||||
|
||||
-- Lua
|
||||
lspconfig.lua_ls.setup {
|
||||
settings = {
|
||||
|
@ -282,7 +283,6 @@ return {
|
|||
lspconfig.vimls.setup {}
|
||||
lspconfig.yamlls.setup {}
|
||||
|
||||
|
||||
-- Ensure the servers and tools above are installed
|
||||
-- To check the current status of installed tools and/or manually install
|
||||
-- other tools, you can run
|
||||
|
@ -312,5 +312,5 @@ return {
|
|||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -39,4 +39,3 @@ return {
|
|||
end,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -90,13 +90,16 @@ return {
|
|||
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||
vim.keymap.set('n', '<leader><leader>', function()
|
||||
builtin.buffers { sort_mru = true, ignore_current_buffer = true }
|
||||
end, { desc = '[ ] Find etisting buffers' })
|
||||
vim.keymap.set('n', '<leader>st', ':Telescope colorscheme<CR>', { desc = '[S]earch [T]hemes' })
|
||||
|
||||
-- Slightly advanced example of overriding default behavior and theme
|
||||
vim.keymap.set('n', '<leader>/', function()
|
||||
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
||||
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
||||
winblend = 10,
|
||||
-- winblend = 10,
|
||||
previewer = false,
|
||||
})
|
||||
end, { desc = '[/] Fuzzily search in current buffer' })
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
-- Чтоб сменить стандартную тему, надо раскомментировать vim.cmd.colorscheme пад именем темы
|
||||
-- и закомментировать это же у прошлой темы
|
||||
|
||||
-- В lazy.nvim параметр priority определяет порядок загрузки плагинов.
|
||||
-- Чем выше значение priority, тем раньше загружается плагин.
|
||||
-- Это особенно важно для тем, поскольку они часто требуют загрузки до других плагинов,
|
||||
-- В lazy.nvim параметр priority определяет порядок загрузки плагинов.
|
||||
-- Чем выше значение priority, тем раньше загружается плагин.
|
||||
-- Это особенно важно для тем, поскольку они часто требуют загрузки до других плагинов,
|
||||
-- чтобы корректно применить стили.
|
||||
|
||||
-- https://dotfyle.com/neovim/colorscheme/top
|
||||
|
@ -17,18 +17,17 @@ local variants = { 'default', 'atlantis', 'andromeda', 'shusia', 'maia', 'espres
|
|||
|
||||
-- Создаем псевдонимы для каждой темы
|
||||
for _, variant in ipairs(variants) do
|
||||
local alias = "sonokai-" .. variant
|
||||
vim.api.nvim_create_user_command("Colorscheme" .. variant, function()
|
||||
vim.g.sonokai_style = variant
|
||||
vim.cmd("colorscheme sonokai")
|
||||
end, {})
|
||||
local alias = 'sonokai-' .. variant
|
||||
vim.api.nvim_create_user_command('Colorscheme' .. variant, function()
|
||||
vim.g.sonokai_style = variant
|
||||
vim.cmd 'colorscheme sonokai'
|
||||
end, {})
|
||||
|
||||
-- Регистрируем в Neovim как отдельный colorscheme
|
||||
vim.api.nvim_set_hl(0, alias, {})
|
||||
vim.cmd(string.format("autocmd ColorSchemePre %s let g:sonokai_style = '%s' | colorscheme sonokai", alias, variant))
|
||||
-- Регистрируем в Neovim как отдельный colorscheme
|
||||
vim.api.nvim_set_hl(0, alias, {})
|
||||
vim.cmd(string.format("autocmd ColorSchemePre %s let g:sonokai_style = '%s' | colorscheme sonokai", alias, variant))
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
{
|
||||
'folke/tokyonight.nvim',
|
||||
|
@ -62,7 +61,7 @@ return {
|
|||
name = 'catppuccin',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- 'catppuccin', 'catppuccin-latte', 'catppuccin-frappe',
|
||||
-- 'catppuccin', 'catppuccin-latte', 'catppuccin-frappe',
|
||||
-- 'catppuccin-macchiato', 'catppuccin-mocha'
|
||||
-- vim.cmd.colorscheme 'catppuccin'
|
||||
end,
|
||||
|
@ -71,12 +70,12 @@ return {
|
|||
'rebelot/kanagawa.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- 'kanagawa-wave', 'kanagawa-dragon', 'kanagawa-lotus',
|
||||
-- 'kanagawa-wave', 'kanagawa-dragon', 'kanagawa-lotus',
|
||||
-- vim.cmd.colorscheme 'kanagawa-dragon'
|
||||
end,
|
||||
},
|
||||
{
|
||||
"EdenEast/nightfox.nvim",
|
||||
'EdenEast/nightfox.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- 'nightfox', 'dayfox', 'dawnfox', 'duskfox'
|
||||
|
@ -147,4 +146,5 @@ return {
|
|||
-- vim.cmd.colorscheme 'edge'
|
||||
end,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,4 +8,3 @@ return {
|
|||
opts = { signs = false },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -53,5 +53,28 @@ return {
|
|||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
},
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter' },
|
||||
config = function()
|
||||
require('treesitter-context').setup {
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
multiwindow = false, -- Enable multiwindow support.
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||
line_numbers = true,
|
||||
multiline_threshold = 3, -- Maximum number of lines to show for a single context
|
||||
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||
-- Separator between context and content. Should be a single character string, like '-'.
|
||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
||||
separator = nil,
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
|
||||
}
|
||||
vim.keymap.set('n', 'gp', function()
|
||||
require('treesitter-context').go_to_context(vim.v.count1)
|
||||
end, { silent = true, desc = '[G]oto context ([P]arent)' })
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||
return {
|
||||
'tpope/vim-sleuth', -- Detect expandtab and shiftwidth automatically
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,13 +60,15 @@ return {
|
|||
-- Document existing key chains
|
||||
spec = {
|
||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
||||
{ '<leader>d', group = '[D]ocument' },
|
||||
-- { '<leader>d', group = '[D]ocument' },
|
||||
{ '<leader>r', group = '[R]ename' },
|
||||
{ '<leader>s', group = '[S]earch' },
|
||||
{ '<leader>w', group = '[W]orkspace' },
|
||||
{ '<leader>t', group = '[T]oggle' },
|
||||
{ '<leader>g', group = '[G]olang' },
|
||||
{ '<leader>gt', group = '[G]olang [T]ag' },
|
||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ vim.opt.relativenumber = true
|
|||
|
||||
-- Табуляция в 4 символа
|
||||
vim.opt.tabstop = 4
|
||||
-- vim.opt.shiftwidth = 4
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.opt.mouse = 'a'
|
||||
|
@ -30,9 +31,29 @@ vim.opt.showmode = false
|
|||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end)
|
||||
-- vim.schedule(function()
|
||||
-- vim.opt.clipboard = 'unnamedplus'
|
||||
-- end)
|
||||
|
||||
-- Use system clipboard via <leader>y/d, but Neovim clipboard via just y/d
|
||||
vim.keymap.set('n', '<leader>y', '"+y', { desc = '[Y]ank to system clipboard' })
|
||||
vim.keymap.set('v', '<leader>y', '"+y', { desc = '[Y]ank to system clipboard' })
|
||||
-- vim.keymap.set('n', '<leader>Y', '"+Y', { desc = '[Y]ank to system clipboard' })
|
||||
vim.keymap.set('n', '<leader>d', '"_d', { desc = '[D]elete to system clipboard' })
|
||||
vim.keymap.set('v', '<leader>d', '"_d', { desc = '[D]elete to system clipboard' })
|
||||
|
||||
-- Change `K` hover documentation size
|
||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, {
|
||||
-- border = 'rounded',
|
||||
max_width = 80,
|
||||
-- max_height = 15,
|
||||
})
|
||||
|
||||
-- Move lines in visual mode
|
||||
vim.keymap.set('v', '<A-j>', ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set('v', '<A-Down>', ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set('v', '<A-k>', ":m '<-2<CR>gv=gv")
|
||||
vim.keymap.set('v', '<A-Up>', ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- Enable break indent
|
||||
vim.opt.breakindent = true
|
||||
|
@ -40,6 +61,15 @@ vim.opt.breakindent = true
|
|||
-- Save undo history
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Disable swap file
|
||||
vim.opt.swapfile = false
|
||||
|
||||
-- Settings for sessions
|
||||
vim.o.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
|
||||
|
||||
-- Highlight a vertical line at the specified column to encourage keeping lines within this limit
|
||||
vim.opt.colorcolumn = '100'
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
|
@ -105,6 +135,11 @@ vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left wind
|
|||
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
-- Use CTRL+arrows to switch between windows
|
||||
vim.keymap.set('n', '<C-Left>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||
vim.keymap.set('n', '<C-Right>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||
vim.keymap.set('n', '<C-Down>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-Up>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
@ -113,9 +148,9 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
|||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
Тут будут куски текста из разных источников. Я не хочу засирать ими свои заметки, кину сюда
|
||||
|
||||
```sql
|
||||
select * from pidor
|
||||
```
|
||||
|
||||
|
||||
## На будущее
|
||||
|
||||
Fix C/C++ - https://www.reddit.com/r/NixOS/comments/1d7zvgu/nvim_cant_find_standard_library_headers/
|
||||
|
|
|
@ -6,7 +6,7 @@ application/xml=nvim.desktop;codium.desktop
|
|||
application/yaml=nvim.desktop;codium.desktop
|
||||
image/*=com.interversehq.qView.desktop;imv.desktop
|
||||
image/apng=com.interversehq.qView.desktop;imv.desktop
|
||||
image/avif=imv.desktop;com.interversehq.qView.desktop
|
||||
image/avif=imv.desktop
|
||||
image/gif=com.interversehq.qView.desktop;imv.desktop
|
||||
image/jpeg=;com.interversehq.qView.desktop;imv.desktop;
|
||||
image/pjpeg=com.interversehq.qView.desktop;imv.desktop
|
||||
|
@ -56,7 +56,7 @@ audio/x-mpegurl=mpv.desktop
|
|||
audio/x-opus+ogg=mpv.desktop
|
||||
image/*=com.interversehq.qView.desktop;imv.desktop
|
||||
image/apng=com.interversehq.qView.desktop;imv.desktop
|
||||
image/avif=imv.desktop;com.interversehq.qView.desktop
|
||||
image/avif=imv.desktop
|
||||
image/gif=com.interversehq.qView.desktop;imv.desktop
|
||||
image/jpeg=com.interversehq.qView.desktop;imv.desktop
|
||||
image/pjpeg=com.interversehq.qView.desktop;imv.desktop
|
||||
|
|
Loading…
Add table
Reference in a new issue