Compare commits
102 Commits
87846dc87c
...
6c9a94e600
| Author | SHA1 | Date |
|---|---|---|
|
|
6c9a94e600 | |
|
|
f0a2108ed5 | |
|
|
ac51593f7a | |
|
|
4e6bf9497f | |
|
|
1f320746e4 | |
|
|
ec3f4489c2 | |
|
|
f660e1f897 | |
|
|
7031a09bf9 | |
|
|
97b3cbb790 | |
|
|
cfdc17be3a | |
|
|
a5d4d12c8c | |
|
|
174b5fa2b1 | |
|
|
2fccee4349 | |
|
|
2e8d5b17cb | |
|
|
a42ed30a09 | |
|
|
716d7465c0 | |
|
|
c4605421e5 | |
|
|
cd7adee3ce | |
|
|
4b065ad2f7 | |
|
|
9b4fbc5021 | |
|
|
f5b0e497c6 | |
|
|
ce353a9b0e | |
|
|
459b86865e | |
|
|
648471c9eb | |
|
|
f27810d1bd | |
|
|
c0cc054155 | |
|
|
c7f05a0f47 | |
|
|
16dd8f5007 | |
|
|
d3168308d4 | |
|
|
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 |
|
|
@ -10,9 +10,11 @@ assignees: ''
|
|||
<!-- Any bug report not following this template will be immediately closed. Thanks -->
|
||||
|
||||
## Before Reporting an Issue
|
||||
|
||||
- I have read the kickstart.nvim README.md.
|
||||
- I have read the appropriate plugin's documentation.
|
||||
- I have searched that this issue has not been reported before.
|
||||
- I have ran `:checkhealth` and so no obvious issue.
|
||||
|
||||
- [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.**
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
blank_issues_enabled: false
|
||||
|
||||
contact_links:
|
||||
- name: Help
|
||||
url: https://github.com/nvim-lua/kickstart.nvim/discussions/categories/q-a
|
||||
about: Ask the community for help
|
||||
|
||||
- name: Ideas
|
||||
url: https://github.com/nvim-lua/kickstart.nvim/discussions/categories/ideas
|
||||
about: Share ideas for new features
|
||||
|
|
@ -9,13 +9,12 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Stylua Check
|
||||
uses: JohnnyMorganz/stylua-action@v3
|
||||
uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
args: --check .
|
||||
|
||||
|
|
|
|||
|
|
@ -4,4 +4,11 @@ test.sh
|
|||
nvim
|
||||
|
||||
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
|
||||
quote_style = "AutoPreferSingle"
|
||||
call_parentheses = "None"
|
||||
collapse_simple_statement = "Always"
|
||||
|
|
|
|||
200
README.md
200
README.md
|
|
@ -1,9 +1,5 @@
|
|||
# kickstart.nvim
|
||||
|
||||
```sh
|
||||
git clone ssh://git@forgejo.galard.uk:222/franchioping/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
A starting point for Neovim that is:
|
||||
|
|
@ -21,29 +17,39 @@ A starting point for Neovim that is:
|
|||
Kickstart.nvim targets *only* the latest
|
||||
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
||||
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
||||
If you are experiencing issues, please make sure you have the latest versions.
|
||||
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
|
||||
|
||||
External Requirements:
|
||||
* Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
||||
* [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
|
||||
* Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
|
||||
* A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
||||
* if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
||||
* Language Setup:
|
||||
* If you want to write Typescript, you need `npm`
|
||||
* If you want to write Golang, you will need `go`
|
||||
* etc.
|
||||
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
||||
- [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)
|
||||
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
||||
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
||||
- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji`
|
||||
- Language Setup:
|
||||
- If you want to write Typescript, you need `npm`
|
||||
- If you want to write Golang, you will need `go`
|
||||
- etc.
|
||||
|
||||
> **NOTE**
|
||||
> See [Install Recipes](#install-recipes) for additional Windows and Linux specific notes
|
||||
> [!NOTE]
|
||||
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes
|
||||
> and quick install snippets
|
||||
|
||||
### Install Kickstart
|
||||
|
||||
> **NOTE**
|
||||
> [Backup](#faq) your previous configuration (if any exists)
|
||||
> [!NOTE]
|
||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
||||
|
||||
Neovim's configurations are located under the following paths, depending on your OS:
|
||||
|
||||
|
|
@ -59,17 +65,17 @@ 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
|
||||
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:
|
||||
> `https://github.com/<your_github_username>/kickstart.nvim.git`
|
||||
|
||||
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
|
||||
too - it's ignored in the kickstart repo to make maintenance easier, but it's
|
||||
[recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
|
||||
You likely want to remove `nvim-pack-lock.json` from your fork's `.gitignore`
|
||||
file too - it's ignored in the kickstart repo to make maintenance easier, but
|
||||
it's recommended to track it in version control (see `:help vim.pack-lockfile`).
|
||||
|
||||
#### Clone kickstart.nvim
|
||||
>
|
||||
> **NOTE**
|
||||
|
||||
> [!NOTE]
|
||||
> If following the recommended step above (i.e., forking the repo), replace
|
||||
> `nvim-lua` with `<your_github_username>` in the commands below
|
||||
|
||||
|
|
@ -105,8 +111,10 @@ Start Neovim
|
|||
nvim
|
||||
```
|
||||
|
||||
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
|
||||
the current plugin status. Hit `q` to close the window.
|
||||
That's it! `vim.pack` will install all the plugins from your config. Use
|
||||
`: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
|
||||
|
||||
|
|
@ -117,6 +125,7 @@ examples of adding popularly requested plugins.
|
|||
> [!NOTE]
|
||||
> For more information about a particular plugin check its repository's documentation.
|
||||
|
||||
|
||||
### Getting Started
|
||||
|
||||
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
|
||||
|
|
@ -131,17 +140,16 @@ examples of adding popularly requested plugins.
|
|||
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME`
|
||||
to maintain multiple configurations. For example, you can install the kickstart
|
||||
configuration in `~/.config/nvim-kickstart` and create an alias:
|
||||
|
||||
```
|
||||
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
|
||||
```
|
||||
|
||||
When you run Neovim using `nvim-kickstart` alias it will use the alternative
|
||||
config directory and the matching local directory
|
||||
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
|
||||
distribution that you would like to try out.
|
||||
* What if I want to "uninstall" this configuration:
|
||||
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
|
||||
* 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?
|
||||
* 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.
|
||||
|
|
@ -162,18 +170,36 @@ After installing all the dependencies continue with the [Install Kickstart](#ins
|
|||
#### Windows Installation
|
||||
|
||||
<details><summary>Windows with Microsoft C++ Build Tools and CMake</summary>
|
||||
Installation may require installing build tools and updating the run command for `telescope-fzf-native`
|
||||
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
|
||||
{'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><summary>Windows with gcc/make using chocolatey</summary>
|
||||
Alternatively, one can install gcc and make which don't require changing the config,
|
||||
|
|
@ -182,18 +208,15 @@ the easiest way is to use choco:
|
|||
1. install [chocolatey](https://chocolatey.org/install)
|
||||
either follow the instructions on the page or use winget,
|
||||
run in cmd as **admin**:
|
||||
|
||||
```
|
||||
winget install --accept-source-agreements chocolatey.chocolatey
|
||||
```
|
||||
|
||||
2. install all requirements using choco, exit the previous cmd and
|
||||
open a new one so that choco path is set, and run in cmd as **admin**:
|
||||
|
||||
```
|
||||
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
|
||||
choco install -y neovim git ripgrep wget fd unzip gzip mingw make tree-sitter
|
||||
```
|
||||
|
||||
</details>
|
||||
<details><summary>WSL (Windows Subsystem for Linux)</summary>
|
||||
|
||||
|
|
@ -202,52 +225,121 @@ wsl --install
|
|||
wsl
|
||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
||||
sudo apt update
|
||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
||||
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
#### Linux Install
|
||||
|
||||
<details><summary>Ubuntu Install Steps</summary>
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:neovim-ppa/unstable -y
|
||||
sudo apt update
|
||||
sudo apt install make gcc ripgrep unzip git xclip neovim
|
||||
sudo apt install make gcc ripgrep fd-find tree-sitter-cli unzip git xclip neovim
|
||||
```
|
||||
|
||||
</details>
|
||||
<details><summary>Debian Install Steps</summary>
|
||||
|
||||
```
|
||||
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
|
||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
|
||||
sudo rm -rf /opt/nvim-linux64
|
||||
sudo mkdir -p /opt/nvim-linux64
|
||||
sudo chmod a+rX /opt/nvim-linux64
|
||||
sudo tar -C /opt -xzf 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-linux-x86_64
|
||||
sudo mkdir -p /opt/nvim-linux-x86_64
|
||||
sudo chmod a+rX /opt/nvim-linux-x86_64
|
||||
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
|
||||
|
||||
# make it available in /usr/local/bin, distro installs to /usr/bin
|
||||
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
|
||||
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/
|
||||
```
|
||||
|
||||
</details>
|
||||
<details><summary>Fedora Install Steps</summary>
|
||||
|
||||
```
|
||||
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
|
||||
sudo dnf install -y gcc make git ripgrep fd-find tree-sitter-cli unzip neovim
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<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>
|
||||
|
||||
### 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>
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
vim.opt_local.spell = true
|
||||
vim.opt_local.spelllang = { 'en_us', 'pt_PT' }
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||
"ccc.nvim": { "branch": "main", "commit": "9d1a256e006decc574789dfc7d628ca11644d4c2" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"conform.nvim": { "branch": "master", "commit": "ffe26e8df8115c9665d24231f8a49fadb2d611ce" },
|
||||
"esp32.nvim": { "branch": "main", "commit": "7b929bd908ba7358b073d1923832cd8d2e682503" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||
"leetcode.nvim": { "branch": "master", "commit": "fdd3f91800b3983e27bc9fcfb99cfa7293d7f11a" },
|
||||
"luasnip-latex-snippets.nvim": { "branch": "main", "commit": "57e4330f967da6ac64bf9b05b06ecb3c4a120ec3" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "0b9bb925c000ae649ff7e7149c8cd00031f4b539" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"mini.nvim": { "branch": "main", "commit": "e27fcecf6cbffd8ed391bdf0eb746fdb5b9bfa44" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" },
|
||||
"nvim-lint": { "branch": "master", "commit": "ebe535956106c60405b02220246e135910f6853d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9c923997123ff9071198ea3b594d4c1931fab169" },
|
||||
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope-undo.nvim": { "branch": "main", "commit": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"vimtex": { "branch": "master", "commit": "32bcb3922c20588e00de68f73c86312eda2141ad" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
return {
|
||||
-- {
|
||||
-- 'akinsho/toggleterm.nvim',
|
||||
-- version = '*',
|
||||
-- opts = {--[[ things you want to change go here]]
|
||||
-- },
|
||||
-- keys = {
|
||||
-- { '<leader>t', ':ToggleTerm direction=float<CR>', desc = 'Terminal', silent = true },
|
||||
-- },
|
||||
-- config = function()
|
||||
-- local opts = { buffer = 0 }
|
||||
-- vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
-- vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
|
||||
-- vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
|
||||
-- vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
|
||||
-- vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
|
||||
-- vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
|
||||
-- vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
'windwp/nvim-ts-autotag',
|
||||
},
|
||||
{
|
||||
'uga-rosa/ccc.nvim',
|
||||
config = function()
|
||||
local ccc = require 'ccc'
|
||||
|
||||
ccc.setup {
|
||||
highlighter = {
|
||||
auto_enable = true,
|
||||
lsp = true,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'kylechui/nvim-surround',
|
||||
version = '^3.0.0', -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
require('nvim-surround').setup {
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'Aietes/esp32.nvim',
|
||||
opts = {
|
||||
build_dir = 'build',
|
||||
},
|
||||
},
|
||||
{
|
||||
'folke/todo-comments.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
|
||||
-- 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, { follow = true }) do
|
||||
if (type == 'file' or type == 'link') and file_name:match '%.lua$' and file_name ~= 'init.lua' then
|
||||
local module = file_name:gsub('%.lua$', '')
|
||||
require('custom.plugins.' .. module)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
-- local function map(mode, lhs, rhs, opts)
|
||||
-- local options = { noremap = true, silent = true }
|
||||
-- if opts then
|
||||
|
|
@ -15,15 +16,7 @@
|
|||
|
||||
vim.keymap.set({ 'x', 'n' }, '<leader>d', '"_d', { remap = false, desc = 'Delete without copying' })
|
||||
|
||||
local operator_rhs = function()
|
||||
return require('vim._comment').operator()
|
||||
end
|
||||
vim.keymap.set({ 'x' }, '<leader>/', operator_rhs, { expr = true, desc = 'Toggle comment' })
|
||||
|
||||
local line_rhs = function()
|
||||
return require('vim._comment').operator() .. '_'
|
||||
end
|
||||
vim.keymap.set('n', '<leader>/', line_rhs, { expr = true, desc = 'Toggle comment line' })
|
||||
vim.keymap.set({'x','n'}, '<leader>/', 'gcc', { remap = true, desc = 'Toggle comment line' })
|
||||
|
||||
vim.g.tex_flavor = 'latex'
|
||||
|
||||
|
|
@ -50,3 +43,7 @@ local list_all_snips = function()
|
|||
end
|
||||
|
||||
vim.api.nvim_create_user_command('SnipListAll', list_all_snips, {})
|
||||
|
||||
vim.keymap.set('n', '<leader>e', function()
|
||||
require('neo-tree.command').execute({ toggle = true })
|
||||
end, { desc = 'Explorer', silent = true })
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
return {
|
||||
|
||||
{
|
||||
'lervag/vimtex',
|
||||
lazy = false, -- we don't want to lazy load VimTeX
|
||||
-- tag = "v2.15", -- uncomment to pin to a specific release
|
||||
init = function()
|
||||
-- VimTeX configuration goes here, e.g.
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
end,
|
||||
config = function()
|
||||
vim.g.vimtex_compiler_latexmk = { ['out_dir'] = '/home/flima/Notes/build' }
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- 'franchioping/luasnip-latex-snippets.nvim',
|
||||
-- dev = true,
|
||||
-- },
|
||||
{
|
||||
'iurimateus/luasnip-latex-snippets.nvim',
|
||||
-- vimtex isn't required if using treesitter
|
||||
requires = { 'L3MON4D3/LuaSnip', 'lervag/vimtex' },
|
||||
config = function()
|
||||
require('luasnip-latex-snippets').setup()
|
||||
-- or setup({ use_treesitter = true })
|
||||
require('luasnip').config.setup { enable_autosnippets = true }
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- 'iurimateus/luasnip-latex-snippets.nvim',
|
||||
-- -- vimtex isn't required if using treesitter
|
||||
-- requires = { 'L3MON4D3/LuaSnip', 'lervag/vimtex' },
|
||||
-- config = function()
|
||||
-- require('luasnip-latex-snippets').setup()
|
||||
-- -- or setup({ use_treesitter = true })
|
||||
-- require('luasnip').config.setup { enable_autosnippets = true }
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
return {
|
||||
{
|
||||
'kawre/leetcode.nvim',
|
||||
build = ':TSUpdate html', -- if you have `nvim-treesitter` installed
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
-- "ibhagwan/fzf-lua",
|
||||
'nvim-lua/plenary.nvim',
|
||||
'MunifTanjim/nui.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
},
|
||||
opts = {
|
||||
-- configuration goes here
|
||||
injector = {
|
||||
['cpp'] = {
|
||||
before = { '#include <bits/stdc++.h>', 'using namespace std;' },
|
||||
after = 'int main() {}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {
|
||||
|
||||
{
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
branch = 'v3.x',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
},
|
||||
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '<leader>e', ':Neotree toggle<CR>', desc = 'Explorer', silent = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
vim.pack.add { 'https://github.com/nvim-tree/nvim-web-devicons' }
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
return {
|
||||
'debugloop/telescope-undo.nvim',
|
||||
dependencies = { -- note how they're inverted to above example
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ -- lazy style key map
|
||||
'<leader>fu',
|
||||
'<cmd>Telescope undo<cr>',
|
||||
desc = 'Telescope Undo History',
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
-- don't use `defaults = { }` here, do this in the main telescope spec
|
||||
extensions = {
|
||||
undo = {
|
||||
-- telescope-undo.nvim config, see below
|
||||
},
|
||||
-- no other extensions here, they can have their own spec too
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- Calling telescope's setup from multiple specs does not hurt, it will happily merge the
|
||||
-- configs for us. We won't use data, as everything is in it's own namespace (telescope
|
||||
-- defaults, as well as each extension).
|
||||
require('telescope').setup(opts)
|
||||
require('telescope').load_extension 'undo'
|
||||
end,
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
vim.pack.add({
|
||||
"https://github.com/ellisonleao/gruvbox.nvim"
|
||||
})
|
||||
|
||||
require("gruvbox").setup(
|
||||
{
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = true,
|
||||
emphasis = true,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
-- inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
-- contrast = "", -- can be "hard", "soft" or empty string
|
||||
-- palette_overrides = {},
|
||||
-- overrides = {},
|
||||
dim_inactive = false,
|
||||
-- transparent_mode = false,
|
||||
}
|
||||
)
|
||||
|
||||
vim.cmd.colorscheme("gruvbox")
|
||||
|
|
@ -12,7 +12,7 @@ local check_version = function()
|
|||
return
|
||||
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))
|
||||
else
|
||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||
|
|
|
|||
|
|
@ -1,16 +1,5 @@
|
|||
-- autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = 'InsertEnter',
|
||||
-- Optional dependency
|
||||
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,
|
||||
}
|
||||
vim.pack.add { 'https://github.com/windwp/nvim-autopairs' }
|
||||
require('nvim-autopairs').setup {}
|
||||
|
|
|
|||
|
|
@ -6,143 +6,90 @@
|
|||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {
|
||||
-- NOTE: Yes, you can install new plugins here!
|
||||
'mfussenegger/nvim-dap',
|
||||
-- NOTE: And you can specify dependencies as well
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
'rcarriga/nvim-dap-ui',
|
||||
|
||||
-- Required dependency for nvim-dap-ui
|
||||
'nvim-neotest/nvim-nio',
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
'williamboman/mason.nvim',
|
||||
'jay-babu/mason-nvim-dap.nvim',
|
||||
|
||||
-- Add your own debuggers here
|
||||
'leoluz/nvim-dap-go',
|
||||
},
|
||||
keys = {
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = 'Debug: Start/Continue',
|
||||
},
|
||||
{
|
||||
'<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.
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dapui').toggle()
|
||||
end,
|
||||
desc = 'Debug: See last session result.',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
|
||||
require('mason-nvim-dap').setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- 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,
|
||||
vim.pack.add {
|
||||
'https://github.com/mfussenegger/nvim-dap',
|
||||
'https://github.com/rcarriga/nvim-dap-ui',
|
||||
'https://github.com/nvim-neotest/nvim-nio',
|
||||
'https://github.com/mason-org/mason.nvim',
|
||||
'https://github.com/jay-babu/mason-nvim-dap.nvim',
|
||||
'https://github.com/leoluz/nvim-dap-go',
|
||||
}
|
||||
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
vim.keymap.set('n', '<F5>', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' })
|
||||
vim.keymap.set('n', '<F1>', function() require('dap').step_into() end, { desc = 'Debug: Step Into' })
|
||||
vim.keymap.set('n', '<F2>', function() require('dap').step_over() end, { desc = 'Debug: Step Over' })
|
||||
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' })
|
||||
vim.keymap.set('n', '<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.
|
||||
vim.keymap.set('n', '<F7>', function() require('dapui').toggle() end, { desc = 'Debug: See last session result.' })
|
||||
|
||||
local dap = require 'dap'
|
||||
local dapui = require 'dapui'
|
||||
|
||||
require('mason-nvim-dap').setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- 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|
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
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 = '*' },
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,60 +2,56 @@
|
|||
-- NOTE: gitsigns is already included in init.lua but contains only the base
|
||||
-- config. This will add also the recommended keymaps.
|
||||
|
||||
return {
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
on_attach = function(bufnr)
|
||||
local gitsigns = require 'gitsigns'
|
||||
vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' }
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
require('gitsigns').setup {
|
||||
on_attach = function(bufnr)
|
||||
local gitsigns = require 'gitsigns'
|
||||
|
||||
-- Navigation
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { ']c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'next'
|
||||
end
|
||||
end, { desc = 'Jump to next git [c]hange' })
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { '[c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'prev'
|
||||
end
|
||||
end, { desc = 'Jump to previous git [c]hange' })
|
||||
-- Navigation
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { ']c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'next'
|
||||
end
|
||||
end, { desc = 'Jump to next git [c]hange' })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function()
|
||||
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function()
|
||||
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
|
||||
end, { desc = 'git [r]eset hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
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,
|
||||
},
|
||||
},
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal { '[c', bang = true }
|
||||
else
|
||||
gitsigns.nav_hunk 'prev'
|
||||
end
|
||||
end, { desc = 'Jump to previous git [c]hange' })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
|
||||
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
|
||||
-- normal mode
|
||||
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
|
||||
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>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
|
||||
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
|
||||
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' })
|
||||
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { 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' })
|
||||
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' })
|
||||
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
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help ibl`
|
||||
main = 'ibl',
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
-- Add indentation guides even on blank lines
|
||||
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help ibl`
|
||||
vim.pack.add { 'https://github.com/lukas-reineke/indent-blankline.nvim' }
|
||||
require('ibl').setup {}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,53 @@
|
|||
return {
|
||||
-- Linting
|
||||
|
||||
{ -- Linting
|
||||
'mfussenegger/nvim-lint',
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
config = function()
|
||||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' },
|
||||
}
|
||||
vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' }
|
||||
|
||||
-- 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.opt_local.modifiable:get() then
|
||||
lint.try_lint()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
|
||||
}
|
||||
|
||||
-- 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,19 @@
|
|||
-- Neo-tree is a Neovim plugin to browse the file system
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||
},
|
||||
opts = {
|
||||
filesystem = {
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
vim.pack.add {
|
||||
{ src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' },
|
||||
'https://github.com/nvim-lua/plenary.nvim',
|
||||
'https://github.com/MunifTanjim/nui.nvim',
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '\\', '<Cmd>Neotree reveal<CR>', { desc = 'NeoTree reveal', silent = true })
|
||||
|
||||
require('neo-tree').setup {
|
||||
filesystem = {
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
local ls = require 'luasnip'
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local events = require 'luasnip.util.events'
|
||||
local ai = require 'luasnip.nodes.absolute_indexer'
|
||||
local extras = require 'luasnip.extras'
|
||||
local l = extras.lambda
|
||||
local rep = extras.rep
|
||||
local p = extras.partial
|
||||
local m = extras.match
|
||||
local n = extras.nonempty
|
||||
local dl = extras.dynamic_lambda
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local conds = require 'luasnip.extras.expand_conditions'
|
||||
local postfix = require('luasnip.extras.postfix').postfix
|
||||
local types = require 'luasnip.util.types'
|
||||
local parse = require('luasnip.util.parser').parse_snippet
|
||||
local ms = ls.multi_snippet
|
||||
local k = require('luasnip.nodes.key_indexer').new_key
|
||||
|
||||
return {
|
||||
s('date', t(os.date '%Y-%m-%d')),
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
--[
|
||||
-- LuaSnip Conditions
|
||||
--]
|
||||
|
||||
local M = {}
|
||||
|
||||
-- math / not math zones
|
||||
|
||||
function M.in_math()
|
||||
return vim.api.nvim_eval 'vimtex#syntax#in_mathzone()' == 1
|
||||
end
|
||||
|
||||
-- comment detection
|
||||
function M.in_comment()
|
||||
return vim.fn['vimtex#syntax#in_comment']() == 1
|
||||
end
|
||||
|
||||
-- document class
|
||||
function M.in_beamer()
|
||||
return vim.b.vimtex['documentclass'] == 'beamer'
|
||||
end
|
||||
|
||||
-- general env function
|
||||
local function env(name)
|
||||
local is_inside = vim.fn['vimtex#env#is_inside'](name)
|
||||
return (is_inside[1] > 0 and is_inside[2] > 0)
|
||||
end
|
||||
|
||||
function M.in_preamble()
|
||||
return not env 'document'
|
||||
end
|
||||
|
||||
function M.in_text()
|
||||
return env 'document' and not M.in_math()
|
||||
end
|
||||
|
||||
function M.in_tikz()
|
||||
return env 'tikzpicture'
|
||||
end
|
||||
|
||||
function M.in_bullets()
|
||||
return env 'itemize' or env 'enumerate'
|
||||
end
|
||||
|
||||
function M.in_align()
|
||||
return env 'align' or env 'align*' or env 'aligned'
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
local ls = require 'luasnip'
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local events = require 'luasnip.util.events'
|
||||
local ai = require 'luasnip.nodes.absolute_indexer'
|
||||
local extras = require 'luasnip.extras'
|
||||
local l = extras.lambda
|
||||
local rep = extras.rep
|
||||
local p = extras.partial
|
||||
local m = extras.match
|
||||
local n = extras.nonempty
|
||||
local dl = extras.dynamic_lambda
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local conds = require 'luasnip.extras.expand_conditions'
|
||||
local postfix = require('luasnip.extras.postfix').postfix
|
||||
local types = require 'luasnip.util.types'
|
||||
local parse = require('luasnip.util.parser').parse_snippet
|
||||
local ms = ls.multi_snippet
|
||||
local k = require('luasnip.nodes.key_indexer').new_key
|
||||
|
||||
local conditions = require 'luasnippets.tex.conditions'
|
||||
local is_math = conditions.is_math
|
||||
|
||||
local as = require('luasnip').extend_decorator.apply(s, { snippetType = 'autosnippet' })
|
||||
|
||||
local ret = {}
|
||||
|
||||
-- dynamic node
|
||||
-- generally, postfix comes in the form PRE-CAPTURE-POST, so in this case, arg1 is the "pre" text, arg2 the "post" text
|
||||
local dynamic_postfix = function(_, parent, _, user_arg1, user_arg2)
|
||||
print(table.concat(parent.snippet, '\n'))
|
||||
local capture = parent.snippet.env.POSTFIX_MATCH
|
||||
if #capture > 0 then
|
||||
return sn(
|
||||
nil,
|
||||
fmta(
|
||||
[[
|
||||
<><><><>
|
||||
]],
|
||||
{ t(user_arg1), t(capture), t(user_arg2), i(0) }
|
||||
)
|
||||
)
|
||||
else
|
||||
local visual_placeholder = ''
|
||||
if #parent.snippet.env.SELECT_RAW > 0 then
|
||||
visual_placeholder = parent.snippet.env.SELECT_RAW
|
||||
end
|
||||
return sn(
|
||||
nil,
|
||||
fmta(
|
||||
[[
|
||||
<><><><>
|
||||
]],
|
||||
{ t(user_arg1), i(1, visual_placeholder), t(user_arg2), i(0) }
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
-- local function postfix_std(trig, result_start, result_end)
|
||||
-- return postfix(
|
||||
-- { trig = trig, snippetType = 'autosnippet' },
|
||||
-- { d(1, dynamic_postfix, {}, { user_args = { result_start, result_end } }) },
|
||||
-- { condition = is_math, show_condition = is_math }
|
||||
-- )
|
||||
-- end
|
||||
|
||||
-- Helper: creates a regex-triggered snippet that wraps the next character(s)
|
||||
-- after <prefix> in <before> ... <after>
|
||||
local function postfix_std(prefix, before, after)
|
||||
return s(
|
||||
{ trig = prefix .. '(%a)', regTrig = true, wordTrig = false, snippetType = 'autosnippet' },
|
||||
f(function(_, snip)
|
||||
local captured = snip.captures[1]
|
||||
return before .. captured .. after
|
||||
end)
|
||||
)
|
||||
end
|
||||
|
||||
table.insert(ret, postfix_std('vec', '\\vec{', '}'))
|
||||
table.insert(ret, postfix_std('hat', '\\hat{', '}'))
|
||||
table.insert(ret, postfix_std('dot', '\\dot{', '}'))
|
||||
table.insert(ret, postfix_std('bar', '\\bar{', '}'))
|
||||
|
||||
return ret
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
local ls = require 'luasnip'
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local events = require 'luasnip.util.events'
|
||||
local ai = require 'luasnip.nodes.absolute_indexer'
|
||||
local extras = require 'luasnip.extras'
|
||||
local l = extras.lambda
|
||||
local rep = extras.rep
|
||||
local p = extras.partial
|
||||
local m = extras.match
|
||||
local n = extras.nonempty
|
||||
local dl = extras.dynamic_lambda
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local conds = require 'luasnip.extras.expand_conditions'
|
||||
local postfix = require('luasnip.extras.postfix').postfix
|
||||
local types = require 'luasnip.util.types'
|
||||
local parse = require('luasnip.util.parser').parse_snippet
|
||||
local ms = ls.multi_snippet
|
||||
local k = require('luasnip.nodes.key_indexer').new_key
|
||||
|
||||
local conditions = require 'luasnippets.tex.conditions'
|
||||
|
||||
local is_math = conditions.is_math
|
||||
local as = require('luasnip').extend_decorator.apply(s, { snippetType = 'autosnippet' })
|
||||
|
||||
local ret = {}
|
||||
--
|
||||
-- table.insert(
|
||||
-- ret,
|
||||
-- as(
|
||||
-- {
|
||||
-- trig = 'rancc',
|
||||
-- regTrig = true,
|
||||
-- name = 'range closed close',
|
||||
-- dscr = 'ranges typing x_ -> x_{}',
|
||||
-- },
|
||||
-- fmta([[ \left[ <> ; <> \right] ]], {
|
||||
-- i(1),
|
||||
-- i(2),
|
||||
-- }),
|
||||
-- { condition = is_math }
|
||||
-- )
|
||||
-- )
|
||||
|
||||
local leters = { 'c', 'o' }
|
||||
for index, value in ipairs(leters) do
|
||||
for index2, value2 in ipairs(leters) do
|
||||
local char1
|
||||
local char2
|
||||
if index == 1 then
|
||||
char1 = '['
|
||||
else
|
||||
char1 = ']'
|
||||
end
|
||||
if index2 == 1 then
|
||||
char2 = ']'
|
||||
else
|
||||
char2 = '['
|
||||
end
|
||||
table.insert(
|
||||
ret,
|
||||
as(
|
||||
{
|
||||
trig = 'ran' .. value .. value2,
|
||||
regTrig = true,
|
||||
name = 'range ' .. value .. value2 .. ' - ' .. char1 .. char2,
|
||||
dscr = 'ranges',
|
||||
},
|
||||
fmta('\\left' .. char1 .. ' <> ; <> \\right' .. char2, {
|
||||
i(1),
|
||||
i(2),
|
||||
}),
|
||||
{ condition = is_math }
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return ret
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
local ls = require 'luasnip'
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local events = require 'luasnip.util.events'
|
||||
local ai = require 'luasnip.nodes.absolute_indexer'
|
||||
local extras = require 'luasnip.extras'
|
||||
local l = extras.lambda
|
||||
local rep = extras.rep
|
||||
local p = extras.partial
|
||||
local m = extras.match
|
||||
local n = extras.nonempty
|
||||
local dl = extras.dynamic_lambda
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local conds = require 'luasnip.extras.expand_conditions'
|
||||
local postfix = require('luasnip.extras.postfix').postfix
|
||||
local types = require 'luasnip.util.types'
|
||||
local parse = require('luasnip.util.parser').parse_snippet
|
||||
local ms = ls.multi_snippet
|
||||
local k = require('luasnip.nodes.key_indexer').new_key
|
||||
|
||||
local conditions = require 'luasnippets.tex.conditions'
|
||||
|
||||
local is_math = conditions.is_math
|
||||
local as = require('luasnip').extend_decorator.apply(s, { snippetType = 'autosnippet' })
|
||||
|
||||
local ret = {
|
||||
as(
|
||||
{
|
||||
trig = '(%a)_',
|
||||
regTrig = true,
|
||||
name = 'auto subscript underscore',
|
||||
dscr = 'Auto subscript: typing x_ -> x_{}',
|
||||
},
|
||||
fmta([[<>_{<>}]], {
|
||||
f(function(_, snip)
|
||||
return snip.captures[1]
|
||||
end),
|
||||
i(1),
|
||||
}),
|
||||
{ condition = is_math }
|
||||
),
|
||||
}
|
||||
|
||||
return ret
|
||||
Loading…
Reference in New Issue