Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9fab3f125d | |||
| a2b01fa801 | |||
| 15ca9992d1 |
26 changed files with 339 additions and 728 deletions
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -1,35 +0,0 @@
|
||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
<!-- Any bug report not following this template will be immediately closed. Thanks -->
|
|
||||||
|
|
||||||
## Before Reporting an Issue
|
|
||||||
- I have read the kickstart.nvim README.md.
|
|
||||||
- I have read the appropriate plugin's documentation.
|
|
||||||
- I have searched that this issue has not been reported before.
|
|
||||||
|
|
||||||
- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.**
|
|
||||||
|
|
||||||
## Describe the bug
|
|
||||||
<!-- A clear and concise description of what the bug is. -->
|
|
||||||
|
|
||||||
## To Reproduce
|
|
||||||
<!-- Steps to reproduce the behavior. -->
|
|
||||||
1. ...
|
|
||||||
|
|
||||||
## Desktop
|
|
||||||
<!-- please complete the following information. -->
|
|
||||||
- OS:
|
|
||||||
- Terminal:
|
|
||||||
|
|
||||||
## Neovim Version
|
|
||||||
<!-- Output of running `:version` from inside of neovim. -->
|
|
||||||
|
|
||||||
```
|
|
||||||
```
|
|
||||||
8
.github/pull_request_template.md
vendored
8
.github/pull_request_template.md
vendored
|
|
@ -1,8 +0,0 @@
|
||||||
***************************************************************************
|
|
||||||
**NOTE**
|
|
||||||
Please verify that the `base repository` above has the intended destination!
|
|
||||||
Github by default opens Pull Requests against the parent of a forked repository.
|
|
||||||
If this is your personal fork and you didn't intend to open a PR for contribution
|
|
||||||
to the original project then adjust the `base repository` accordingly.
|
|
||||||
**************************************************************************
|
|
||||||
|
|
||||||
21
.github/workflows/stylua.yml
vendored
21
.github/workflows/stylua.yml
vendored
|
|
@ -1,21 +0,0 @@
|
||||||
# Check Lua Formatting
|
|
||||||
name: Check Lua Formatting
|
|
||||||
on: pull_request_target
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stylua-check:
|
|
||||||
if: github.repository == 'nvim-lua/kickstart.nvim'
|
|
||||||
name: Stylua Check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
|
||||||
- name: Stylua Check
|
|
||||||
uses: JohnnyMorganz/stylua-action@v3
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
version: latest
|
|
||||||
args: --check .
|
|
||||||
|
|
||||||
273
README.md
273
README.md
|
|
@ -1,267 +1,26 @@
|
||||||
Сделай бекап старого конфига, если он есть и если он нужен. Конфиг находится тут: `~/.config/nvim`
|
Сделай бекап старого конфига, если он есть и если он нужен. Конфиг находится тут: `~/.config/nvim`
|
||||||
|
|
||||||
|
Это вариант конфига, который я ставлю на сервер.
|
||||||
|
|
||||||
Первый запуск конфига может быть долгим. Не прерывай этот процесс, пока не появится меню плагин манагера.
|
Первый запуск конфига может быть долгим. Не прерывай этот процесс, пока не появится меню плагин манагера.
|
||||||
|
|
||||||
Надо скачать:
|
```sh
|
||||||
- `neovim`
|
sudo pacman -Sy neovim git ripgrep fd unzip npm gcc ttf-jetbrains-mono-nerd noto-fonts-emoji go rustup ueberzugpp
|
||||||
- `git`
|
```
|
||||||
- `ripgrep`
|
К этим пакетам добавь `wl-clipboard` если ты на wayland или `xclip`, если на X11
|
||||||
- `fd`
|
Если тебе не нужна поддержка языков программирования `go` и `rust`, то удали соответствующие пакеты из списка. Для поддержки `rust` надо дописать это в терминал, чтоб скачать ласт версию языка:
|
||||||
- `unzip`
|
```sh
|
||||||
- `npm` (на некоторых дистрах он отдельно, на некоторых является частью `nodejs`, на всякий качаю оба пакета)
|
rustup default stable
|
||||||
- Что-то для буфера обмена. На X11 это `xclip`, на Wayland это `wl-clipboard`. На маке и винде не знаю что надо качать.
|
```
|
||||||
- Любой nerd font. У меня это `JetBrainsMono Nerd Font Mono`
|
|
||||||
|
|
||||||
Установить этот конфиг на Linux или Mac можно так:
|
Установить этот конфиг на Linux или Mac можно так:
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/buliway/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
git clone --branch arch --single-branch --depth 1 https://github.com/Buliway/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
||||||
```
|
|
||||||
Для винды через `cmd.exe` так:
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/buliway/kickstart.nvim.git "%localappdata%\nvim"
|
|
||||||
```
|
|
||||||
Для винды через `powershell.exe` так:
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/buliway/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# kickstart.nvim
|
Если надо больше информации по установке и настройке, то вот доп источники:
|
||||||
|
- [kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) - Оригинальный конфиг, который я взял за основу и немного дополнил. В их readme много дополнительной информации.
|
||||||
## Introduction
|
- [The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) - Гайд по `kickstart.nvim`. Название видео говорит как есть. Мне очень сильно помогло создать свой конфиг.
|
||||||
|
- [0 to LSP : Neovim RC From Scratch](https://youtu.be/w7i4amO_zaE) - Старый гайд по настройке NeoVim с нуля. Некоторые настройки и плагины больше не актуальны, но мне понравилось видеть логику и рассуждения человека при составлении конфига с нуля.
|
||||||
A starting point for Neovim that is:
|
|
||||||
|
|
||||||
* Small
|
|
||||||
* Single-file
|
|
||||||
* Completely Documented
|
|
||||||
|
|
||||||
**NOT** a Neovim distribution, but instead a starting point for your configuration.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
### Install Neovim
|
|
||||||
|
|
||||||
Kickstart.nvim targets *only* the latest
|
|
||||||
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
|
||||||
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
|
||||||
If you are experiencing issues, please make sure you have the latest versions.
|
|
||||||
|
|
||||||
### Install External Dependencies
|
|
||||||
|
|
||||||
External Requirements:
|
|
||||||
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
|
||||||
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
|
|
||||||
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
|
||||||
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
|
||||||
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
|
||||||
- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji`
|
|
||||||
- Language Setup:
|
|
||||||
- If you want to write Typescript, you need `npm`
|
|
||||||
- If you want to write Golang, you will need `go`
|
|
||||||
- etc.
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes
|
|
||||||
> and quick install snippets
|
|
||||||
|
|
||||||
### Install Kickstart
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
|
||||||
|
|
||||||
Neovim's configurations are located under the following paths, depending on your OS:
|
|
||||||
|
|
||||||
| OS | PATH |
|
|
||||||
| :- | :--- |
|
|
||||||
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
|
||||||
| Windows (cmd)| `%localappdata%\nvim\` |
|
|
||||||
| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` |
|
|
||||||
|
|
||||||
#### Recommended Step
|
|
||||||
|
|
||||||
[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo
|
|
||||||
so that you have your own copy that you can modify, then install by cloning the
|
|
||||||
fork to your machine using one of the commands below, depending on your OS.
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> Your fork's URL will be something like this:
|
|
||||||
> `https://github.com/<your_github_username>/kickstart.nvim.git`
|
|
||||||
|
|
||||||
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
|
|
||||||
too - it's ignored in the kickstart repo to make maintenance easier, but it's
|
|
||||||
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
|
|
||||||
|
|
||||||
#### Clone kickstart.nvim
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> If following the recommended step above (i.e., forking the repo), replace
|
|
||||||
> `nvim-lua` with `<your_github_username>` in the commands below
|
|
||||||
|
|
||||||
<details><summary> Linux and Mac </summary>
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details><summary> Windows </summary>
|
|
||||||
|
|
||||||
If you're using `cmd.exe`:
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim"
|
|
||||||
```
|
|
||||||
|
|
||||||
If you're using `powershell.exe`
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
|
|
||||||
```
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### Post Installation
|
|
||||||
|
|
||||||
Start Neovim
|
|
||||||
|
|
||||||
```sh
|
|
||||||
nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
|
|
||||||
the current plugin status. Hit `q` to close the window.
|
|
||||||
|
|
||||||
#### Read The Friendly Documentation
|
|
||||||
|
|
||||||
Read through the `init.lua` file in your configuration folder for more
|
|
||||||
information about extending and exploring Neovim. That also includes
|
|
||||||
examples of adding popularly requested plugins.
|
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> For more information about a particular plugin check its repository's documentation.
|
|
||||||
|
|
||||||
|
|
||||||
### Getting Started
|
|
||||||
|
|
||||||
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
|
|
||||||
|
|
||||||
### FAQ
|
|
||||||
|
|
||||||
* What should I do if I already have a pre-existing Neovim configuration?
|
|
||||||
* You should back it up and then delete all associated files.
|
|
||||||
* This includes your existing init.lua and the Neovim files in `~/.local`
|
|
||||||
which can be deleted with `rm -rf ~/.local/share/nvim/`
|
|
||||||
* Can I keep my existing configuration in parallel to kickstart?
|
|
||||||
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME`
|
|
||||||
to maintain multiple configurations. For example, you can install the kickstart
|
|
||||||
configuration in `~/.config/nvim-kickstart` and create an alias:
|
|
||||||
```
|
|
||||||
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
|
|
||||||
```
|
|
||||||
When you run Neovim using `nvim-kickstart` alias it will use the alternative
|
|
||||||
config directory and the matching local directory
|
|
||||||
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
|
|
||||||
distribution that you would like to try out.
|
|
||||||
* What if I want to "uninstall" this configuration:
|
|
||||||
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
|
|
||||||
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
|
|
||||||
* The main purpose of kickstart is to serve as a teaching tool and a reference
|
|
||||||
configuration that someone can easily use to `git clone` as a basis for their own.
|
|
||||||
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
|
|
||||||
into smaller parts. A fork of kickstart that does this while maintaining the
|
|
||||||
same functionality is available here:
|
|
||||||
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
|
|
||||||
* Discussions on this topic can be found here:
|
|
||||||
* [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218)
|
|
||||||
* [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473)
|
|
||||||
|
|
||||||
### Install Recipes
|
|
||||||
|
|
||||||
Below you can find OS specific install instructions for Neovim and dependencies.
|
|
||||||
|
|
||||||
After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step.
|
|
||||||
|
|
||||||
#### Windows Installation
|
|
||||||
|
|
||||||
<details><summary>Windows with Microsoft C++ Build Tools and CMake</summary>
|
|
||||||
Installation may require installing build tools and updating the run command for `telescope-fzf-native`
|
|
||||||
|
|
||||||
See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
|
|
||||||
|
|
||||||
This requires:
|
|
||||||
|
|
||||||
- Install CMake and the Microsoft C++ Build Tools on Windows
|
|
||||||
|
|
||||||
```lua
|
|
||||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
<details><summary>Windows with gcc/make using chocolatey</summary>
|
|
||||||
Alternatively, one can install gcc and make which don't require changing the config,
|
|
||||||
the easiest way is to use choco:
|
|
||||||
|
|
||||||
1. install [chocolatey](https://chocolatey.org/install)
|
|
||||||
either follow the instructions on the page or use winget,
|
|
||||||
run in cmd as **admin**:
|
|
||||||
```
|
|
||||||
winget install --accept-source-agreements chocolatey.chocolatey
|
|
||||||
```
|
|
||||||
|
|
||||||
2. install all requirements using choco, exit the previous cmd and
|
|
||||||
open a new one so that choco path is set, and run in cmd as **admin**:
|
|
||||||
```
|
|
||||||
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
<details><summary>WSL (Windows Subsystem for Linux)</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
wsl --install
|
|
||||||
wsl
|
|
||||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
#### Linux Install
|
|
||||||
<details><summary>Ubuntu Install Steps</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
<details><summary>Debian Install Steps</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install make gcc ripgrep unzip git xclip curl
|
|
||||||
|
|
||||||
# Now we install nvim
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
|
|
||||||
sudo rm -rf /opt/nvim-linux-x86_64
|
|
||||||
sudo mkdir -p /opt/nvim-linux-x86_64
|
|
||||||
sudo chmod a+rX /opt/nvim-linux-x86_64
|
|
||||||
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
|
|
||||||
|
|
||||||
# make it available in /usr/local/bin, distro installs to /usr/bin
|
|
||||||
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
<details><summary>Fedora Install Steps</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details><summary>Arch Install Steps</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
В этом конфиге я выключил плагин для дебага. Этот конфиг я использую на запасных системах, где мне не нужен дебаг и я не хочу качать дополнительные пакеты для него. Если нужен дебаг, то можно раскомментировать нужные строки в `init.lua`. Не уверен надо ли докачивать какие-то пакеты для этого.
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
================================================================================
|
|
||||||
INTRODUCTION *kickstart.nvim*
|
|
||||||
|
|
||||||
Kickstart.nvim is a project to help you get started on your neovim journey.
|
|
||||||
|
|
||||||
*kickstart-is-not*
|
|
||||||
It is not:
|
|
||||||
- Complete framework for every plugin under the sun
|
|
||||||
- Place to add every plugin that could ever be useful
|
|
||||||
|
|
||||||
*kickstart-is*
|
|
||||||
It is:
|
|
||||||
- Somewhere that has a good start for the most common "IDE" type features:
|
|
||||||
- autocompletion
|
|
||||||
- goto-definition
|
|
||||||
- find references
|
|
||||||
- fuzzy finding
|
|
||||||
- and hinting at what more can be done :)
|
|
||||||
- A place to _kickstart_ your journey.
|
|
||||||
- You should fork this project and use/modify it so that it matches your
|
|
||||||
style and preferences. If you don't want to do that, there are probably
|
|
||||||
other projects that would fit much better for you (and that's great!)!
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:ft=help:norl:
|
|
||||||
8
init.lua
8
init.lua
|
|
@ -64,7 +64,7 @@ require('lazy').setup({
|
||||||
require 'kickstart.plugins.treesitter',
|
require 'kickstart.plugins.treesitter',
|
||||||
|
|
||||||
-- Debug your code via Debug Adapter Protocol
|
-- Debug your code via Debug Adapter Protocol
|
||||||
require 'kickstart.plugins.debug',
|
-- require 'kickstart.plugins.debug',
|
||||||
|
|
||||||
-- Add indentation guides even on blank lines
|
-- Add indentation guides even on blank lines
|
||||||
require 'kickstart.plugins.indent_line',
|
require 'kickstart.plugins.indent_line',
|
||||||
|
|
@ -94,6 +94,12 @@ require('lazy').setup({
|
||||||
-- Plugins for color highlight
|
-- Plugins for color highlight
|
||||||
require 'custom.plugins.colorizer',
|
require 'custom.plugins.colorizer',
|
||||||
|
|
||||||
|
-- Symbol usage plugin
|
||||||
|
require 'custom.plugins.symbol_usage',
|
||||||
|
|
||||||
|
-- Adding history for nvim clipboard
|
||||||
|
require 'custom.plugins.clip_history',
|
||||||
|
|
||||||
-- Autoformat markdown tables
|
-- Autoformat markdown tables
|
||||||
{
|
{
|
||||||
'Kicamon/markdown-table-mode.nvim',
|
'Kicamon/markdown-table-mode.nvim',
|
||||||
|
|
|
||||||
14
lua/custom/plugins/clip_history.lua
Normal file
14
lua/custom/plugins/clip_history.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
-- Adding history for nvim clipboard
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'AckslD/nvim-neoclip.lua',
|
||||||
|
dependencies = {
|
||||||
|
{ 'nvim-telescope/telescope.nvim' },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('neoclip').setup()
|
||||||
|
vim.keymap.set('n', '<leader>sc', ':Telescope neoclip<CR>', { desc = '[S]earch [C]lip history' })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,9 @@ return {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('go').setup()
|
require('go').setup {
|
||||||
|
tag_options = '', -- sets options sent to gomodifytags, i.e., json=omitempty
|
||||||
|
}
|
||||||
vim.keymap.set({ 'n' }, '<leader>gta', ':GoAddTag<CR>', { desc = '[G]o [T]ag [A]dd' })
|
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>gtr', ':GoRmTag<CR>', { desc = '[G]o [T]ag [R]emove' })
|
||||||
vim.keymap.set({ 'n' }, '<leader>gs', ':GoFillStruct<CR>', { desc = '[G]o fill [S]truct' })
|
vim.keymap.set({ 'n' }, '<leader>gs', ':GoFillStruct<CR>', { desc = '[G]o fill [S]truct' })
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'mrcjkb/rustaceanvim',
|
'mrcjkb/rustaceanvim',
|
||||||
version = '^5', -- Recommended
|
version = '^6', -- Recommended
|
||||||
lazy = false, -- This plugin is already lazy
|
lazy = false, -- This plugin is already lazy
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
80
lua/custom/plugins/symbol_usage.lua
Normal file
80
lua/custom/plugins/symbol_usage.lua
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
-- Symbol usage plugin
|
||||||
|
|
||||||
|
local SymbolKind = vim.lsp.protocol.SymbolKind
|
||||||
|
|
||||||
|
local function h(name)
|
||||||
|
return vim.api.nvim_get_hl(0, { name = name })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- hl-groups can have any name
|
||||||
|
vim.api.nvim_set_hl(0, 'SymbolUsageRounding', { fg = h('CursorLine').bg, italic = true })
|
||||||
|
vim.api.nvim_set_hl(0, 'SymbolUsageContent', { bg = h('CursorLine').bg, fg = h('Comment').fg, italic = true })
|
||||||
|
vim.api.nvim_set_hl(0, 'SymbolUsageRef', { fg = h('Function').fg, bg = h('CursorLine').bg, italic = true })
|
||||||
|
vim.api.nvim_set_hl(0, 'SymbolUsageDef', { fg = h('Type').fg, bg = h('CursorLine').bg, italic = true })
|
||||||
|
vim.api.nvim_set_hl(0, 'SymbolUsageImpl', { fg = h('@keyword').fg, bg = h('CursorLine').bg, italic = true })
|
||||||
|
|
||||||
|
local function text_format(symbol)
|
||||||
|
local res = {}
|
||||||
|
|
||||||
|
local round_start = { '', 'SymbolUsageRounding' }
|
||||||
|
local round_end = { '', 'SymbolUsageRounding' }
|
||||||
|
|
||||||
|
-- Indicator that shows if there are any other symbols in the same line
|
||||||
|
local stacked_functions_content = symbol.stacked_count > 0 and ('+%s'):format(symbol.stacked_count) or ''
|
||||||
|
|
||||||
|
if symbol.references then
|
||||||
|
local usage = symbol.references <= 1 and 'usage' or 'usages'
|
||||||
|
local num = symbol.references == 0 and 'no' or symbol.references
|
||||||
|
table.insert(res, round_start)
|
||||||
|
table.insert(res, { ' ', 'SymbolUsageRef' })
|
||||||
|
table.insert(res, { ('%s %s'):format(num, usage), 'SymbolUsageContent' })
|
||||||
|
table.insert(res, round_end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if symbol.definition then
|
||||||
|
if #res > 0 then
|
||||||
|
table.insert(res, { ' ', 'NonText' })
|
||||||
|
end
|
||||||
|
table.insert(res, round_start)
|
||||||
|
table.insert(res, { ' ', 'SymbolUsageDef' })
|
||||||
|
table.insert(res, { symbol.definition .. ' defs', 'SymbolUsageContent' })
|
||||||
|
table.insert(res, round_end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if symbol.implementation then
|
||||||
|
if #res > 0 then
|
||||||
|
table.insert(res, { ' ', 'NonText' })
|
||||||
|
end
|
||||||
|
table.insert(res, round_start)
|
||||||
|
table.insert(res, { ' ', 'SymbolUsageImpl' })
|
||||||
|
table.insert(res, { symbol.implementation .. ' impls', 'SymbolUsageContent' })
|
||||||
|
table.insert(res, round_end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if stacked_functions_content ~= '' then
|
||||||
|
if #res > 0 then
|
||||||
|
table.insert(res, { ' ', 'NonText' })
|
||||||
|
end
|
||||||
|
table.insert(res, round_start)
|
||||||
|
table.insert(res, { ' ', 'SymbolUsageImpl' })
|
||||||
|
table.insert(res, { stacked_functions_content, 'SymbolUsageContent' })
|
||||||
|
table.insert(res, round_end)
|
||||||
|
end
|
||||||
|
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
'Wansmer/symbol-usage.nvim',
|
||||||
|
event = 'LspAttach', -- need run before LspAttach if you use nvim 0.9. On 0.10 use 'LspAttach'
|
||||||
|
config = function()
|
||||||
|
require('symbol-usage').setup {
|
||||||
|
filetypes = {},
|
||||||
|
log = { enabled = false, level = 'INFO', stdout = {}, log_file = {}, notify = {} },
|
||||||
|
text_format = text_format,
|
||||||
|
kinds = { SymbolKind.Function, SymbolKind.Method, SymbolKind.Class, SymbolKind.Struct, SymbolKind.Variable, SymbolKind.Constant },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -98,10 +98,6 @@ vim.api.nvim_create_autocmd('User', {
|
||||||
nested = true,
|
nested = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set('n', '<Space><BS>', function()
|
|
||||||
restore_session()
|
|
||||||
end, { desc = 'Restore session' })
|
|
||||||
|
|
||||||
-- Session delete
|
-- Session delete
|
||||||
vim.keymap.set('n', '<Space>Sd', function()
|
vim.keymap.set('n', '<Space>Sd', function()
|
||||||
local name = session_name()
|
local name = session_name()
|
||||||
|
|
|
||||||
|
|
@ -4,41 +4,30 @@ local state = {
|
||||||
win = -1,
|
win = -1,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local function create_floating_window(opts)
|
local function create_floating_window(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
local width = opts.width or math.floor(vim.o.columns * 0.8)
|
local width = opts.width or math.floor(vim.o.columns * 0.8)
|
||||||
local height = opts.height or math.floor(vim.o.lines * 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 col = math.floor((vim.o.columns - width) / 2)
|
||||||
local row = math.floor((vim.o.lines - height) / 2)
|
local row = math.floor((vim.o.lines - height) / 2)
|
||||||
|
|
||||||
-- Create a buffer
|
|
||||||
local buf = nil
|
local buf = nil
|
||||||
if vim.api.nvim_buf_is_valid(opts.buf) then
|
if vim.api.nvim_buf_is_valid(opts.buf) then
|
||||||
buf = opts.buf
|
buf = opts.buf
|
||||||
else
|
else
|
||||||
buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer
|
buf = vim.api.nvim_create_buf(false, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Define window configuration
|
|
||||||
local win_config = {
|
local win_config = {
|
||||||
relative = 'editor',
|
relative = 'editor',
|
||||||
width = width,
|
width = width,
|
||||||
height = height,
|
height = height,
|
||||||
col = col,
|
col = col,
|
||||||
row = row,
|
row = row,
|
||||||
style = 'minimal', -- No borders or extra UI elements
|
style = 'minimal',
|
||||||
border = 'rounded',
|
border = 'rounded',
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Create the floating window
|
|
||||||
local win = vim.api.nvim_open_win(buf, true, win_config)
|
local win = vim.api.nvim_open_win(buf, true, win_config)
|
||||||
|
|
||||||
return { buf = buf, win = win }
|
return { buf = buf, win = win }
|
||||||
end
|
end
|
||||||
|
|
||||||
local toggle_terminal = function()
|
local toggle_terminal = function()
|
||||||
if not vim.api.nvim_win_is_valid(state.floating.win) then
|
if not vim.api.nvim_win_is_valid(state.floating.win) then
|
||||||
state.floating = create_floating_window { buf = state.floating.buf }
|
state.floating = create_floating_window { buf = state.floating.buf }
|
||||||
|
|
@ -49,8 +38,5 @@ local toggle_terminal = function()
|
||||||
vim.api.nvim_win_hide(state.floating.win)
|
vim.api.nvim_win_hide(state.floating.win)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Example usage:
|
|
||||||
-- Create a floating window with default dimensions
|
|
||||||
vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {})
|
vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {})
|
||||||
vim.keymap.set({ 'n', 't' }, '<leader>tt', toggle_terminal, { desc = '[T]oggle [T]erminal' })
|
vim.keymap.set({ 'n', 't' }, '<leader>tt', toggle_terminal, { desc = '[T]oggle [T]erminal' })
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,3 @@
|
||||||
--[[
|
|
||||||
--
|
|
||||||
-- This file is not required for your own configuration,
|
|
||||||
-- but helps people determine if their system is setup correctly.
|
|
||||||
--
|
|
||||||
--]]
|
|
||||||
|
|
||||||
local check_version = function()
|
local check_version = function()
|
||||||
local verstr = tostring(vim.version())
|
local verstr = tostring(vim.version())
|
||||||
if not vim.version.ge then
|
if not vim.version.ge then
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
-- Autoformat
|
|
||||||
-- Timeout для форматирования пришлось задать в 5 секунд, потому что sqlfluff очень долго форматирует
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'stevearc/conform.nvim',
|
'stevearc/conform.nvim',
|
||||||
|
|
@ -27,21 +24,18 @@ return {
|
||||||
-- have a well standardized coding style. You can add additional
|
-- have a well standardized coding style. You can add additional
|
||||||
-- languages here or re-enable it for the disabled ones.
|
-- languages here or re-enable it for the disabled ones.
|
||||||
local disable_filetypes = { c = true, cpp = true }
|
local disable_filetypes = { c = true, cpp = true }
|
||||||
local lsp_format_opt
|
|
||||||
if disable_filetypes[vim.bo[bufnr].filetype] then
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
||||||
lsp_format_opt = 'never'
|
return nil
|
||||||
else
|
else
|
||||||
lsp_format_opt = 'fallback'
|
return {
|
||||||
|
timeout_ms = 5000,
|
||||||
|
lsp_format = 'fallback',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
return {
|
|
||||||
timeout_ms = 5000,
|
|
||||||
lsp_format = lsp_format_opt,
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
go = { 'gofmt', 'injected' },
|
go = { 'gofmt', 'injected' },
|
||||||
sql = { 'sqlfluff' },
|
|
||||||
-- ['*'] = { 'injected' }, -- enables injected-lang formatting for all filetypes
|
-- ['*'] = { 'injected' }, -- enables injected-lang formatting for all filetypes
|
||||||
|
|
||||||
-- Conform can also run multiple formatters sequentially
|
-- Conform can also run multiple formatters sequentially
|
||||||
|
|
@ -50,36 +44,7 @@ return {
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
},
|
},
|
||||||
formatters = {
|
formatters = {},
|
||||||
-- sql_formatter = {
|
|
||||||
-- -- prepend_args = { "-c", vim.fn.expand("~/.config/sql_formatter.json"),
|
|
||||||
-- args = function()
|
|
||||||
-- -- Создаём временный JSON-файл конфигурации
|
|
||||||
-- local config_path = vim.fn.tempname() .. ".json"
|
|
||||||
-- local config_content = vim.fn.json_encode({
|
|
||||||
-- tabWidth = 4,
|
|
||||||
-- })
|
|
||||||
-- local file = io.open(config_path, "w")
|
|
||||||
-- file:write(config_content)
|
|
||||||
-- file:close()
|
|
||||||
-- -- Возвращаем аргументы для форматтера с указанием конфигурационного файла
|
|
||||||
-- return { "-c", config_path }
|
|
||||||
-- end,
|
|
||||||
-- stdin = true,
|
|
||||||
-- },
|
|
||||||
sqlfluff = {
|
|
||||||
command = 'sqlfluff',
|
|
||||||
args = {
|
|
||||||
'format',
|
|
||||||
-- 'fix',
|
|
||||||
-- '--dialect',
|
|
||||||
-- 'postgres',
|
|
||||||
-- '--disable-progress-bar',
|
|
||||||
'-',
|
|
||||||
},
|
|
||||||
stdin = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,5 @@
|
||||||
-- autopairs
|
|
||||||
-- https://github.com/windwp/nvim-autopairs
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'windwp/nvim-autopairs',
|
'windwp/nvim-autopairs',
|
||||||
event = 'InsertEnter',
|
event = 'InsertEnter',
|
||||||
-- Optional dependency
|
opts = {},
|
||||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
|
||||||
config = function()
|
|
||||||
require('nvim-autopairs').setup {}
|
|
||||||
-- If you want to automatically add `(` after selecting a function or method
|
|
||||||
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
-- Autocompletion
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'hrsh7th/nvim-cmp',
|
'saghen/blink.cmp',
|
||||||
event = 'InsertEnter',
|
event = 'VimEnter',
|
||||||
|
version = '1.*',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Snippet Engine & its associated nvim-cmp source
|
-- Snippet Engine
|
||||||
{
|
{
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
|
version = '2.*',
|
||||||
build = (function()
|
build = (function()
|
||||||
-- Build Step is needed for regex support in snippets.
|
-- Build Step is needed for regex support in snippets.
|
||||||
-- This step is not supported in many windows environments.
|
-- This step is not supported in many windows environments.
|
||||||
|
|
@ -28,108 +28,96 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
opts = {},
|
||||||
},
|
},
|
||||||
'saadparwaiz1/cmp_luasnip',
|
'folke/lazydev.nvim',
|
||||||
|
|
||||||
-- Adds other completion capabilities.
|
|
||||||
-- nvim-cmp does not ship with all sources by default. They are split
|
|
||||||
-- into multiple repos for maintenance purposes.
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
'hrsh7th/cmp-path',
|
|
||||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
|
||||||
},
|
},
|
||||||
config = function()
|
--- @module 'blink.cmp'
|
||||||
-- See `:help cmp`
|
--- @type blink.cmp.Config
|
||||||
local cmp = require 'cmp'
|
opts = {
|
||||||
local luasnip = require 'luasnip'
|
keymap = {
|
||||||
luasnip.config.setup {}
|
|
||||||
|
|
||||||
cmp.setup {
|
|
||||||
preselect = cmp.PreselectMode.None,
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
luasnip.lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
|
||||||
|
|
||||||
-- For an understanding of why these mappings were
|
|
||||||
-- chosen, you will need to read `:help ins-completion`
|
|
||||||
--
|
|
||||||
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
||||||
mapping = cmp.mapping.preset.insert {
|
--
|
||||||
-- (enabled by default in nvim-cmp)
|
-- All presets have the following mappings:
|
||||||
-- Select the [n]ext item
|
-- <tab>/<s-tab>: move to right/left of your snippet expansion
|
||||||
-- ['<C-n>'] = cmp.mapping.select_next_item(),
|
-- <c-space>: Open menu or open docs if already open
|
||||||
-- Select the [p]revious item
|
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
|
||||||
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
|
-- <c-e>: Hide menu
|
||||||
|
-- <c-k>: Toggle signature help
|
||||||
|
--
|
||||||
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
|
-- preset = 'default',
|
||||||
|
|
||||||
-- Accept ([y]es) the completion.
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
-- This will auto-import if your LSP supports it.
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
-- This will expand snippets if the LSP sent a snippet.
|
|
||||||
-- ['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
||||||
|
|
||||||
-- If you prefer more traditional completion keymaps,
|
-- Удалил все сток бинды и добавил сам что надо
|
||||||
-- you can uncomment the following lines
|
-- https://cmp.saghen.dev/configuration/keymap.html
|
||||||
-- ['<CR>'] = cmp.mapping.confirm { select = true },
|
preset = 'none',
|
||||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
|
||||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
|
||||||
|
|
||||||
-- Allows Up arrow to fall back without interacting with cmp
|
-- Open menu or open docs if already open
|
||||||
['<Up>'] = cmp.mapping(function(fallback)
|
['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
|
||||||
cmp.close()
|
-- Hide menu
|
||||||
fallback()
|
['<C-e>'] = { 'hide' },
|
||||||
end, { 'i', 'c' }),
|
-- Accept the completion
|
||||||
|
['<C-y>'] = { 'select_and_accept' },
|
||||||
|
['<C-Tab>'] = { 'select_and_accept' },
|
||||||
|
|
||||||
-- Allows Up arrow to fall back without interacting with cmp
|
-- Select next/previous item
|
||||||
['<Down>'] = cmp.mapping(function(fallback)
|
['<Tab>'] = { 'select_next', 'fallback' },
|
||||||
cmp.close()
|
['<S-Tab>'] = { 'select_prev', 'fallback' },
|
||||||
fallback()
|
|
||||||
end, { 'i', 'c' }),
|
|
||||||
|
|
||||||
-- Scroll the documentation window [b]ack / [f]orward
|
-- Scroll the documentation window [b]ack / [f]orward
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
['<C-b>'] = { 'scroll_documentation_up', 'fallback' },
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
['<C-f>'] = { 'scroll_documentation_down', 'fallback' },
|
||||||
|
|
||||||
-- Manually trigger a completion from nvim-cmp.
|
-- Think of <c-l> as moving to the right of your snippet expansion.
|
||||||
-- Generally you don't need this, because nvim-cmp will display
|
-- So if you have a snippet that's like:
|
||||||
-- completions whenever it has completion options available.
|
-- function $name($args)
|
||||||
['<C-Space>'] = cmp.mapping.complete {},
|
-- $body
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- <c-l> will move you to the right of each of the expansion locations.
|
||||||
|
-- <c-h> is similar, except moving you backwards.
|
||||||
|
['<C-l>'] = { 'snippet_forward', 'fallback' },
|
||||||
|
['<C-h>'] = { 'snippet_backward', 'fallback' },
|
||||||
|
|
||||||
-- Think of <c-l> as moving to the right of your snippet expansion.
|
-- Toggle signature help
|
||||||
-- So if you have a snippet that's like:
|
['<C-k>'] = { 'show_signature', 'hide_signature', 'fallback' },
|
||||||
-- function $name($args)
|
},
|
||||||
-- $body
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- <c-l> will move you to the right of each of the expansion locations.
|
|
||||||
-- <c-h> is similar, except moving you backwards.
|
|
||||||
['<C-l>'] = cmp.mapping(function()
|
|
||||||
if luasnip.expand_or_locally_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
['<C-h>'] = cmp.mapping(function()
|
|
||||||
if luasnip.locally_jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
|
|
||||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
appearance = {
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||||
|
-- Adjusts spacing to ensure icons are aligned
|
||||||
|
nerd_font_variant = 'mono',
|
||||||
|
},
|
||||||
|
|
||||||
|
completion = {
|
||||||
|
-- By default, you may press `<c-space>` to show the documentation.
|
||||||
|
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
||||||
|
documentation = { auto_show = true, auto_show_delay_ms = 500 },
|
||||||
|
},
|
||||||
|
|
||||||
|
sources = {
|
||||||
|
default = { 'lsp', 'path', 'snippets', 'lazydev' },
|
||||||
|
providers = {
|
||||||
|
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
||||||
},
|
},
|
||||||
sources = {
|
},
|
||||||
{
|
|
||||||
name = 'lazydev',
|
snippets = { preset = 'luasnip' },
|
||||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
|
||||||
group_index = 0,
|
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
|
||||||
},
|
-- which automatically downloads a prebuilt binary when enabled.
|
||||||
{ name = 'nvim_lsp' },
|
--
|
||||||
{ name = 'luasnip' },
|
-- By default, we use the Lua implementation instead, but you may enable
|
||||||
{ name = 'path' },
|
-- the rust implementation via `'prefer_rust_with_warning'`
|
||||||
{ name = 'nvim_lsp_signature_help' },
|
--
|
||||||
},
|
-- See :h blink-cmp-config-fuzzy for more information
|
||||||
}
|
fuzzy = { implementation = 'lua' },
|
||||||
end,
|
|
||||||
|
-- Shows a signature help window while you type arguments for a function
|
||||||
|
signature = { enabled = true },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,32 @@
|
||||||
-- Neo-tree is a Neovim plugin to browse the file system
|
-- Neo-tree is a Neovim plugin to browse the file system
|
||||||
|
-- Не умеет работать со сессиями
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
version = '*',
|
branch = 'v3.x',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||||
'MunifTanjim/nui.nvim',
|
'MunifTanjim/nui.nvim',
|
||||||
-- { -- Optional image support in preview window: See `# Preview Mode` for more information
|
{ -- 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
|
build = false, -- so that it doesn't build the rock
|
||||||
-- opts = {
|
opts = {
|
||||||
-- backend = 'ueberzug', -- or "kitty"
|
backend = 'ueberzug', -- or "kitty"
|
||||||
-- processor = 'magick_cli', -- or "magick_rock"
|
processor = 'magick_cli', -- or "magick_rock"
|
||||||
-- },
|
},
|
||||||
-- },
|
},
|
||||||
},
|
},
|
||||||
cmd = 'Neotree',
|
lazy = false, -- neo-tree will lazily load itself
|
||||||
keys = {
|
keys = {
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||||
},
|
},
|
||||||
|
---@module "neo-tree"
|
||||||
|
---@type neotree.Config?
|
||||||
opts = {
|
opts = {
|
||||||
|
close_if_last_window = true,
|
||||||
filesystem = {
|
filesystem = {
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,3 @@
|
||||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
|
||||||
|
|
||||||
-- NOTE: Plugins can also be added by using a table,
|
|
||||||
-- with the first argument being the link and the following
|
|
||||||
-- keys can be used to configure plugin behavior/loading/etc.
|
|
||||||
--
|
|
||||||
-- Use `opts = {}` to force a plugin to be loaded.
|
|
||||||
--
|
|
||||||
|
|
||||||
-- Here is a more advanced example where we pass configuration
|
|
||||||
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
|
||||||
-- require('gitsigns').setup({ ... })
|
|
||||||
--
|
|
||||||
-- See `:help gitsigns` to understand what the configuration keys do
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
-- Add indentation guides even on blank lines
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
|
||||||
-- See `:help ibl`
|
|
||||||
main = 'ibl',
|
main = 'ibl',
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ return {
|
||||||
local lint = require 'lint'
|
local lint = require 'lint'
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
-- markdown = { 'markdownlint' },
|
-- markdown = { 'markdownlint' },
|
||||||
sql = { 'sqlfluff' },
|
|
||||||
-- go = { 'golangcilint' },
|
-- go = { 'golangcilint' },
|
||||||
-- proto = { 'buf_lint' }, -- Крашит
|
-- proto = { 'buf_lint' }, -- Крашит
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,89 +27,69 @@ return {
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
|
||||||
-- Allows extra capabilities provided by nvim-cmp
|
-- Allows extra capabilities provided by blink.cmp
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
'saghen/blink.cmp',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief aside: **What is LSP?**
|
|
||||||
--
|
|
||||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
|
||||||
--
|
|
||||||
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
|
|
||||||
-- and language tooling communicate in a standardized fashion.
|
|
||||||
--
|
|
||||||
-- In general, you have a "server" which is some tool built to understand a particular
|
|
||||||
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
|
|
||||||
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
|
|
||||||
-- processes that communicate with some "client" - in this case, Neovim!
|
|
||||||
--
|
|
||||||
-- LSP provides Neovim with features like:
|
|
||||||
-- - Go to definition
|
|
||||||
-- - Find references
|
|
||||||
-- - Autocompletion
|
|
||||||
-- - Symbol Search
|
|
||||||
-- - and more!
|
|
||||||
--
|
|
||||||
-- Thus, Language Servers are external tools that must be installed separately from
|
|
||||||
-- Neovim. This is where `mason` and related plugins come into play.
|
|
||||||
--
|
|
||||||
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
|
||||||
-- and elegantly composed help section, `:help lsp-vs-treesitter`
|
|
||||||
|
|
||||||
-- This function gets run when an LSP attaches to a particular buffer.
|
|
||||||
-- That is to say, every time a new file is opened that is associated with
|
|
||||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
|
||||||
-- function will be executed to configure the current buffer
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
|
|
||||||
-- to define small helper and utility functions so you don't have to repeat yourself.
|
|
||||||
--
|
|
||||||
-- In this case, we create a function that lets us more easily define mappings specific
|
|
||||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
|
||||||
local map = function(keys, func, desc, mode)
|
local map = function(keys, func, desc, mode)
|
||||||
mode = mode or 'n'
|
mode = mode or 'n'
|
||||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
-- Rename the variable under your cursor.
|
||||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
-- Most Language Servers support renaming across files, etc.
|
||||||
-- To jump back, press <C-t>.
|
map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
|
||||||
|
-- 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.
|
||||||
|
map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||||
|
|
||||||
-- Find references for the word under your cursor.
|
-- Find references for the word under your cursor.
|
||||||
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
|
|
||||||
-- Jump to the implementation of the word under your cursor.
|
-- Jump to the implementation of the word under your cursor.
|
||||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||||
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||||
|
|
||||||
|
-- Jump to the definition of the word under your cursor.
|
||||||
|
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||||
|
-- To jump back, press <C-t>.
|
||||||
|
map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
|
|
||||||
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
|
-- For example, in C this would take you to the header.
|
||||||
|
map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
|
||||||
|
-- Fuzzy find all the symbols in your current document.
|
||||||
|
-- Symbols are things like variables, functions, types, etc.
|
||||||
|
map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols')
|
||||||
|
-- Было <leader>ds [D]ocument [S]ymbols
|
||||||
|
-- map('<leader>ss', 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.
|
||||||
|
map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
|
||||||
|
|
||||||
-- Jump to the type of the word under your cursor.
|
-- Jump to the type of the word under your cursor.
|
||||||
-- Useful when you're not sure what type a variable is and you want to see
|
-- 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*.
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current document.
|
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||||
-- Symbols are things like variables, functions, types, etc.
|
---@param client vim.lsp.Client
|
||||||
-- Было <leader>ds [D]ocument [S]ymbols
|
---@param method vim.lsp.protocol.Method
|
||||||
map('<leader>ss', require('telescope.builtin').lsp_document_symbols, 'Document [S]ymbols')
|
---@param bufnr? integer some lsp support methods only in specific files
|
||||||
|
---@return boolean
|
||||||
-- Fuzzy find all the symbols in your current workspace.
|
local function client_supports_method(client, method, bufnr)
|
||||||
-- Similar to document symbols, except searches over your entire project.
|
if vim.fn.has 'nvim-0.11' == 1 then
|
||||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
return client:supports_method(method, bufnr)
|
||||||
|
else
|
||||||
-- Rename the variable under your cursor.
|
return client.supports_method(method, { bufnr = bufnr })
|
||||||
-- Most Language Servers support renaming across files, etc.
|
end
|
||||||
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
end
|
||||||
|
|
||||||
-- 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.
|
|
||||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
|
||||||
-- For example, in C this would take you to the header.
|
|
||||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
|
||||||
|
|
||||||
-- The following two autocommands are used to highlight references of the
|
-- The following two autocommands are used to highlight references of the
|
||||||
-- word under your cursor when your cursor rests there for a little while.
|
-- word under your cursor when your cursor rests there for a little while.
|
||||||
|
|
@ -117,7 +97,8 @@ return {
|
||||||
--
|
--
|
||||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
-- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then
|
||||||
|
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
|
||||||
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
||||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
buffer = event.buf,
|
buffer = event.buf,
|
||||||
|
|
@ -144,7 +125,8 @@ return {
|
||||||
-- code, if the language server you are using supports them
|
-- code, if the language server you are using supports them
|
||||||
--
|
--
|
||||||
-- This may be unwanted, since they displace some of your code
|
-- This may be unwanted, since they displace some of your code
|
||||||
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
-- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
|
||||||
|
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||||
map('<leader>th', function()
|
map('<leader>th', function()
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
||||||
end, '[T]oggle Inlay [H]ints')
|
end, '[T]oggle Inlay [H]ints')
|
||||||
|
|
@ -164,18 +146,9 @@ return {
|
||||||
|
|
||||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||||
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
||||||
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
|
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||||
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
|
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
|
||||||
|
|
||||||
-- Настройки для некоторых lsp серверов. Приходится делать так.
|
|
||||||
local cap_css = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
cap_css.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
local cap_html = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
cap_html.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
local cap_json = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
cap_json.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
-- Enable the following language servers
|
-- Enable the following language servers
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||||
|
|
@ -187,30 +160,25 @@ return {
|
||||||
-- - on_attach (func): Функция, которая вызывается, когда LSP подключается к буферу
|
-- - on_attach (func): Функция, которая вызывается, когда LSP подключается к буферу
|
||||||
-- - settings (table): Override the default settings passed when initializing the server.
|
-- - 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/
|
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||||
|
local cap_css = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
cap_css.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
local cap_html = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
cap_html.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
local cap_json = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
cap_json.textDocument.completion.completionItem.snippetSupport = true
|
||||||
local servers = {
|
local servers = {
|
||||||
-- 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
|
|
||||||
|
|
||||||
-- SQL
|
|
||||||
sqls = {
|
|
||||||
on_attach = function(client)
|
|
||||||
-- Выключить форматирование
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Golang
|
-- Golang
|
||||||
gopls = {},
|
gopls = {
|
||||||
-- templ = {},
|
completion = {
|
||||||
|
unimported = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
templ = {},
|
||||||
|
|
||||||
-- Frontend
|
-- Frontend
|
||||||
|
tailwindcss = {},
|
||||||
ts_ls = {},
|
ts_ls = {},
|
||||||
-- tailwindcss = {},
|
htmx = {},
|
||||||
-- htmx = {},
|
|
||||||
emmet_language_server = {
|
emmet_language_server = {
|
||||||
filetypes = {
|
filetypes = {
|
||||||
'templ',
|
'templ',
|
||||||
|
|
@ -247,12 +215,9 @@ return {
|
||||||
completion = {
|
completion = {
|
||||||
callSnippet = 'Replace',
|
callSnippet = 'Replace',
|
||||||
},
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- C/C++
|
-- C/C++
|
||||||
clangd = {
|
clangd = {
|
||||||
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, -- Удалил "proto"
|
filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda' }, -- Удалил "proto"
|
||||||
|
|
@ -271,7 +236,14 @@ return {
|
||||||
rust_analyzer = {},
|
rust_analyzer = {},
|
||||||
|
|
||||||
-- Bash
|
-- Bash
|
||||||
bashls = {},
|
bashls = {
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
local filename = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
if filename:match '/%.env$' or filename:match '/%.env%..+$' then
|
||||||
|
client.stop() -- отключить LSP только для .env
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- JSON
|
-- JSON
|
||||||
jsonls = {
|
jsonls = {
|
||||||
|
|
@ -302,6 +274,8 @@ return {
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
|
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
||||||
|
automatic_installation = false,
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
-- Collection of various small independent plugins/modules
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'echasnovski/mini.nvim',
|
'echasnovski/mini.nvim',
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,7 @@
|
||||||
-- Fuzzy Finder (files, lsp, etc)
|
|
||||||
|
|
||||||
-- NOTE: Plugins can specify dependencies.
|
|
||||||
--
|
|
||||||
-- The dependencies are proper plugin specifications as well - anything
|
|
||||||
-- you do for a plugin at the top level, you can do for a dependency.
|
|
||||||
--
|
|
||||||
-- Use the `dependencies` key to specify the dependencies of a particular plugin
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
event = 'VimEnter',
|
event = 'VimEnter',
|
||||||
branch = '0.1.x',
|
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
|
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
|
||||||
|
|
@ -92,7 +82,7 @@ return {
|
||||||
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||||
vim.keymap.set('n', '<leader><leader>', function()
|
vim.keymap.set('n', '<leader><leader>', function()
|
||||||
builtin.buffers { sort_mru = true, ignore_current_buffer = true }
|
builtin.buffers { sort_mru = true, ignore_current_buffer = true }
|
||||||
end, { desc = '[ ] Find etisting buffers' })
|
end, { desc = '[ ] Find existing buffers' })
|
||||||
vim.keymap.set('n', '<leader>st', ':Telescope colorscheme<CR>', { desc = '[S]earch [T]hemes' })
|
vim.keymap.set('n', '<leader>st', ':Telescope colorscheme<CR>', { desc = '[S]earch [T]hemes' })
|
||||||
|
|
||||||
-- Slightly advanced example of overriding default behavior and theme
|
-- Slightly advanced example of overriding default behavior and theme
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
-- You can easily change to a different colorscheme.
|
-- You can easily change to a different colorscheme.
|
||||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
||||||
|
|
||||||
-- Cмена тем тут сделана уёбищно
|
-- Чтоб сменить стандартную тему, надо раскомментировать vim.cmd.colorscheme под именем темы
|
||||||
-- Чтоб сменить стандартную тему, надо раскомментировать vim.cmd.colorscheme пад именем темы
|
|
||||||
-- и закомментировать это же у прошлой темы
|
-- и закомментировать это же у прошлой темы
|
||||||
|
|
||||||
-- В lazy.nvim параметр priority определяет порядок загрузки плагинов.
|
-- В lazy.nvim параметр priority определяет порядок загрузки плагинов.
|
||||||
|
|
@ -12,22 +11,6 @@
|
||||||
|
|
||||||
-- https://dotfyle.com/neovim/colorscheme/top
|
-- https://dotfyle.com/neovim/colorscheme/top
|
||||||
|
|
||||||
-- Убедитесь, что Sonokai установлен через lazy.nvim или другой менеджер
|
|
||||||
local variants = { 'default', 'atlantis', 'andromeda', 'shusia', 'maia', 'espresso' }
|
|
||||||
|
|
||||||
-- Создаем псевдонимы для каждой темы
|
|
||||||
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, {})
|
|
||||||
|
|
||||||
-- Регистрируем в 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 {
|
return {
|
||||||
{
|
{
|
||||||
'folke/tokyonight.nvim',
|
'folke/tokyonight.nvim',
|
||||||
|
|
@ -92,7 +75,7 @@ return {
|
||||||
},
|
},
|
||||||
|
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
-- Гандоны не дают выбрать тему нормально --
|
-- Не дают выбрать тему нормально --
|
||||||
-- Приходится конфиг переписывать ради выбора расцветок --
|
-- Приходится конфиг переписывать ради выбора расцветок --
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
{
|
{
|
||||||
|
|
@ -149,27 +132,6 @@ return {
|
||||||
vim.cmd.colorscheme 'gruvbox'
|
vim.cmd.colorscheme 'gruvbox'
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'sainnhe/gruvbox-material',
|
|
||||||
priority = 1000,
|
|
||||||
init = function()
|
|
||||||
-- 'hard', 'medium', 'soft'
|
|
||||||
vim.g.gruvbox_material_background = 'medium'
|
|
||||||
-- 'material', 'mix', 'original'
|
|
||||||
vim.g.gruvbox_material_foreground = 'mix'
|
|
||||||
-- 'grey', 'colored', 'highlighted'
|
|
||||||
vim.g.gruvbox_material_diagnostic_virtual_text = 'colored'
|
|
||||||
vim.g.gruvbox_material_diagnostic_line_highlight = 1
|
|
||||||
vim.g.gruvbox_material_diagnostic_text_highlight = 1
|
|
||||||
|
|
||||||
-- vim.g.gruvbox_material_inlay_hints_background = 'dimmed'
|
|
||||||
-- vim.g.gruvbox_material_better_performance = 1
|
|
||||||
-- vim.g.gruvbox_material_spell_foreground = 'colored'
|
|
||||||
-- vim.g.gruvbox_material_enable_bold = 1
|
|
||||||
-- vim.g.gruvbox_material_enable_italic = true
|
|
||||||
-- vim.cmd.colorscheme 'gruvbox-material'
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'sainnhe/everforest',
|
'sainnhe/everforest',
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,3 @@
|
||||||
-- Useful plugin to show you pending keybinds.
|
|
||||||
|
|
||||||
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
|
|
||||||
--
|
|
||||||
-- This is often very useful to both group configuration, as well as handle
|
|
||||||
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
|
||||||
--
|
|
||||||
-- For example, in the following configuration, we use:
|
|
||||||
-- event = 'VimEnter'
|
|
||||||
--
|
|
||||||
-- which loads which-key before all the UI elements are loaded. Events can be
|
|
||||||
-- normal autocommands events (`:help autocmd-events`).
|
|
||||||
--
|
|
||||||
-- Then, because we use the `config` key, the configuration only runs
|
|
||||||
-- after the plugin has been loaded:
|
|
||||||
-- config = function() ... end
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
|
|
@ -59,12 +42,12 @@ return {
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
spec = {
|
spec = {
|
||||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
-- { '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
||||||
-- { '<leader>d', group = '[D]ocument' },
|
-- { '<leader>d', group = '[D]ocument' },
|
||||||
{ '<leader>r', group = '[R]ename' },
|
-- { '<leader>r', group = '[R]ename' },
|
||||||
{ '<leader>s', group = '[S]earch' },
|
{ '<leader>s', group = '[S]earch' },
|
||||||
{ '<leader>S', group = '[S]ession' },
|
{ '<leader>S', group = '[S]ession' },
|
||||||
{ '<leader>w', group = '[W]orkspace' },
|
-- { '<leader>w', group = '[W]orkspace' },
|
||||||
{ '<leader>t', group = '[T]oggle' },
|
{ '<leader>t', group = '[T]oggle' },
|
||||||
{ '<leader>g', group = '[G]olang' },
|
{ '<leader>g', group = '[G]olang' },
|
||||||
{ '<leader>gt', group = '[G]olang [T]ag' },
|
{ '<leader>gt', group = '[G]olang [T]ag' },
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ vim.opt.expandtab = true
|
||||||
-- yaml lsp за меня решают сколько пробелов мне надо. Это фикс
|
-- yaml lsp за меня решают сколько пробелов мне надо. Это фикс
|
||||||
-- Их параметры конфига для переназначения не работают. Пришлось костыль сделать
|
-- Их параметры конфига для переназначения не работают. Пришлось костыль сделать
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
autocmd FileType yaml setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
|
autocmd FileType yaml setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
|
||||||
]]
|
]]
|
||||||
|
|
||||||
-- Комментировать .proto код биндом
|
-- Комментировать .proto код биндом
|
||||||
|
|
@ -37,6 +37,25 @@ vim.api.nvim_create_autocmd('FileType', {
|
||||||
vim.bo.commentstring = '// %s'
|
vim.bo.commentstring = '// %s'
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
-- Комментировать .sql код биндом
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
pattern = 'sql',
|
||||||
|
callback = function()
|
||||||
|
vim.bo.commentstring = '-- %s'
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Fix .sqlfluff highlight
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||||
|
pattern = '*.sqlfluff',
|
||||||
|
command = 'set filetype=toml',
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Disable netrw for file tree
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
-- optionally enable 24-bit colour
|
||||||
|
-- vim.opt.termguicolors = true
|
||||||
|
|
||||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||||
vim.opt.mouse = 'a'
|
vim.opt.mouse = 'a'
|
||||||
|
|
@ -123,6 +142,11 @@ vim.opt.cursorline = true
|
||||||
-- Minimal number of screen lines to keep above and below the cursor.
|
-- Minimal number of screen lines to keep above and below the cursor.
|
||||||
vim.opt.scrolloff = 10
|
vim.opt.scrolloff = 10
|
||||||
|
|
||||||
|
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
||||||
|
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||||
|
-- See `:help 'confirm'`
|
||||||
|
-- vim.opt.confirm = true
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
-- See `:help vim.keymap.set()`
|
-- See `:help vim.keymap.set()`
|
||||||
|
|
||||||
|
|
@ -161,6 +185,12 @@ vim.keymap.set('n', '<C-Right>', '<C-w><C-l>', { desc = 'Move focus to the right
|
||||||
vim.keymap.set('n', '<C-Down>', '<C-w><C-j>', { desc = 'Move focus to the lower 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' })
|
vim.keymap.set('n', '<C-Up>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||||
|
|
||||||
|
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||||
|
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||||
|
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||||
|
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||||
|
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See `:help lua-guide-autocommands`
|
-- See `:help lua-guide-autocommands`
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue