Merge branch 'master' into master
This commit is contained in:
commit
7f270d9f56
|
|
@ -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 .
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,11 @@ test.sh
|
||||||
nvim
|
nvim
|
||||||
|
|
||||||
spell/
|
spell/
|
||||||
lazy-lock.json
|
|
||||||
|
# In your personal fork, you likely want to comment this, since it's recommended to track
|
||||||
|
# nvim-pack-lock.json in version control - see :help vim.pack-lockfile
|
||||||
|
# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded
|
||||||
|
# merge conflicts.
|
||||||
|
nvim-pack-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"
|
||||||
|
|
|
||||||
142
README.md
142
README.md
|
|
@ -17,7 +17,14 @@ 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
|
||||||
|
|
||||||
|
|
@ -25,6 +32,7 @@ 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)
|
[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
|
||||||
|
|
@ -61,9 +69,9 @@ fork to your machine using one of the commands below, depending on your OS.
|
||||||
> 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`
|
||||||
|
|
||||||
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
|
You likely want to remove `nvim-pack-lock.json` from your fork's `.gitignore`
|
||||||
too - it's ignored in the kickstart repo to make maintenance easier, but it's
|
file too - it's ignored in the kickstart repo to make maintenance easier, but
|
||||||
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
|
it's recommended to track it in version control (see `:help vim.pack-lockfile`).
|
||||||
|
|
||||||
#### Clone kickstart.nvim
|
#### Clone kickstart.nvim
|
||||||
|
|
||||||
|
|
@ -103,8 +111,10 @@ Start Neovim
|
||||||
nvim
|
nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
|
That's it! `vim.pack` will install all the plugins from your config. Use
|
||||||
the current plugin status. Hit `q` to close the window.
|
`:lua vim.pack.update(nil, { offline = true })` to inspect plugin state and
|
||||||
|
`:lua vim.pack.update()` to fetch updates (`:write` applies updates, `:quit`
|
||||||
|
cancels them).
|
||||||
|
|
||||||
#### Read The Friendly Documentation
|
#### Read The Friendly Documentation
|
||||||
|
|
||||||
|
|
@ -138,7 +148,8 @@ examples of adding popularly requested plugins.
|
||||||
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
|
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
|
||||||
distribution that you would like to try out.
|
distribution that you would like to try out.
|
||||||
* What if I want to "uninstall" this configuration:
|
* What if I want to "uninstall" this configuration:
|
||||||
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
|
* Remove your config directory and local data directory (for example,
|
||||||
|
`~/.config/nvim` and `~/.local/share/nvim`).
|
||||||
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
|
* 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
|
* 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.
|
configuration that someone can easily use to `git clone` as a basis for their own.
|
||||||
|
|
@ -154,22 +165,41 @@ 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
|
||||||
|
|
||||||
<details><summary>Windows with Microsoft C++ Build Tools and CMake</summary>
|
<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`
|
Kickstart's default config is make-only for `telescope-fzf-native.nvim`.
|
||||||
|
If `make` is unavailable, the plugin is skipped.
|
||||||
|
|
||||||
See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
|
Recommended: install `make` (see the chocolatey section below).
|
||||||
|
|
||||||
This requires:
|
If you want a CMake-only setup, customize `init.lua` in two places:
|
||||||
|
|
||||||
- Install CMake and the Microsoft C++ Build Tools on Windows
|
1. Include `telescope-fzf-native.nvim` when `cmake` is available:
|
||||||
|
|
||||||
```lua
|
```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' }
|
if vim.fn.executable 'make' == 1 or vim.fn.executable 'cmake' == 1 then
|
||||||
|
table.insert(plugins, gh 'nvim-telescope/telescope-fzf-native.nvim')
|
||||||
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
2. In the `PackChanged` hook, use CMake when `make` is unavailable:
|
||||||
|
|
||||||
|
```lua
|
||||||
|
if name == 'telescope-fzf-native.nvim' then
|
||||||
|
if vim.fn.executable 'make' == 1 then
|
||||||
|
run_build(name, { 'make' }, ev.data.path)
|
||||||
|
elseif vim.fn.executable 'cmake' == 1 then
|
||||||
|
run_build(name, { 'cmake', '-S.', '-Bbuild', '-DCMAKE_BUILD_TYPE=Release' }, ev.data.path)
|
||||||
|
run_build(name, { 'cmake', '--build', 'build', '--config', 'Release', '--target', 'install' }, ev.data.path)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
See `telescope-fzf-native` documentation for [build details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation).
|
||||||
</details>
|
</details>
|
||||||
<details><summary>Windows with gcc/make using chocolatey</summary>
|
<details><summary>Windows with gcc/make using chocolatey</summary>
|
||||||
Alternatively, one can install gcc and make which don't require changing the config,
|
Alternatively, one can install gcc and make which don't require changing the config,
|
||||||
|
|
@ -185,7 +215,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>
|
||||||
|
|
@ -195,7 +225,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>
|
||||||
|
|
||||||
|
|
@ -205,14 +235,14 @@ 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-linux-x86_64.tar.gz
|
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
|
||||||
|
|
@ -228,14 +258,88 @@ sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
|
||||||
<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>
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,12 @@
|
||||||
-- 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
|
||||||
return {}
|
|
||||||
|
-- Iterate over all Lua files in the plugins directory and load them
|
||||||
|
local plugins_dir = vim.fs.joinpath(vim.fn.stdpath 'config', 'lua', 'custom', 'plugins')
|
||||||
|
for file_name, type in vim.fs.dir(plugins_dir) do
|
||||||
|
if type == 'file' and file_name:match '%.lua$' and file_name ~= 'init.lua' then
|
||||||
|
local module = file_name:gsub('%.lua$', '')
|
||||||
|
require('custom.plugins.' .. module)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -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.12') 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,8 +1,5 @@
|
||||||
-- autopairs
|
-- autopairs
|
||||||
-- https://github.com/windwp/nvim-autopairs
|
-- https://github.com/windwp/nvim-autopairs
|
||||||
|
|
||||||
return {
|
vim.pack.add { 'https://github.com/windwp/nvim-autopairs' }
|
||||||
'windwp/nvim-autopairs',
|
require('nvim-autopairs').setup {}
|
||||||
event = 'InsertEnter',
|
|
||||||
opts = {},
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -6,143 +6,90 @@
|
||||||
-- 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 ;)
|
||||||
|
|
||||||
return {
|
vim.pack.add {
|
||||||
-- NOTE: Yes, you can install new plugins here!
|
'https://github.com/mfussenegger/nvim-dap',
|
||||||
'mfussenegger/nvim-dap',
|
'https://github.com/rcarriga/nvim-dap-ui',
|
||||||
-- NOTE: And you can specify dependencies as well
|
'https://github.com/nvim-neotest/nvim-nio',
|
||||||
dependencies = {
|
'https://github.com/mason-org/mason.nvim',
|
||||||
-- Creates a beautiful debugger UI
|
'https://github.com/jay-babu/mason-nvim-dap.nvim',
|
||||||
'rcarriga/nvim-dap-ui',
|
'https://github.com/leoluz/nvim-dap-go',
|
||||||
|
}
|
||||||
-- Required dependency for nvim-dap-ui
|
|
||||||
'nvim-neotest/nvim-nio',
|
-- Basic debugging keymaps, feel free to change to your liking!
|
||||||
|
vim.keymap.set('n', '<F5>', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' })
|
||||||
-- Installs the debug adapters for you
|
vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' })
|
||||||
'mason-org/mason.nvim',
|
vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' })
|
||||||
'jay-babu/mason-nvim-dap.nvim',
|
vim.keymap.set('n', '<F3>', function() require('dap').step_out() end, { desc = 'Debug: Step Out' })
|
||||||
|
vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end, { desc = 'Debug: Toggle Breakpoint' })
|
||||||
-- Add your own debuggers here
|
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, { desc = 'Debug: Set Breakpoint' })
|
||||||
'leoluz/nvim-dap-go',
|
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||||
},
|
vim.keymap.set('n', '<F7>', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' })
|
||||||
keys = {
|
|
||||||
-- Basic debugging keymaps, feel free to change to your liking!
|
local dap = require 'dap'
|
||||||
{
|
local dapui = require 'dapui'
|
||||||
'<F5>',
|
|
||||||
function()
|
require('mason-nvim-dap').setup {
|
||||||
require('dap').continue()
|
-- Makes a best effort to setup the various debuggers with
|
||||||
end,
|
-- reasonable debug configurations
|
||||||
desc = 'Debug: Start/Continue',
|
automatic_installation = true,
|
||||||
},
|
|
||||||
{
|
-- You can provide additional configuration to the handlers,
|
||||||
'<F1>',
|
-- see mason-nvim-dap README for more information
|
||||||
function()
|
handlers = {},
|
||||||
require('dap').step_into()
|
|
||||||
end,
|
-- You'll need to check that you have the required things installed
|
||||||
desc = 'Debug: Step Into',
|
-- online, please don't ask me how to install them :)
|
||||||
},
|
ensure_installed = {
|
||||||
{
|
-- Update this to ensure that you have the debuggers for the langs you want
|
||||||
'<F2>',
|
'delve',
|
||||||
function()
|
},
|
||||||
require('dap').step_over()
|
}
|
||||||
end,
|
|
||||||
desc = 'Debug: Step Over',
|
-- Dap UI setup
|
||||||
},
|
-- For more information, see |:help nvim-dap-ui|
|
||||||
{
|
---@diagnostic disable-next-line: missing-fields
|
||||||
'<F3>',
|
dapui.setup {
|
||||||
function()
|
-- Set icons to characters that are more likely to work in every terminal.
|
||||||
require('dap').step_out()
|
-- Feel free to remove or use ones that you like more! :)
|
||||||
end,
|
-- Don't feel like these are good choices.
|
||||||
desc = 'Debug: Step Out',
|
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
||||||
},
|
---@diagnostic disable-next-line: missing-fields
|
||||||
{
|
controls = {
|
||||||
'<leader>b',
|
icons = {
|
||||||
function()
|
pause = '⏸',
|
||||||
require('dap').toggle_breakpoint()
|
play = '▶',
|
||||||
end,
|
step_into = '⏎',
|
||||||
desc = 'Debug: Toggle Breakpoint',
|
step_over = '⏭',
|
||||||
},
|
step_out = '⏮',
|
||||||
{
|
step_back = 'b',
|
||||||
'<leader>B',
|
run_last = '▶▶',
|
||||||
function()
|
terminate = '⏹',
|
||||||
require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ')
|
disconnect = '⏏',
|
||||||
end,
|
},
|
||||||
desc = 'Debug: Set Breakpoint',
|
},
|
||||||
},
|
}
|
||||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
|
||||||
{
|
-- Change breakpoint icons
|
||||||
'<F7>',
|
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
||||||
function()
|
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
||||||
require('dapui').toggle()
|
-- local breakpoint_icons = vim.g.have_nerd_font
|
||||||
end,
|
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
||||||
desc = 'Debug: See last session result.',
|
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
||||||
},
|
-- for type, icon in pairs(breakpoint_icons) do
|
||||||
},
|
-- local tp = 'Dap' .. type
|
||||||
config = function()
|
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
||||||
local dap = require 'dap'
|
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
||||||
local dapui = require 'dapui'
|
-- end
|
||||||
|
|
||||||
require('mason-nvim-dap').setup {
|
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
||||||
-- Makes a best effort to setup the various debuggers with
|
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
||||||
-- reasonable debug configurations
|
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||||
automatic_installation = true,
|
|
||||||
|
-- Install golang specific config
|
||||||
-- You can provide additional configuration to the handlers,
|
require('dap-go').setup {
|
||||||
-- see mason-nvim-dap README for more information
|
delve = {
|
||||||
handlers = {},
|
-- On Windows delve must be run attached or it crashes.
|
||||||
|
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
|
||||||
-- You'll need to check that you have the required things installed
|
detached = vim.fn.has 'win32' == 0,
|
||||||
-- online, please don't ask me how to install them :)
|
},
|
||||||
ensure_installed = {
|
|
||||||
-- Update this to ensure that you have the debuggers for the langs you want
|
|
||||||
'delve',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Dap UI setup
|
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
|
||||||
dapui.setup {
|
|
||||||
-- Set icons to characters that are more likely to work in every terminal.
|
|
||||||
-- Feel free to remove or use ones that you like more! :)
|
|
||||||
-- Don't feel like these are good choices.
|
|
||||||
icons = { expanded = '▾', collapsed = '▸', current_frame = '*' },
|
|
||||||
controls = {
|
|
||||||
icons = {
|
|
||||||
pause = '⏸',
|
|
||||||
play = '▶',
|
|
||||||
step_into = '⏎',
|
|
||||||
step_over = '⏭',
|
|
||||||
step_out = '⏮',
|
|
||||||
step_back = 'b',
|
|
||||||
run_last = '▶▶',
|
|
||||||
terminate = '⏹',
|
|
||||||
disconnect = '⏏',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Change breakpoint icons
|
|
||||||
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
|
|
||||||
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' })
|
|
||||||
-- local breakpoint_icons = vim.g.have_nerd_font
|
|
||||||
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' }
|
|
||||||
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' }
|
|
||||||
-- for type, icon in pairs(breakpoint_icons) do
|
|
||||||
-- local tp = 'Dap' .. type
|
|
||||||
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak'
|
|
||||||
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl })
|
|
||||||
-- end
|
|
||||||
|
|
||||||
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
|
|
||||||
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
|
|
||||||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
|
||||||
|
|
||||||
-- Install golang specific config
|
|
||||||
require('dap-go').setup {
|
|
||||||
delve = {
|
|
||||||
-- On Windows delve must be run attached or it crashes.
|
|
||||||
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
|
|
||||||
detached = vim.fn.has 'win32' == 0,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,60 +2,56 @@
|
||||||
-- 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.
|
||||||
|
|
||||||
return {
|
vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' }
|
||||||
{
|
|
||||||
'lewis6991/gitsigns.nvim',
|
|
||||||
opts = {
|
|
||||||
on_attach = function(bufnr)
|
|
||||||
local gitsigns = require 'gitsigns'
|
|
||||||
|
|
||||||
local function map(mode, l, r, opts)
|
require('gitsigns').setup {
|
||||||
opts = opts or {}
|
on_attach = function(bufnr)
|
||||||
opts.buffer = bufnr
|
local gitsigns = require 'gitsigns'
|
||||||
vim.keymap.set(mode, l, r, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Navigation
|
local function map(mode, l, r, opts)
|
||||||
map('n', ']c', function()
|
opts = opts or {}
|
||||||
if vim.wo.diff then
|
opts.buffer = bufnr
|
||||||
vim.cmd.normal { ']c', bang = true }
|
vim.keymap.set(mode, l, r, opts)
|
||||||
else
|
end
|
||||||
gitsigns.nav_hunk 'next'
|
|
||||||
end
|
|
||||||
end, { desc = 'Jump to next git [c]hange' })
|
|
||||||
|
|
||||||
map('n', '[c', function()
|
-- Navigation
|
||||||
if vim.wo.diff then
|
map('n', ']c', function()
|
||||||
vim.cmd.normal { '[c', bang = true }
|
if vim.wo.diff then
|
||||||
else
|
vim.cmd.normal { ']c', bang = true }
|
||||||
gitsigns.nav_hunk 'prev'
|
else
|
||||||
end
|
gitsigns.nav_hunk 'next'
|
||||||
end, { desc = 'Jump to previous git [c]hange' })
|
end
|
||||||
|
end, { desc = 'Jump to next git [c]hange' })
|
||||||
|
|
||||||
-- Actions
|
map('n', '[c', function()
|
||||||
-- visual mode
|
if vim.wo.diff then
|
||||||
map('v', '<leader>hs', function()
|
vim.cmd.normal { '[c', bang = true }
|
||||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
else
|
||||||
end, { desc = 'git [s]tage hunk' })
|
gitsigns.nav_hunk 'prev'
|
||||||
map('v', '<leader>hr', function()
|
end
|
||||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
end, { desc = 'Jump to previous git [c]hange' })
|
||||||
end, { desc = 'git [r]eset hunk' })
|
|
||||||
-- normal mode
|
-- Actions
|
||||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
-- visual mode
|
||||||
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
|
||||||
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
|
||||||
map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
|
-- normal mode
|
||||||
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
|
||||||
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
|
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
|
||||||
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||||
map('n', '<leader>hD', function()
|
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||||
gitsigns.diffthis '@'
|
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
|
||||||
end, { desc = 'git [D]iff against last commit' })
|
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' })
|
||||||
-- Toggles
|
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
|
||||||
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
|
||||||
map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
|
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
|
||||||
end,
|
map('n', '<leader>hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' })
|
||||||
},
|
-- Toggles
|
||||||
},
|
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
|
||||||
|
map('n', '<leader>tw', gitsigns.toggle_word_diff, { desc = '[T]oggle git intra-line [w]ord diff' })
|
||||||
|
|
||||||
|
-- Text object
|
||||||
|
map({ 'o', 'x' }, 'ih', gitsigns.select_hunk)
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
return {
|
-- Add indentation guides even on blank lines
|
||||||
{ -- Add indentation guides even on blank lines
|
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
-- See `:help ibl`
|
||||||
-- See `:help ibl`
|
vim.pack.add { 'https://github.com/lukas-reineke/indent-blankline.nvim' }
|
||||||
main = 'ibl',
|
require('ibl').setup {}
|
||||||
opts = {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,60 +1,53 @@
|
||||||
return {
|
-- Linting
|
||||||
|
|
||||||
{ -- Linting
|
vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' }
|
||||||
'mfussenegger/nvim-lint',
|
|
||||||
event = { 'BufReadPre', 'BufNewFile' },
|
|
||||||
config = function()
|
|
||||||
local lint = require 'lint'
|
|
||||||
lint.linters_by_ft = {
|
|
||||||
markdown = { 'markdownlint' },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
local lint = require 'lint'
|
||||||
-- instead set linters_by_ft like this:
|
lint.linters_by_ft = {
|
||||||
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
|
||||||
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
|
||||||
--
|
|
||||||
-- However, note that this will enable a set of default linters,
|
|
||||||
-- 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
|
|
||||||
|
|
||||||
-- 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.bo.modifiable then
|
|
||||||
lint.try_lint()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||||
|
-- instead set linters_by_ft like this:
|
||||||
|
-- lint.linters_by_ft = lint.linters_by_ft or {}
|
||||||
|
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
|
||||||
|
--
|
||||||
|
-- However, note that this will enable a set of default linters,
|
||||||
|
-- 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
|
||||||
|
|
||||||
|
-- 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.bo.modifiable then lint.try_lint() end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,25 @@
|
||||||
-- 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 {
|
local plugins = {
|
||||||
'nvim-neo-tree/neo-tree.nvim',
|
{ src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' },
|
||||||
version = '*',
|
'https://github.com/nvim-lua/plenary.nvim',
|
||||||
dependencies = {
|
'https://github.com/MunifTanjim/nui.nvim',
|
||||||
'nvim-lua/plenary.nvim',
|
}
|
||||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
|
||||||
'MunifTanjim/nui.nvim',
|
if vim.g.have_nerd_font then
|
||||||
},
|
table.insert(plugins, 'https://github.com/nvim-tree/nvim-web-devicons') -- not strictly required, but recommended
|
||||||
lazy = false,
|
end
|
||||||
keys = {
|
|
||||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
vim.pack.add(plugins)
|
||||||
},
|
|
||||||
opts = {
|
vim.keymap.set('n', '\\', '<Cmd>Neotree reveal<CR>', { desc = 'NeoTree reveal', silent = true })
|
||||||
filesystem = {
|
|
||||||
window = {
|
require('neo-tree').setup {
|
||||||
mappings = {
|
filesystem = {
|
||||||
['\\'] = 'close_window',
|
window = {
|
||||||
},
|
mappings = {
|
||||||
|
['\\'] = 'close_window',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue