Compare commits

..

17 Commits

Author SHA1 Message Date
Franchioping 87846dc87c new laptop 2026-01-27 16:04:08 +00:00
Franchioping a882fc5d24 fix esp32 2025-12-08 20:44:13 +00:00
Franchioping bd4d79f7f3 neovim stuffs, tex, esp32 2025-11-26 21:21:58 +00:00
Franchioping 044ebe7bff changes 2025-11-05 10:02:56 +00:00
Franchioping 1b6c7bdf45 readme repo change 2025-10-29 17:57:46 +00:00
Franchioping 3fc7120f1b change local leader 2025-10-29 17:54:55 +00:00
Franchioping 5ed85f9cf9 working kind of base for nix??? 2025-10-29 17:00:40 +00:00
Franchioping 4ec5add8ce working kind of base for nix?? 2025-10-29 17:00:34 +00:00
Franchioping 8402b24466 Merge branch 'master' of github.com:franchioping/kickstart.nvim
disk dying fuck me
2025-10-14 22:35:19 +01:00
Franchioping 1418ed2435 disk dying 2025-10-14 22:34:32 +01:00
Francisco Lima a57e14db1a
Update README with installation instructions
Added installation instructions for cloning the repository.
2025-09-12 00:03:02 +01:00
Franchioping 2b4f2987c2 update lock 2025-08-21 20:32:22 +01:00
franchioping 2adcea052c add file 2025-04-18 00:20:04 +01:00
franchioping 48e9082bf8 chanes 2025-04-18 00:18:58 +01:00
franchioping 1fd3c1d354 changes 2025-04-12 16:42:14 +01:00
franchioping f976a7cba6 changed opts to option 2025-01-22 16:02:21 +00:00
franchioping 0081252e35 changes 2025-01-22 15:41:21 +00:00
30 changed files with 1806 additions and 1287 deletions

View File

@ -10,11 +10,9 @@ assignees: ''
<!-- Any bug report not following this template will be immediately closed. Thanks --> <!-- Any bug report not following this template will be immediately closed. Thanks -->
## Before Reporting an Issue ## Before Reporting an Issue
- I have read the kickstart.nvim README.md. - I have read the kickstart.nvim README.md.
- I have read the appropriate plugin's documentation. - I have read the appropriate plugin's documentation.
- I have searched that this issue has not been reported before. - I have searched that this issue has not been reported before.
- 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.** - [ ] **By checking this, I confirm that the above steps are completed. I understand leaving this unchecked will result in this report being closed immediately.**

View File

@ -1,10 +0,0 @@
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

View File

@ -9,12 +9,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v6 uses: actions/checkout@v2
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@v4 uses: JohnnyMorganz/stylua-action@v3
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
version: latest version: latest
args: --check . args: --check .

9
.gitignore vendored
View File

@ -4,11 +4,4 @@ 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

View File

@ -4,4 +4,3 @@ 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"

200
README.md
View File

@ -1,5 +1,9 @@
# kickstart.nvim # kickstart.nvim
```sh
git clone ssh://git@forgejo.galard.uk:222/franchioping/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
```
## Introduction ## Introduction
A starting point for Neovim that is: A starting point for Neovim that is:
@ -17,39 +21,29 @@ 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 at least the latest If you are experiencing issues, please make sure you have the latest versions.
stable version. Most likely, you want to install neovim via a [package
manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package).
To check your neovim version, run `nvim --version` and make sure it is not
below the latest
['stable'](https://github.com/neovim/neovim/releases/tag/stable) version. If
your chosen install method only gives you an outdated version of neovim, find
alternative [installation methods below](#alternative-neovim-installation-methods).
### Install External Dependencies ### Install External Dependencies
External Requirements: External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) * Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation), * [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
[fd-find](https://github.com/sharkdp/fd#installation) * Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
- [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/blob/master/crates/cli/README.md#installation) * A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform) * if you have it set `vim.g.have_nerd_font` in `init.lua` to true
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons * Language Setup:
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true * If you want to write Typescript, you need `npm`
- Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji` * If you want to write Golang, you will need `go`
- Language Setup: * etc.
- If you want to write Typescript, you need `npm`
- If you want to write Golang, you will need `go`
- etc.
> [!NOTE] > **NOTE**
> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes > See [Install Recipes](#install-recipes) for additional Windows and Linux specific notes
> and quick install snippets > and quick install snippets
### Install Kickstart ### Install Kickstart
> [!NOTE] > **NOTE**
> [Backup](#FAQ) your previous configuration (if any exists) > [Backup](#faq) your previous configuration (if any exists)
Neovim's configurations are located under the following paths, depending on your OS: Neovim's configurations are located under the following paths, depending on your OS:
@ -65,17 +59,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 so that you have your own copy that you can modify, then install by cloning the
fork to your machine using one of the commands below, depending on your OS. fork to your machine using one of the commands below, depending on your OS.
> [!NOTE] > **NOTE**
> Your fork's URL will be something like this: > Your fork's URL will be something like this:
> `https://github.com/<your_github_username>/kickstart.nvim.git` > `https://github.com/<your_github_username>/kickstart.nvim.git`
You likely want to remove `nvim-pack-lock.json` from your fork's `.gitignore` You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
file too - it's ignored in the kickstart repo to make maintenance easier, but too - it's ignored in the kickstart repo to make maintenance easier, but it's
it's recommended to track it in version control (see `:help vim.pack-lockfile`). [recommended to track it in version control](https://lazy.folke.io/usage/lockfile).
#### Clone kickstart.nvim #### Clone kickstart.nvim
>
> [!NOTE] > **NOTE**
> If following the recommended step above (i.e., forking the repo), replace > If following the recommended step above (i.e., forking the repo), replace
> `nvim-lua` with `<your_github_username>` in the commands below > `nvim-lua` with `<your_github_username>` in the commands below
@ -111,10 +105,8 @@ Start Neovim
nvim nvim
``` ```
That's it! `vim.pack` will install all the plugins from your config. Use That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
`:lua vim.pack.update(nil, { offline = true })` to inspect plugin state and the current plugin status. Hit `q` to close the window.
`:lua vim.pack.update()` to fetch updates (`:write` applies updates, `:quit`
cancels them).
#### Read The Friendly Documentation #### Read The Friendly Documentation
@ -125,7 +117,6 @@ examples of adding popularly requested plugins.
> [!NOTE] > [!NOTE]
> For more information about a particular plugin check its repository's documentation. > For more information about a particular plugin check its repository's documentation.
### Getting Started ### Getting Started
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) [The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
@ -140,16 +131,17 @@ examples of adding popularly requested plugins.
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` * 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 to maintain multiple configurations. For example, you can install the kickstart
configuration in `~/.config/nvim-kickstart` and create an alias: configuration in `~/.config/nvim-kickstart` and create an alias:
``` ```
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
``` ```
When you run Neovim using `nvim-kickstart` alias it will use the alternative When you run Neovim using `nvim-kickstart` alias it will use the alternative
config directory and the matching local directory config directory and the matching local directory
`~/.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:
* Remove your config directory and local data directory (for example, * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
`~/.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.
@ -170,36 +162,18 @@ After installing all the dependencies continue with the [Install Kickstart](#ins
#### 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>
Kickstart's default config is make-only for `telescope-fzf-native.nvim`. Installation may require installing build tools and updating the run command for `telescope-fzf-native`
If `make` is unavailable, the plugin is skipped.
Recommended: install `make` (see the chocolatey section below). See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation)
If you want a CMake-only setup, customize `init.lua` in two places: This requires:
1. Include `telescope-fzf-native.nvim` when `cmake` is available: * Install CMake and the Microsoft C++ Build Tools on Windows
```lua ```lua
if vim.fn.executable 'make' == 1 or vim.fn.executable 'cmake' == 1 then {'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
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,
@ -208,15 +182,18 @@ the easiest way is to use choco:
1. install [chocolatey](https://chocolatey.org/install) 1. install [chocolatey](https://chocolatey.org/install)
either follow the instructions on the page or use winget, either follow the instructions on the page or use winget,
run in cmd as **admin**: run in cmd as **admin**:
``` ```
winget install --accept-source-agreements chocolatey.chocolatey 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 tree-sitter choco install -y neovim git ripgrep wget fd unzip gzip mingw make
``` ```
</details> </details>
<details><summary>WSL (Windows Subsystem for Linux)</summary> <details><summary>WSL (Windows Subsystem for Linux)</summary>
@ -225,121 +202,52 @@ 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 fd-find tree-sitter-cli unzip git xclip neovim sudo apt install make gcc ripgrep unzip git xclip neovim
``` ```
</details> </details>
#### Linux Install #### Linux Install
<details><summary>Ubuntu Install Steps</summary> <details><summary>Ubuntu Install Steps</summary>
``` ```
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 fd-find tree-sitter-cli unzip git xclip neovim sudo apt install make gcc ripgrep 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 fd-find tree-sitter-cli unzip git xclip curl sudo apt install make gcc ripgrep 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-linux64.tar.gz
sudo rm -rf /opt/nvim-linux-x86_64 sudo rm -rf /opt/nvim-linux64
sudo mkdir -p /opt/nvim-linux-x86_64 sudo mkdir -p /opt/nvim-linux64
sudo chmod a+rX /opt/nvim-linux-x86_64 sudo chmod a+rX /opt/nvim-linux64
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz sudo tar -C /opt -xzf nvim-linux64.tar.gz
# make it available in /usr/local/bin, distro installs to /usr/bin # make it available in /usr/local/bin, distro installs to /usr/bin
sudo ln -sf /opt/nvim-linux-x86_64/bin/nvim /usr/local/bin/ sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
``` ```
</details> </details>
<details><summary>Fedora Install Steps</summary> <details><summary>Fedora Install Steps</summary>
``` ```
sudo dnf install -y gcc make git ripgrep fd-find tree-sitter-cli unzip neovim sudo dnf install -y gcc make git ripgrep fd-find 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 tree-sitter-cli unzip neovim sudo pacman -S --noconfirm --needed gcc make git ripgrep fd 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>
<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>

View File

@ -0,0 +1,2 @@
vim.opt_local.spell = true
vim.opt_local.spelllang = { 'en_us', 'pt_PT' }

1798
init.lua

File diff suppressed because it is too large Load Diff

38
lazy-lock.json Normal file
View File

@ -0,0 +1,38 @@
{
"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" }
}

View File

@ -1,4 +1,3 @@
-- local function map(mode, lhs, rhs, opts) -- local function map(mode, lhs, rhs, opts)
-- local options = { noremap = true, silent = true } -- local options = { noremap = true, silent = true }
-- if opts then -- if opts then
@ -16,7 +15,15 @@
vim.keymap.set({ 'x', 'n' }, '<leader>d', '"_d', { remap = false, desc = 'Delete without copying' }) vim.keymap.set({ 'x', 'n' }, '<leader>d', '"_d', { remap = false, desc = 'Delete without copying' })
vim.keymap.set({'x','n'}, '<leader>/', 'gcc', { remap = true, desc = 'Toggle comment line' }) 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.g.tex_flavor = 'latex' vim.g.tex_flavor = 'latex'
@ -43,7 +50,3 @@ local list_all_snips = function()
end end
vim.api.nvim_create_user_command('SnipListAll', list_all_snips, {}) 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 })

View File

@ -0,0 +1,57 @@
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' },
},
}

View File

@ -1,13 +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
-- 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

View File

@ -0,0 +1,39 @@
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,
-- },
}

View File

@ -0,0 +1,22 @@
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() {}',
},
},
},
},
}

View File

@ -0,0 +1,22 @@
-- 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 },
},
},
}

View File

@ -1,2 +0,0 @@
vim.pack.add { 'https://github.com/nvim-tree/nvim-web-devicons' }

View File

@ -0,0 +1,32 @@
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,
}

View File

@ -1,31 +0,0 @@
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")

View File

@ -12,7 +12,7 @@ local check_version = function()
return return
end end
if vim.version.ge(vim.version(), '0.12') then if vim.version.ge(vim.version(), '0.10-dev') 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))

View File

@ -1,5 +1,16 @@
-- autopairs -- autopairs
-- https://github.com/windwp/nvim-autopairs -- https://github.com/windwp/nvim-autopairs
vim.pack.add { 'https://github.com/windwp/nvim-autopairs' } return {
require('nvim-autopairs').setup {} '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,
}

View File

@ -6,90 +6,143 @@
-- 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 ;)
vim.pack.add { return {
'https://github.com/mfussenegger/nvim-dap', -- NOTE: Yes, you can install new plugins here!
'https://github.com/rcarriga/nvim-dap-ui', 'mfussenegger/nvim-dap',
'https://github.com/nvim-neotest/nvim-nio', -- NOTE: And you can specify dependencies as well
'https://github.com/mason-org/mason.nvim', dependencies = {
'https://github.com/jay-babu/mason-nvim-dap.nvim', -- Creates a beautiful debugger UI
'https://github.com/leoluz/nvim-dap-go', 'rcarriga/nvim-dap-ui',
}
-- Basic debugging keymaps, feel free to change to your liking! -- Required dependency for nvim-dap-ui
vim.keymap.set('n', '<F5>', function() require('dap').continue() end, { desc = 'Debug: Start/Continue' }) 'nvim-neotest/nvim-nio',
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' -- Installs the debug adapters for you
local dapui = require 'dapui' 'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
require('mason-nvim-dap').setup { -- Add your own debuggers here
-- Makes a best effort to setup the various debuggers with 'leoluz/nvim-dap-go',
-- 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',
}, },
} keys = {
-- Basic debugging keymaps, feel free to change to your liking!
-- Dap UI setup {
-- For more information, see |:help nvim-dap-ui| '<F5>',
---@diagnostic disable-next-line: missing-fields function()
dapui.setup { require('dap').continue()
-- Set icons to characters that are more likely to work in every terminal. end,
-- Feel free to remove or use ones that you like more! :) desc = 'Debug: Start/Continue',
-- Don't feel like these are good choices. },
icons = { expanded = '', collapsed = '', current_frame = '*' }, {
---@diagnostic disable-next-line: missing-fields '<F1>',
controls = { function()
icons = { require('dap').step_into()
pause = '', end,
play = '', desc = 'Debug: Step Into',
step_into = '', },
step_over = '', {
step_out = '', '<F2>',
step_back = 'b', function()
run_last = '▶▶', require('dap').step_over()
terminate = '', end,
disconnect = '', 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'
-- Change breakpoint icons local dapui = require 'dapui'
-- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' })
-- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) require('mason-nvim-dap').setup {
-- local breakpoint_icons = vim.g.have_nerd_font -- Makes a best effort to setup the various debuggers with
-- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } -- reasonable debug configurations
-- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } automatic_installation = true,
-- for type, icon in pairs(breakpoint_icons) do
-- local tp = 'Dap' .. type -- You can provide additional configuration to the handlers,
-- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' -- see mason-nvim-dap README for more information
-- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) handlers = {},
-- end
-- You'll need to check that you have the required things installed
dap.listeners.after.event_initialized['dapui_config'] = dapui.open -- online, please don't ask me how to install them :)
dap.listeners.before.event_terminated['dapui_config'] = dapui.close ensure_installed = {
dap.listeners.before.event_exited['dapui_config'] = dapui.close -- Update this to ensure that you have the debuggers for the langs you want
'delve',
-- Install golang specific config },
require('dap-go').setup { }
delve = {
-- On Windows delve must be run attached or it crashes. -- Dap UI setup
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring -- For more information, see |:help nvim-dap-ui|
detached = vim.fn.has 'win32' == 0, 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,
} }

View File

@ -2,56 +2,60 @@
-- 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.
vim.pack.add { 'https://github.com/lewis6991/gitsigns.nvim' } return {
{
'lewis6991/gitsigns.nvim',
opts = {
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
require('gitsigns').setup { local function map(mode, l, r, opts)
on_attach = function(bufnr) opts = opts or {}
local gitsigns = require 'gitsigns' opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
local function map(mode, l, r, opts) -- Navigation
opts = opts or {} map('n', ']c', function()
opts.buffer = bufnr if vim.wo.diff then
vim.keymap.set(mode, l, r, opts) vim.cmd.normal { ']c', bang = true }
end else
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
-- Navigation map('n', '[c', function()
map('n', ']c', function() if vim.wo.diff then
if vim.wo.diff then vim.cmd.normal { '[c', bang = true }
vim.cmd.normal { ']c', bang = true } else
else gitsigns.nav_hunk 'prev'
gitsigns.nav_hunk 'next' end
end end, { desc = 'Jump to previous git [c]hange' })
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function() -- Actions
if vim.wo.diff then -- visual mode
vim.cmd.normal { '[c', bang = true } map('v', '<leader>hs', function()
else gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
gitsigns.nav_hunk 'prev' end, { desc = 'git [s]tage hunk' })
end map('v', '<leader>hr', function()
end, { desc = 'Jump to previous git [c]hange' }) gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'git [r]eset hunk' })
-- Actions -- normal mode
-- visual mode map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage 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>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' }) map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
-- normal mode map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', '<leader>hD', function()
map('n', '<leader>hi', gitsigns.preview_hunk_inline, { desc = 'git preview hunk [i]nline' }) gitsigns.diffthis '@'
map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end, { desc = 'git [b]lame line' }) end, { desc = 'git [D]iff against last commit' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) -- Toggles
map('n', '<leader>hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>hQ', function() gitsigns.setqflist 'all' end, { desc = 'git hunk [Q]uickfix list (all files in repo)' }) map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
map('n', '<leader>hq', gitsigns.setqflist, { desc = 'git hunk [q]uickfix list (all changes in this file)' }) end,
-- 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,
} }

View File

@ -1,6 +1,9 @@
-- Add indentation guides even on blank lines return {
{ -- Add indentation guides even on blank lines
-- Enable `lukas-reineke/indent-blankline.nvim` 'lukas-reineke/indent-blankline.nvim',
-- See `:help ibl` -- Enable `lukas-reineke/indent-blankline.nvim`
vim.pack.add { 'https://github.com/lukas-reineke/indent-blankline.nvim' } -- See `:help ibl`
require('ibl').setup {} main = 'ibl',
opts = {},
},
}

View File

@ -1,53 +1,60 @@
-- Linting return {
vim.pack.add { 'https://github.com/mfussenegger/nvim-lint' } { -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
local lint = require 'lint' -- To allow other plugins to add linters to require('lint').linters_by_ft,
lint.linters_by_ft = { -- instead set linters_by_ft like this:
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm -- 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,
},
} }
-- 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,
})

View File

@ -1,19 +1,24 @@
-- 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
vim.pack.add { return {
{ src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', version = vim.version.range '*' }, 'nvim-neo-tree/neo-tree.nvim',
'https://github.com/nvim-lua/plenary.nvim', version = '*',
'https://github.com/MunifTanjim/nui.nvim', dependencies = {
} 'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
vim.keymap.set('n', '\\', '<Cmd>Neotree reveal<CR>', { desc = 'NeoTree reveal', silent = true }) 'MunifTanjim/nui.nvim',
},
require('neo-tree').setup { cmd = 'Neotree',
filesystem = { keys = {
window = { { '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
mappings = { },
['\\'] = 'close_window', opts = {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
}, },
}, },
}, },

31
lua/luasnippets/all.lua Normal file
View File

@ -0,0 +1,31 @@
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')),
}

View File

@ -0,0 +1,49 @@
--[
-- 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

View File

@ -0,0 +1,93 @@
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

View File

@ -0,0 +1,87 @@
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

View File

@ -0,0 +1,52 @@
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