mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2026-04-14 22:21:16 -07:00
Compare commits
76 Commits
cpatti_rem
...
feature/ts
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e01e1eb8f8 | ||
|
|
8ac4b12632 | ||
|
|
0619d89884 | ||
|
|
58170c7ae3 | ||
|
|
164cedf212 | ||
|
|
431cf2e881 | ||
|
|
d132bd3e9f | ||
|
|
f7b74c7b83 | ||
|
|
b212fdb33f | ||
|
|
d97de4f0ae | ||
|
|
886f2bc076 | ||
|
|
dabce46993 | ||
|
|
7cc245ecaf | ||
|
|
86f1ba26f2 | ||
|
|
9a3a2f9678 | ||
|
|
1f4c21f463 | ||
|
|
4021496050 | ||
|
|
a6dcf6874b | ||
|
|
966d5e94b1 | ||
|
|
a4bbfdc3db | ||
|
|
80b1ee1789 | ||
|
|
09ab9ae265 | ||
|
|
afc734f993 | ||
|
|
177ff61483 | ||
|
|
b9f3965282 | ||
|
|
1ba1789318 | ||
|
|
df9436c0e5 | ||
|
|
e79572c9e6 | ||
|
|
7e54a4c5c8 | ||
|
|
8c6b78c770 | ||
|
|
560d9dc894 | ||
|
|
21d5aabc22 | ||
|
|
318bd3e65c | ||
|
|
e87b7281ed | ||
|
|
88c65592ae | ||
|
|
b15cca8d31 | ||
|
|
8f479db123 | ||
|
|
35822809e6 | ||
|
|
b2af42acb3 | ||
|
|
c8e189ff78 | ||
|
|
ad246eb5dd | ||
|
|
0c17d320bb | ||
|
|
7ea937dbc5 | ||
|
|
3ddda4a8b8 | ||
|
|
5740ddcf9c | ||
|
|
2d541c4140 | ||
|
|
3338d39206 | ||
|
|
6ba2408cdf | ||
|
|
f5a9f9cdc6 | ||
|
|
fb73617653 | ||
|
|
c92ea7ca97 | ||
|
|
2b2f0f8364 | ||
|
|
76cb865e4f | ||
|
|
d350db2449 | ||
|
|
9929044f24 | ||
|
|
1a5787bc57 | ||
|
|
8a5a52f647 | ||
|
|
e947649cb0 | ||
|
|
5e2d7e184b | ||
|
|
2abcb39fae | ||
|
|
38f4744e25 | ||
|
|
34e7d29aa7 | ||
|
|
ea60b2b01f | ||
|
|
e64aa51ef2 | ||
|
|
7c49ba1cb7 | ||
|
|
282cbb9c82 | ||
|
|
ebca680dea | ||
|
|
76e06fec5c | ||
|
|
db78c0b217 | ||
|
|
d2c006819a | ||
|
|
94f551b803 | ||
|
|
71ad926ab1 | ||
|
|
abdbfce0f8 | ||
|
|
5bdde24dfb | ||
|
|
ff89769e45 | ||
|
|
f6abf682ff |
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -11,7 +11,7 @@ assignees: ''
|
|||||||
|
|
||||||
## Before Reporting an Issue
|
## Before Reporting an Issue
|
||||||
- I have read the kickstart.nvim README.md.
|
- I have read the kickstart.nvim README.md.
|
||||||
- I have read the appropiate plugin's documentation.
|
- I have read the appropriate plugin's documentation.
|
||||||
- I have searched that this issue has not been reported before.
|
- 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.**
|
- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.**
|
||||||
|
|||||||
5
.github/workflows/stylua.yml
vendored
5
.github/workflows/stylua.yml
vendored
@@ -9,13 +9,12 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Stylua Check
|
- name: Stylua Check
|
||||||
uses: JohnnyMorganz/stylua-action@v3
|
uses: JohnnyMorganz/stylua-action@v4
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
version: latest
|
version: latest
|
||||||
args: --check .
|
args: --check .
|
||||||
|
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -4,4 +4,11 @@ test.sh
|
|||||||
nvim
|
nvim
|
||||||
|
|
||||||
spell/
|
spell/
|
||||||
|
|
||||||
|
# In your personal fork, you likely want to comment this, since it's recommended to track
|
||||||
|
# lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile
|
||||||
|
# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded
|
||||||
|
# merge conflicts.
|
||||||
lazy-lock.json
|
lazy-lock.json
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ indent_type = "Spaces"
|
|||||||
indent_width = 2
|
indent_width = 2
|
||||||
quote_style = "AutoPreferSingle"
|
quote_style = "AutoPreferSingle"
|
||||||
call_parentheses = "None"
|
call_parentheses = "None"
|
||||||
|
collapse_simple_statement = "Always"
|
||||||
|
|||||||
123
README.md
123
README.md
@@ -17,28 +17,38 @@ A starting point for Neovim that is:
|
|||||||
Kickstart.nvim targets *only* the latest
|
Kickstart.nvim targets *only* the latest
|
||||||
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
||||||
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
||||||
If you are experiencing issues, please make sure you have the latest versions.
|
If you are experiencing issues, please make sure you have at least the latest
|
||||||
|
stable version. Most likely, you want to install neovim via a [package
|
||||||
|
manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package).
|
||||||
|
To check your neovim version, run `nvim --version` and make sure it is not
|
||||||
|
below the latest
|
||||||
|
['stable'](https://github.com/neovim/neovim/releases/tag/stable) version. If
|
||||||
|
your chosen install method only gives you an outdated version of neovim, find
|
||||||
|
alternative [installation methods below](#alternative-neovim-installation-methods).
|
||||||
|
|
||||||
### Install External Dependencies
|
### Install External Dependencies
|
||||||
|
|
||||||
External Requirements:
|
External Requirements:
|
||||||
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
||||||
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
|
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
|
||||||
|
[fd-find](https://github.com/sharkdp/fd#installation)
|
||||||
|
- [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md#installation)
|
||||||
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
||||||
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
- 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
|
- 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:
|
- Language Setup:
|
||||||
- If you want to write Typescript, you need `npm`
|
- If you want to write Typescript, you need `npm`
|
||||||
- If you want to write Golang, you will need `go`
|
- If you want to write Golang, you will need `go`
|
||||||
- etc.
|
- etc.
|
||||||
|
|
||||||
> **NOTE**
|
> [!NOTE]
|
||||||
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes
|
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes
|
||||||
> and quick install snippets
|
> and quick install snippets
|
||||||
|
|
||||||
### Install Kickstart
|
### Install Kickstart
|
||||||
|
|
||||||
> **NOTE**
|
> [!NOTE]
|
||||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
> [Backup](#FAQ) your previous configuration (if any exists)
|
||||||
|
|
||||||
Neovim's configurations are located under the following paths, depending on your OS:
|
Neovim's configurations are located under the following paths, depending on your OS:
|
||||||
@@ -55,7 +65,7 @@ Neovim's configurations are located under the following paths, depending on your
|
|||||||
so that you have your own copy that you can modify, then install by cloning the
|
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.
|
fork to your machine using one of the commands below, depending on your OS.
|
||||||
|
|
||||||
> **NOTE**
|
> [!NOTE]
|
||||||
> Your fork's URL will be something like this:
|
> Your fork's URL will be something like this:
|
||||||
> `https://github.com/<your_github_username>/kickstart.nvim.git`
|
> `https://github.com/<your_github_username>/kickstart.nvim.git`
|
||||||
|
|
||||||
@@ -64,7 +74,8 @@ 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).
|
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
|
||||||
|
|
||||||
#### Clone kickstart.nvim
|
#### Clone kickstart.nvim
|
||||||
> **NOTE**
|
|
||||||
|
> [!NOTE]
|
||||||
> If following the recommended step above (i.e., forking the repo), replace
|
> If following the recommended step above (i.e., forking the repo), replace
|
||||||
> `nvim-lua` with `<your_github_username>` in the commands below
|
> `nvim-lua` with `<your_github_username>` in the commands below
|
||||||
|
|
||||||
@@ -151,7 +162,7 @@ examples of adding popularly requested plugins.
|
|||||||
|
|
||||||
Below you can find OS specific install instructions for Neovim and dependencies.
|
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.
|
After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step.
|
||||||
|
|
||||||
#### Windows Installation
|
#### Windows Installation
|
||||||
|
|
||||||
@@ -182,7 +193,7 @@ winget install --accept-source-agreements chocolatey.chocolatey
|
|||||||
2. install all requirements using choco, exit the previous cmd and
|
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**:
|
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
|
choco install -y neovim git ripgrep wget fd unzip gzip mingw make tree-sitter
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
<details><summary>WSL (Windows Subsystem for Linux)</summary>
|
<details><summary>WSL (Windows Subsystem for Linux)</summary>
|
||||||
@@ -192,7 +203,7 @@ wsl --install
|
|||||||
wsl
|
wsl
|
||||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@@ -202,37 +213,111 @@ sudo apt install make gcc ripgrep unzip git xclip neovim
|
|||||||
```
|
```
|
||||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
<details><summary>Debian Install Steps</summary>
|
<details><summary>Debian Install Steps</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install make gcc ripgrep unzip git xclip curl
|
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip curl
|
||||||
|
|
||||||
# Now we install nvim
|
# Now we install nvim
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
|
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
|
||||||
sudo rm -rf /opt/nvim-linux64
|
sudo rm -rf /opt/nvim-linux-x86_64
|
||||||
sudo mkdir -p /opt/nvim-linux64
|
sudo mkdir -p /opt/nvim-linux-x86_64
|
||||||
sudo chmod a+rX /opt/nvim-linux64
|
sudo chmod a+rX /opt/nvim-linux-x86_64
|
||||||
sudo tar -C /opt -xzf nvim-linux64.tar.gz
|
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
|
||||||
|
|
||||||
# make it available in /usr/local/bin, distro installs to /usr/bin
|
# make it available in /usr/local/bin, distro installs to /usr/bin
|
||||||
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
|
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
<details><summary>Fedora Install Steps</summary>
|
<details><summary>Fedora Install Steps</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
|
sudo dnf install -y gcc make git ripgrep fd-find tree-sitter-cli unzip neovim
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details><summary>Arch Install Steps</summary>
|
<details><summary>Arch Install Steps</summary>
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
|
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd tree-sitter-cli unzip neovim
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### Alternative neovim installation methods
|
||||||
|
|
||||||
|
For some systems it is not unexpected that the [package manager installation
|
||||||
|
method](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
|
||||||
|
recommended by neovim is significantly behind. If that is the case for you,
|
||||||
|
pick one of the following methods that are known to deliver fresh neovim versions very quickly.
|
||||||
|
They have been picked for their popularity and because they make installing and updating
|
||||||
|
neovim to the latest versions easy. You can also find more detail about the
|
||||||
|
available methods being discussed
|
||||||
|
[here](https://github.com/nvim-lua/kickstart.nvim/issues/1583).
|
||||||
|
|
||||||
|
|
||||||
|
<details><summary>Bob</summary>
|
||||||
|
|
||||||
|
[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for
|
||||||
|
all platforms. Simply install
|
||||||
|
[rustup](https://rust-lang.github.io/rustup/installation/other.html),
|
||||||
|
and run the following commands:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rustup default stable
|
||||||
|
rustup update stable
|
||||||
|
cargo install bob-nvim
|
||||||
|
bob use stable
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>Homebrew</summary>
|
||||||
|
|
||||||
|
[Homebrew](https://brew.sh) is a package manager popular on Mac and Linux.
|
||||||
|
Simply install using [`brew install`](https://formulae.brew.sh/formula/neovim).
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>Flatpak</summary>
|
||||||
|
|
||||||
|
Flatpak is a package manager for applications that allows developers to package their applications
|
||||||
|
just once to make it available on all Linux systems. Simply [install flatpak](https://flatpak.org/setup/)
|
||||||
|
and setup [flathub](https://flathub.org/setup) to [install neovim](https://flathub.org/apps/io.neovim.nvim).
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>asdf and mise-en-place</summary>
|
||||||
|
|
||||||
|
[asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/) are tool version managers,
|
||||||
|
mostly aimed towards project-specific tool versioning. However both support managing tools
|
||||||
|
globally in the user-space as well:
|
||||||
|
|
||||||
|
<details><summary>mise</summary>
|
||||||
|
|
||||||
|
[Install mise](https://mise.jdx.dev/getting-started.html), then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mise plugins install neovim
|
||||||
|
mise use neovim@stable
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>asdf</summary>
|
||||||
|
|
||||||
|
[Install asdf](https://asdf-vm.com/guide/getting-started.html), then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
asdf plugin add neovim
|
||||||
|
asdf install neovim stable
|
||||||
|
asdf set neovim stable --home
|
||||||
|
asdf reshim neovim
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|||||||
680
init.lua
680
init.lua
@@ -94,67 +94,75 @@ vim.g.maplocalleader = ' '
|
|||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = false
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.o`
|
||||||
-- NOTE: You can change these options as you wish!
|
-- NOTE: You can change these options as you wish!
|
||||||
-- For more options, you can see `:help option-list`
|
-- For more options, you can see `:help option-list`
|
||||||
|
|
||||||
-- Make line numbers default
|
-- Make line numbers default
|
||||||
vim.opt.number = true
|
vim.o.number = true
|
||||||
-- You can also add relative line numbers, to help with jumping.
|
-- You can also add relative line numbers, to help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.opt.relativenumber = true
|
-- vim.o.relativenumber = 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.o.mouse = 'a'
|
||||||
|
|
||||||
-- Don't show the mode, since it's already in the status line
|
-- Don't show the mode, since it's already in the status line
|
||||||
vim.opt.showmode = false
|
vim.o.showmode = false
|
||||||
|
|
||||||
-- Sync clipboard between OS and Neovim.
|
-- Sync clipboard between OS and Neovim.
|
||||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||||
-- Remove this option if you want your OS clipboard to remain independent.
|
-- Remove this option if you want your OS clipboard to remain independent.
|
||||||
-- See `:help 'clipboard'`
|
-- See `:help 'clipboard'`
|
||||||
vim.schedule(function()
|
vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
|
||||||
end)
|
|
||||||
|
|
||||||
-- Enable break indent
|
-- Enable break indent
|
||||||
vim.opt.breakindent = true
|
vim.o.breakindent = true
|
||||||
|
|
||||||
-- Save undo history
|
-- Enable undo/redo changes even after closing and reopening a file
|
||||||
vim.opt.undofile = true
|
vim.o.undofile = true
|
||||||
|
|
||||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||||
vim.opt.ignorecase = true
|
vim.o.ignorecase = true
|
||||||
vim.opt.smartcase = true
|
vim.o.smartcase = true
|
||||||
|
|
||||||
-- Keep signcolumn on by default
|
-- Keep signcolumn on by default
|
||||||
vim.opt.signcolumn = 'yes'
|
vim.o.signcolumn = 'yes'
|
||||||
|
|
||||||
-- Decrease update time
|
-- Decrease update time
|
||||||
vim.opt.updatetime = 250
|
vim.o.updatetime = 250
|
||||||
|
|
||||||
-- Decrease mapped sequence wait time
|
-- Decrease mapped sequence wait time
|
||||||
vim.opt.timeoutlen = 300
|
vim.o.timeoutlen = 300
|
||||||
|
|
||||||
-- Configure how new splits should be opened
|
-- Configure how new splits should be opened
|
||||||
vim.opt.splitright = true
|
vim.o.splitright = true
|
||||||
vim.opt.splitbelow = true
|
vim.o.splitbelow = true
|
||||||
|
|
||||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||||
-- See `:help 'list'`
|
-- See `:help 'list'`
|
||||||
-- and `:help 'listchars'`
|
-- and `:help 'listchars'`
|
||||||
vim.opt.list = true
|
--
|
||||||
|
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
|
||||||
|
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.
|
||||||
|
-- See `:help lua-options`
|
||||||
|
-- and `:help lua-guide-options`
|
||||||
|
vim.o.list = true
|
||||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||||
|
|
||||||
-- Preview substitutions live, as you type!
|
-- Preview substitutions live, as you type!
|
||||||
vim.opt.inccommand = 'split'
|
vim.o.inccommand = 'split'
|
||||||
|
|
||||||
-- Show which line your cursor is on
|
-- Show which line your cursor is on
|
||||||
vim.opt.cursorline = true
|
vim.o.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.o.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.o.confirm = true
|
||||||
|
|
||||||
-- [[ Basic Keymaps ]]
|
-- [[ Basic Keymaps ]]
|
||||||
-- See `:help vim.keymap.set()`
|
-- See `:help vim.keymap.set()`
|
||||||
@@ -163,7 +171,22 @@ vim.opt.scrolloff = 10
|
|||||||
-- See `:help hlsearch`
|
-- See `:help hlsearch`
|
||||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||||
|
|
||||||
-- Diagnostic keymaps
|
-- Diagnostic Config & Keymaps
|
||||||
|
-- See :help vim.diagnostic.Opts
|
||||||
|
vim.diagnostic.config {
|
||||||
|
update_in_insert = false,
|
||||||
|
severity_sort = true,
|
||||||
|
float = { border = 'rounded', source = 'if_many' },
|
||||||
|
underline = { severity = { min = vim.diagnostic.severity.WARN } },
|
||||||
|
|
||||||
|
-- Can switch between these as you prefer
|
||||||
|
virtual_text = true, -- Text shows up at the end of the line
|
||||||
|
virtual_lines = false, -- Text shows up underneath the line, with virtual lines
|
||||||
|
|
||||||
|
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
|
||||||
|
jump = { float = true },
|
||||||
|
}
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
|
|
||||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||||
@@ -189,18 +212,22 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|||||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower 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' })
|
vim.keymap.set('n', '<C-k>', '<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`
|
||||||
|
|
||||||
-- Highlight when yanking (copying) text
|
-- Highlight when yanking (copying) text
|
||||||
-- Try it with `yap` in normal mode
|
-- Try it with `yap` in normal mode
|
||||||
-- See `:help vim.highlight.on_yank()`
|
-- See `:help vim.hl.on_yank()`
|
||||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||||
desc = 'Highlight when yanking (copying) text',
|
desc = 'Highlight when yanking (copying) text',
|
||||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||||
callback = function()
|
callback = function() vim.hl.on_yank() end,
|
||||||
vim.highlight.on_yank()
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- [[ Install `lazy.nvim` plugin manager ]]
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||||
@@ -209,11 +236,12 @@ local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||||
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end
|
||||||
error('Error cloning lazy.nvim:\n' .. out)
|
end
|
||||||
end
|
|
||||||
end ---@diagnostic disable-next-line: undefined-field
|
---@type vim.Option
|
||||||
vim.opt.rtp:prepend(lazypath)
|
local rtp = vim.opt.rtp
|
||||||
|
rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- [[ Configure and install plugins ]]
|
-- [[ Configure and install plugins ]]
|
||||||
--
|
--
|
||||||
@@ -227,30 +255,36 @@ vim.opt.rtp:prepend(lazypath)
|
|||||||
--
|
--
|
||||||
-- NOTE: Here is where you install your plugins.
|
-- NOTE: Here is where you install your plugins.
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
-- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}`
|
||||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
{ 'NMAC427/guess-indent.nvim', opts = {} },
|
||||||
|
|
||||||
-- NOTE: Plugins can also be added by using a table,
|
-- Alternatively, use `config = function() ... end` for full control over the configuration.
|
||||||
-- with the first argument being the link and the following
|
-- If you prefer to call `setup` explicitly, use:
|
||||||
-- keys can be used to configure plugin behavior/loading/etc.
|
-- {
|
||||||
|
-- 'lewis6991/gitsigns.nvim',
|
||||||
|
-- config = function()
|
||||||
|
-- require('gitsigns').setup({
|
||||||
|
-- -- Your gitsigns configuration here
|
||||||
|
-- })
|
||||||
|
-- end,
|
||||||
|
-- }
|
||||||
--
|
--
|
||||||
-- Use `opts = {}` to force a plugin to be loaded.
|
|
||||||
--
|
|
||||||
|
|
||||||
-- Here is a more advanced example where we pass configuration
|
-- Here is a more advanced example where we pass configuration
|
||||||
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
-- options to `gitsigns.nvim`.
|
||||||
-- require('gitsigns').setup({ ... })
|
|
||||||
--
|
--
|
||||||
-- See `:help gitsigns` to understand what the configuration keys do
|
-- See `:help gitsigns` to understand what the configuration keys do
|
||||||
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
|
---@module 'gitsigns'
|
||||||
|
---@type Gitsigns.Config
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
opts = {
|
opts = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = '+' },
|
add = { text = '+' }, ---@diagnostic disable-line: missing-fields
|
||||||
change = { text = '~' },
|
change = { text = '~' }, ---@diagnostic disable-line: missing-fields
|
||||||
delete = { text = '_' },
|
delete = { text = '_' }, ---@diagnostic disable-line: missing-fields
|
||||||
topdelete = { text = '‾' },
|
topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields
|
||||||
changedelete = { text = '~' },
|
changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -271,57 +305,21 @@ require('lazy').setup({
|
|||||||
|
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter',
|
||||||
|
---@module 'which-key'
|
||||||
|
---@type wk.Opts
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
opts = {
|
opts = {
|
||||||
-- delay between pressing a key and opening which-key (milliseconds)
|
-- delay between pressing a key and opening which-key (milliseconds)
|
||||||
-- this setting is independent of vim.opt.timeoutlen
|
|
||||||
delay = 0,
|
delay = 0,
|
||||||
icons = {
|
icons = { mappings = vim.g.have_nerd_font },
|
||||||
-- set icon mappings to true if you have a Nerd Font
|
|
||||||
mappings = vim.g.have_nerd_font,
|
|
||||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
|
||||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
|
||||||
keys = vim.g.have_nerd_font and {} or {
|
|
||||||
Up = '<Up> ',
|
|
||||||
Down = '<Down> ',
|
|
||||||
Left = '<Left> ',
|
|
||||||
Right = '<Right> ',
|
|
||||||
C = '<C-…> ',
|
|
||||||
M = '<M-…> ',
|
|
||||||
D = '<D-…> ',
|
|
||||||
S = '<S-…> ',
|
|
||||||
CR = '<CR> ',
|
|
||||||
Esc = '<Esc> ',
|
|
||||||
ScrollWheelDown = '<ScrollWheelDown> ',
|
|
||||||
ScrollWheelUp = '<ScrollWheelUp> ',
|
|
||||||
NL = '<NL> ',
|
|
||||||
BS = '<BS> ',
|
|
||||||
Space = '<Space> ',
|
|
||||||
Tab = '<Tab> ',
|
|
||||||
F1 = '<F1>',
|
|
||||||
F2 = '<F2>',
|
|
||||||
F3 = '<F3>',
|
|
||||||
F4 = '<F4>',
|
|
||||||
F5 = '<F5>',
|
|
||||||
F6 = '<F6>',
|
|
||||||
F7 = '<F7>',
|
|
||||||
F8 = '<F8>',
|
|
||||||
F9 = '<F9>',
|
|
||||||
F10 = '<F10>',
|
|
||||||
F11 = '<F11>',
|
|
||||||
F12 = '<F12>',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Document existing key chains
|
-- Document existing key chains
|
||||||
spec = {
|
spec = {
|
||||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
{ '<leader>s', group = '[S]earch', mode = { 'n', 'v' } },
|
||||||
{ '<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>t', group = '[T]oggle' },
|
||||||
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first
|
||||||
|
{ 'gr', group = 'LSP Actions', mode = { 'n' } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -335,8 +333,17 @@ require('lazy').setup({
|
|||||||
|
|
||||||
{ -- Fuzzy Finder (files, lsp, etc)
|
{ -- Fuzzy Finder (files, lsp, etc)
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
|
-- By default, Telescope is included and acts as your picker for everything.
|
||||||
|
|
||||||
|
-- If you would like to switch to a different picker (like snacks, or fzf-lua)
|
||||||
|
-- you can disable the Telescope plugin by setting enabled to false and enable
|
||||||
|
-- your replacement picker by requiring it explicitly (e.g. 'custom.plugins.snacks')
|
||||||
|
|
||||||
|
-- Note: If you customize your config for yourself,
|
||||||
|
-- it’s best to remove the Telescope plugin config entirely
|
||||||
|
-- instead of just disabling it here, to keep your config clean.
|
||||||
|
enabled = true,
|
||||||
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
|
||||||
@@ -348,9 +355,7 @@ require('lazy').setup({
|
|||||||
|
|
||||||
-- `cond` is a condition used to determine whether this plugin should be
|
-- `cond` is a condition used to determine whether this plugin should be
|
||||||
-- installed and loaded.
|
-- installed and loaded.
|
||||||
cond = function()
|
cond = function() return vim.fn.executable 'make' == 1 end,
|
||||||
return vim.fn.executable 'make' == 1
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||||
|
|
||||||
@@ -390,9 +395,7 @@ require('lazy').setup({
|
|||||||
-- },
|
-- },
|
||||||
-- pickers = {}
|
-- pickers = {}
|
||||||
extensions = {
|
extensions = {
|
||||||
['ui-select'] = {
|
['ui-select'] = { require('telescope.themes').get_dropdown() },
|
||||||
require('telescope.themes').get_dropdown(),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,14 +409,49 @@ require('lazy').setup({
|
|||||||
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
||||||
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
||||||
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
||||||
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
vim.keymap.set({ 'n', 'v' }, '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
||||||
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
||||||
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
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>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>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||||
|
vim.keymap.set('n', '<leader>sc', builtin.commands, { desc = '[S]earch [C]ommands' })
|
||||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||||
|
|
||||||
-- Slightly advanced example of overriding default behavior and theme
|
-- This runs on LSP attach per buffer (see main LSP attach function in 'neovim/nvim-lspconfig' config for more info,
|
||||||
|
-- it is better explained there). This allows easily switching between pickers if you prefer using something else!
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }),
|
||||||
|
callback = function(event)
|
||||||
|
local buf = event.buf
|
||||||
|
|
||||||
|
-- Find references for the word under your cursor.
|
||||||
|
vim.keymap.set('n', 'grr', builtin.lsp_references, { buffer = buf, desc = '[G]oto [R]eferences' })
|
||||||
|
|
||||||
|
-- Jump to the implementation of the word under your cursor.
|
||||||
|
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||||
|
vim.keymap.set('n', 'gri', builtin.lsp_implementations, { buffer = buf, desc = '[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>.
|
||||||
|
vim.keymap.set('n', 'grd', builtin.lsp_definitions, { buffer = buf, desc = '[G]oto [D]efinition' })
|
||||||
|
|
||||||
|
-- Fuzzy find all the symbols in your current document.
|
||||||
|
-- Symbols are things like variables, functions, types, etc.
|
||||||
|
vim.keymap.set('n', 'gO', builtin.lsp_document_symbols, { buffer = buf, desc = 'Open Document Symbols' })
|
||||||
|
|
||||||
|
-- Fuzzy find all the symbols in your current workspace.
|
||||||
|
-- Similar to document symbols, except searches over your entire project.
|
||||||
|
vim.keymap.set('n', 'gW', builtin.lsp_dynamic_workspace_symbols, { buffer = buf, desc = 'Open Workspace Symbols' })
|
||||||
|
|
||||||
|
-- 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
|
||||||
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
|
vim.keymap.set('n', 'grt', builtin.lsp_type_definitions, { buffer = buf, desc = '[G]oto [T]ype Definition' })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Override default behavior and theme when searching
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
|
||||||
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
||||||
@@ -424,34 +462,24 @@ require('lazy').setup({
|
|||||||
|
|
||||||
-- It's also possible to pass additional configuration options.
|
-- It's also possible to pass additional configuration options.
|
||||||
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
-- See `:help telescope.builtin.live_grep()` for information about particular keys
|
||||||
vim.keymap.set('n', '<leader>s/', function()
|
vim.keymap.set(
|
||||||
builtin.live_grep {
|
'n',
|
||||||
grep_open_files = true,
|
'<leader>s/',
|
||||||
prompt_title = 'Live Grep in Open Files',
|
function()
|
||||||
}
|
builtin.live_grep {
|
||||||
end, { desc = '[S]earch [/] in Open Files' })
|
grep_open_files = true,
|
||||||
|
prompt_title = 'Live Grep in Open Files',
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
{ desc = '[S]earch [/] in Open Files' }
|
||||||
|
)
|
||||||
|
|
||||||
-- Shortcut for searching your Neovim configuration files
|
-- Shortcut for searching your Neovim configuration files
|
||||||
vim.keymap.set('n', '<leader>sn', function()
|
vim.keymap.set('n', '<leader>sn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } end, { desc = '[S]earch [N]eovim files' })
|
||||||
builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
|
||||||
end, { desc = '[S]earch [N]eovim files' })
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- LSP Plugins
|
-- LSP Plugins
|
||||||
{
|
|
||||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
|
||||||
-- used for completion, annotations and signatures of Neovim apis
|
|
||||||
'folke/lazydev.nvim',
|
|
||||||
ft = 'lua',
|
|
||||||
opts = {
|
|
||||||
library = {
|
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
|
||||||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{ 'Bilal2453/luvit-meta', lazy = true },
|
|
||||||
{
|
{
|
||||||
-- Main LSP Configuration
|
-- Main LSP Configuration
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
@@ -459,16 +487,19 @@ require('lazy').setup({
|
|||||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||||
-- Mason must be loaded before its dependents so we need to set it up here.
|
-- Mason must be loaded before its dependents so we need to set it up here.
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
||||||
{ 'williamboman/mason.nvim', opts = {} },
|
{
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'mason-org/mason.nvim',
|
||||||
|
---@module 'mason.settings'
|
||||||
|
---@type MasonSettings
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
-- Maps LSP server names between nvim-lspconfig and Mason package names.
|
||||||
|
'mason-org/mason-lspconfig.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
|
||||||
-- Useful status updates for LSP.
|
-- Useful status updates for LSP.
|
||||||
-- 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
|
|
||||||
'hrsh7th/cmp-nvim-lsp',
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief aside: **What is LSP?**
|
-- Brief aside: **What is LSP?**
|
||||||
@@ -513,42 +544,17 @@ require('lazy').setup({
|
|||||||
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.
|
|
||||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
|
||||||
-- To jump back, press <C-t>.
|
|
||||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
|
||||||
|
|
||||||
-- Find references for the word under your cursor.
|
|
||||||
map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
||||||
|
|
||||||
-- Jump to the implementation of the word under your cursor.
|
|
||||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
|
||||||
map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
|
||||||
|
|
||||||
-- 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
|
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
|
||||||
map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
|
||||||
|
|
||||||
-- 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')
|
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current workspace.
|
|
||||||
-- Similar to document symbols, except searches over your entire project.
|
|
||||||
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
|
||||||
|
|
||||||
-- Rename the variable under your cursor.
|
-- Rename the variable under your cursor.
|
||||||
-- Most Language Servers support renaming across files, etc.
|
-- Most Language Servers support renaming across files, etc.
|
||||||
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
|
|
||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
-- 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.
|
-- or a suggestion from your LSP for this to activate.
|
||||||
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
|
map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
map('grD', 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.
|
||||||
@@ -556,7 +562,7 @@ require('lazy').setup({
|
|||||||
--
|
--
|
||||||
-- 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('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,
|
||||||
@@ -583,66 +589,56 @@ require('lazy').setup({
|
|||||||
-- 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('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 }) end, '[T]oggle Inlay [H]ints')
|
||||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
|
||||||
end, '[T]oggle Inlay [H]ints')
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- 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 } }
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- 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.
|
|
||||||
-- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities.
|
|
||||||
-- So, we create new capabilities with nvim cmp, and then broadcast that to the servers.
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
|
||||||
|
|
||||||
-- 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.
|
||||||
--
|
-- See `:help lsp-config` for information about keys and how to configure
|
||||||
-- Add any additional override configuration in the following tables. Available keys are:
|
---@type table<string, vim.lsp.Config>
|
||||||
-- - cmd (table): Override the default command used to start the server
|
|
||||||
-- - filetypes (table): Override the default list of associated filetypes for the server
|
|
||||||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
|
||||||
-- - 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 = {
|
local servers = {
|
||||||
-- clangd = {},
|
-- clangd = {},
|
||||||
-- gopls = {},
|
-- gopls = {},
|
||||||
-- pyright = {},
|
-- pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
-- ... etc. 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:
|
-- Some languages (like typescript) have entire language plugins that can be useful:
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||||
-- ts_ls = {},
|
-- ts_ls = {},
|
||||||
--
|
|
||||||
|
|
||||||
|
stylua = {}, -- Used to format Lua code
|
||||||
|
|
||||||
|
-- Special Lua Config, as recommended by neovim help docs
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = { ... },
|
on_init = function(client)
|
||||||
-- filetypes = { ... },
|
if client.workspace_folders then
|
||||||
-- capabilities = {},
|
local path = client.workspace_folders[1].name
|
||||||
settings = {
|
if path ~= vim.fn.stdpath 'config' and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) then return end
|
||||||
Lua = {
|
end
|
||||||
completion = {
|
|
||||||
callSnippet = 'Replace',
|
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
path = { 'lua/?.lua', 'lua/?/init.lua' },
|
||||||
},
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
workspace = {
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
checkThirdParty = false,
|
||||||
},
|
-- NOTE: this is a lot slower and will cause issues when working on your own configuration.
|
||||||
|
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
|
||||||
|
library = vim.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), {
|
||||||
|
'${3rd}/luv/library',
|
||||||
|
'${3rd}/busted/library',
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
Lua = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -654,30 +650,17 @@ require('lazy').setup({
|
|||||||
-- :Mason
|
-- :Mason
|
||||||
--
|
--
|
||||||
-- You can press `g?` for help in this menu.
|
-- You can press `g?` for help in this menu.
|
||||||
--
|
|
||||||
-- `mason` had to be setup earlier: to configure its options see the
|
|
||||||
-- `dependencies` table for `nvim-lspconfig` above.
|
|
||||||
--
|
|
||||||
-- You can add other tools here that you want Mason to install
|
|
||||||
-- for you, so that they are available from within Neovim.
|
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'stylua', -- Used to format Lua code
|
-- You can add other tools here that you want Mason to install
|
||||||
})
|
})
|
||||||
|
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
for name, server in pairs(servers) do
|
||||||
handlers = {
|
vim.lsp.config(name, server)
|
||||||
function(server_name)
|
vim.lsp.enable(name)
|
||||||
local server = servers[server_name] or {}
|
end
|
||||||
-- This handles overriding only values explicitly passed
|
|
||||||
-- by the server configuration above. Useful when disabling
|
|
||||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
|
||||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
|
||||||
require('lspconfig')[server_name].setup(server)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -688,13 +671,13 @@ require('lazy').setup({
|
|||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
'<leader>f',
|
'<leader>f',
|
||||||
function()
|
function() require('conform').format { async = true, lsp_format = 'fallback' } end,
|
||||||
require('conform').format { async = true, lsp_format = 'fallback' }
|
|
||||||
end,
|
|
||||||
mode = '',
|
mode = '',
|
||||||
desc = '[F]ormat buffer',
|
desc = '[F]ormat buffer',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
---@module 'conform'
|
||||||
|
---@type conform.setupOpts
|
||||||
opts = {
|
opts = {
|
||||||
notify_on_error = false,
|
notify_on_error = false,
|
||||||
format_on_save = function(bufnr)
|
format_on_save = function(bufnr)
|
||||||
@@ -702,16 +685,14 @@ require('lazy').setup({
|
|||||||
-- 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 = 500,
|
||||||
|
lsp_format = 'fallback',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
return {
|
|
||||||
timeout_ms = 500,
|
|
||||||
lsp_format = lsp_format_opt,
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
@@ -725,19 +706,19 @@ require('lazy').setup({
|
|||||||
},
|
},
|
||||||
|
|
||||||
{ -- Autocompletion
|
{ -- Autocompletion
|
||||||
'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.
|
||||||
-- Remove the below condition to re-enable on windows.
|
-- Remove the below condition to re-enable on windows.
|
||||||
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
return 'make install_jsregexp'
|
return 'make install_jsregexp'
|
||||||
end)(),
|
end)(),
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@@ -751,93 +732,70 @@ require('lazy').setup({
|
|||||||
-- end,
|
-- end,
|
||||||
-- },
|
-- },
|
||||||
},
|
},
|
||||||
|
opts = {},
|
||||||
},
|
},
|
||||||
'saadparwaiz1/cmp_luasnip',
|
|
||||||
|
|
||||||
-- 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',
|
|
||||||
},
|
},
|
||||||
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 {}
|
-- 'default' (recommended) for mappings similar to built-in completions
|
||||||
|
-- <c-y> to accept ([y]es) the completion.
|
||||||
cmp.setup {
|
-- This will auto-import if your LSP supports it.
|
||||||
snippet = {
|
-- This will expand snippets if the LSP sent a snippet.
|
||||||
expand = function(args)
|
-- 'super-tab' for tab to accept
|
||||||
luasnip.lsp_expand(args.body)
|
-- 'enter' for enter to accept
|
||||||
end,
|
-- 'none' for no mappings
|
||||||
},
|
--
|
||||||
completion = { completeopt = 'menu,menuone,noinsert' },
|
-- For an understanding of why the 'default' preset is recommended,
|
||||||
|
-- you will need to read `:help ins-completion`
|
||||||
-- 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 {
|
--
|
||||||
-- Select the [n]ext item
|
-- All presets have the following mappings:
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
-- <tab>/<s-tab>: move to right/left of your snippet expansion
|
||||||
-- Select the [p]revious item
|
-- <c-space>: Open menu or open docs if already open
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
|
||||||
|
-- <c-e>: Hide menu
|
||||||
|
-- <c-k>: Toggle signature help
|
||||||
|
--
|
||||||
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
|
preset = 'default',
|
||||||
|
|
||||||
-- Scroll the documentation window [b]ack / [f]orward
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
},
|
||||||
|
|
||||||
-- Accept ([y]es) the completion.
|
appearance = {
|
||||||
-- This will auto-import if your LSP supports it.
|
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||||
-- This will expand snippets if the LSP sent a snippet.
|
-- Adjusts spacing to ensure icons are aligned
|
||||||
['<C-y>'] = cmp.mapping.confirm { select = true },
|
nerd_font_variant = 'mono',
|
||||||
|
},
|
||||||
|
|
||||||
-- If you prefer more traditional completion keymaps,
|
completion = {
|
||||||
-- you can uncomment the following lines
|
-- By default, you may press `<c-space>` to show the documentation.
|
||||||
--['<CR>'] = cmp.mapping.confirm { select = true },
|
-- Optionally, set `auto_show = true` to show the documentation after a delay.
|
||||||
--['<Tab>'] = cmp.mapping.select_next_item(),
|
documentation = { auto_show = false, auto_show_delay_ms = 500 },
|
||||||
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
},
|
||||||
|
|
||||||
-- Manually trigger a completion from nvim-cmp.
|
sources = {
|
||||||
-- Generally you don't need this, because nvim-cmp will display
|
default = { 'lsp', 'path', 'snippets' },
|
||||||
-- completions whenever it has completion options available.
|
},
|
||||||
['<C-Space>'] = cmp.mapping.complete {},
|
|
||||||
|
|
||||||
-- Think of <c-l> as moving to the right of your snippet expansion.
|
snippets = { preset = 'luasnip' },
|
||||||
-- So if you have a snippet that's like:
|
|
||||||
-- 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:
|
-- Blink.cmp includes an optional, recommended rust fuzzy matcher,
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- which automatically downloads a prebuilt binary when enabled.
|
||||||
},
|
--
|
||||||
sources = {
|
-- By default, we use the Lua implementation instead, but you may enable
|
||||||
{
|
-- the rust implementation via `'prefer_rust_with_warning'`
|
||||||
name = 'lazydev',
|
--
|
||||||
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
|
-- See :h blink-cmp-config-fuzzy for more information
|
||||||
group_index = 0,
|
fuzzy = { implementation = 'lua' },
|
||||||
},
|
|
||||||
{ name = 'nvim_lsp' },
|
-- Shows a signature help window while you type arguments for a function
|
||||||
{ name = 'luasnip' },
|
signature = { enabled = true },
|
||||||
{ name = 'path' },
|
},
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{ -- You can easily change to a different colorscheme.
|
{ -- You can easily change to a different colorscheme.
|
||||||
@@ -847,22 +805,34 @@ require('lazy').setup({
|
|||||||
-- 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`.
|
||||||
'folke/tokyonight.nvim',
|
'folke/tokyonight.nvim',
|
||||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||||
init = function()
|
config = function()
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
require('tokyonight').setup {
|
||||||
|
styles = {
|
||||||
|
comments = { italic = false }, -- Disable italics in comments
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- Load the colorscheme here.
|
-- Load the colorscheme here.
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
-- Like many other themes, this one has different styles, and you could load
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
vim.cmd.colorscheme 'tokyonight-night'
|
||||||
|
|
||||||
-- You can configure highlights by doing something like:
|
|
||||||
vim.cmd.hi 'Comment gui=none'
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Highlight todo, notes, etc in comments
|
-- Highlight todo, notes, etc in comments
|
||||||
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
{
|
||||||
|
'folke/todo-comments.nvim',
|
||||||
|
event = 'VimEnter',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
---@module 'todo-comments'
|
||||||
|
---@type TodoOptions
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
|
opts = { signs = false },
|
||||||
|
},
|
||||||
|
|
||||||
{ -- Collection of various small independent plugins/modules
|
{ -- Collection of various small independent plugins/modules
|
||||||
'echasnovski/mini.nvim',
|
'nvim-mini/mini.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
-- Better Around/Inside textobjects
|
-- Better Around/Inside textobjects
|
||||||
--
|
--
|
||||||
@@ -890,38 +860,64 @@ require('lazy').setup({
|
|||||||
-- default behavior. For example, here we set the section for
|
-- default behavior. For example, here we set the section for
|
||||||
-- cursor location to LINE:COLUMN
|
-- cursor location to LINE:COLUMN
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
statusline.section_location = function()
|
statusline.section_location = function() return '%2l:%-2v' end
|
||||||
return '%2l:%-2v'
|
|
||||||
end
|
|
||||||
|
|
||||||
-- ... and there is more!
|
-- ... and there is more!
|
||||||
-- Check out: https://github.com/echasnovski/mini.nvim
|
-- Check out: https://github.com/nvim-mini/mini.nvim
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
lazy = false,
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
branch = 'main',
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter-intro`
|
||||||
opts = {
|
config = function()
|
||||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
-- ensure basic parser are installed
|
||||||
-- Autoinstall languages that are not installed
|
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
||||||
auto_install = true,
|
require('nvim-treesitter').install(parsers)
|
||||||
highlight = {
|
|
||||||
enable = true,
|
---@param buf integer
|
||||||
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
|
---@param language string
|
||||||
-- If you are experiencing weird indenting issues, add the language to
|
local function treesitter_try_attach(buf, language)
|
||||||
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
|
-- check if parser exists and load it
|
||||||
additional_vim_regex_highlighting = { 'ruby' },
|
if not vim.treesitter.language.add(language) then return end
|
||||||
},
|
-- enables syntax highlighting and other treesitter features
|
||||||
indent = { enable = true, disable = { 'ruby' } },
|
vim.treesitter.start(buf, language)
|
||||||
},
|
|
||||||
-- There are additional nvim-treesitter modules that you can use to interact
|
-- enables treesitter based folds
|
||||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
-- for more info on folds see `:help folds`
|
||||||
--
|
-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
-- vim.wo.foldmethod = 'expr'
|
||||||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
|
||||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
-- enables treesitter based indentation
|
||||||
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
|
end
|
||||||
|
|
||||||
|
local available_parsers = require('nvim-treesitter').get_available()
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
callback = function(args)
|
||||||
|
local buf, filetype = args.buf, args.match
|
||||||
|
|
||||||
|
local language = vim.treesitter.language.get_lang(filetype)
|
||||||
|
if not language then return end
|
||||||
|
|
||||||
|
local installed_parsers = require('nvim-treesitter').get_installed 'parsers'
|
||||||
|
|
||||||
|
if vim.tbl_contains(installed_parsers, language) then
|
||||||
|
-- enable the parser if it is installed
|
||||||
|
treesitter_try_attach(buf, language)
|
||||||
|
elseif vim.tbl_contains(available_parsers, language) then
|
||||||
|
-- if a parser is available in `nvim-treesitter` auto install it, and enable it after the installation is done
|
||||||
|
require('nvim-treesitter').install(language):await(function() treesitter_try_attach(buf, language) end)
|
||||||
|
else
|
||||||
|
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
|
||||||
|
treesitter_try_attach(buf, language)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
||||||
@@ -938,7 +934,7 @@ require('lazy').setup({
|
|||||||
-- require 'kickstart.plugins.lint',
|
-- require 'kickstart.plugins.lint',
|
||||||
-- require 'kickstart.plugins.autopairs',
|
-- require 'kickstart.plugins.autopairs',
|
||||||
-- require 'kickstart.plugins.neo-tree',
|
-- require 'kickstart.plugins.neo-tree',
|
||||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- 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.
|
-- This is the easiest way to modularize your config.
|
||||||
@@ -950,7 +946,7 @@ require('lazy').setup({
|
|||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
|
||||||
-- you can continue same window with `<space>sr` which resumes last telescope search
|
-- you can continue same window with `<space>sr` which resumes last telescope search
|
||||||
}, {
|
}, { ---@diagnostic disable-line: missing-fields
|
||||||
ui = {
|
ui = {
|
||||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||||
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
|
||||||
|
|||||||
@@ -2,4 +2,7 @@
|
|||||||
-- I promise not to create any merge conflicts in this directory :)
|
-- I promise not to create any merge conflicts in this directory :)
|
||||||
--
|
--
|
||||||
-- See the kickstart.nvim README for more information
|
-- See the kickstart.nvim README for more information
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ local check_version = function()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.version.ge(vim.version(), '0.10-dev') then
|
if vim.version.ge(vim.version(), '0.11') then
|
||||||
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
||||||
else
|
else
|
||||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
-- autopairs
|
-- autopairs
|
||||||
-- https://github.com/windwp/nvim-autopairs
|
-- https://github.com/windwp/nvim-autopairs
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
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,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
-- be extended to other languages as well. That's why it's called
|
-- be extended to other languages as well. That's why it's called
|
||||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
-- NOTE: Yes, you can install new plugins here!
|
-- NOTE: Yes, you can install new plugins here!
|
||||||
'mfussenegger/nvim-dap',
|
'mfussenegger/nvim-dap',
|
||||||
@@ -18,7 +20,7 @@ return {
|
|||||||
'nvim-neotest/nvim-nio',
|
'nvim-neotest/nvim-nio',
|
||||||
|
|
||||||
-- Installs the debug adapters for you
|
-- Installs the debug adapters for you
|
||||||
'williamboman/mason.nvim',
|
'mason-org/mason.nvim',
|
||||||
'jay-babu/mason-nvim-dap.nvim',
|
'jay-babu/mason-nvim-dap.nvim',
|
||||||
|
|
||||||
-- Add your own debuggers here
|
-- Add your own debuggers here
|
||||||
@@ -26,56 +28,14 @@ return {
|
|||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
-- Basic debugging keymaps, feel free to change to your liking!
|
-- Basic debugging keymaps, feel free to change to your liking!
|
||||||
{
|
{ '<F5>', function() require('dap').continue() end, desc = 'Debug: Start/Continue' },
|
||||||
'<F5>',
|
{ '<F1>', function() require('dap').step_into() end, desc = 'Debug: Step Into' },
|
||||||
function()
|
{ '<F2>', function() require('dap').step_over() end, desc = 'Debug: Step Over' },
|
||||||
require('dap').continue()
|
{ '<F3>', function() require('dap').step_out() end, desc = 'Debug: Step Out' },
|
||||||
end,
|
{ '<leader>b', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' },
|
||||||
desc = 'Debug: Start/Continue',
|
{ '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, desc = 'Debug: Set Breakpoint' },
|
||||||
},
|
|
||||||
{
|
|
||||||
'<F1>',
|
|
||||||
function()
|
|
||||||
require('dap').step_into()
|
|
||||||
end,
|
|
||||||
desc = 'Debug: Step Into',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'<F2>',
|
|
||||||
function()
|
|
||||||
require('dap').step_over()
|
|
||||||
end,
|
|
||||||
desc = 'Debug: Step Over',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'<F3>',
|
|
||||||
function()
|
|
||||||
require('dap').step_out()
|
|
||||||
end,
|
|
||||||
desc = 'Debug: Step Out',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'<leader>b',
|
|
||||||
function()
|
|
||||||
require('dap').toggle_breakpoint()
|
|
||||||
end,
|
|
||||||
desc = 'Debug: Toggle Breakpoint',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'<leader>B',
|
|
||||||
function()
|
|
||||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
|
||||||
end,
|
|
||||||
desc = 'Debug: Set Breakpoint',
|
|
||||||
},
|
|
||||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||||
{
|
{ '<F7>', function() require('dapui').toggle() end, desc = 'Debug: See last session result.' },
|
||||||
'<F7>',
|
|
||||||
function()
|
|
||||||
require('dapui').toggle()
|
|
||||||
end,
|
|
||||||
desc = 'Debug: See last session result.',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require 'dap'
|
local dap = require 'dap'
|
||||||
@@ -100,11 +60,13 @@ return {
|
|||||||
|
|
||||||
-- Dap UI setup
|
-- Dap UI setup
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
-- For more information, see |:help nvim-dap-ui|
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
dapui.setup {
|
dapui.setup {
|
||||||
-- Set icons to characters that are more likely to work in every terminal.
|
-- Set icons to characters that are more likely to work in every terminal.
|
||||||
-- Feel free to remove or use ones that you like more! :)
|
-- Feel free to remove or use ones that you like more! :)
|
||||||
-- Don't feel like these are good choices.
|
-- Don't feel like these are good choices.
|
||||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||||
|
---@diagnostic disable-next-line: missing-fields
|
||||||
controls = {
|
controls = {
|
||||||
icons = {
|
icons = {
|
||||||
pause = '⏸',
|
pause = '⏸',
|
||||||
|
|||||||
@@ -2,60 +2,57 @@
|
|||||||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||||
-- config. This will add also the recommended keymaps.
|
-- config. This will add also the recommended keymaps.
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
{
|
'lewis6991/gitsigns.nvim',
|
||||||
'lewis6991/gitsigns.nvim',
|
---@module 'gitsigns'
|
||||||
opts = {
|
---@type Gitsigns.Config
|
||||||
on_attach = function(bufnr)
|
---@diagnostic disable-next-line: missing-fields
|
||||||
local gitsigns = require 'gitsigns'
|
opts = {
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gitsigns = require 'gitsigns'
|
||||||
|
|
||||||
local function map(mode, l, r, opts)
|
local function map(mode, l, r, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
opts.buffer = bufnr
|
opts.buffer = bufnr
|
||||||
vim.keymap.set(mode, l, r, opts)
|
vim.keymap.set(mode, l, r, opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Navigation
|
||||||
|
map('n', ']c', function()
|
||||||
|
if vim.wo.diff then
|
||||||
|
vim.cmd.normal { ']c', bang = true }
|
||||||
|
else
|
||||||
|
gitsigns.nav_hunk 'next'
|
||||||
end
|
end
|
||||||
|
end, { desc = 'Jump to next git [c]hange' })
|
||||||
|
|
||||||
-- Navigation
|
map('n', '[c', function()
|
||||||
map('n', ']c', function()
|
if vim.wo.diff then
|
||||||
if vim.wo.diff then
|
vim.cmd.normal { '[c', bang = true }
|
||||||
vim.cmd.normal { ']c', bang = true }
|
else
|
||||||
else
|
gitsigns.nav_hunk 'prev'
|
||||||
gitsigns.nav_hunk 'next'
|
end
|
||||||
end
|
end, { desc = 'Jump to previous git [c]hange' })
|
||||||
end, { desc = 'Jump to next git [c]hange' })
|
|
||||||
|
|
||||||
map('n', '[c', function()
|
-- Actions
|
||||||
if vim.wo.diff then
|
-- visual mode
|
||||||
vim.cmd.normal { '[c', bang = true }
|
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
|
||||||
else
|
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
|
||||||
gitsigns.nav_hunk 'prev'
|
-- normal mode
|
||||||
end
|
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||||
end, { desc = 'Jump to previous git [c]hange' })
|
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||||
|
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
||||||
-- Actions
|
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
||||||
-- visual mode
|
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||||
map('v', '<leader>hs', function()
|
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
||||||
end, { desc = 'git [s]tage hunk' })
|
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||||
map('v', '<leader>hr', function()
|
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
|
||||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
-- Toggles
|
||||||
end, { desc = 'git [r]eset hunk' })
|
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||||
-- normal mode
|
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
||||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
end,
|
||||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
|
||||||
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
|
||||||
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
|
||||||
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
|
||||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
|
||||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
|
||||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
|
||||||
map('n', '<leader>hD', function()
|
|
||||||
gitsigns.diffthis '@'
|
|
||||||
end, { desc = 'git [D]iff against last commit' })
|
|
||||||
-- Toggles
|
|
||||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
|
||||||
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
|
-- Add indentation guides even on blank lines
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
{ -- Add indentation guides even on blank lines
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
-- See `:help ibl`
|
||||||
-- See `:help ibl`
|
main = 'ibl',
|
||||||
main = 'ibl',
|
---@module 'ibl'
|
||||||
opts = {},
|
---@type ibl.config
|
||||||
},
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +1,59 @@
|
|||||||
|
-- Linting
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
|
'mfussenegger/nvim-lint',
|
||||||
|
event = { 'BufReadPre', 'BufNewFile' },
|
||||||
|
config = function()
|
||||||
|
local lint = require 'lint'
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
markdown = { 'markdownlint' },
|
||||||
|
}
|
||||||
|
|
||||||
{ -- Linting
|
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||||
'mfussenegger/nvim-lint',
|
-- instead set linters_by_ft like this:
|
||||||
event = { 'BufReadPre', 'BufNewFile' },
|
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
||||||
config = function()
|
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
||||||
local lint = require 'lint'
|
--
|
||||||
lint.linters_by_ft = {
|
-- However, note that this will enable a set of default linters,
|
||||||
markdown = { 'markdownlint' },
|
-- which will cause errors unless these tools are available:
|
||||||
}
|
-- {
|
||||||
|
-- clojure = { "clj-kondo" },
|
||||||
|
-- dockerfile = { "hadolint" },
|
||||||
|
-- inko = { "inko" },
|
||||||
|
-- janet = { "janet" },
|
||||||
|
-- json = { "jsonlint" },
|
||||||
|
-- markdown = { "vale" },
|
||||||
|
-- rst = { "vale" },
|
||||||
|
-- ruby = { "ruby" },
|
||||||
|
-- terraform = { "tflint" },
|
||||||
|
-- text = { "vale" }
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
-- You can disable the default linters by setting their filetypes to nil:
|
||||||
|
-- lint.linters_by_ft['clojure'] = nil
|
||||||
|
-- lint.linters_by_ft['dockerfile'] = nil
|
||||||
|
-- lint.linters_by_ft['inko'] = nil
|
||||||
|
-- lint.linters_by_ft['janet'] = nil
|
||||||
|
-- lint.linters_by_ft['json'] = nil
|
||||||
|
-- lint.linters_by_ft['markdown'] = nil
|
||||||
|
-- lint.linters_by_ft['rst'] = nil
|
||||||
|
-- lint.linters_by_ft['ruby'] = nil
|
||||||
|
-- lint.linters_by_ft['terraform'] = nil
|
||||||
|
-- lint.linters_by_ft['text'] = nil
|
||||||
|
|
||||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
-- Create autocommand which carries out the actual linting
|
||||||
-- instead set linters_by_ft like this:
|
-- on the specified events.
|
||||||
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||||
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||||
--
|
group = lint_augroup,
|
||||||
-- However, note that this will enable a set of default linters,
|
callback = function()
|
||||||
-- which will cause errors unless these tools are available:
|
-- Only run the linter in buffers that you can modify in order to
|
||||||
-- {
|
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
||||||
-- clojure = { "clj-kondo" },
|
-- describe the hovered symbol using Markdown.
|
||||||
-- dockerfile = { "hadolint" },
|
if vim.bo.modifiable then lint.try_lint() end
|
||||||
-- inko = { "inko" },
|
end,
|
||||||
-- janet = { "janet" },
|
})
|
||||||
-- json = { "jsonlint" },
|
end,
|
||||||
-- markdown = { "vale" },
|
|
||||||
-- rst = { "vale" },
|
|
||||||
-- ruby = { "ruby" },
|
|
||||||
-- terraform = { "tflint" },
|
|
||||||
-- text = { "vale" }
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- You can disable the default linters by setting their filetypes to nil:
|
|
||||||
-- lint.linters_by_ft['clojure'] = nil
|
|
||||||
-- lint.linters_by_ft['dockerfile'] = nil
|
|
||||||
-- lint.linters_by_ft['inko'] = nil
|
|
||||||
-- lint.linters_by_ft['janet'] = nil
|
|
||||||
-- lint.linters_by_ft['json'] = nil
|
|
||||||
-- lint.linters_by_ft['markdown'] = nil
|
|
||||||
-- lint.linters_by_ft['rst'] = nil
|
|
||||||
-- lint.linters_by_ft['ruby'] = nil
|
|
||||||
-- lint.linters_by_ft['terraform'] = nil
|
|
||||||
-- lint.linters_by_ft['text'] = nil
|
|
||||||
|
|
||||||
-- Create autocommand which carries out the actual linting
|
|
||||||
-- on the specified events.
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
|
||||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
|
||||||
group = lint_augroup,
|
|
||||||
callback = function()
|
|
||||||
-- Only run the linter in buffers that you can modify in order to
|
|
||||||
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
|
||||||
-- describe the hovered symbol using Markdown.
|
|
||||||
if vim.opt_local.modifiable:get() then
|
|
||||||
lint.try_lint()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
-- 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
|
||||||
|
|
||||||
|
---@module 'lazy'
|
||||||
|
---@type LazySpec
|
||||||
return {
|
return {
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
version = '*',
|
version = '*',
|
||||||
@@ -9,10 +11,12 @@ return {
|
|||||||
'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',
|
||||||
},
|
},
|
||||||
cmd = 'Neotree',
|
lazy = false,
|
||||||
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 = {
|
||||||
filesystem = {
|
filesystem = {
|
||||||
window = {
|
window = {
|
||||||
|
|||||||
Reference in New Issue
Block a user