Compare commits

...

12 commits

104 changed files with 800 additions and 6300 deletions

1
.envrc
View file

@ -1 +0,0 @@
use flake . -Lv

4
.gitignore vendored
View file

@ -1,3 +1,3 @@
result
.direnv
tags
.luarc.json
/result

View file

@ -1,10 +1,6 @@
column_width = 80
column_width = 160
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "Always"
collapse_simple_statement = "Never"
[sort_requires]
enabled = true
call_parentheses = "None"

View file

@ -1,23 +0,0 @@
alias d := dev
dev:
nix develop
alias t := test
test:
git aa && nix run .
alias to := testone
testone:
git aa && nix run . -- flake.nix
alias tt := testtwo
testtwo:
git aa && nix run . -- flake.nix .stylua.toml
alias tl := testlua
testlua:
git aa && nix run . -- nvim/lua/autocmds.lua
alias s := search
search this:
nh search {{this}}

333
README.md
View file

@ -1,332 +1,5 @@
<!-- markdownlint-disable -->
<br />
<div align="center">
<a href="https://github.com/nix-community/kickstart-nix.nvim">
<img src="./nvim-nix.svg" alt="kickstart-nix.nvim">
</a>
<!-- TODO: -->
<!-- <p align="center"> -->
<!-- <br /> -->
<!-- TODO: -->
<!-- <a href="./nvim/doc/kickstart-nix.txt"><strong>Explore the docs »</strong></a> -->
<!-- <br /> -->
<!-- <br /> -->
<!-- <a href="https://github.com/nix-community/kickstart-nix.nvim/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml">Report Bug</a> -->
<!-- · -->
<!-- <a href="https://github.com/nix-community/kickstart-nix.nvim/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml">Request Feature</a> -->
<!-- · -->
<!-- <a href="https://github.com/nix-community/kickstart-nix.nvim/discussions/new?category=q-a">Ask Question</a> -->
<!-- </p> -->
<p>❄️</p>
<p>
<strong>
A dead simple <a href="https://nixos.org/">Nix</a> flake template repository</br>
for <a href="https://neovim.io/">Neovim</a>
</strong>
</p>
# LazyVim distribution
[![Neovim][neovim-shield]][neovim-url]
[![Nix][nix-shield]][nix-url]
[![Lua][lua-shield]][lua-url]
How to get the [LazyVim](http://www.lazyvim.org/) distribution up and running
[![GPL2 License][license-shield]][license-url]
[![Issues][issues-shield]][issues-url]
</div>
<!-- markdownlint-restore -->
![](https://github.com/nix-community/kickstart-nix.nvim/assets/12857160/84faa268-82de-4401-acf3-efddc26dd58a)
## :grey_question: Why kickstart-nix.nvim
If Nix and Neovim have one thing in common,
it's that many new users don't know where to get started.
Most Nix-based Neovim setups assume deep expertise in both realms,
abstracting away Neovim's core functionalities
as well as the Nix internals used to build a Neovim config.
Frameworks and module-based DSLs are opinionated and difficult to diverge from
with one's own modifications.
`kickstart-nix.nvim` is different:
It's geared for users of all levels,
making the migration of Neovim configurations to Nix straightforward.
This project aims to be as simple as possible, while allowing
for maximum flexibility.
> [!NOTE]
>
> Similar to [`kickstart.nvim`](https://github.com/nvim-lua/kickstart.nvim),
> this repository is meant to be used by **you** to begin your
> **Nix**/Neovim journey; remove the things you don't use and add what you miss.
## :milky_way: Philosophy
- KISS principle with sane defaults.
- Manage plugins + external dependencies using Nix
(managing plugins shouldn't be the responsibility of a plugin).
- Configuration entirely in Lua[^1] (Vimscript is also possible).
This makes it easy to migrate from non-nix dotfiles.
- Use Neovim's built-in loading mechanisms. See:
- [`:h initialization`](https://neovim.io/doc/user/starting.html#initialization)
- [`:h runtimepath`](https://neovim.io/doc/user/options.html#'runtimepath')
- [`:h packadd`](https://neovim.io/doc/user/repeat.html#%3Apackadd)
- Use Neovim's built-in LSP client, with Nix managing language servers.
[^1]: The absence of a Nix module DSL for Neovim configuration is deliberate.
If you were to copy the `nvim` directory to `$XDG_CONFIG_HOME`,
and install the plugins, it would work out of the box.
## :star2: Features
- Use either nixpkgs or flake inputs as plugin sources.
- Usable on any device with Neovim and Nix installed.
- Create multiple derivations with different sets of plugins,
and simple regex filters to exclude config files.
- Uses Nix to generate a `.luarc.json` in the devShell's `shellHook`.
This sets up lua-language-server to recognize all plugins
and the Neovim API.
## :bicyclist: Test drive
If you have Nix installed (with [flakes](https://wiki.nixos.org/wiki/Flakes) enabled),
you can test drive this by running:
```console
nix run "github:nix-community/kickstart-nix.nvim"
```
## :books: Usage
1. Click on [Use this template](https://github.com/nix-community/kickstart-nix.nvim/generate)
to start a repo based on this template. **Do _not_ fork it**.
1. Add/remove plugins to/from the [Neovim overlay](./nix/neovim-overlay.nix).
1. Add/remove plugin configs to/from the `nvim/plugin` directory.
1. Modify as you wish (you will probably want to add a color theme, ...).
See: [Design](#robot-design).
1. You can create more than one package using the `mkNeovim` function by
- Passing different plugin lists.
- Adding `ignoreConfigRegexes` (e.g. `= [ "^ftplugin/.*.lua" ]`).
> [!TIP]
>
> The nix and lua files contain comments explaining
> what everything does in detail.
## :zap: Installation
### :snowflake: NixOS (with flakes)
1. Add your flake to you NixOS flake inputs.
1. Add the overlay provided by this flake.
```nix
nixpkgs.overlays = [
# replace <kickstart-nix-nvim> with the name you chose
<kickstart-nix-nvim>.overlays.default
];
```
You can then add the overlay's output(s) to the `systemPackages`:
```nix
environment.systemPackages = with pkgs; [
nvim-pkg # The default package added by the overlay
];
```
> [!IMPORTANT]
>
> This flake uses `nixpkgs.wrapNeovimUnstable`, which has an
> unstable signature. If you set `nixpkgs.follows = "nixpkgs";`
> when importing this into your flake.nix, it may break.
> Especially if your nixpkgs input pins a different branch.
### :penguin: Non-NixOS
With Nix installed (flakes enabled), from the repo root:
```console
nix profile install .#nvim
```
## :robot: Design
Directory structure:
```sh
── flake.nix
── nvim # Neovim configs (lua), equivalent to ~/.config/nvim
── nix # Nix configs
```
### :open_file_folder: Neovim configs
- Set options in `init.lua`.
- Source autocommands, user commands, keymaps,
and configure plugins in individual files within the `plugin` directory.
- Filetype-specific scripts (e.g. start LSP clients) in the `ftplugin` directory.
- Library modules in the `lua/user` directory.
Directory structure:
```sh
── nvim
├── ftplugin # Sourced when opening a file type
│ └── <filetype>.lua
├── init.lua # Always sourced
├── lua # Shared library modules
│ └── user
│ └── <lib>.lua
├── plugin # Automatically sourced at startup
│ ├── autocommands.lua
│ ├── commands.lua
│ ├── keymaps.lua
│ ├── plugins.lua # Plugins that require a `setup` call
│ └── <plugin-config>.lua # Plugin configurations
└── after # Empty in this template
├── plugin # Sourced at the very end of startup (rarely needed)
└── ftplugin # Sourced when opening a filetype, after sourcing ftplugin scripts
```
> [!IMPORTANT]
>
> - Configuration variables (e.g. `vim.g.<plugin_config>`) should go in `nvim/init.lua`
> or a module that is `require`d in `init.lua`.
> - Configurations for plugins that require explicit initialization
> (e.g. via a call to a `setup()` function) should go in `nvim/plugin/<plugin>.lua`
> or `nvim/plugin/plugins.lua`.
> - See [Initialization order](#initialization-order) for details.
### :open_file_folder: Nix
You can declare Neovim derivations in `nix/neovim-overlay.nix`.
There are two ways to add plugins:
- The traditional way, using `nixpkgs` as the source.
- By adding plugins as flake inputs (if you like living on the bleeding-edge).
Plugins added as flake inputs must be built in `nix/plugin-overlay.nix`.
Directory structure:
```sh
── flake.nix
── nix
├── mkNeovim.nix # Function for creating the Neovim derivation
└── neovim-overlay.nix # Overlay that adds Neovim derivation
```
### :mag: Initialization order
This derivation creates an `init.lua` as follows:
1. Add `nvim/lua` to the `runtimepath`.
1. Add the content of `nvim/init.lua`.
1. Add `nvim/*` to the `runtimepath`.
1. Add `nvim/after` to the `runtimepath`.
This means that modules in `nvim/lua` can be `require`d in `init.lua` and `nvim/*/*.lua`.
Modules in `nvim/plugin/` are sourced automatically, as if they were plugins.
Because they are added to the runtime path at the end of the resulting `init.lua`,
Neovim sources them _after_ loading plugins.
## :electric_plug: Pre-configured plugins
This configuration comes with [a few plugins pre-configured](./nix/neovim-overlay.nix).
You can add or remove plugins by
- Adding/Removing them in the [Nix list](./nix/neovim-overlay.nix).
- Adding/Removing the config in `nvim/plugin/<plugin>.lua`.
## :anchor: Syncing updates
If you have used this template and would like to fetch updates
that were added later...
Add this template as a remote:
```console
git remote add upstream git@github.com:nix-community/kickstart-nix.nvim.git
```
Fetch and merge changes:
```console
git fetch upstream
git merge upstream/main --allow-unrelated-histories
```
## :pencil: Editing your config
When your neovim setup is a nix derivation, editing your config
demands a different workflow than you are used to without nix.
Here is how I usually do it:
- Perform modifications and stage any new files[^2].
- Run `nix run /path/to/neovim/#nvim`
or `nix run /path/to/neovim/#nvim -- <nvim-args>`
[^2]: When adding new files, nix flakes won't pick them up unless they
have been committed or staged.
This requires a rebuild of the `nvim` derivation, but has the advantage
that if anything breaks, it's only broken during your test run.
If you want an impure, but faster feedback loop,
you can use `$XDG_CONFIG_HOME/$NVIM_APPNAME`[^3], where `$NVIM_APPNAME`
defaults to `nvim` if the `appName` attribute is not set
in the `mkNeovim` function.
[^3]: Assuming Linux. Refer to `:h initialization` for Darwin.
This has one caveat: The wrapper which nix generates for the derivation
calls `nvim` with `-u /nix/store/path/to/generated-init.lua`.
So it won't source a local `init.lua` file.
To work around this, you can put scripts in the `plugin` or `after/plugin` directory.
> [!TIP]
>
> If you are starting out, and want to test things without having to
> stage or commit new files for changes to take effect,
> you can remove the `.git` directory and re-initialize it (`git init`)
> when you are done.
## :link: Alternative / similar projects
- [`kickstart.nvim`](https://github.com/nvim-lua/kickstart.nvim):
Single-file Neovim configuration template with a similar philosophy to this project.
Does not use Nix to manage plugins.
- [`neovim-flake`](https://github.com/jordanisaacs/neovim-flake):
Configured using a Nix module DSL.
- [`NixVim`](https://github.com/nix-community/nixvim):
A module system for Neovim, with a focus on plugin configs.
- [`nixCats-nvim`](https://github.com/BirdeeHub/nixCats-nvim):
A project that organises plugins into categories.
It also separates lua and nix configuration.
- [`lz.n`](https://github.com/nvim-neorocks/lz.n):
A plugin-manager agnostic Lua library for lazy-loading plugins.
Can be used with Nix.
> [!NOTE]
>
> When comparing with projects in the "non-Nix world", this
> repository would be more comparable to `kickstart.nvim` (hence the name),
> while the philosophies of `neovim-flake` and `NixVim` are more in line with
> a Neovim distribution like [`LunarVim`](https://www.lunarvim.org/)
> or [`LazyVim`](https://www.lazyvim.org/)
> (though they are far more minimal by default).
<!-- MARKDOWN LINKS & IMAGES -->
[neovim-shield]: https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white
[neovim-url]: https://neovim.io/
[nix-shield]: https://img.shields.io/badge/nix-0175C2?style=for-the-badge&logo=NixOS&logoColor=white
[nix-url]: https://nixos.org/
[lua-shield]: https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge&logo=lua&logoColor=white
[lua-url]: https://www.lua.org/
[license-shield]: https://img.shields.io/github/license/nix-community/kickstart-nix.nvim.svg?style=for-the-badge
[license-url]: https://github.com/nix-community/kickstart-nix.nvim/blob/master/LICENSE
[issues-shield]: https://img.shields.io/github/issues/nix-community/kickstart-nix.nvim.svg?style=for-the-badge
[issues-url]: https://github.com/nix-community/kickstart-nix.nvim/issues
[license-shield]: https://img.shields.io/github/license/nix-community/kickstart-nix.nvim.svg?style=for-the-badge
[license-url]: https://github.com/nix-community/kickstart-nix.nvim/blob/master/LICENSE
see the [kickstart-nvim template](../kickstart-nvim) for more info on the lazy wrapper or other utilities used.

View file

@ -1,22 +1,6 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
@ -32,7 +16,7 @@
"type": "github"
}
},
"flake-compat_3": {
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
@ -50,14 +34,17 @@
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
"nixpkgs-lib": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1717285511,
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github"
},
"original": {
@ -69,38 +56,17 @@
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1736143030,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly",
"neovim-nightly-overlay",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github"
},
"original": {
@ -108,84 +74,21 @@
"type": "indirect"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gen-luarc": {
"inputs": {
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"luvit-meta": "luvit-meta",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1735608918,
"narHash": "sha256-/TAukZv6LiqIrA/7mq1fxP5pb3Iavik7BTYqrnLO/JE=",
"ref": "refs/heads/main",
"rev": "24c726151769c2f2ee493ce45c8027860ddbcbcd",
"revCount": 21,
"type": "git",
"url": "https://codewith.babesonthe.net/punkfairie/nix-gen-luarc-json.git"
},
"original": {
"type": "git",
"url": "https://codewith.babesonthe.net/punkfairie/nix-gen-luarc-json.git"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"gen-luarc",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1723803910,
"narHash": "sha256-yezvUuFiEnCFbGuwj/bQcqg7RykIEqudOy/RBrId0pc=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "bfef0ada09e2c8ac55bbcd0831bd0c9d42e651ba",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"git-hooks_2": {
"inputs": {
"flake-compat": "flake-compat_3",
"gitignore": "gitignore_2",
"nixpkgs": [
"neovim-nightly",
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735882644,
"narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=",
"lastModified": 1737465171,
"narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
"rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17",
"type": "github"
},
"original": {
@ -197,29 +100,7 @@
"gitignore": {
"inputs": {
"nixpkgs": [
"gen-luarc",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"neovim-nightly",
"neovim-nightly-overlay",
"git-hooks",
"nixpkgs"
]
@ -240,18 +121,18 @@
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_3",
"flake-parts": "flake-parts_2",
"nixpkgs": [
"neovim-nightly",
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735695978,
"narHash": "sha256-cwk53OX1S1bCFY09zydubZNmmwcx9l5XEba8mVYuNE4=",
"lastModified": 1739595404,
"narHash": "sha256-0CjCfbq0yHWexOrpO06e2WU1r5JAqR6ffy1zgM3NksI=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "f6233b5cfbada692d93a73d6ed35bdbfd0fdb9c4",
"rev": "06519cec8fb32d219006da6eacd255504a9996af",
"type": "github"
},
"original": {
@ -260,56 +141,22 @@
"type": "github"
}
},
"luvit-meta": {
"flake": false,
"locked": {
"lastModified": 1705776742,
"narHash": "sha256-zAAptV/oLuLAAsa2zSB/6fxlElk4+jNZd/cPr9oxFig=",
"owner": "Bilal2453",
"repo": "luvit-meta",
"rev": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60",
"type": "github"
},
"original": {
"owner": "Bilal2453",
"repo": "luvit-meta",
"type": "github"
}
},
"neotab-nvim": {
"flake": false,
"locked": {
"lastModified": 1733176083,
"narHash": "sha256-5IJQwZxDGDMM6KBWKU/EZwa5wciHeTXOZgHPCRmlxJk=",
"owner": "kawre",
"repo": "neotab.nvim",
"rev": "f6ed1ef49f32586f5db95edae5d6f264c8180d85",
"type": "github"
},
"original": {
"owner": "kawre",
"repo": "neotab.nvim",
"type": "github"
}
},
"neovim-nightly": {
"neovim-nightly-overlay": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks_2",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs": "nixpkgs",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1736753650,
"narHash": "sha256-qSbPnZ2utGL39UD6lKi+K/7sWyZVl/kGZfOoy+xJEjA=",
"lastModified": 1740790052,
"narHash": "sha256-hF7yeQ+ljZeHdybfemarAVjABCWb5SUtWgyhEgIzUVc=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "9e2c41b7c12adc3ca17b1b50589f5234bcc0bbac",
"rev": "06c050aa63007593fec78c38d37f75e28fe3f740",
"type": "github"
},
"original": {
@ -321,11 +168,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1736752727,
"narHash": "sha256-sFD18EfXyQrN51ru6uzCt20C3DT4qBipJ1PbP9hnw80=",
"lastModified": 1740786347,
"narHash": "sha256-yY6ipjD1eMUtOK69ZrBH3JCxrmKlLAxWf+DgYUpqwgE=",
"owner": "neovim",
"repo": "neovim",
"rev": "2c16c849986794682a4776ff4ec100d00eeba5ca",
"rev": "45d7aa3301d436aef3cf5d88db8d0da145f9b70c",
"type": "github"
},
"original": {
@ -334,83 +181,54 @@
"type": "github"
}
},
"nerdy-nvim": {
"flake": false,
"nixCats": {
"locked": {
"lastModified": 1733092208,
"narHash": "sha256-ALghRgNavAeGZk0+JbSdjSkTvtDgzD8zAguCl00R0yw=",
"owner": "2kabhishek",
"repo": "nerdy.nvim",
"rev": "719ed52244b34ea9de08f074e0d22fd67d615640",
"lastModified": 1740837766,
"narHash": "sha256-LKeBL3gjm+Fg2yVDKqB2gIiVnccv4TSUtt5NmQcasrk=",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"rev": "83264cfaf7d7438c52db28a95934d87ae45faaae",
"type": "github"
},
"original": {
"owner": "2kabhishek",
"repo": "nerdy.nvim",
"owner": "BirdeeHub",
"repo": "nixCats-nvim",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1718714799,
"narHash": "sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1717284937,
"narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1720386169,
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
"lastModified": 1740547748,
"narHash": "sha256-Ly2fBL1LscV+KyCqPRufUBuiw+zmWrlJzpWOWbahplg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
"rev": "3a05eebede89661660945da1f151959900903b6a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1736701207,
"narHash": "sha256-jG/+MvjVY7SlTakzZ2fJ5dC3V1PrKKrUEOEE30jrOKA=",
"owner": "NixOS",
"lastModified": 1740791350,
"narHash": "sha256-igS2Z4tVw5W/x3lCZeeadt0vcU9fxtetZ/RyrqsCRQ0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ed4a395ea001367c1f13d34b1e01aa10290f67d6",
"rev": "199169a2135e6b864a888e89a2ace345703c025d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nvim-emmet": {
"plugins-nvim-emmet": {
"flake": false,
"locked": {
"lastModified": 1717158539,
@ -428,43 +246,25 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"gen-luarc": "gen-luarc",
"neotab-nvim": "neotab-nvim",
"neovim-nightly": "neovim-nightly",
"nerdy-nvim": "nerdy-nvim",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nixCats": "nixCats",
"nixpkgs": "nixpkgs_2",
"nvim-emmet": "nvim-emmet"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
"plugins-nvim-emmet": "plugins-nvim-emmet"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"neovim-nightly",
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1736154270,
"narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=",
"lastModified": 1739829690,
"narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b",
"rev": "3d0579f5cc93436052d94b73925b48973a104204",
"type": "github"
},
"original": {

428
flake.nix
View file

@ -1,89 +1,385 @@
# Copyright (c) 2023 BirdeeHub
# Licensed under the MIT license
{
description = "Neovim derivation";
description = "A Lua-natic's neovim flake, with extra cats! nixCats!";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
gen-luarc.url = "git+https://codewith.babesonthe.net/punkfairie/nix-gen-luarc-json.git";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixCats.url = "github:BirdeeHub/nixCats-nvim";
neovim-nightly = {
neovim-nightly-overlay = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
neotab-nvim = {
url = "github:kawre/neotab.nvim";
flake = false;
};
nerdy-nvim = {
url = "github:2kabhishek/nerdy.nvim";
flake = false;
};
nvim-emmet = {
"plugins-nvim-emmet" = {
url = "github:olrtg/nvim-emmet";
flake = false;
};
# nixd.url = "github:nix-community/nixd";
# see :help nixCats.flake.inputs
# If you want your plugin to be loaded by the standard overlay,
# i.e. if it wasnt on nixpkgs, but doesnt have an extra build step.
# Then you should name it "plugins-something"
# If you wish to define a custom build step not handled by nixpkgs,
# then you should name it in a different format, and deal with that in the
# overlay defined for custom builds in the overlays directory.
# for specific tags, branches and commits, see:
# https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#examples
};
outputs = inputs @ {
# see :help nixCats.flake.outputs
outputs = {
self,
nixpkgs,
flake-utils,
gen-luarc,
nixCats,
...
}: let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
} @ inputs: let
inherit (nixCats) utils;
luaPath = "${./.}";
forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
# the following extra_pkg_config contains any values
# which you want to pass to the config set of nixpkgs
# import nixpkgs { config = extra_pkg_config; inherit system; }
# will not apply to module imports
# as that will have your system values
extra_pkg_config = {
# allowUnfree = true;
};
# management of the system variable is one of the harder parts of using flakes.
# This is where the Neovim derivation is built.
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
# so I have done it here in an interesting way to keep it out of the way.
# It gets resolved within the builder itself, and then passed to your
# categoryDefinitions and packageDefinitions.
# this allows you to use ${pkgs.system} whenever you want in those sections
# without fear.
# sometimes our overlays require a ${system} to access the overlay.
# Your dependencyOverlays can either be lists
# in a set of ${system}, or simply a list.
# the nixCats builder function will accept either.
# see :help nixCats.flake.outputs.overlays
dependencyOverlays =
/*
(import ./overlays inputs) ++
*/
[
# This overlay grabs all the inputs named in the format
# `plugins-<pluginName>`
# Once we add this overlay to our nixpkgs, we are able to
# use `pkgs.neovimPlugins`, which is a set of our plugins.
(utils.standardPluginOverlay inputs)
# add any other flake overlays here.
# when other people mess up their overlays by wrapping them with system,
# you may instead call this function on their overlay.
# it will check if it has the system in the set, and if so return the desired overlay
# (utils.fixSystemizedOverlay inputs.codeium.overlays
# (system: inputs.codeium.overlays.${system}.default)
# )
];
# see :help nixCats.flake.outputs.categories
# and
# :help nixCats.flake.outputs.categoryDefinitions.scheme
categoryDefinitions = {
pkgs,
settings,
categories,
extra,
name,
mkNvimPlugin,
...
} @ packageDef: {
# to define and use a new category, simply add a new list to a set here,
# and later, you will include categoryname = true; in the set you
# provide when you build the package using this builder function.
# see :help nixCats.flake.outputs.packageDefinitions for info on that section.
# lspsAndRuntimeDeps:
# this section is for dependencies that should be available
# at RUN TIME for plugins. Will be available to PATH within neovim terminal
# this includes LSPs
lspsAndRuntimeDeps = with pkgs; {
general = [
universal-ctags
curl
lazygit
ripgrep
fd
stdenv.cc.cc
lua-language-server
nil # I would go for nixd but lazy chooses this one idk
stylua
];
};
# NOTE: lazy doesnt care if these are in startupPlugins or optionalPlugins
# also you dont have to download everything via nix if you dont want.
# but you have the option, and that is demonstrated here.
startupPlugins = with pkgs.vimPlugins; with pkgs.neovimPlugins; {
general = [
# LazyVim
lazy-nvim
LazyVim
# Coding
{
plugin = mini-pairs;
name = "mini.pairs";
}
ts-comments-nvim
{
plugin = mini-ai;
name = "mini.ai";
}
lazydev-nvim
# Colorscheme
tokyonight-nvim
{
plugin = catppuccin-nvim;
name = "catppuccin";
}
# Editor
grug-far-nvim
flash-nvim
which-key-nvim
gitsigns-nvim
trouble-nvim
todo-comments-nvim
# Formatting
conform-nvim
# Linting
nvim-lint
# LSP
nvim-lspconfig
# Treesitter
nvim-treesitter.withAllGrammars
nvim-treesitter-textobjects
nvim-ts-autotag
# UI
bufferline-nvim
lualine-nvim
noice-nvim
{
plugin = mini-icons;
name = "mini.icons";
}
nui-nvim
# Util
snacks-nvim
persistence-nvim
plenary-nvim
# Extras
# Coding
# Blink
blink-cmp
friendly-snippets
# Luasnip
{
plugin = luasnip;
name = "LuaSnip";
}
# Custom
rose-pine
diffview-nvim
nvim-emmet
treesj
vim-caddyfile
];
};
# not loaded automatically at startup.
# use with packadd and an autocommand in config to achieve lazy loading
# NOTE: this template is using lazy.nvim so, which list you put them in is irrelevant.
# startupPlugins or optionalPlugins, it doesnt matter, lazy.nvim does the loading.
# I just put them all in startupPlugins. I could have put them all in here instead.
optionalPlugins = {};
# shared libraries to be added to LD_LIBRARY_PATH
# variable available to nvim runtime
sharedLibraries = {
general = with pkgs; [
# libgit2
];
};
# environmentVariables:
# this section is for environmentVariables that should be available
# at RUN TIME for plugins. Will be available to path within neovim terminal
environmentVariables = {
test = {
CATTESTVAR = "It worked!";
};
};
# If you know what these are, you can provide custom ones by category here.
# If you dont, check this link out:
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh
extraWrapperArgs = {
test = [
''--set CATTESTVAR2 "It worked again!"''
];
};
# lists of the functions you would have passed to
# python.withPackages or lua.withPackages
# get the path to this python environment
# in your lua config via
# vim.g.python3_host_prog
# or run from nvim terminal via :!<packagename>-python3
extraPython3Packages = {
test = [(_: [])];
};
# populates $LUA_PATH and $LUA_CPATH
extraLuaPackages = {
test = [(_: [])];
};
};
# And then build a package with specific categories from above here:
# All categories you wish to include must be marked true,
# but false may be omitted.
# This entire set is also passed to nixCats for querying within the lua.
# see :help nixCats.flake.outputs.packageDefinitions
packageDefinitions = {
# These are the names of your packages
# you can include as many as you wish.
nvim = {
pkgs,
mkNvimPlugin,
...
}: {
# they contain a settings set defined above
# see :help nixCats.flake.outputs.settings
settings = {
wrapRc = true;
# IMPORTANT:
# your alias may not conflict with your other packages.
# aliases = [ "vim" ];
neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
};
# and a set of categories that you want
# (and other information to pass to lua)
categories = {
general = true;
test = false;
};
extra = {};
};
# an extra test package with normal lua reload for fast edits
# nix doesnt provide the config in this package, allowing you free reign to edit it.
# then you can swap back to the normal pure package when done.
testnvim = {
pkgs,
mkNvimPlugin,
...
}: {
settings = {
wrapRc = false;
unwrappedCfgPath = "/absolute/path/to/config";
};
categories = {
general = true;
test = false;
};
extra = {};
};
};
# In this section, the main thing you will need to do is change the default package name
# to the name of the packageDefinitions entry you wish to use as the default.
defaultPackageName = "nvim";
in
flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
# Import the overlay, so that the final Neovim derivation(s) can be accessed via pkgs.<nvim-pkg>
neovim-overlay
# This adds a function can be used to generate a .luarc.json
# containing the Neovim API all plugins in the workspace directory.
# The generated file can be symlinked in the devShell's shellHook.
gen-luarc.overlays.default
];
};
shell = pkgs.mkShell {
name = "nvim-devShell";
buildInputs = with pkgs; [
fish
just
];
shellHook = ''
# symlink the .luarc.json generated in the overlay
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
# use fish
exec fish
'';
};
# see :help nixCats.flake.outputs.exports
forEachSystem (system: let
# the builder function that makes it all work
nixCatsBuilder =
utils.baseBuilder luaPath {
inherit nixpkgs system dependencyOverlays extra_pkg_config;
}
categoryDefinitions
packageDefinitions;
defaultPackage = nixCatsBuilder defaultPackageName;
# this is just for using utils such as pkgs.mkShell
# The one used to build neovim is resolved inside the builder
# and is passed to our categoryDefinitions and packageDefinitions
pkgs = import nixpkgs {inherit system;};
in {
packages = rec {
default = nvim;
nvim = pkgs.nvim-pkg;
};
# these outputs will be wrapped with ${system} by utils.eachSystem
# this will make a package out of each of the packageDefinitions defined above
# and set the default package to the one passed in here.
packages = utils.mkAllWithDefault defaultPackage;
# choose your package for devShell
# and add whatever else you want in it.
devShells = {
default = shell;
default = pkgs.mkShell {
name = defaultPackageName;
packages = [defaultPackage];
inputsFrom = [];
shellHook = ''
'';
};
};
})
// {
# You can add this overlay to your NixOS configuration
overlays.default = neovim-overlay;
};
// (let
# we also export a nixos module to allow reconfiguration from configuration.nix
nixosModule = utils.mkNixosModules {
moduleNamespace = [defaultPackageName];
inherit
defaultPackageName
dependencyOverlays
luaPath
categoryDefinitions
packageDefinitions
extra_pkg_config
nixpkgs
;
};
# and the same for home manager
homeModule = utils.mkHomeModules {
moduleNamespace = [defaultPackageName];
inherit
defaultPackageName
dependencyOverlays
luaPath
categoryDefinitions
packageDefinitions
extra_pkg_config
nixpkgs
;
};
in {
# these outputs will be NOT wrapped with ${system}
# this will make an overlay out of each of the packageDefinitions defined above
# and set the default overlay to the one named here.
overlays =
utils.makeOverlays luaPath {
inherit nixpkgs dependencyOverlays extra_pkg_config;
}
categoryDefinitions
packageDefinitions
defaultPackageName;
nixosModules.default = nixosModule;
homeModules.default = homeModule;
inherit utils nixosModule homeModule;
inherit (utils) templates;
});
}

55
init.lua Normal file
View file

@ -0,0 +1,55 @@
-- NOTE: this just gives nixCats global command a default value
-- so that it doesnt throw an error if you didnt install via nix.
-- usage of both this setup and the nixCats command is optional,
-- but it is very useful for passing info from nix to lua so you will likely use it at least once.
require('nixCatsUtils').setup {
non_nix_value = true,
}
-- NOTE: You might want to move the lazy-lock.json file
local function getlockfilepath()
if require('nixCatsUtils').isNixCats and type(nixCats.settings.unwrappedCfgPath) == 'string' then
return nixCats.settings.unwrappedCfgPath .. '/lazy-lock.json'
else
return vim.fn.stdpath 'config' .. '/lazy-lock.json'
end
end
local lazyOptions = {
lockfile = getlockfilepath(),
install = {
missing = false,
},
}
-- NOTE: this the lazy wrapper. Use it like require('lazy').setup() but with an extra
-- argument, the path to lazy.nvim as downloaded by nix, or nil, before the normal arguments.
require('nixCatsUtils.lazyCat').setup(nixCats.pawsible { 'allPlugins', 'start', 'lazy.nvim' }, {
{ 'LazyVim/LazyVim', import = 'lazyvim.plugins' },
-- disable mason.nvim while using nix
-- precompiled binaries do not agree with nixos, and we can just make nix install this stuff for us.
{ 'williamboman/mason-lspconfig.nvim', enabled = require('nixCatsUtils').lazyAdd(true, false) },
{ 'williamboman/mason.nvim', enabled = require('nixCatsUtils').lazyAdd(true, false) },
{
'nvim-treesitter/nvim-treesitter',
build = require('nixCatsUtils').lazyAdd ':TSUpdate',
opts_extend = require('nixCatsUtils').lazyAdd(nil, false),
opts = {
-- nix already ensured they were installed, and we would need to change the parser_install_dir if we wanted to use it instead.
-- so we just disable install and do it via nix.
ensure_installed = require('nixCatsUtils').lazyAdd({ 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, false),
auto_install = require('nixCatsUtils').lazyAdd(true, false),
},
},
{
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- adds type hints for nixCats global, but LazyDev is just nice in general
{ path = (nixCats.nixCatsPath or '') .. '/lua', words = { 'nixCats' } },
},
},
},
-- import/override with your plugins
{ import = 'plugins' },
}, lazyOptions)

10
lua/config/autocmds.lua Normal file
View file

@ -0,0 +1,10 @@
-- Open help window in a vsplit to the right.
vim.api.nvim_create_autocmd('BufWinEnter', {
group = vim.api.nvim_create_augroup('help_window_right', {}),
pattern = { '*.txt' },
callback = function()
if vim.o.filetype == 'help' then
vim.cmd.wincmd 'L'
end
end,
})

2
lua/config/options.lua Normal file
View file

@ -0,0 +1,2 @@
vim.o.textwidth = 80
vim.o.colorcolumn = '+1'

129
lua/nixCatsUtils/init.lua Normal file
View file

@ -0,0 +1,129 @@
--[[
This directory is the luaUtils template.
You can choose what things from it that you would like to use.
And then delete the rest.
Everything in this directory is optional.
--]]
local M = {}
--[[
This file is for making your config still work WITHOUT nixCats.
When you don't use nixCats to load your config,
you wont have the nixCats plugin.
The setup function defined here defines a mock nixCats plugin when nixCats wasnt used to load the config.
This will help avoid indexing errors when the nixCats plugin doesnt exist.
NOTE: If you only ever use nixCats to load your config, you don't need this file.
--]]
---@type boolean
M.isNixCats = vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] ~= nil
---@class nixCatsSetupOpts
---@field non_nix_value boolean|nil
---This function will setup a mock nixCats plugin when not using nix
---It will help prevent you from running into indexing errors without a nixCats plugin from nix.
---If you loaded the config via nix, it does nothing
---non_nix_value defaults to true if not provided or is not a boolean.
---@param v nixCatsSetupOpts
function M.setup(v)
if not M.isNixCats then
local nixCats_default_value
if type(v) == "table" and type(v.non_nix_value) == "boolean" then
nixCats_default_value = v.non_nix_value
else
nixCats_default_value = true
end
local mk_with_meta = function (tbl)
return setmetatable(tbl, {
__call = function(_, attrpath)
local strtable = {}
if type(attrpath) == "table" then
strtable = attrpath
elseif type(attrpath) == "string" then
for key in attrpath:gmatch("([^%.]+)") do
table.insert(strtable, key)
end
else
print("function requires a table of strings or a dot separated string")
return
end
return vim.tbl_get(tbl, unpack(strtable));
end
})
end
package.preload['nixCats'] = function ()
local ncsub = {
get = function(_) return nixCats_default_value end,
cats = mk_with_meta({
nixCats_config_location = vim.fn.stdpath('config'),
wrapRc = false,
}),
settings = mk_with_meta({
nixCats_config_location = vim.fn.stdpath('config'),
configDirName = os.getenv("NVIM_APPNAME") or "nvim",
wrapRc = false,
}),
petShop = mk_with_meta({}),
extra = mk_with_meta({}),
pawsible = mk_with_meta({
allPlugins = {
start = {},
opt = {},
},
}),
configDir = vim.fn.stdpath('config'),
packageBinPath = os.getenv('NVIM_WRAPPER_PATH_NIX') or vim.v.progpath
}
return setmetatable(ncsub, {__call = function(_, cat) return ncsub.get(cat) end})
end
_G.nixCats = require('nixCats')
end
end
---allows you to guarantee a boolean is returned, and also declare a different
---default value than specified in setup when not using nix to load the config
---@overload fun(v: string|string[]): boolean
---@overload fun(v: string|string[], default: boolean): boolean
function M.enableForCategory(v, default)
if M.isNixCats or default == nil then
if nixCats(v) then
return true
else
return false
end
else
return default
end
end
---if nix, return value of nixCats(v) else return default
---Exists to specify a different non_nix_value than the one in setup()
---@param v string|string[]
---@param default any
---@return any
function M.getCatOrDefault(v, default)
if M.isNixCats then
return nixCats(v)
else
return default
end
end
---for conditionally disabling build steps on nix, as they are done via nix
---I should probably have named it dontAddIfCats or something.
---@overload fun(v: any): any|nil
---Will return the second value if nix, otherwise the first
---@overload fun(v: any, o: any): any
function M.lazyAdd(v, o)
if M.isNixCats then
return o
else
return v
end
end
return M

View file

@ -0,0 +1,119 @@
--[[
This directory is the luaUtils template.
You can choose what things from it that you would like to use.
And then delete the rest.
Everything in this directory is optional.
--]]
local M = {}
-- NOTE: If you don't use lazy.nvim, you don't need this file.
---lazy.nvim wrapper
---@overload fun(nixLazyPath: string|nil, lazySpec: any, opts: table)
---@overload fun(nixLazyPath: string|nil, opts: table)
function M.setup(nixLazyPath, lazySpec, opts)
local lazySpecs = nil
local lazyCFG = nil
if opts == nil and type(lazySpec) == "table" and lazySpec.spec then
lazyCFG = lazySpec
else
lazySpecs = lazySpec
lazyCFG = opts
end
local function regularLazyDownload()
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
return lazypath
end
local isNixCats = vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] ~= nil
local lazypath
if not isNixCats then
-- No nixCats? Not nix. Do it normally
lazypath = regularLazyDownload()
vim.opt.rtp:prepend(lazypath)
else
local nixCats = require('nixCats')
-- Else, its nix, so we wrap lazy with a few extra config options
lazypath = nixLazyPath
-- and also we probably dont have to download lazy either
if lazypath == nil then
lazypath = regularLazyDownload()
end
local oldPath
local lazypatterns
local fallback
if type(lazyCFG) == "table" and type(lazyCFG.dev) == "table" then
lazypatterns = lazyCFG.dev.patterns
fallback = lazyCFG.dev.fallback
oldPath = lazyCFG.dev.path
end
local myNeovimPackages = nixCats.vimPackDir .. "/pack/myNeovimPackages"
local newLazyOpts = {
performance = {
rtp = {
reset = false,
},
},
dev = {
path = function(plugin)
local path = nil
if type(oldPath) == "string" and vim.fn.isdirectory(oldPath .. "/" .. plugin.name) == 1 then
path = oldPath .. "/" .. plugin.name
elseif type(oldPath) == "function" then
path = oldPath(plugin)
if type(path) ~= "string" then
path = nil
end
end
if path == nil then
if vim.fn.isdirectory(myNeovimPackages .. "/start/" .. plugin.name) == 1 then
path = myNeovimPackages .. "/start/" .. plugin.name
elseif vim.fn.isdirectory(myNeovimPackages .. "/opt/" .. plugin.name) == 1 then
path = myNeovimPackages .. "/opt/" .. plugin.name
else
path = "~/projects/" .. plugin.name
end
end
return path
end,
patterns = lazypatterns or { "" },
fallback = fallback == nil and true or fallback,
}
}
lazyCFG = vim.tbl_deep_extend("force", lazyCFG or {}, newLazyOpts)
-- do the reset we disabled without removing important stuff
local cfgdir = nixCats.configDir
vim.opt.rtp = {
cfgdir,
nixCats.nixCatsPath,
nixCats.pawsible.allPlugins.ts_grammar_path,
vim.fn.stdpath("data") .. "/site",
lazypath,
vim.env.VIMRUNTIME,
vim.fn.fnamemodify(vim.v.progpath, ":p:h:h") .. "/lib/nvim",
cfgdir .. "/after",
}
end
if lazySpecs then
require('lazy').setup(lazySpecs, lazyCFG)
else
require('lazy').setup(lazyCFG)
end
end
return M

6
lua/plugins/diffview.lua Normal file
View file

@ -0,0 +1,6 @@
return {
{
'sindrets/diffview.nvim',
config = true,
},
}

View file

@ -0,0 +1,9 @@
return {
{
'nvim-emmet',
keys = {
{ '<LEADER>xe', mode = { 'n', 'v' }, require('nvim-emmet').wrap_with_abbreviation, desc = 'Wrap with Emmet abbr' },
},
ft = { 'html', 'css', 'scss', 'vue', 'blade' },
},
}

26
lua/plugins/rose-pine.lua Normal file
View file

@ -0,0 +1,26 @@
return {
{
'rose-pine/neovim',
name = 'rose-pine',
},
{
'LazyVim/LazyVim',
opts = {
colorscheme = 'rose-pine',
},
},
{
'akinsho/bufferline.nvim',
optional = true,
opts = {
highlights = require 'rose-pine.plugins.bufferline',
},
},
{
'nvim-lualine/lualine.nvim',
optional = true,
opts = function(_, opts)
table.insert(opts.options, { theme = 'rose-pine' })
end,
},
}

10
lua/plugins/treesj.lua Normal file
View file

@ -0,0 +1,10 @@
return {
{
'Wansmer/treesj',
keys = { '<SPACE>m', '<SPACE>j', '<SPACE>s' },
dependencies = { 'nvim-treesitter/nvim-treesitter' },
opts = {
max_join_length = vim.o.textwidth,
},
},
}

View file

@ -0,0 +1,5 @@
return {
{
'isobit/vim-caddyfile',
},
}

View file

@ -1,219 +0,0 @@
# Function for creating a Neovim derivation
{
pkgs,
lib,
stdenv,
#
# Set by the overlay to ensure we use a compatible version of `wrapNeovimUnstable`
pkgs-wrapNeovim ? pkgs,
}:
with lib;
{
# NVIM_APPNAME - Defaults to 'nvim' if not set.
# If set to something else, this will also rename the binary.
appName ? null,
#
# The Neovim package to wrap
neovim-unwrapped ? pkgs-wrapNeovim.neovim-unwrapped,
#
# List of plugins
plugins ? [],
#
# List of dev plugins (will be bootstrapped) - useful for plugin developers
# { name = <plugin-name>; url = <git-url>; }
devPlugins ? [],
#
# Regexes for config files to ignore, relative to the nvim directory.
# e.g. [ "^plugin/neogit.lua" "^ftplugin/.*.lua" ]
ignoreConfigRegexes ? [],
#
# Extra runtime dependencies (e.g. ripgrep, ...)
extraPackages ? [],
#
#
# The below arguments can typically be left as their defaults
#
# Additional lua packages (not plugins), e.g. from luarocks.org.
# e.g. p: [p.jsregexp]
extraLuaPackages ? p: [],
#
# Additional python 3 packages
extraPython3Packages ? p: [],
#
withPython3 ? true, # Build Neovim with Python 3 support?
withRuby ? false, # Build Neovim with Ruby support?
withNodeJs ? false, # Build Neovim with NodeJS support?
withSqlite ? true, # Add sqlite? This is a dependency for some plugins
#
# You probably don't want to create vi or vim aliases
# if the appName is something different than "nvim"
#
# Add a "vi" binary to the build output as an alias?
viAlias ? appName == null || appName == "nvim",
#
# Add a "vim" binary to the build output as an alias?
vimAlias ? appName == null || appName == "nvim",
}: let
externalPackages = extraPackages ++ (optionals withSqlite [pkgs.sqlite]);
# Map all plugins to an attrset { plugin = <plugin>; config = <config>; optional = <tf>; ... }
normalizedPlugins =
map (
x:
if x ? plugin
then x
else {plugin = x;}
)
plugins;
# This nixpkgs util function creates an attrset
# that pkgs.wrapNeovimUnstable uses to configure the Neovim build.
neovimConfig = pkgs-wrapNeovim.neovimUtils.makeNeovimConfig {
inherit extraPython3Packages withPython3 withRuby withNodeJs viAlias vimAlias;
plugins = normalizedPlugins;
};
# This uses the ignoreConfigRegexes list to filter
# the nvim directory
nvimRtpSrc = let
src = ../nvim;
in
lib.cleanSourceWith {
inherit src;
name = "nvim-rtp-src";
filter = path: tyoe: let
srcPrefix = toString src + "/";
relPath = lib.removePrefix srcPrefix (toString path);
in
lib.all (regex: builtins.match regex relPath == null) ignoreConfigRegexes;
};
# Split runtimepath into 3 directories:
# - lua, to be prepended to the rtp at the beginning of init.lua
# - nvim, containing plugin, ftplugin, ... subdirectories
# - after, to be sourced last in the startup initialization
# See also: https://neovim.io/doc/user/starting.html
nvimRtp = stdenv.mkDerivation {
name = "nvim-rtp";
src = nvimRtpSrc;
buildPhase = ''
mkdir -p $out/nvim
mkdir -p $out/lua
rm init.lua
'';
installPhase = ''
cp -r lua $out/lua
rm -r lua
# Copy nvim/after only if it exists
if [ -d "after" ]; then
cp -r after $out/after
rm -r after
fi
# Copy rest of nvim/ subdirectories only if they exist
if [ ! -z "$(ls -A)" ]; then
cp -r -- * $out/nvim
fi
'';
};
# The final init.lua content that we pass to the Neovim wrapper.
# It wraps the user init.lua, prepends the lua lib directory to the RTP
# and prepends the nvim and after directory to the RTP
# It also adds logic for bootstrapping dev plugins (for plugin developers)
initLua =
''
vim.loader.enable()
-- prepend lua directory
vim.opt.rtp:prepend('${nvimRtp}/lua')
''
# Wrap init.lua
+ (builtins.readFile ../nvim/init.lua)
# Bootstrap/load dev plugins
+ optionalString (devPlugins != []) (
''
local dev_pack_path = vim.fn.stdpath('data') .. '/site/pack/dev'
local dev_plugins_dir = dev_pack_path .. '/opt'
local dev_plugin_path
''
+ strings.concatMapStringsSep
"\n"
(plugin: ''
dev_plugin_path = dev_plugins_dir .. '/${plugin.name}'
if vim.fn.empty(vim.fn.glob(dev_plugin_path)) > 0 then
vim.notify('Bootstrapping dev plugin ${plugin.name} ...', vim.log.levels.INFO)
vim.cmd('!${pkgs.git}/bin/git clone ${plugin.url} ' .. dev_plugin_path)
end
vim.cmd('packadd! ${plugin.name}')
'')
devPlugins
)
# Prepend nvim and after directories to the runtimepath
# NOTE: This is done after init.lua,
# because of a bug in Neovim that can cause filetype plugins
# to be sourced prematurely, see https://github.com/neovim/neovim/issues/19008
# We prepend to ensure that user ftplugins are sourced before builtin ftplugins.
+ ''
vim.opt.rtp:prepend('${nvimRtp}/nvim')
vim.opt.rtp:prepend('${nvimRtp}/after')
'';
# Add arguments to the Neovim wrapper script
extraMakeWrapperArgs = builtins.concatStringsSep " " (
# Set the NVIM_APPNAME environment variable
(optional (appName != "nvim" && appName != null && appName != "")
''--set NVIM_APPNAME "${appName}"'')
# Add external packages to the PATH
++ (optional (externalPackages != [])
''--prefix PATH : "${makeBinPath externalPackages}"'')
# Set the LIBSQLITE_CLIB_PATH if sqlite is enabled
++ (optional withSqlite
''--set LIBSQLITE_CLIB_PATH "${pkgs.sqlite.out}/lib/libsqlite3.so"'')
# Set the LIBSQLITE environment variable if sqlite is enabled
++ (optional withSqlite
''--set LIBSQLITE "${pkgs.sqlite.out}/lib/libsqlite3.so"'')
);
luaPackages = neovim-unwrapped.lua.pkgs;
resolvedExtraLuaPackages = extraLuaPackages luaPackages;
# Native Lua libraries
extraMakeWrapperLuaCArgs =
optionalString (resolvedExtraLuaPackages != [])
''--suffix LUA_CPATH ";" "${concatMapStringsSep ";" luaPackages.getLuaCPath resolvedExtraLuaPackages}"'';
# Lua libraries
extraMakeWrapperLuaArgs =
optionalString (resolvedExtraLuaPackages != [])
''--suffix LUA_PATH ";" "${concatMapStringsSep ";" luaPackages.getLuaPath resolvedExtraLuaPackages}"'';
# wrapNeovimUnstable is the nixpkgs utility function for building a Neovim derivation.
neovim-wrapped = pkgs-wrapNeovim.wrapNeovimUnstable neovim-unwrapped (neovimConfig
// {
luaRcContent = initLua;
wrapperArgs =
escapeShellArgs neovimConfig.wrapperArgs
+ " "
+ extraMakeWrapperArgs
+ " "
+ extraMakeWrapperLuaCArgs
+ " "
+ extraMakeWrapperLuaArgs;
wrapRc = true;
});
isCustomAppName = appName != null && appName != "nvim";
in
neovim-wrapped.overrideAttrs (oa: {
buildPhase =
oa.buildPhase
# If a custom NVIM_APPNAME has been set, rename the `nvim` binary
+ lib.optionalString isCustomAppName ''
mv $out/bin/nvim $out/bin/${lib.escapeShellArg appName}
'';
meta.mainProgram =
if isCustomAppName
then appName
else oa.meta.mainProgram;
})

View file

@ -1,208 +0,0 @@
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
{inputs}: final: prev:
with final.pkgs.lib; let
pkgs = final;
# Use this to create a plugin from a flake input
mkNvimPlugin = src: pname:
pkgs.vimUtils.buildVimPlugin {
inherit pname src;
version = src.lastModifiedDate;
};
# Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable,
# otherwise it could have an incompatible signature when applying this overlay.
pkgs-wrapNeovim = inputs.nixpkgs.legacyPackages.${pkgs.system};
# This is the helper function that builds the Neovim derivation.
mkNeovim = pkgs.callPackage ./mkNeovim.nix {inherit pkgs-wrapNeovim;};
# A plugin can either be a package or an attrset, such as
# { plugin = <plugin>; # the package, e.g. pkgs.vimPlugins.nvim-cmp
# config = <config>; # String; a config that will be loaded with the plugin
# # Boolean; Whether to automatically load the plugin as a 'start' plugin,
# # or as an 'opt' plugin, that can be loaded with `:packadd!`
# optional = <true|false>; # Default: false
# ...
# }
all-plugins = with pkgs.vimPlugins; [
# Base
lz-n
snacks-nvim
# Util
plenary-nvim
nui-nvim
persistence-nvim
mini-hipatterns
project-nvim
(mkNvimPlugin inputs.nerdy-nvim "nerdy.nvim")
# Colorscheme
rose-pine
# UI
mini-icons
alpha-nvim
bufferline-nvim
lualine-nvim
noice-nvim
indent-blankline-nvim
mini-animate
nvim-treesitter-context
diffview-nvim
no-neck-pain-nvim
# Editor
neo-tree-nvim
grug-far-nvim
flash-nvim
which-key-nvim
gitsigns-nvim
trouble-nvim
todo-comments-nvim
aerial-nvim
fzf-lua
refactoring-nvim
(mkNvimPlugin inputs.nvim-emmet "nvim-emmet")
# Treesitter
nvim-treesitter-textobjects
nvim-ts-autotag
(nvim-treesitter.withPlugins (
plugins:
with plugins; [
bash
comment
css
diff
fish
git_config
gitignore
html
hyprlang
ini
javascript
jsdoc
json
jsonc
just
lua
luadoc
markdown
markdown_inline
nix
just
phpdoc
php_only
printf
python
query
rasi
regex
scss
ssh_config
toml
tsx
typescript
vim
vimdoc
xml
yaml
]
))
# Coding
blink-cmp
luasnip
friendly-snippets
lexima-vim
(mkNvimPlugin inputs.neotab-nvim "neotab.nvim")
ts-comments-nvim
mini-comment
mini-ai
mini-surround
yanky-nvim
# Formatting
conform-nvim
# Linting
nvim-lint
# Test
nvim-nio
neotest
# Languages
vim-caddyfile
];
extraPackages = with pkgs; [
# System packages
ripgrep
lazygit # snacks.nvim
fzf # fzf-lua
fd # fzf-lua
bat # fzf-lua
delta # fzf-lua
chafa # fzf-lua
# Language servers
bash-language-server
emmet-language-server
lua-language-server
nil
# inputs.nixd.packages.${pkgs.system}.nixd
phpactor
stylelint-lsp
taplo
vscode-langservers-extracted # html, css, json, eslint
# Linters
biome
shellcheck
statix
yamllint
# Formatters
alejandra
blade-formatter
fish
php84Packages.php-cs-fixer
nodePackages.prettier
rustywind
shfmt
stylelint
stylua
];
in {
# This is the neovim derivation returned by the overlay.
nvim-pkg = mkNeovim {
plugins = all-plugins;
neovim-unwrapped = inputs.neovim-nightly.packages.${pkgs.system}.default;
inherit extraPackages;
};
# This can be symlinked in the devShell's shellHook.
nvim-luarc-json = final.mk-luarc-json {
plugins = all-plugins;
globals = ["MarleyVim"];
runtimePath = ["nvim/lua/?.lua" "nvim/lua/?/init.lua"];
};
# You can add as many derivations as you like.
# Use `ignoreConfigRegexes` to filter out config
# files you would not like to include.
#
# For example:
#
# nvim-pkg-no-telescope = mkNeovim {
# plugins = [];
# ignoreConfigRegexes = [
# "^plugin/telescope.lua"
# "^ftplugin/.*.lua"
# ];
# inherit extraPackages;
# };
}

View file

@ -1,317 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="600"
height="71.653839"
viewBox="0 0 600.00003 71.653839"
version="1.1"
id="svg95"
sodipodi:docname="nvim-nix.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview97"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050"
showgrid="false"
inkscape:zoom="3.7301328"
inkscape:cx="323.71502"
inkscape:cy="-34.583219"
inkscape:window-width="3580"
inkscape:window-height="1508"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g8863" />
<title
id="title70">neovim-mark@2x</title>
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
<defs
id="defs87">
<linearGradient
inkscape:collect="always"
id="linearGradient1782">
<stop
style="stop-color:#159ce0;stop-opacity:0.80000001;"
offset="0"
id="stop1778" />
<stop
style="stop-color:#105db5;stop-opacity:0.83529413;"
offset="1"
id="stop1780" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient1774">
<stop
style="stop-color:#7bb442;stop-opacity:0.80000001;"
offset="0"
id="stop1770" />
<stop
style="stop-color:#459440;stop-opacity:0.8392157;"
offset="1"
id="stop1772" />
</linearGradient>
<linearGradient
x1="167.95833"
y1="-0.46142399"
x2="167.95833"
y2="335.45523"
id="linearGradient-1"
gradientTransform="scale(0.46142398,2.1672042)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#16B0ED"
stop-opacity="0.800235524"
offset="0%"
id="stop72" />
<stop
stop-color="#0F59B2"
stop-opacity="0.83700023"
offset="100%"
id="stop74" />
</linearGradient>
<linearGradient
x1="1118.3427"
y1="-0.46586797"
x2="1118.3427"
y2="338.68604"
id="linearGradient-2"
gradientTransform="scale(0.46586797,2.1465309)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#7DB643"
offset="0%"
id="stop77" />
<stop
stop-color="#367533"
offset="100%"
id="stop79" />
</linearGradient>
<linearGradient
x1="356.33795"
y1="0"
x2="356.33795"
y2="612.90131"
id="linearGradient-3"
gradientTransform="scale(0.84189739,1.1877932)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#88C649"
stop-opacity="0.8"
offset="0%"
id="stop82" />
<stop
stop-color="#439240"
stop-opacity="0.84"
offset="100%"
id="stop84" />
</linearGradient>
<linearGradient
x1="49.021549"
y1="-0.079835393"
x2="49.021549"
y2="97.845657"
id="linearGradient-1-2"
gradientTransform="scale(0.46153975,2.1666606)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#16B0ED"
stop-opacity="0.800235524"
offset="0%"
id="stop5136" />
<stop
stop-color="#0F59B2"
stop-opacity="0.83700023"
offset="100%"
id="stop5138" />
</linearGradient>
<linearGradient
x1="326.17365"
y1="-0.069164939"
x2="326.17365"
y2="98.851547"
id="linearGradient-2-2"
gradientTransform="scale(0.46628455,2.1446132)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#7DB643"
offset="0%"
id="stop5141" />
<stop
stop-color="#367533"
offset="100%"
id="stop5143" />
</linearGradient>
<linearGradient
x1="103.88479"
y1="-0.11508822"
x2="103.88479"
y2="178.55785"
id="linearGradient-3-8"
gradientTransform="scale(0.84203823,1.1875945)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#88C649"
stop-opacity="0.8"
offset="0%"
id="stop5146" />
<stop
stop-color="#439240"
stop-opacity="0.84"
offset="100%"
id="stop5148" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1774"
id="linearGradient1776"
x1="52.443624"
y1="-87.210322"
x2="119.70557"
y2="-87.210322"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.66190409,0,0,0.66190409,-85.433543,-23.706043)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient1782"
id="linearGradient1784"
x1="44.901705"
y1="-87.250641"
x2="112.14013"
y2="-87.250641"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.66190409,0,0,0.66190409,-85.433543,-23.706043)" />
</defs>
<metadata
id="metadata14713">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:title>neovim-mark@2x</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
aria-label="haskell-tools.nvim"
id="text4483"
style="font-weight:bold;font-size:33.4748px;font-family:Lato;-inkscape-font-specification:'Lato Bold';fill:#1a1a1a;stroke-width:1.39478"
transform="translate(307.65719,89.970579)">
<g
id="g5925"
transform="matrix(1.6576683,0,0,1.6576683,-217.36825,0)">
<g
id="g8863"
transform="matrix(0.81614217,0,0,0.81614217,-10.014267,-7.820178)">
<g
aria-label="kickstart-nix.nvim"
id="text1840"
style="font-size:47.306px;font-family:Roboto;-inkscape-font-specification:Roboto;fill:#444444;stroke-width:1.03096"
transform="translate(2.5202188,76.281885)">
<path
d="m 33.747205,-123.78629 v 20.98021 h 1.088038 q 0.331142,0 0.614978,-0.0946 0.307489,-0.0946 0.662284,-0.44941 l 9.437547,-8.96449 q 0.23653,-0.28383 0.520366,-0.42575 0.283836,-0.16557 0.70959,-0.16557 h 1.986852 l -10.383667,9.8633 q -0.425754,0.49671 -0.922467,0.78055 0.378448,0.18922 0.638631,0.4494 0.283836,0.23653 0.544019,0.56768 l 10.904033,11.873802 H 47.58421 q -0.331142,0 -0.614978,-0.09461 -0.260183,-0.118265 -0.496713,-0.449407 l -9.886954,-10.596545 q -0.189224,-0.21288 -0.378448,-0.3548 -0.165571,-0.14191 -0.354795,-0.21287 -0.189224,-0.0946 -0.449407,-0.11827 -0.23653,-0.0473 -0.591325,-0.0473 h -1.064385 v 11.873804 h -2.270688 v -34.415114 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2262" />
<path
d="m 56.501384,-112.90591 v 23.534732 h -2.247035 v -23.534732 z m 0.969773,-8.11298 q 0,0.42575 -0.189224,0.8042 -0.165571,0.3548 -0.449407,0.63863 -0.283836,0.28384 -0.662284,0.44941 -0.378448,0.16557 -0.804202,0.16557 -0.425754,0 -0.804202,-0.16557 -0.378448,-0.16557 -0.662284,-0.44941 -0.283836,-0.28383 -0.449407,-0.63863 -0.165571,-0.37845 -0.165571,-0.8042 0,-0.42576 0.165571,-0.8042 0.165571,-0.4021 0.449407,-0.68594 0.283836,-0.28384 0.662284,-0.44941 0.378448,-0.16557 0.804202,-0.16557 0.425754,0 0.804202,0.16557 0.378448,0.16557 0.662284,0.44941 0.283836,0.28384 0.449407,0.68594 0.189224,0.37844 0.189224,0.8042 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2264" />
<path
d="m 80.343603,-109.76006 q -0.118265,0.11826 -0.23653,0.21287 -0.09461,0.071 -0.283836,0.071 -0.23653,0 -0.638631,-0.30749 -0.402101,-0.33114 -1.088038,-0.70959 -0.685937,-0.37844 -1.726669,-0.68593 -1.017079,-0.33115 -2.483565,-0.33115 -2.034158,0 -3.618909,0.73325 -1.561098,0.70959 -2.649136,2.05781 -1.088038,1.34822 -1.65571,3.26411 -0.544019,1.9159 -0.544019,4.30485 0,2.483563 0.567672,4.399456 0.591325,1.915893 1.65571,3.240461 1.064385,1.300915 2.578177,1.986852 1.513792,0.685937 3.358726,0.685937 1.703016,0 2.83836,-0.402101 1.158997,-0.402101 1.89224,-0.875161 0.756896,-0.47306 1.18265,-0.875161 0.425754,-0.402101 0.70959,-0.402101 0.283836,0 0.47306,0.23653 l 0.591325,0.756896 q -0.544019,0.70959 -1.371874,1.324568 -0.827855,0.614978 -1.868587,1.064385 -1.040732,0.449407 -2.270688,0.685937 -1.206303,0.260183 -2.530871,0.260183 -2.247035,0 -4.115622,-0.804202 -1.844934,-0.827855 -3.193155,-2.3653 -1.324568,-1.561098 -2.081464,-3.808133 -0.733243,-2.247035 -0.733243,-5.109046 0,-2.69644 0.70959,-4.91983 0.70959,-2.22338 2.081464,-3.83178 1.371874,-1.60841 3.335073,-2.48357 1.986852,-0.89881 4.541376,-0.89881 2.294341,0 4.068316,0.73324 1.773975,0.73325 3.098543,1.98685 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2266" />
<path
d="m 89.095228,-123.78629 v 20.98021 h 1.088038 q 0.331142,0 0.614978,-0.0946 0.307489,-0.0946 0.662284,-0.44941 l 9.437542,-8.96449 q 0.23653,-0.28383 0.52037,-0.42575 0.28384,-0.16557 0.70959,-0.16557 h 1.98685 l -10.383664,9.8633 q -0.425754,0.49671 -0.922467,0.78055 0.378448,0.18922 0.638631,0.4494 0.283836,0.23653 0.544019,0.56768 l 10.904031,11.873802 h -1.9632 q -0.33114,0 -0.61498,-0.09461 -0.26018,-0.118265 -0.49671,-0.449407 l -9.886952,-10.596545 q -0.189224,-0.21288 -0.378448,-0.3548 -0.165571,-0.14191 -0.354795,-0.21287 -0.189224,-0.0946 -0.449407,-0.11827 -0.23653,-0.0473 -0.591325,-0.0473 h -1.064385 v 11.873804 H 86.82454 v -34.415114 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2268" />
<path
d="m 122.28039,-109.99659 q -0.18923,0.33114 -0.54402,0.33114 -0.26019,0 -0.66229,-0.28384 -0.4021,-0.30749 -1.08804,-0.66228 -0.66228,-0.37845 -1.65571,-0.66229 -0.99342,-0.30748 -2.4126,-0.30748 -1.27726,0 -2.34165,0.37844 -1.04073,0.3548 -1.79763,0.96978 -0.73324,0.61497 -1.13534,1.44283 -0.4021,0.8042 -0.4021,1.70302 0,1.11169 0.56767,1.84493 0.56767,0.73324 1.46649,1.25361 0.92246,0.52036 2.10511,0.89881 1.18265,0.37845 2.38896,0.7569 1.22995,0.37845 2.4126,0.85151 1.18265,0.4494 2.08147,1.13534 0.92246,0.685937 1.49014,1.679363 0.56767,0.993426 0.56767,2.412606 0,1.537445 -0.54402,2.862013 -0.54402,1.324568 -1.60841,2.294341 -1.04073,0.969773 -2.57817,1.537445 -1.53745,0.567672 -3.5243,0.567672 -2.48356,0 -4.28119,-0.780549 -1.79763,-0.804202 -3.21681,-2.081464 l 0.52037,-0.804202 q 0.11826,-0.189224 0.26018,-0.283836 0.16557,-0.09461 0.42575,-0.09461 0.30749,0 0.73325,0.378448 0.4494,0.378448 1.18265,0.827855 0.73324,0.425754 1.79762,0.804202 1.08804,0.378448 2.67279,0.378448 1.49014,0 2.62549,-0.402101 1.13534,-0.425754 1.89224,-1.135344 0.75689,-0.70959 1.13534,-1.65571 0.4021,-0.969773 0.4021,-2.034158 0,-1.18265 -0.56767,-1.963199 -0.56767,-0.780549 -1.49014,-1.324568 -0.92247,-0.544019 -2.10512,-0.922472 -1.15899,-0.37844 -2.38895,-0.75689 -1.22996,-0.37845 -2.41261,-0.82786 -1.15899,-0.4494 -2.08146,-1.13534 -0.92247,-0.68594 -1.49014,-1.65571 -0.56767,-0.99343 -0.56767,-2.45991 0,-1.25361 0.54402,-2.41261 0.54402,-1.159 1.53744,-2.03416 1.01708,-0.87516 2.45991,-1.39552 1.44284,-0.52037 3.24047,-0.52037 2.15242,0 3.80813,0.61498 1.67936,0.61498 3.05124,1.89224 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2270" />
<path
d="m 135.88082,-88.99273 q -2.38895,0 -3.73717,-1.324568 -1.32457,-1.324568 -1.32457,-4.091969 v -16.084043 h -3.38238 q -0.26018,0 -0.42575,-0.14191 -0.16557,-0.14192 -0.16557,-0.40211 v -0.87516 l 4.02101,-0.28383 0.56767,-8.42047 q 0.0473,-0.21288 0.18922,-0.37845 0.14192,-0.16557 0.4021,-0.16557 h 1.06439 v 8.98814 h 7.42704 v 1.67936 h -7.42704 v 15.965778 q 0,0.969773 0.23653,1.679363 0.26018,0.685937 0.68593,1.135344 0.44941,0.449407 1.04074,0.662284 0.59132,0.212877 1.27726,0.212877 0.85151,0 1.46648,-0.23653 0.61498,-0.260183 1.06439,-0.544019 0.44941,-0.307489 0.73324,-0.544019 0.28384,-0.260183 0.44941,-0.260183 0.18922,0 0.37845,0.23653 l 0.61498,0.993426 q -0.89882,0.993426 -2.29435,1.608404 -1.37187,0.591325 -2.86201,0.591325 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2272" />
<path
d="m 158.82426,-100.74827 q -3.35873,0.11826 -5.79499,0.54402 -2.4126,0.402099 -3.99735,1.111689 -1.5611,0.70959 -2.318,1.703016 -0.75689,0.969773 -0.75689,2.223382 0,1.18265 0.37844,2.057811 0.4021,0.851508 1.04074,1.41918 0.66228,0.544019 1.51379,0.804202 0.85151,0.260183 1.77397,0.260183 1.37188,0 2.50722,-0.283836 1.159,-0.307489 2.12877,-0.827855 0.99343,-0.544019 1.84493,-1.277262 0.85151,-0.733243 1.67937,-1.584751 z m -13.83701,-8.82257 q 1.84494,-1.84493 3.87909,-2.79105 2.03416,-0.94612 4.61234,-0.94612 1.89224,0 3.31142,0.61497 1.41918,0.59133 2.34165,1.72667 0.94612,1.11169 1.41918,2.7201 0.47306,1.58475 0.47306,3.54795 v 15.327142 h -0.89882 q -0.70959,0 -0.87516,-0.662284 l -0.33114,-3.027584 q -0.96977,0.94612 -1.93955,1.703016 -0.94612,0.756896 -1.98685,1.277262 -1.04073,0.520366 -2.24703,0.804202 -1.20631,0.283836 -2.64914,0.283836 -1.2063,0 -2.34165,-0.354795 -1.13534,-0.354795 -2.03415,-1.088038 -0.87517,-0.733243 -1.41918,-1.868587 -0.52037,-1.158997 -0.52037,-2.767401 0,-1.490139 0.85151,-2.767401 0.85151,-1.277262 2.67279,-2.223378 1.82128,-0.94612 4.65964,-1.5138 2.86201,-0.56767 6.85937,-0.66228 v -2.45991 q 0,-3.26412 -1.41918,-5.01444 -1.39553,-1.77397 -4.16293,-1.77397 -1.70302,0 -2.90932,0.47306 -1.18265,0.47306 -2.0105,1.04073 -0.82786,0.56767 -1.34823,1.04073 -0.52036,0.47306 -0.87516,0.47306 -0.26018,0 -0.42575,-0.11826 -0.16557,-0.11827 -0.28384,-0.30749 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2274" />
<path
d="m 170.69803,-107.22919 q 0.54402,-1.44284 1.22996,-2.55453 0.70959,-1.13534 1.6084,-1.91589 0.92247,-0.78055 2.03416,-1.18265 1.13534,-0.42575 2.50722,-0.42575 0.73324,0 1.44283,0.14191 0.70959,0.11827 1.25361,0.44941 l -0.18922,1.5611 q -0.11827,0.37845 -0.44941,0.37845 -0.28384,0 -0.87516,-0.16557 -0.56767,-0.16557 -1.51379,-0.16557 -1.37188,0 -2.43626,0.42575 -1.04073,0.4021 -1.89224,1.22996 -0.82786,0.82785 -1.46649,2.05781 -0.61498,1.2063 -1.13534,2.79105 v 15.232532 h -2.27069 v -23.534732 h 1.2063 q 0.4021,0 0.56767,0.16557 0.16558,0.16557 0.21288,0.56767 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2276" />
<path
d="m 191.70191,-88.99273 q -2.38895,0 -3.73717,-1.324568 -1.32457,-1.324568 -1.32457,-4.091969 v -16.084043 h -3.38238 q -0.26018,0 -0.42575,-0.14191 -0.16557,-0.14192 -0.16557,-0.40211 v -0.87516 l 4.02101,-0.28383 0.56767,-8.42047 q 0.0473,-0.21288 0.18922,-0.37845 0.14192,-0.16557 0.4021,-0.16557 h 1.06439 v 8.98814 h 7.42704 v 1.67936 h -7.42704 v 15.965778 q 0,0.969773 0.23653,1.679363 0.26018,0.685937 0.68593,1.135344 0.44941,0.449407 1.04074,0.662284 0.59132,0.212877 1.27726,0.212877 0.85151,0 1.46648,-0.23653 0.61498,-0.260183 1.06439,-0.544019 0.44941,-0.307489 0.73324,-0.544019 0.28384,-0.260183 0.44941,-0.260183 0.18922,0 0.37845,0.23653 l 0.61498,0.993426 q -0.89882,0.993426 -2.29435,1.608404 -1.37187,0.591325 -2.86201,0.591325 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2278" />
<path
d="m 200.85565,-104.36718 h 10.99864 v 1.91589 h -10.99864 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2280" />
<path
d="m 221.12632,-108.79029 q 1.63205,-2.03416 3.76082,-3.26411 2.15243,-1.22996 4.77791,-1.22996 1.93954,0 3.40603,0.61498 1.49014,0.61498 2.45991,1.77397 0.96978,1.159 1.46649,2.79106 0.49671,1.63205 0.49671,3.68986 v 15.043312 h -2.27069 v -15.043312 q 0,-3.31142 -1.51379,-5.18 -1.51379,-1.89224 -4.61233,-1.89224 -2.29434,0 -4.30485,1.18265 -1.98685,1.15899 -3.54795,3.24046 v 17.692442 h -2.27069 v -23.534732 h 1.25361 q 0.59133,0 0.68594,0.59132 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2282" />
<path
d="m 247.49938,-112.90591 v 23.534732 h -2.24704 v -23.534732 z m 0.96977,-8.11298 q 0,0.42575 -0.18923,0.8042 -0.16557,0.3548 -0.4494,0.63863 -0.28384,0.28384 -0.66229,0.44941 -0.37844,0.16557 -0.8042,0.16557 -0.42575,0 -0.8042,-0.16557 -0.37845,-0.16557 -0.66228,-0.44941 -0.28384,-0.28383 -0.44941,-0.63863 -0.16557,-0.37845 -0.16557,-0.8042 0,-0.42576 0.16557,-0.8042 0.16557,-0.4021 0.44941,-0.68594 0.28383,-0.28384 0.66228,-0.44941 0.37845,-0.16557 0.8042,-0.16557 0.42576,0 0.8042,0.16557 0.37845,0.16557 0.66229,0.44941 0.28383,0.28384 0.4494,0.68594 0.18923,0.37844 0.18923,0.8042 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2284" />
<path
d="M 272.78442,-89.371178 H 270.632 q -0.33114,0 -0.52037,-0.189224 -0.18922,-0.212877 -0.30749,-0.402101 l -7.1432,-10.430977 q -0.0946,0.425758 -0.3548,0.827859 l -6.81206,9.603118 q -0.16557,0.212877 -0.3548,0.402101 -0.16557,0.189224 -0.4494,0.189224 h -2.03416 l 8.56238,-12.039372 -8.23124,-11.49536 h 2.15242 q 0.33115,0 0.49672,0.14192 0.16557,0.14191 0.28383,0.33114 l 6.90668,9.95791 q 0.0473,-0.18922 0.14192,-0.4021 0.11826,-0.21288 0.23653,-0.42575 l 6.45727,-9.10641 q 0.14191,-0.21288 0.30748,-0.35479 0.16558,-0.14192 0.42576,-0.14192 h 2.05781 l -8.20759,11.35344 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2286" />
<path
d="m 277.16022,-91.192459 q 0,-0.449407 0.16557,-0.851508 0.16557,-0.402101 0.44941,-0.685937 0.30749,-0.307489 0.68594,-0.47306 0.4021,-0.189224 0.87516,-0.189224 0.4494,0 0.8515,0.189224 0.40211,0.165571 0.68594,0.47306 0.30749,0.283836 0.47306,0.685937 0.18923,0.402101 0.18923,0.851508 0,0.47306 -0.18923,0.875161 -0.16557,0.378448 -0.47306,0.685937 -0.28383,0.283836 -0.68594,0.449407 -0.4021,0.165571 -0.8515,0.165571 -0.92247,0 -1.5611,-0.614978 -0.61498,-0.638631 -0.61498,-1.561098 z"
style="font-weight:300;font-family:Lato;-inkscape-font-specification:'Lato Light'"
id="path2288" />
<path
d="m 293.22059,-110.65888 q 0.73324,-0.73324 1.53744,-1.34822 0.82786,-0.63863 1.72667,-1.06438 0.92247,-0.44941 1.9632,-0.68594 1.04073,-0.26018 2.27069,-0.26018 1.98685,0 3.52429,0.68593 1.53745,0.66229 2.55453,1.89224 1.04073,1.20631 1.5611,2.90932 0.54401,1.67937 0.54401,3.71352 v 15.445412 h -5.84229 v -15.445412 q 0,-2.22338 -1.01708,-3.42968 -1.01707,-1.22996 -3.09854,-1.22996 -1.51379,0 -2.83836,0.68594 -1.32457,0.68594 -2.50722,1.86859 v 17.550522 h -5.84229 v -24.267982 h 3.57161 q 1.13534,0 1.49013,1.06439 z"
style="font-family:Lato;-inkscape-font-specification:'Lato Bold'"
id="path2290" />
<path
d="m 335.77233,-113.63916 -9.62677,24.267982 h -5.29827 l -9.62677,-24.267982 h 4.82521 q 0.66229,0 1.08804,0.30749 0.44941,0.30749 0.59132,0.78055 l 4.6833,12.961846 q 0.37845,1.135344 0.66228,2.223382 0.28384,1.088038 0.49672,2.176076 0.23653,-1.088038 0.52036,-2.176076 0.28384,-1.088038 0.68594,-2.223382 l 4.7779,-12.961846 q 0.16558,-0.47306 0.59133,-0.78055 0.42575,-0.30749 1.01708,-0.30749 z"
style="font-family:Lato;-inkscape-font-specification:'Lato Bold'"
id="path2292" />
<path
d="m 344.92602,-113.63916 v 24.267982 h -5.86595 v -24.267982 z m 0.8042,-7.07224 q 0,0.75689 -0.30749,1.41918 -0.30749,0.66228 -0.82786,1.15899 -0.49671,0.49672 -1.18265,0.80421 -0.68593,0.28383 -1.46648,0.28383 -0.7569,0 -1.44284,-0.28383 -0.66228,-0.30749 -1.15899,-0.80421 -0.49672,-0.49671 -0.8042,-1.15899 -0.28384,-0.66229 -0.28384,-1.41918 0,-0.78055 0.28384,-1.46649 0.30748,-0.68594 0.8042,-1.18265 0.49671,-0.49671 1.15899,-0.78055 0.68594,-0.30749 1.44284,-0.30749 0.78055,0 1.46648,0.30749 0.68594,0.28384 1.18265,0.78055 0.52037,0.49671 0.82786,1.18265 0.30749,0.68594 0.30749,1.46649 z"
style="font-family:Lato;-inkscape-font-specification:'Lato Bold'"
id="path2294" />
<path
d="m 350.88656,-89.371178 v -24.267982 h 3.57161 q 1.13534,0 1.49014,1.06439 l 0.37844,1.79763 q 0.63864,-0.70959 1.32457,-1.30092 0.70959,-0.59132 1.49014,-1.01708 0.8042,-0.42575 1.70302,-0.66228 0.92246,-0.26018 2.0105,-0.26018 2.29434,0 3.76083,1.25361 1.49014,1.22995 2.22338,3.28776 0.56767,-1.2063 1.41918,-2.05781 0.85151,-0.87516 1.86859,-1.41918 1.01708,-0.54402 2.15242,-0.8042 1.159,-0.26018 2.318,-0.26018 2.0105,0 3.5716,0.61497 1.5611,0.61498 2.62548,1.79763 1.06439,1.18265 1.60841,2.88567 0.56767,1.70301 0.56767,3.90274 v 15.445412 h -5.84229 v -15.445412 q 0,-2.31799 -1.01708,-3.47699 -1.01708,-1.18265 -2.98028,-1.18265 -0.89881,0 -1.67936,0.30749 -0.7569,0.30749 -1.34822,0.89882 -0.56768,0.56767 -0.89882,1.44283 -0.33114,0.87516 -0.33114,2.0105 v 15.445412 h -5.86594 v -15.445412 q 0,-2.43626 -0.99343,-3.54795 -0.96977,-1.11169 -2.86201,-1.11169 -1.27727,0 -2.38896,0.63863 -1.08803,0.61498 -2.03415,1.70302 v 17.763402 z"
style="font-family:Lato;-inkscape-font-specification:'Lato Bold'"
id="path2296" />
</g>
</g>
<g
id="g2301"
transform="translate(6.7950945,48.768295)">
<path
fill="#7ebae4"
d="m -36.254318,-89.55896 -12.061602,21.02585 -2.815852,-4.804756 3.250288,-5.631303 -6.455455,-0.01677 -1.375982,-2.40098 1.40513,-2.455691 9.189052,0.0292 3.302196,-5.73073 z m 0.925574,16.808062 24.121211,0.0012 -2.726012,4.857064 -6.470627,-0.01797 3.213152,5.636095 -1.377581,2.399783 -2.81505,0.0032 -4.569969,-8.024697 -6.581633,-0.01358 z m 14.039327,-9.213408 -12.059606,-21.027044 5.54226,-0.0523 3.219541,5.64927 3.242303,-5.61892 2.753959,6.6e-4 1.410325,2.45289 -4.619884,7.99555 3.279436,5.7443 z"
clip-rule="evenodd"
fill-rule="evenodd"
id="path830"
style="fill:url(#linearGradient1784);fill-opacity:1;stroke-width:0.556933" />
<path
fill="#5277c3"
d="m -40.607068,-80.897381 12.059606,21.027048 -5.54226,0.05231 -3.219542,-5.649272 -3.242302,5.618926 -2.75396,-7.95e-4 -1.410321,-2.452889 4.619881,-7.995549 -3.279437,-5.744305 z m 14.007383,-9.266509 -24.121209,-0.001 2.726409,-4.85667 6.470229,0.0179 -3.213153,-5.63609 1.377579,-2.39979 2.815452,-0.004 4.569569,8.0247 6.582033,0.0136 2.793491,4.84109 z m 0.941147,16.85677 12.061604,-21.02625 2.815853,4.80516 -3.25069,5.6309 6.455855,0.0172 1.375979,2.400982 -1.40513,2.455684 -9.189049,-0.02915 -3.302197,5.730729 z"
clip-rule="evenodd"
fill-rule="evenodd"
id="path832"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccc"
style="fill:url(#linearGradient1776);fill-opacity:1;stroke-width:0.556933" />
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 23 KiB

View file

@ -1,19 +0,0 @@
-- Native plugins
vim.cmd.filetype('plugin', 'indent', 'on')
-- let sqlite.lua (which some plugins depend on) know where to find sqlite
---@diagnostic disable-next-line:missing-parameter
vim.g.sqlite_clib_path = require('luv').os_getenv('LIBSQLITE')
_G.MarleyVim = require('lib')
require('options')
require('keymaps')
require('autocmds')
require('snacks-nvim')
require('lsp')
require('lz.n').load('plugins')
vim.cmd('colorscheme rose-pine')

View file

@ -1,11 +0,0 @@
return {
filetypes = { 'bash', 'sh' },
cmd = { 'bash-language-server', 'start' },
root_markers = { '.git' },
settings = {
bashIde = {
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
},
},
}

View file

@ -1,20 +0,0 @@
return {
cmd = { 'emmet-language-server', '--stdio' },
filetypes = {
'blade',
'css',
'eruby',
'html',
'htmlangular',
'htmldjango',
'javascriptreact',
'less',
'liquid',
'pug',
'sass',
'scss',
'typescriptreact',
'vue',
},
root_markers = { '.git' },
}

View file

@ -1,39 +0,0 @@
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = {
'.luarc.json',
'.luarc.jsonc',
'.luacheckrc',
'.stylua.toml',
'stylua.toml',
'selene.toml',
'selene.yml',
'.git',
},
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
codeLens = {
enable = true,
},
completion = {
callSnippet = 'Replace',
},
doc = {
privateName = { '^_' },
},
hint = {
enable = true,
setType = false,
paramType = true,
paramName = 'Disable',
semicolon = 'Disable',
arrayIndex = 'Disable',
},
},
},
}

View file

@ -1,14 +0,0 @@
return {
cmd = { 'nil' },
filetypes = { 'nix' },
root_markers = { 'flake.nix', '.git' },
settings = {
['nil'] = {
flake = {
autoArchive = true,
autoEvalInputs = true,
},
},
},
}

View file

@ -1,24 +0,0 @@
return {
cmd = { 'nixd' },
filetypes = { 'nix' },
root_markers = { 'flake.nix', '.git' },
settings = {
nixd = {
formatting = {
command = { 'alejandra' },
},
options = {
nixos = {
expr = '(builtins.getFlake "/home/marley/marleyos").nixosConfigurations.nyx.options',
},
['home-manager'] = {
expr = '(builtins.getFlake "/home/marley/marleyos").homeConfigurations."marley@nyx".options',
},
['nix-darwin'] = {
expr = '(builtins.getFlake "/home/marley/marleyos").darwinConfigurations.mairley.options',
},
},
},
},
}

View file

@ -1,10 +0,0 @@
return {
cmd = { 'phpactor', 'language-server' },
filetypes = { 'php', 'blade' },
root_markers = {
'composer.json',
'.git',
'.phpactor.json',
'.phpactor.yml',
},
}

View file

@ -1,29 +0,0 @@
return {
cmd = { 'stylelint-lsp', '--stdio' },
filetypes = {
'css',
'less',
'scss',
'sugarss',
'vue',
'wxss',
},
root_markers = {
'.stylelintrc',
'.stylelintrc.cjs',
'.stylelintrc.js',
'.stylelintrc.json',
'.stylelintrc.yaml',
'.stylelintrc.yml',
'stylelint.config.cjs',
'stylelint.config.js',
},
settings = {
stylelintplus = {
autoFixOnFormat = true,
validateOnSave = true,
validateOnType = false,
},
},
}

View file

@ -1,5 +0,0 @@
return {
cmd = { 'taplo', 'lsp', 'stdio' },
filetypes = { 'toml' },
root_markers = { '.git' },
}

View file

@ -1,12 +0,0 @@
return {
cmd = { 'vscode-css-language-server', '--stdio' },
filetypes = { 'css', 'scss', 'less' },
root_markers = { 'package.json', '.git' },
init_options = { provideFormatter = true },
settings = {
css = { validate = true },
scss = { validate = true },
less = { validate = true },
},
}

View file

@ -1,11 +0,0 @@
return {
cmd = { 'vscode-html-language-server', '--stdio' },
filetypes = { 'html', 'templ', 'liquid' },
root_markers = { 'package.json', '.git' },
init_options = {
provideFormatter = true,
embeddedLanguages = { css = true, javascript = true },
configurationSection = { 'html', 'css', 'javascript' },
},
}

View file

@ -1,139 +0,0 @@
local function augroup(name)
return vim.api.nvim_create_augroup('marleyvim_' .. name, { clear = true })
end
local autocmd = vim.api.nvim_create_autocmd
autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, {
desc = 'Reload file when changed if needed',
group = augroup('checktime'),
callback = function()
if vim.o.buftype ~= 'nofile' then
vim.cmd('checktime')
end
end,
})
autocmd({ 'TextYankPost' }, {
desc = 'Highlight on yank',
group = augroup('highlight_yank'),
callback = function()
(vim.hl or vim.highlight).on_yank()
end,
})
autocmd({ 'VimResized' }, {
desc = 'Resize splits on window resize',
group = augroup('resize_splits'),
callback = function()
local current_tab = vim.fn.tabpagenr()
vim.cmd('tabdo wincmd =')
vim.cmd('tabnext ' .. current_tab)
end,
})
autocmd({ 'BufReadPost' }, {
desc = 'Go to last location when opening a buffer',
group = augroup('last_loc'),
callback = function(event)
local exclude = { 'gitcommit' }
local buf = event.buf
if
vim.tbl_contains(exclude, vim.bo[buf].filetype)
or vim.b[buf].marleyvim_last_loc
then
return
end
vim.b[buf].marleyvim_last_loc = true
local mark = vim.api.nvim_buf_get_mark(buf, '"')
local lcount = vim.api.nvim_buf_line_count(buf)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
autocmd({ 'FileType' }, {
desc = 'Close some filetypes with <q>',
group = augroup('close_with_q'),
pattern = {
'PlenaryTestPopup',
'checkhealth',
'dbout',
'gitsigns-blame',
'grug-far',
'help',
'lspinfo',
'neotest-output',
'neotest-output-panel',
'neotest-summary',
'notify',
'qf',
'snacks_win',
'spectre_panel',
'startuptime',
'tsplayground',
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.schedule(function()
vim.keymap.set({ 'n' }, 'q', function()
vim.cmd('close')
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })
end, {
desc = 'Quit buffer',
buffer = event.buf,
silent = true,
})
end)
end,
})
autocmd({ 'FileType' }, {
desc = 'Make it easier to close man-files',
group = augroup('man_unlisted'),
pattern = { 'man' },
callback = function(event)
vim.bo[event.buf].buflisted = false
end,
})
autocmd({ 'FileType' }, {
desc = 'Fix conceallevel for JSON files',
group = augroup('json_conceal'),
pattern = { 'json', 'jsonc', 'json5' },
callback = function()
vim.opt_local.conceallevel = 0
end,
})
autocmd({ 'BufWritePre' }, {
desc = 'Auto create missing directories when saving a file',
group = augroup('auto_create_dir'),
callback = function(event)
if event.match:match('^%w%w+:[\\/][\\/') then
return
end
local file = vim.uv.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p')
end,
})
autocmd({ 'BufWinEnter' }, {
desc = 'Open help files in vertical split to the right',
group = augroup('help_window_right'),
pattern = { '*.txt' },
callback = function()
if vim.o.filetype == 'help' then
vim.cmd.wincmd('L')
end
end,
})

View file

@ -1,381 +0,0 @@
---@class colors
---@field tailwind colors.tailwind
---@field [string] colorNames
local M = {}
---@alias colorNames "azure" | "blue" | "cyan" | "green" | "grey" | "orange" | "purple" | "red" | "yellow"
---@type {[string]:colorNames}
M.colors = {
around = 'purple',
buffers = 'cyan',
change = 'cyan',
delete = 'red',
diagnostics = 'green',
explorer = 'yellow',
fold = 'purple',
format = 'purple',
git = 'orange',
go_to = 'cyan',
inner = 'purple',
notifications = 'orange',
replace = 'blue',
search = 'green',
sessions = 'azure',
spell = 'red',
surround = 'purple',
ui = 'green',
visual = 'purple',
window = 'blue',
yank = 'yellow',
}
---@class colorSteps
---@field [50] string
---@field [100] string
---@field [200] string
---@field [300] string
---@field [400] string
---@field [500] string
---@field [600] string
---@field [700] string
---@field [800] string
---@field [900] string
---@field [950] string
---@class colors.tailwind
---@field slate colorSteps
---@field gray colorSteps
---@field zinc colorSteps
---@field neutral colorSteps
---@field stone colorSteps
---@field red colorSteps
---@field orange colorSteps
---@field amber colorSteps
---@field yellow colorSteps
---@field lime colorSteps
---@field green colorSteps
---@field emerald colorSteps
---@field teal colorSteps
---@field cyan colorSteps
---@field sky colorSteps
---@field blue colorSteps
---@field indigo colorSteps
---@field violet colorSteps
---@field purple colorSteps
---@field fuchsia colorSteps
---@field pink colorSteps
---@field rose colorSteps
---@type colors.tailwind
M.tailwind = {
slate = {
[50] = 'f8fafc',
[100] = 'f1f5f9',
[200] = 'e2e8f0',
[300] = 'cbd5e1',
[400] = '94a3b8',
[500] = '64748b',
[600] = '475569',
[700] = '334155',
[800] = '1e293b',
[900] = '0f172a',
[950] = '020617',
},
gray = {
[50] = 'f9fafb',
[100] = 'f3f4f6',
[200] = 'e5e7eb',
[300] = 'd1d5db',
[400] = '9ca3af',
[500] = '6b7280',
[600] = '4b5563',
[700] = '374151',
[800] = '1f2937',
[900] = '111827',
[950] = '030712',
},
zinc = {
[50] = 'fafafa',
[100] = 'f4f4f5',
[200] = 'e4e4e7',
[300] = 'd4d4d8',
[400] = 'a1a1aa',
[500] = '71717a',
[600] = '52525b',
[700] = '3f3f46',
[800] = '27272a',
[900] = '18181b',
[950] = '09090B',
},
neutral = {
[50] = 'fafafa',
[100] = 'f5f5f5',
[200] = 'e5e5e5',
[300] = 'd4d4d4',
[400] = 'a3a3a3',
[500] = '737373',
[600] = '525252',
[700] = '404040',
[800] = '262626',
[900] = '171717',
[950] = '0a0a0a',
},
stone = {
[50] = 'fafaf9',
[100] = 'f5f5f4',
[200] = 'e7e5e4',
[300] = 'd6d3d1',
[400] = 'a8a29e',
[500] = '78716c',
[600] = '57534e',
[700] = '44403c',
[800] = '292524',
[900] = '1c1917',
[950] = '0a0a0a',
},
red = {
[50] = 'fef2f2',
[100] = 'fee2e2',
[200] = 'fecaca',
[300] = 'fca5a5',
[400] = 'f87171',
[500] = 'ef4444',
[600] = 'dc2626',
[700] = 'b91c1c',
[800] = '991b1b',
[900] = '7f1d1d',
[950] = '450a0a',
},
orange = {
[50] = 'fff7ed',
[100] = 'ffedd5',
[200] = 'fed7aa',
[300] = 'fdba74',
[400] = 'fb923c',
[500] = 'f97316',
[600] = 'ea580c',
[700] = 'c2410c',
[800] = '9a3412',
[900] = '7c2d12',
[950] = '431407',
},
amber = {
[50] = 'fffbeb',
[100] = 'fef3c7',
[200] = 'fde68a',
[300] = 'fcd34d',
[400] = 'fbbf24',
[500] = 'f59e0b',
[600] = 'd97706',
[700] = 'b45309',
[800] = '92400e',
[900] = '78350f',
[950] = '451a03',
},
yellow = {
[50] = 'fefce8',
[100] = 'fef9c3',
[200] = 'fef08a',
[300] = 'fde047',
[400] = 'facc15',
[500] = 'eab308',
[600] = 'ca8a04',
[700] = 'a16207',
[800] = '854d0e',
[900] = '713f12',
[950] = '422006',
},
lime = {
[50] = 'f7fee7',
[100] = 'ecfccb',
[200] = 'd9f99d',
[300] = 'bef264',
[400] = 'a3e635',
[500] = '84cc16',
[600] = '65a30d',
[700] = '4d7c0f',
[800] = '3f6212',
[900] = '365314',
[950] = '1a2e05',
},
green = {
[50] = 'f0fdf4',
[100] = 'dcfce7',
[200] = 'bbf7d0',
[300] = '86efac',
[400] = '4ade80',
[500] = '22c55e',
[600] = '16a34a',
[700] = '15803d',
[800] = '166534',
[900] = '14532d',
[950] = '052e16',
},
emerald = {
[50] = 'ecfdf5',
[100] = 'd1fae5',
[200] = 'a7f3d0',
[300] = '6ee7b7',
[400] = '34d399',
[500] = '10b981',
[600] = '059669',
[700] = '047857',
[800] = '065f46',
[900] = '064e3b',
[950] = '022c22',
},
teal = {
[50] = 'f0fdfa',
[100] = 'ccfbf1',
[200] = '99f6e4',
[300] = '5eead4',
[400] = '2dd4bf',
[500] = '14b8a6',
[600] = '0d9488',
[700] = '0f766e',
[800] = '115e59',
[900] = '134e4a',
[950] = '042f2e',
},
cyan = {
[50] = 'ecfeff',
[100] = 'cffafe',
[200] = 'a5f3fc',
[300] = '67e8f9',
[400] = '22d3ee',
[500] = '06b6d4',
[600] = '0891b2',
[700] = '0e7490',
[800] = '155e75',
[900] = '164e63',
[950] = '083344',
},
sky = {
[50] = 'f0f9ff',
[100] = 'e0f2fe',
[200] = 'bae6fd',
[300] = '7dd3fc',
[400] = '38bdf8',
[500] = '0ea5e9',
[600] = '0284c7',
[700] = '0369a1',
[800] = '075985',
[900] = '0c4a6e',
[950] = '082f49',
},
blue = {
[50] = 'eff6ff',
[100] = 'dbeafe',
[200] = 'bfdbfe',
[300] = '93c5fd',
[400] = '60a5fa',
[500] = '3b82f6',
[600] = '2563eb',
[700] = '1d4ed8',
[800] = '1e40af',
[900] = '1e3a8a',
[950] = '172554',
},
indigo = {
[50] = 'eef2ff',
[100] = 'e0e7ff',
[200] = 'c7d2fe',
[300] = 'a5b4fc',
[400] = '818cf8',
[500] = '6366f1',
[600] = '4f46e5',
[700] = '4338ca',
[800] = '3730a3',
[900] = '312e81',
[950] = '1e1b4b',
},
violet = {
[50] = 'f5f3ff',
[100] = 'ede9fe',
[200] = 'ddd6fe',
[300] = 'c4b5fd',
[400] = 'a78bfa',
[500] = '8b5cf6',
[600] = '7c3aed',
[700] = '6d28d9',
[800] = '5b21b6',
[900] = '4c1d95',
[950] = '2e1065',
},
purple = {
[50] = 'faf5ff',
[100] = 'f3e8ff',
[200] = 'e9d5ff',
[300] = 'd8b4fe',
[400] = 'c084fc',
[500] = 'a855f7',
[600] = '9333ea',
[700] = '7e22ce',
[800] = '6b21a8',
[900] = '581c87',
[950] = '3b0764',
},
fuchsia = {
[50] = 'fdf4ff',
[100] = 'fae8ff',
[200] = 'f5d0fe',
[300] = 'f0abfc',
[400] = 'e879f9',
[500] = 'd946ef',
[600] = 'c026d3',
[700] = 'a21caf',
[800] = '86198f',
[900] = '701a75',
[950] = '4a044e',
},
pink = {
[50] = 'fdf2f8',
[100] = 'fce7f3',
[200] = 'fbcfe8',
[300] = 'f9a8d4',
[400] = 'f472b6',
[500] = 'ec4899',
[600] = 'db2777',
[700] = 'be185d',
[800] = '9d174d',
[900] = '831843',
[950] = '500724',
},
rose = {
[50] = 'fff1f2',
[100] = 'ffe4e6',
[200] = 'fecdd3',
[300] = 'fda4af',
[400] = 'fb7185',
[500] = 'f43f5e',
[600] = 'e11d48',
[700] = 'be123c',
[800] = '9f1239',
[900] = '881337',
[950] = '4c0519',
},
}
return M

View file

@ -1,95 +0,0 @@
return {
around = '󰅪',
bottom = '',
center = '󰘢',
change = '',
char = '󰾹',
comment = '',
dashboard = {
quit = '',
mru = '',
project = '',
},
delete = '󰆴',
diagnostics = {
Error = '',
Warn = '',
Hint = '',
Info = '',
},
explorer = '󰙅',
first = '󰘀',
fold = '',
format = '󰉼',
git = {
added = '',
modified = '',
removed = '',
unstaged = '󰄱',
staged = '󰱒',
diff = '󰫙',
},
go_to = '',
indent = {
left = '󰉵',
decrease = '󰉵',
right = '󰉶',
increase = '󰉶',
},
inner = '󰅩',
last = '󰘁',
lazygit = '',
left = '',
lsp = {
Array = '',
Boolean = '',
Class = '',
Color = '',
Control = '',
Constant = '󰏿',
Constructor = '',
Enum = '',
EnumMember = '',
Event = '',
Field = '',
File = '',
Folder = '',
Function = '󰊕',
Interface = '',
Key = '󰌋',
Keyword = '',
Method = '󰊕',
Module = '',
Namespace = '󰌗',
Null = '',
Number = '󰎠',
Object = '',
Operator = '󰆕',
Package = '',
Property = '',
Reference = '',
Snippet = '󱄽',
String = '',
Struct = '',
Text = '',
TypeParameter = '',
Unit = '',
Value = '',
Variable = '',
},
next = '',
notifications = '󰈸',
prev = '',
registers = '󰅍',
replace = '',
right = '',
sessions = '',
spell = '',
search = '',
top = '',
ui = '󰙵',
undo = '',
visual = '',
word = '',
yank = '',
}

View file

@ -1,207 +0,0 @@
local g = vim.g
local set = vim.keymap.set
local f = string.format
g.mapleader = ' '
g.maplocalleader = '\\'
-- Disable arrow key movement -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for _, key in ipairs({ '<DOWN>', '<UP>', '<LEFT>', '<RIGHT>' }) do
set({ 'n', 'i' }, key, '<NOP>')
end
-- Better up/down -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for dir, key in pairs({ Down = 'j', Up = 'k' }) do
set(
{ 'n', 'x' },
key,
f("v:count == 0 ? 'g%s' : '%s'", key, key),
{ desc = dir, expr = true, silent = true }
)
end
-- Resize windows -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for key, dir in pairs({
Up = 'increase',
Down = 'decrease',
Left = 'decrease',
Right = 'increase',
}) do
local sign = (dir == 'increase') and '+' or '-'
set(
{ 'n' },
f('<C-%s>', key),
f('<CMD>resize %s4<CR>', sign),
{ desc = f('%s window height', dir) }
)
end
-- Buffers -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for key, dir in pairs({
['<S-H>'] = 'previous',
['<S-L>'] = 'next',
['[b'] = 'previous',
[']b'] = 'next',
}) do
-- previous -> prev
local prettyDir = dir:sub(1, 4)
set(
{ 'n' },
key,
f('<CMD>b%s<CR>', dir),
{ desc = f('%s buffer', prettyDir) }
)
end
set({ 'n' }, '<LEADER>bD', '<CMD>bd<CR>', { desc = 'delete buffer and window' })
-- Clear search & refresh -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set(
{ 'n', 'i' },
'<ESC>',
'<CMD>noh<CR><ESC>',
{ desc = 'escape and clear hlsearch' }
)
set(
{ 'n' },
'<LEADER>ur',
'<CMD>nohlsearch<BAR>diffupdate<BAR>normal! <C-l><CR>',
{ desc = 'redraw / clear hlsearch / diff update' }
)
-- Better n & N -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for _, mode in ipairs({ 'n', 'x', 'o' }) do
local zv = (mode == 'n') and ".'zv'" or ''
set(
{ mode },
'n',
f("'Nn'[v:searchforward]%s", zv),
{ desc = 'next search result', expr = true }
)
set(
{ mode },
'N',
f("'nN'[v:searchforward]%s", zv),
{ desc = 'previous search result', expr = true }
)
end
-- Undo break-points -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for _, char in ipairs({ ',', '.', ';' }) do
set({ 'i' }, char, f('%s<C-g>u', char))
end
-- Search docs (keywordprog) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- https://til.codeinthehole.com/posts/about-how-to-use-keywordprg-effectively/
set(
{ 'n' },
'<LEADER>K',
'<CMD>norm! K<CR>',
{ desc = 'search <KEYWORDPROG> for word' }
)
-- Better indenting -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for _, char in ipairs({ '<', '>' }) do
local desc = 'indent ' .. (char == '<' and 'left' or 'right')
set({ 'v' }, char, f('%sgv', char), { desc = desc })
end
-- Commenting -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for key, dir in pairs({ o = 'below', O = 'above' }) do
set(
{ 'n' },
f('gc%s', key),
f('%s<ESC>Vcx<ESC><CMD>normal gcc<CR>fxa<BS>', key),
{ desc = f('add comment %s', dir) }
)
end
-- New files -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>fn', '<CMD>enew<CR>', { desc = 'new file' })
-- Locations/quickfixes -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>xl', '<CMD>lopen<CR>', { desc = 'location list' })
set({ 'n' }, '<LEADER>xq', '<CMD>copen<CR>', { desc = 'quickfix list' })
for key, dir in pairs({ ['['] = 'previous', [']'] = 'next' }) do
-- previous -> prev
local cmd = dir:sub(1, 4)
set(
{ 'n' },
f('%sq', key),
f('<CMD>c%s<CR>', cmd),
{ desc = f('%s quickfix', dir) }
)
end
-- Diagnostics -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>cd', function()
vim.diagnostic.open_float()
end, { desc = 'line diagnostics' })
local function goto_diagnostic(next, severity)
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
severity = severity and vim.diagnostic.severity[severity] or nil
return function()
go({ severity = severity })
end
end
for key, sev in pairs({
d = { nil, 'diagnostic' },
e = { 'ERROR', 'error' },
w = { 'WARN', 'warning' },
}) do
set(
{ 'n' },
f(']%s', key),
goto_diagnostic(true, sev[1]),
{ desc = f('next %s', sev[2]) }
)
set(
{ 'n' },
f('[%s', key),
goto_diagnostic(false, sev[1]),
{ desc = f('previous %s', sev[2]) }
)
end
-- Quit -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>qq', '<CMD>qa<CR>', { desc = 'quit all' })
-- Inspect -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>ui', vim.show_pos, { desc = 'inspect position' })
-- Window management -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>w', '<C-w>', { desc = 'windows', remap = true })
set({ 'n' }, '<LEADER>-', '<C-w>s', { desc = 'split below', remap = true })
set({ 'n' }, '<LEADER>|', '<C-w>v', { desc = 'split right', remap = true })
set({ 'n' }, '<LEADER>wd', '<C-w>c', { desc = 'delete window', remap = true })
-- Tab management -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
for key, act in pairs({
l = 'last',
o = 'only',
f = 'first',
['<TAB>'] = 'new',
[']'] = 'next',
d = 'close',
['['] = 'previous',
}) do
local desc = (act == 'only') and 'close other tabs' or f('%s tab', act)
set(
{ 'n' },
f('<LEADER><TAB>%s', key),
f('<CMD>tab%s<CR>', act:lower()),
{ desc = desc }
)
end

View file

@ -1,53 +0,0 @@
---@class lib
local M = {}
M.lsp = require('lib.lsp')
M.prettier = require('lib.prettier')
---Find the root of a project based on `vim.g.root_spec`. Defaults to
---`{ '.git' }` if unset.
---@return string?
function M.root()
local root_spec = vim.g.root_spec or { '.git' }
return vim.fs.root(0, root_spec)
end
---Require a file relative to the given prefix, to avoid repetition.
---@param prefix string The string to prefix to all req calls.
function M.local_require(prefix)
---@param mod string The module to require.
return function(mod)
return require(prefix .. '.' .. mod)
end
end
---Get and format the foreground of a highlight group.
---@param name string The highlight group name to fetch from.
---@return {fg:string}?
function M.fg(name)
local hl = vim.api.nvim_get_hl(0, { name = name, link = false })
return hl and { fg = string.format('#%06x', hl.fg) } or nil
end
---Generates a function that can be used to create which-key mappings.
---@param color string The color to use for the icon.
---@return function
function M.wkSpec(color)
---@param lhs string
---@param rhs string | fun()
---@param icon string | wk.Icon
---@param opts? wk.Spec
return function(lhs, rhs, icon, opts)
if type(icon) == 'string' then
icon = { icon = icon, color = color }
else
icon = vim.tbl_deep_extend('force', icon, { color = color })
end
return vim.tbl_deep_extend('force', { lhs, rhs, icon = icon }, (opts or {}))
end
end
return M

View file

@ -1,20 +0,0 @@
---@class lib.lsp
local M = {}
---Boilerplate to create an autocommand to do something on LspAttach.
---@param callback fun(client:vim.lsp.Client, buffer:number)
---@param name? string
function M.on_attach(callback, name)
return vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local buffer = args.buf ---@type number
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client and (not name or client.name == name) then
return callback(client, buffer)
end
end,
})
end
return M

View file

@ -1,54 +0,0 @@
---@class lib.prettier
local M = {}
---@alias ConformCtx {buf: number, filename: string, dirname: string}
M.supported = {
'css',
'graphql',
'handlebars',
'html',
'javascript',
'javascriptreact',
'json',
'jsonc',
'less',
'markdown',
'markdown.mdx',
'scss',
'typescript',
'typescriptreact',
'vue',
'yaml',
}
---Check if a parser exists for the given context.
---@param ctx ConformCtx
function M.has_parser(ctx)
local ft = vim.bo[ctx.buf].filetype --[[@as string]]
-- Default filetypes are always supported.
if vim.tbl_contains(M.supported, ft) then
return true
end
-- Otherwise, check if a parser can be inferred.
local inferred = vim.fn.system({ 'prettier', '--file-info', ctx.filename })
---@type boolean, string?
local ok, parser = pcall(function()
return vim.fn.json_decode(inferred).inferredParser
end)
return ok and parser and parser ~= vim.NIL
end
---Check if a Prettier config file exists in the current context.
---@param ctx ConformCtx
function M.has_config(ctx)
vim.fn.system({ 'prettier', '--find-config-path', ctx.filename })
return vim.v.shell_error == 0
end
return M

View file

@ -1,181 +0,0 @@
local i = require('icons')
-- Diagnostics -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
---@type vim.diagnostic.Opts
local diagnosticConfig = {
underline = true,
update_in_insert = true,
virtual_text = {
spacing = 4,
source = 'if_many',
prefix = function(diagnostic)
for d, icon in pairs(i.diagnostics) do
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
return icon
end
end
return ''
end,
},
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = i.diagnostics.Error,
[vim.diagnostic.severity.WARN] = i.diagnostics.Warn,
[vim.diagnostic.severity.HINT] = i.diagnostics.Hint,
[vim.diagnostic.severity.INFO] = i.diagnostics.Info,
},
},
}
for severity, icon in pairs(diagnosticConfig.signs.text) do
local name =
vim.diagnostic.severity[severity]:lower():gsub('^%l', string.upper)
name = 'DiagnosticSign' .. name
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = '' })
end
vim.diagnostic.config(diagnosticConfig)
-- Codelens -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
vim.api.nvim_create_autocmd('User', {
pattern = 'LspSupportsMethod',
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
local buffer = args.data.buffer
if client and args.data.method == 'textDocument/codeLens' then
vim.lsp.codelens.refresh()
vim.api.nvim_create_autocmd({ 'BufEnter', 'CursorHold', 'InsertLeave' }, {
buffer = buffer,
callback = vim.lsp.codelens.refresh,
})
end
end,
})
-- Server Setup -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
local has_blink, blink = pcall(require, 'blink.cmp')
local capabilities = vim.tbl_deep_extend(
'force',
{},
vim.lsp.protocol.make_client_capabilities(),
has_blink and blink.get_lsp_capabilities() or {},
{
workspace = {
fileOperations = {
didRename = true,
willRename = true,
},
},
}
)
vim.lsp.config('*', {
root_markers = { '.git' },
capabilities = capabilities,
})
vim.lsp.enable({
'bash-language-server',
'emmet-language-server',
'lua-language-server',
'nil',
-- 'nixd',
'phpactor',
'stylelint-lsp',
'taplo',
'vscode-css-language-server',
'vscode-html-language-server',
})
-- Keymaps -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MarleyVim.lsp.on_attach(function(client)
local set = vim.keymap.set
set('n', 'gD', vim.lsp.buf.declaration, { desc = 'declaration' })
set('n', 'gI', vim.lsp.buf.implementation, { desc = 'implementation' })
set('n', 'gr', vim.lsp.buf.references, { desc = 'references', nowait = true })
set('n', 'gy', vim.lsp.buf.type_definition, { desc = 'type definition' })
set('n', 'K', function()
return vim.lsp.buf.hover()
end, { desc = 'hover' })
if client.supports_method('textDocument/codeAction') then
set(
{ 'n', 'v' },
'<LEADER>ca',
vim.lsp.buf.code_action,
{ desc = 'code action' }
)
end
if client.supports_method('textDocument/codeLens') then
set(
{ 'n', 'v' },
'<LEADER>cc',
vim.lsp.codelens.run,
{ desc = 'run codelens' }
)
set(
'n',
'<LEADER>cC',
vim.lsp.codelens.refresh,
{ desc = 'refresh & display codelens' }
)
end
if client.supports_method('textDocument/definition') then
set('n', 'gd', vim.lsp.buf.definition, { desc = 'definition' })
end
if client.supports_method('textDocument/documentHighlight') then
if Snacks.words.is_enabled() then
set('n', '<A-n>', function()
Snacks.words.jump(vim.v.count1, true)
end, { desc = 'next reference' })
set('n', '<A-p>', function()
Snacks.words.jump(-vim.v.count1, true)
end, { desc = 'prev reference' })
set('n', ']]', function()
Snacks.words.jump(vim.v.count1)
end, { desc = 'next reference' })
set('n', '[[', function()
Snacks.words.jump(-vim.v.count1)
end, { desc = 'prev reference' })
end
end
if client.supports_method('textDocument/rename') then
set('n', '<LEADER>cr', vim.lsp.buf.rename, { desc = 'rename' })
end
if client.supports_method('textDocument/signatureHelp') then
set('i', '<C-k>', function()
return vim.lsp.buf.signature_help()
end, { desc = 'signature help' })
set('n', 'gK', function()
vim.lsp.buf.signature_help()
end, { desc = 'signature help' })
end
if
client.supports_method('workspace/didRenameFiles')
or client.supports_method('workspace/willRenameFiles')
then
set('n', '<LEADER>cR', function()
Snacks.rename.rename_file()
end, { desc = 'rename file' })
end
end)

View file

@ -1,135 +0,0 @@
local g = vim.g
local opt = vim.opt
-- Root dir detection options.
-- Each entry can be a pattern `.git` or `package.json`
g.root_spec = { '.git', 'package.json' }
-- Only set clipboard if not in SSH, to make sure the OSC 52 integration works
-- automatically. Requires Neovim >= 0.10.0.
-- `unnamedplus` is the system clipboard.
opt.clipboard = vim.env.SSH_TTY and '' or 'unnamedplus'
-- Relative line numbers.
opt.number = true
opt.relativenumber = true
-- Set <Tab> to 2 spaces.
opt.expandtab = true
opt.shiftwidth = 2
opt.tabstop = 2
-- Smart/auto indenting.
opt.shiftround = true
opt.smartindent = true
opt.breakindent = true
-- Show matches in real time while searching.
opt.hlsearch = true
opt.incsearch = true
-- Disable text wrap.
opt.wrap = false
-- Better splitting.
opt.splitbelow = true
opt.splitright = true
-- Enable mouse mode.
opt.mouse = 'a'
-- Smart handling of case when searching.
opt.ignorecase = true
opt.smartcase = true
-- Use Ripgrep for searching.
opt.grepprg = 'rg --vimgrep'
opt.grepformat = '%f:%l:%c:%m'
-- More frequent swap file saving.
opt.updatetime = 200
-- Completion options.
opt.completeopt = { 'menu', 'menuone', 'noselect', 'noinsert' }
-- Persistant & bigger undo history.
opt.undofile = true
opt.undolevels = 10000
-- Enable 24-bit colors.
opt.termguicolors = true
-- Always show the signcolumn to keep the text from jumping.
opt.signcolumn = 'yes'
-- Highlight the current line.
opt.cursorline = true
-- Fold settings.
opt.foldcolumn = '1'
opt.foldlevel = 99
opt.foldenable = true
opt.foldmethod = 'expr'
opt.foldexpr = 'nvim_treesitter#foldexpr()'
opt.foldtext = ''
-- Always keep 4 lines above/below cursor.
opt.scrolloff = 4
-- Max width.
opt.textwidth = 80
opt.colorcolumn = '+1'
-- Show some invisible chars.
opt.list = true
opt.listchars = { tab = '->', trail = '·' }
-- Only show a single statusline instead of one for each window.
opt.laststatus = 3
-- Preview subsitutions as you type.
opt.inccommand = 'split'
-- Ask to save changes before exiting modified buffer.
opt.confirm = true
-- I don't understand this but LazyVim sets it and it seems like a good idea.
opt.jumpoptions = 'view'
-- Enable a little transparency for pop-ups.
opt.pumblend = 10
-- Disable default line/col numbers in statusline.
opt.ruler = false
-- What to save when calling :mksession.
opt.sessionoptions = {
'buffers',
'curdir',
'tabpages',
'winsize',
'help',
'globals',
'skiprtp',
'folds',
}
-- Scrolling.
opt.smoothscroll = true
opt.sidescroll = 1
opt.sidescrolloff = 8
-- Spelling suggestions language.
opt.spelllang = { 'en' }
-- Allow cursor to move where there is no text in visual block mode.
opt.virtualedit = 'block'
-- Command mode completion mode.
opt.wildmode = { 'longest:full', 'full' }
-- Min window width when splitting.
opt.winminwidth = 5
-- Disable some messages.
opt.shortmess:append({ W = true, I = true, c = true, C = true })

View file

@ -1,84 +0,0 @@
return {
'blink.cmp',
event = 'InsertEnter',
before = function()
require('lz.n').trigger_load({
'mini.icons',
'luasnip',
})
end,
after = function()
---@module 'blink.cmp'
---@type blink.cmp.Config
local opts = {
appearance = {
use_nvim_cmp_as_default = false,
nerd_font_variant = 'mono',
},
completion = {
accept = {
auto_brackets = {
enabled = true,
},
},
menu = {
draw = {
treesitter = { 'lsp' },
components = {
kind_icon = {
ellipsis = false,
text = function(ctx)
local icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
return icon
end,
highlight = function(ctx)
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
return hl
end,
},
},
},
},
documentation = {
auto_show = true,
auto_show_delay_ms = 200,
},
ghost_text = {
enabled = false,
},
list = {
selection = { preselect = true, auto_insert = false },
},
},
snippets = {
preset = 'luasnip',
expand = function(snippet)
require('luasnip').lsp_expand(snippet)
end,
active = function(filter)
if filter and filter.direction then
return require('luasnip').jumpable(filter.direction)
end
return require('luasnip').in_snippet()
end,
jump = function(direction)
require('luasnip').jump(direction)
end,
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' },
},
keymap = {
preset = 'super-tab',
},
}
require('blink.cmp').setup(opts)
end,
}

View file

@ -1,4 +0,0 @@
return {
'friendly-snippets',
lazy = true,
}

View file

@ -1,14 +0,0 @@
local req = MarleyVim.local_require('plugins.coding')
return {
req('blink-cmp'),
req('friendly-snippets'),
req('lexima-vim'),
req('luasnip'),
req('mini-ai'),
req('mini-comment'),
req('mini-surround'),
req('neotab-nvim'),
req('ts-comments-nvim'),
req('yanky-nvim'),
}

View file

@ -1,4 +0,0 @@
return {
'lexima.vim',
event = 'DeferredUIEnter',
}

View file

@ -1,32 +0,0 @@
return {
'luasnip',
lazy = true,
before = function()
require('lz.n').trigger_load({
'friendly-snippets',
})
end,
after = function()
require('luasnip').setup({
history = true,
delete_check_events = 'TextChanged',
store_selection_keys = '<TAB>',
update_events = 'TextChanged,TextChangedI',
})
-- friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load()
-- Personal snippets.
local snippets = {}
local paths = vim.api.nvim_get_runtime_file('lua/snippets', true)
for _, path in ipairs(paths) do
if string.find(path, '%/nix%/store%/.+') then
table.insert(snippets, path)
end
end
require('luasnip.loaders.from_lua').load({ paths = snippets })
end,
}

View file

@ -1,124 +0,0 @@
return {
'mini.ai',
event = 'DeferredUIEnter',
before = function()
require('lz.n').trigger_load('which-key.nvim')
end,
after = function()
local ai = require('mini.ai')
ai.setup({
n_lines = 500,
custom_textobjects = {
-- code blOck
o = ai.gen_spec.treesitter({
a = { '@block.outer', '@conditional.outer', '@loop.outer' },
i = { '@block.inner', '@conditional.inner', '@loop.inner' },
}),
-- Class
c = ai.gen_spec.treesitter({
a = '@class.outer',
i = '@class.inner',
}),
-- Usage (fn call)
u = ai.gen_spec.function_call(),
-- Usage (to last .)
U = ai.gen_spec.function_call({ name_pattern = '[%w_]' }),
-- Digit
d = { '%f[%d]%d+' },
-- word within casE (snake_case, CamelCase, etc)
e = {
{
'%u[%l%d]+%f[^%l%d]',
'%f[%S][%l%d]+%f[^%l%d]',
'%f[%P][%l%d]+%f[^%l%d]',
'^[%l%d]+%f[^%l%d]',
},
'^().*()$',
},
-- buffer
g = {
from = { line = 1, col = 1 },
to = {
line = vim.fn.line('$'),
col = math.max(vim.fn.getline('$'):len(), 1),
},
},
},
})
local i = require('icons')
local c = require('colors')
local mkA = MarleyVim.wkSpec(c.around)
local mkI = MarleyVim.wkSpec(c.inner)
---@param lhs string
---@param icon string
---@param opts table
local function mkKey(lhs, icon, opts)
if lhs:sub(1, 1) == 'a' then
return mkA(lhs, nil, icon, opts)
else
return mkI(lhs, nil, icon, opts)
end
end
local groups = {
around = { 'a', i.around },
around_last = { 'al', i.around },
around_next = { 'an', i.around },
inner = { 'i', i.inner },
inner_last = { 'il', i.inner },
inner_next = { 'in', i.inner },
}
local mappings = {
{ '<SPACE>', '', 'whitespace' },
{ '"', '', 'double quotes' },
{ "'", '', 'single quotes' },
{ '`', '', 'backticks' },
{ '(', '󰅲', '()' },
{ ')', '󰅲', '() with ws' },
{ '[', '󰅪', '[] block' },
{ ']', '󰅪', '[] block with ws' },
{ '{', '󰅩', '{} block' },
{ '}', '󰅩', '{} block with ws' },
{ '<', '󰅴', '<>' },
{ '>', '󰅴', '<> with ws' },
{ '_', '󱁐', 'underscores' },
{ '?', '󰘎', 'user prompt' },
{ 'a', i.lsp.Variable, 'argument' },
{ 'b', '󰅲', ')]} block' },
{ 'c', i.lsp.Class, 'class' },
{ 'd', i.lsp.Number, 'numbers' },
{ 'e', i.lsp.Variable, 'word within case' },
{ 'f', i.lsp.Function, 'function' },
{ 'g', i.lsp.File, 'entire buffer' },
{ 'o', i.lsp.Control, 'block, conditional, loop' },
{ 'q', i.lsp.String, 'quotes/backticks' },
{ 't', '󰅴', 'tags' },
{ 'u', i.lsp.Method, 'use/call' },
{ 'U', i.lsp.Method, 'use/call without dot' },
}
local spec = { mode = { 'o', 'x' } }
for name, data in pairs(groups) do
name = name:gsub('^around_', ''):gsub('^insude_', '')
spec[#spec + 1] = mkKey(data[1], data[2], { group = name })
for _, item in ipairs(mappings) do
spec[#spec + 1] = mkKey(data[1] .. item[1], item[2], { desc = item[3] })
end
end
require('which-key').add({ spec })
end,
}

View file

@ -1,7 +0,0 @@
return {
'mini.comment',
event = 'DeferredUIEnter',
after = function()
require('mini.comment').setup({})
end,
}

View file

@ -1,26 +0,0 @@
local keys = {
add = 'gsa',
delete = 'gsd',
find = 'gsf',
find_left = 'gsF',
highlight = 'gsh',
replace = 'gsr',
update_n_lines = 'gsn',
}
return {
'mini.surround',
keys = {
{ keys.add, desc = 'add surrounding', mode = { 'n', 'v' } },
{ keys.delete, desc = 'delete surrounding' },
{ keys.find, desc = 'find right surrounding' },
{ keys.find_left, desc = 'find left surrounding' },
{ keys.highlight, desc = 'highlight surrounding' },
{ keys.replace, desc = 'replace surrounding' },
{ keys.update_n_lines, desc = 'update n_lines' },
},
after = function()
require('mini.surround').setup({
mappings = keys,
})
end,
}

View file

@ -1,36 +0,0 @@
return {
'neotab.nvim',
event = 'InsertEnter',
after = function()
require('neotab').setup({
behavior = 'closing',
smart_punctuators = {
enabled = true,
semicolon = {
enabled = true,
ft = { 'javascript', 'typescript', 'php', 'nix' },
},
escape = {
enabled = true,
triggers = {
[','] = {
pairs = {
{ open = "'", close = "'" },
{ open = '"', close = '"' },
},
format = '%s ', -- ", "
},
['='] = {
pairs = {
{ open = '(', close = ')' },
},
ft = { 'javascript', 'typescript' },
format = ' %s> ', -- ` => `
cond = '^$', -- match only pairs with empty content
},
},
},
},
})
end,
}

View file

@ -1,7 +0,0 @@
return {
'ts-comments.nvim',
event = 'DeferredUIEnter',
after = function()
require('ts-comments').setup({})
end,
}

View file

@ -1,104 +0,0 @@
return {
'yanky.nvim',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
keys = {
{
'gp',
'<PLUG>(YankyGPutAfter)',
mode = { 'n', 'x' },
desc = 'put text after selection',
},
{
'gP',
'<PLUG>(YankyGPutBefore',
mode = { 'n', 'x' },
desc = 'put text before selection',
},
{
'p',
'<PLUG>(YankyPutAfter)',
mode = { 'n', 'x' },
desc = 'put text after cursor',
},
{
'P',
'<PLUG>(YankyPutBefore)',
mode = { 'n', 'x' },
desc = 'put text before cursor',
},
{ 'y', '<PLUG>(YankyYank)', mode = { 'n', 'x' }, desc = 'yank text' },
{
'<LEADER>p',
function()
vim.cmd([[YankyRingHistory]])
end,
mode = { 'n', 'x' },
desc = 'open yank history',
},
{
'[p',
'<PLUG>(YankyPutIndentBeforeLinewise)',
desc = 'put indented before cursor (linewise)',
},
{
'[P',
'<PLUG>(YankyPutIndentBeforeLinewise)',
desc = 'put indented before cursor (linewise)',
},
{
']p',
'<PLUG>(YankyPutIndentAfterLinewise)',
desc = 'put indented after cursor (linewise)',
},
{
']P',
'<PLUG>(YankyPutIndentAfterLinewise)',
desc = 'put indented after cursor (linewise)',
},
{
'[y',
'<PLUG>(YankyCycleForward)',
desc = 'cycle forward through yank history',
},
{
']y',
'<PLUG>(YankyCycleBackward)',
desc = 'cycle backword through yank history',
},
{
'<p',
'<PLUG>(YankyPutIndentAfterShiftLeft)',
desc = 'put and indent left',
},
{
'<P',
'<PLUG>(YankyPutIndentBeforeShiftLeft)',
desc = 'put and indent left',
},
{
'>p',
'<PLUG>(YankyPutIndentAfterShiftRight)',
desc = 'put and indent right',
},
{
'>P',
'<PLUG>(YankyPutIndentBeforeShiftRight)',
desc = 'put and indent right',
},
{
'=p',
'<PLUG>(YankyPutAfterFilter)',
desc = 'put after applying a filter',
},
{
'=P',
'<PLUG>(YankyPutBeforeFilter)',
desc = 'put before applying a filter',
},
},
after = function()
require('yanky').setup({
highlight = { timer = 150 },
})
end,
}

View file

@ -1,5 +0,0 @@
local req = MarleyVim.local_require('plugins.colorscheme')
return {
req('rose-pine'),
}

View file

@ -1,17 +0,0 @@
return {
'rose-pine',
colorscheme = {
'rose-pine',
'rose-pine-main',
'rose-pine-moon',
'rose-pine-dawn',
},
after = function()
require('rose-pine').setup({
variant = 'main',
})
-- Reload the colorscheme once opts are set.
vim.cmd('colorscheme rose-pine')
end,
}

View file

@ -1,32 +0,0 @@
return {
'aerial.nvim',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
keys = {
{ '<LEADER>cs', '<CMD>AerialToggle<CR>', desc = 'toggle aerial' },
},
before = function()
require('lz.n').trigger_load({ 'mini.icons' })
end,
after = function()
require('aerial').setup({
attach_mode = 'global',
backends = { 'lsp', 'treesitter', 'markdown', 'man' },
show_guides = true,
layout = {
resize_to_content = false,
placement = 'edge',
win_opts = {
winhl = 'Normal:NormalFloat,FloatBorder:NormalFloat,SignColumn:SignColumnSB',
signcolumn = 'yes',
statuscolumn = ' ',
},
},
guides = {
mid_item = '├╴',
last_item = '└╴',
nested_top = '',
whitespace = ' ',
},
})
end,
}

View file

@ -1,61 +0,0 @@
return {
'flash.nvim',
event = 'DeferredUIEnter',
keys = {
{
's',
function()
require('flash').jump()
end,
mode = { 'n', 'x', 'o' },
desc = 'flash',
},
{
'S',
function()
require('flash').treesitter()
end,
mode = { 'n', 'x', 'o' },
desc = 'flash (treesitter)',
},
{
'r',
function()
require('flash').remote()
end,
mode = { 'o' },
desc = 'remote flash',
},
{
'R',
function()
require('flash').treesitter_search()
end,
mode = { 'x', 'o' },
desc = 'treesitter search',
},
{
'<C-s>',
function()
require('flash').toggle()
end,
mode = { 'c' },
desc = 'toggle flash search',
},
},
before = function()
require('lz.n').trigger_load('which-key.nvim')
end,
after = function()
require('flash').setup({})
local mkKey = MarleyVim.wkSpec(require('colors').search)
require('which-key').add({
mkKey('s', nil, '', { mode = { 'n', 'x', 'o' } }),
mkKey('S', nil, '', { mode = { 'n', 'x', 'o' } }),
mkKey('r', nil, '', { mode = { 'o' } }),
mkKey('r', nil, '󰊕', { mode = { 'x', 'o' } }),
mkKey('<C-s>', nil, '󰥖', { mode = { 'c' } }),
})
end,
}

View file

@ -1,370 +0,0 @@
---@param picker string
---@param opts? table
local function pick(picker, opts)
opts = opts or {}
return function()
require('fzf-lua')[picker](opts)
end
end
local projectPick = nil
projectPick = function()
local has_project, _ = pcall(require, 'project_nvim')
if not has_project then
return
end
local fzf_lua = require('fzf-lua')
local project = require('project_nvim.project')
local history = require('project_nvim.utils.history')
local results = history.get_recent_projects()
local utils = require('fzf-lua.utils')
local function hl_validate(hl)
return not utils.is_hl_cleared(hl) and hl or nil
end
local function ansi_from_hl(hl, s)
return utils.ansi_from_hl(hl_validate(hl), s)
end
local opts = {
fzf_opts = {
['--header'] = string.format(
':: <%s> to %s | <%s> to %s | <%s> to %s | <%s> to %s | <%s> to %s',
ansi_from_hl('FzfLuaHeaderBind', 'ctrl-t'),
ansi_from_hl('FzfLuaHeaderText', 'tabedit'),
ansi_from_hl('FzfLuaHeaderBind', 'ctrl-s'),
ansi_from_hl('FzfLuaHeaderText', 'live_grep'),
ansi_from_hl('FzfLuaHeaderBind', 'ctrl-r'),
ansi_from_hl('FzfLuaHeaderText', 'oldfiles'),
ansi_from_hl('FzfLuaHeaderBind', 'ctrl-w'),
ansi_from_hl('FzfLuaHeaderText', 'change_dir'),
ansi_from_hl('FzfLuaHeaderBind', 'ctrl-d'),
ansi_from_hl('FzfLuaHeaderText', 'delete')
),
},
fzf_colors = true,
actions = {
['default'] = {
function(selected)
fzf_lua.files({ cwd = selected[1] })
end,
},
['ctrl-t'] = {
function(selected)
vim.cmd('tabedit')
fzf_lua.files({ cwd = selected[1] })
end,
},
['ctrl-s'] = {
function(selected)
fzf_lua.live_grep({ cwd = selected[1] })
end,
},
['ctrl-r'] = {
function(selected)
fzf_lua.oldfiles({ cwd = selected[1] })
end,
},
['ctrl-w'] = {
function(selected)
local path = selected[1]
local ok = project.set_pwd(path)
if ok then
vim.api.nvim_win_close(0, false)
vim.notify('Change project dir to ' .. path, 'info')
end
end,
},
['ctrl-d'] = function(selected)
local path = selected[1]
local choice =
vim.fn.confirm("Delete '" .. path .. "' project? ", '&Yes\n&No')
if choice == 1 then
history.delete_project({ value = path })
end
---@diagnostic disable-next-line:need-check-nil
projectPick()
end,
},
}
fzf_lua.fzf_exec(results, opts)
end
return {
'fzf-lua',
event = { 'DeferredUIEnter' },
cmd = { 'FzfLua' },
keys = {
-- Find.
{
'<LEADER>fb',
pick('buffers', { sort_mru = true, sort_lastused = true }),
desc = 'buffers',
},
{ '<LEADER>ff', pick('files'), desc = 'find files (root dir)' },
{
'<LEADER>fF',
pick('files', { root = false }),
desc = 'find files (cwd)',
},
{ '<LEADER>fg', pick('git_files'), desc = 'find files (git)' },
{ '<LEADER>fp', projectPick, desc = 'projects' },
{ '<LEADER>fr', pick('oldfiles'), desc = 'recent' },
{
'<LEADER>fR',
pick('oldfiles', { cwd = vim.uv.cwd() }),
desc = 'recent (cwd)',
},
-- Git.
{ '<LEADER>gc', pick('git_commits'), desc = 'commits' },
{ '<LEADER>gs', pick('git_status'), desc = 'status' },
-- Search.
{ '<LEADER>sa', pick('autocmds'), desc = 'auto-commands' },
{ '<LEADER>sb', pick('grep_curbuf'), desc = 'buffer' },
{ '<LEADER>sc', pick('command_history'), desc = 'command history' },
{ '<LEADER>sC', pick('commands'), desc = 'commands' },
{
'<LEADER>sd',
pick('diagnostics_document'),
desc = 'document diagnostics',
},
{
'<LEADER>sD',
pick('diagnostics_workspace'),
desc = 'workspace diagnostics',
},
{ '<LEADER>sg', pick('live_grep'), desc = 'grep (root dir)' },
{ '<LEADER>sG', pick('live_grep', { root = false }), desc = 'grep (cwd)' },
{ '<LEADER>sh', pick('help_tags'), desc = 'help pages' },
{ '<LEADER>sH', pick('highlights'), desc = 'search highlight groups' },
{ '<LEADER>sj', pick('jumps'), desc = 'jumplist' },
{ '<LEADER>sk', pick('keymaps'), desc = 'keymaps' },
{ '<LEADER>sl', pick('loclist'), desc = 'location list' },
{ '<LEADER>sm', pick('marks'), desc = 'jump to mark' },
{ '<LEADER>sM', pick('man_pages'), desc = 'man pages' },
{ '<LEADER>sq', pick('quickfix'), desc = 'quickfix list' },
{ '<LEADER>sR', pick('resume'), desc = 'resume last picker' },
{ '<LEADER>sw', pick('grep_cword'), desc = 'word under cursor (root dir)' },
{
'<LEADER>sw',
pick('grep_visual'),
mode = 'v',
desc = 'selection (root dir)',
},
{
'<LEADER>sW',
pick('grep_cword', { root = false }),
desc = 'word under cursor (cwd)',
},
{
'<LEADER>sW',
pick('grep_visual', { root = false }),
mode = 'v',
desc = 'selection (cwd)',
},
{ '<LEADER>s"', pick('registers'), desc = 'registers' },
-- Misc.
{ '<LEADER>uC', pick('colorschemes'), desc = 'colorschemes' },
{ '<LEADER><SPACE>', pick('files'), desc = 'find files (root dir)' },
{
'<LEADER>,',
pick('buffers', { sort_mru = true, sort_lastused = true }),
desc = 'switch buffer',
},
{ '<LEADER>/', pick('live_grep'), desc = 'grep (root dir)' },
{ '<LEADER>:', pick('command_history'), desc = 'command history' },
},
after = function()
local config = require('fzf-lua.config')
local actions = require('fzf-lua.actions')
-- quickfix
config.defaults.keymap.fzf['ctrl-q'] = 'select-all+accept'
config.defaults.keymap.fzf['ctrl-u'] = 'half-page-up'
config.defaults.keymap.fzf['ctrl-d'] = 'half-page-down'
config.defaults.keymap.fzf['ctrl-x'] = 'jump'
config.defaults.keymap.fzf['ctrl-f'] = 'preview-page-down'
config.defaults.keymap.fzf['ctrl-b'] = 'preview-page-up'
config.defaults.keymap.builtin['<c-f>'] = 'preview-page-down'
config.defaults.keymap.builtin['<c-b>'] = 'preview-page-up'
-- trouble.nvim
local has_trouble, _ = pcall(require, 'trouble')
if has_trouble then
config.defaults.actions.files['ctrl-t'] =
require('trouble.sources.fzf').actions.open
end
local img_previewer = { 'chafa', '{file}', '--format=symbols' }
local opts = {
-- Base profile.
'default-title',
fzf_colors = true,
fzf_opts = {
['--no-scrollbar'] = true,
},
defaults = {
formatter = 'path.dirname_first',
},
previewers = {
builtin = {
extensions = {
['png'] = img_previewer,
['jpg'] = img_previewer,
['jpeg'] = img_previewer,
['gif'] = img_previewer,
['webp'] = img_previewer,
},
},
},
winopts = {
width = 0.8,
height = 0.8,
row = 0.5,
col = 0.5,
preview = {
scrollchars = { '', '' },
},
},
files = {
cwd_prompt = false,
actions = {
['alt-i'] = { actions.toggle_ignore },
['alt-h'] = { actions.toggle_hidden },
},
},
grep = {
actions = {
['alt-i'] = { actions.toggle_ignore },
['alt-h'] = { actions.toggle_hidden },
},
},
lsp = {
symbols = {
symbol_hl = function(s)
return 'TroubleIcon' .. s
end,
symbol_fmt = function(s)
return s:lower() .. '\t'
end,
child_prefix = false,
},
code_actions = {
previewer = 'codeaction_native',
},
},
}
-- Use the same prompt for all pickers for profile 'default-title'.
local function fix(table)
table.prompt = table.prompt ~= nil and '' or nil
-- Recurse into subtables.
for _, value in pairs(table) do
if type(value) == 'table' then
fix(value)
end
end
return table
end
opts = vim.tbl_deep_extend(
'force',
fix(require('fzf-lua.profiles.default-title')),
opts
)
-- Don't let fzf-lua apply the profile as we've already done so above.
opts[1] = nil
require('fzf-lua').setup(opts)
require('fzf-lua').register_ui_select(function(fzf_opts, items)
return vim.tbl_deep_extend('force', fzf_opts, {
prompt = '',
winopts = {
title = ' '
.. vim.trim((fzf_opts.prompt or 'Select'):gsub('%s*:%s*$', ''))
.. ' ',
title_pos = 'center',
},
}, fzf_opts.kind == 'codeaction' and {
winopts = {
layout = 'vertical',
height = math.floor(
math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5
) + 16,
preview = not vim.tbl_isempty(
vim.lsp.get_clients({ bufnr = 0, name = 'vtsls' })
)
and {
layout = 'vertical',
vertical = 'down:15,border-top',
hidden = 'hidden',
}
or {
layout = 'vertical',
vertical = 'down:15,border-top',
},
},
} or {
winopts = {
width = 0.5,
height = math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5),
},
})
end)
-- LSP keybinds.
MarleyVim.lsp.on_attach(function(client)
local set = vim.keymap.set
local pickOpts =
{ jump_to_single_result = true, ignore_current_line = true }
set(
'n',
'gI',
pick('lsp_implementations', pickOpts),
{ desc = 'implementation' }
)
set(
'n',
'gr',
pick('lsp_references', pickOpts),
{ desc = 'references', nowait = true }
)
set(
'n',
'gy',
pick('lsp_typedefs', pickOpts),
{ desc = 't[y]pe definition' }
)
if client.supports_method('textDocument/definition') then
set(
'n',
'gd',
pick('lsp_definitions', pickOpts),
{ desc = 'definition' }
)
end
end)
end,
}

View file

@ -1,133 +0,0 @@
return {
'gitsigns.nvim',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
before = function()
require('lz.n').trigger_load('which-key.nvim')
end,
after = function()
require('gitsigns').setup({
signs = {
add = { text = '' },
change = { text = '' },
delete = { text = '' },
topdelete = { text = '' },
changedelete = { text = '' },
untracked = { text = '' },
},
signs_staged = {
add = { text = '' },
change = { text = '' },
delete = { text = '' },
topdelete = { text = '' },
changedelete = { text = '' },
},
on_attach = function(buf)
local gitsigns = package.loaded.gitsigns
local icons = require('icons')
local mkKey = MarleyVim.wkSpec(require('colors').git)
require('which-key').add({
{
buffer = buf,
mkKey(']h', function()
if vim.wo.diff then
vim.cmd.normal({ ']c', bang = true })
else
gitsigns.nav_hunk('next')
end
end, icons.next, { desc = 'next hunk' }),
mkKey('[h', function()
if vim.wo.diff then
vim.cmd.normal({ '[c', bang = true })
else
gitsigns.nav_hunk('prev')
end
end, icons.prev, { desc = 'previous hunk' }),
mkKey(']H', function()
gitsigns.nav_hunk('last')
end, icons.last, { desc = 'last hunk' }),
mkKey('[H', function()
gitsigns.nav_hunk('first')
end, icons.first, { desc = 'first hunk' }),
mkKey(
'<LEADER>ghs',
'<CMD>Gitsigns stage_hunk<CR>',
icons.git.staged,
{ mode = { 'n', 'v' }, desc = 'stage hunk' }
),
mkKey(
'<LEADER>ghr',
'<CMD>Gitsigns reset_hunk<CR>',
icons.git.unstaged,
{ mode = { 'n', 'v' }, desc = 'reset hunk' }
),
mkKey(
'<LEADER>ghS',
gitsigns.stage_buffer,
icons.git.staged,
{ desc = 'stage buffer' }
),
mkKey(
'<LEADER>ghu',
gitsigns.undo_stage_hunk,
icons.undo,
{ desc = 'undo stage hunk' }
),
mkKey(
'<LEADER>ghR',
gitsigns.reset_buffer,
icons.git.unstaged,
{ desc = 'reset buffer' }
),
mkKey(
'<LEADER>ghp',
gitsigns.preview_hunk_inline,
'',
{ desc = 'preview hunk inline' }
),
mkKey('<LEADER>ghb', function()
gitsigns.blame_line({ full = true })
end, { cat = 'filetype', name = 'git' }, {
desc = 'blame line',
}),
mkKey(
'<LEADER>ghB',
gitsigns.blame,
{ cat = 'filetype', name = 'git' },
{ desc = 'blame buffer' }
),
mkKey(
'<LEADER>ghd',
gitsigns.diffthis,
icons.git.diff,
{ desc = 'diff file' }
),
mkKey('<LEADER>ghD', function()
gitsigns.diffthis('~')
end, icons.git.diff, { desc = 'diff file from ~' }),
mkKey(
'ih',
'<CMD><C-u>Gitsigns select_hunk<CR>',
'󰿚',
{ mode = { 'o', 'x' }, desc = 'select hunk' }
),
},
})
end,
})
end,
}

View file

@ -1,25 +0,0 @@
return {
'grug-far.nvim',
cmd = 'GrugFar',
keys = {
{
'<LEADER>sr',
function()
local grug = require('grug-far')
local ext = vim.bo.buftype == '' and vim.fn.expand('%:e')
grug.open({
transient = true,
prefills = {
filesFilter = ext and ext ~= '' and '*.' .. ext or nil,
},
})
end,
mode = { 'n', 'v' },
desc = 'search and replace',
},
},
after = function()
require('grug-far').setup({ headerMaxWidth = 80 })
end,
}

View file

@ -1,15 +0,0 @@
local req = MarleyVim.local_require('plugins.editor')
return {
req('aerial-nvim'),
req('flash-nvim'),
req('fzf-lua'),
req('gitsigns-nvim'),
req('grug-far-nvim'),
req('neo-tree-nvim'),
req('nvim-emmet'),
req('refactoring-nvim'),
req('todo-comments-nvim'),
req('trouble-nvim'),
req('which-key-nvim'),
}

View file

@ -1,140 +0,0 @@
---@param root? boolean
---@param grouped? boolean
local function make_toggle_mapping(root, grouped)
root = root or false
grouped = grouped or false
local lhs = grouped and '<LEADER>fe' or '<LEADER>e'
lhs = root and lhs or (lhs:gsub('%l$', string.upper))
return {
lhs,
function()
require('neo-tree.command').execute({
toggle = true,
dir = root and (MarleyVim.root()) or (vim.uv.cwd()),
})
end,
desc = 'explorer (' .. (root and 'root' or 'cwd') .. ')',
}
end
return {
'neo-tree.nvim',
cmd = 'Neotree',
keys = {
make_toggle_mapping(true, true), -- root / grouped
make_toggle_mapping(false, true), -- cwd / grouped
make_toggle_mapping(true, false), -- root / non-grouped
make_toggle_mapping(false, false), -- cwd / non-grouped
{
'<LEADER>ge',
function()
require('neo-tree.command').execute({
source = 'git_status',
toggle = true,
})
end,
desc = 'git explorer',
},
{
'<LEADER>be',
function()
require('neo-tree.command').execute({
source = 'buffers',
toggle = true,
})
end,
desc = 'buffer explorer',
},
},
before = function()
require('lz.n').trigger_load({
'plenary.nvim',
'mini.icons',
'nui.nvim',
'which-key.nvim',
})
end,
after = function()
local icons = require('icons')
local events = require('neo-tree.events')
for _, type in ipairs({ 'Error', 'Warn', 'Info', 'Hint' }) do
vim.fn.sign_define('DiagnosticSign' .. type, {
text = icons.diagnostics[type] .. ' ',
texthl = 'DiagnosticSign' .. type,
})
end
local function on_move(data)
Snacks.rename.on_rename_file(data.source, data.destination)
end
require('neo-tree').setup({
close_if_last_window = true,
sources = { 'filesystem', 'buffers', 'git_status' },
open_files_do_not_replace_types = {
'terminal',
'Trouble',
'trouble',
'qf',
'Outline',
},
filesystem = {
bind_to_cwd = false,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
filtered_items = {
visible = true,
hide_dotfiles = false,
hide_gitignored = false,
hide_hidden = false,
},
},
window = {
width = 30,
mappings = {
['l'] = 'open',
['h'] = 'close_node',
['<SPACE>'] = 'none',
['Y'] = {
function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg('+', path, 'c')
end,
desc = 'copy path to clipboard',
},
['P'] = { 'toggle_preview', config = { use_float = false } },
},
},
default_component_configs = {
indent = {
with_expanders = true,
expanders_collapsed = '',
expander_expanded = '',
expander_highlight = 'NeoTreeExpander',
},
git_status = {
symbols = {
unstaged = icons.git.unstaged,
staged = icons.git.staged,
},
},
},
event_handlers = {
{ event = events.FILE_MOVED, handler = on_move },
{ event = events.FILE_RENAMED, handler = on_move },
},
})
local colors = require('colors')
require('which-key').add({
{ '<LEADER>ge', icon = { icon = '', color = colors.git } },
{ '<LEADER>be', icon = { icon = '', color = colors.buffer } },
})
end,
}

View file

@ -1,11 +0,0 @@
return {
'nvim-emmet',
keys = {
{
'<LEADER>xe',
require('nvim-emmet').wrap_with_abbreviation,
mode = { 'n', 'v' },
desc = 'wrap with emmet abbr',
},
},
}

View file

@ -1,126 +0,0 @@
return {
'refactoring.nvim',
event = { 'BufReadPre', 'BufNewFile' },
keys = {
{ '<LEADER>r', '', desc = '+refactor', mode = { 'n', 'v' } },
{
'<LEADER>rb',
function()
require('refactoring').refactor('Extract Block')
end,
desc = 'extract block',
},
{
'<LEADER>rc',
function()
require('refactoring').debug.cleanup({})
end,
desc = 'debug cleanup',
},
{
'<LEADER>rf',
function()
require('refactoring').refactor('Extract Block To File')
end,
desc = 'extract block to file',
},
{
'<LEADER>rf',
function()
require('refactoring').refactor('Extract Function')
end,
mode = 'v',
desc = 'extract function',
},
{
'<LEADER>rF',
function()
require('refactoring').refactor('Extract Function To File')
end,
mode = 'v',
desc = 'extract function to file',
},
{
'<LEADER>ri',
function()
require('refactoring').refactor('Inline Variable')
end,
mode = { 'n', 'v' },
desc = 'inline variable',
},
{
'<LEADER>rp',
function()
require('refactoring').debug.print_var({ normal = true })
end,
desc = 'debug print variable',
},
{
'<LEADER>rp',
function()
require('refactoring').debug.print_var()
end,
mode = 'v',
desc = 'debug print variable',
},
{
'<LEADER>rP',
function()
require('refactoring').debug.printf({ below = false })
end,
desc = 'debug print',
},
{
'<LEADER>rs',
function()
require('fzf-lua').fzf_exec(require('refactoring').get_refactors(), {
fzf_opts = {},
fzf_colors = true,
actions = {
['default'] = function(selected)
require('refactoring').refactor(selected[1])
end,
},
})
end,
mode = 'v',
desc = 'refactor',
},
{
'<LEADER>rx',
function()
require('refactoring').refactor('Extract Variable')
end,
mode = 'v',
desc = 'extract variable',
},
},
before = function()
require('lz.n').trigger_load({ 'plenary.nvim', 'nvim-treesitter' })
end,
after = function()
require('refactoring').setup({
prompt_func_param_type = {
go = false,
java = false,
cpp = false,
c = false,
h = false,
hpp = false,
cxx = false,
},
prompt_func_return_type = {
go = false,
java = false,
cpp = false,
c = false,
h = false,
hpp = false,
cxx = false,
},
printf_statements = {},
print_var_statements = {},
show_success_message = false,
})
end,
}

View file

@ -1,49 +0,0 @@
return {
'todo-comments.nvim',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
cmd = { 'TodoTrouble', 'TodoTelescope' },
keys = {
{
'<LEADER>st',
function()
require('todo-comments.fzf').todo()
end,
desc = 'todo search',
},
{
'<LEADER>sT',
function()
require('todo-comments.fzf').todo({
keywords = { 'TODO', 'FIX', 'FIXME' },
})
end,
desc = 'todo/fix/fixme search',
},
{ '<LEADER>xt', '<CMD>Trouble todo toggle<CR>', desc = 'todo' },
{
'<LEADER>xT',
'<CMD>Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}<CR>',
desc = 'todo/fix/fixme',
},
{
']t',
function()
require('todo-comments').jump_prev()
end,
desc = 'previous todo',
},
{
']t',
function()
require('todo-comments').jump_next()
end,
desc = 'next todo',
},
},
before = function()
require('lz.n').trigger_load({ 'trouble.nvim', 'fzf-lua' })
end,
after = function()
require('todo-comments').setup({})
end,
}

View file

@ -1,55 +0,0 @@
return {
'trouble.nvim',
cmd = { 'Trouble' },
keys = {
{
'<LEADER>xQ',
'<CMD>Trouble qflist toggle<CR>',
desc = 'quickfix list (trouble)',
},
{
'<LEADER>xx',
'<CMD>Trouble diagnostics toggle<CR>',
desc = 'diagnostics',
},
{
'<LEADER>xX',
'<CMD>Trouble diagnostics toggle filter.buf=0<CR>',
desc = 'buffer diagnostics',
},
{
'[q',
function()
if require('trouble').is_open() then
require('trouble').prev({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cprev)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = 'previous trouble/quickfix item',
},
{
']q',
function()
if require('trouble').is_open() then
require('trouble').next({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cnext)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
},
},
after = function()
require('trouble').setup({
modes = { lsp = { win = { position = 'right' } } },
})
end,
}

View file

@ -1,240 +0,0 @@
return {
'which-key.nvim',
event = 'DeferredUIEnter',
keys = {
{
'<LEADER>?',
function()
require('which-key').show({ global = false })
end,
desc = 'buffer keymaps (which key)',
},
{
'<C-w><SPACE>',
function()
require('which-key').show({ keys = '<C-w>', loop = true })
end,
desc = 'window hydra mode (which key)',
},
},
before = function()
require('lz.n').trigger_load('mini.icons')
end,
after = function()
local i = require('icons')
local c = require('colors')
require('which-key').setup({
preset = 'modern',
spec = {
{
mode = { 'n', 'v' },
{
'<LEADER>',
group = 'leader',
icon = { icon = '', color = 'green' },
},
{ '<LEADER><TAB>', group = 'tabs' },
{
'<LEADER>b',
group = 'buffer',
expand = function()
return require('which-key.extras').expand.buf()
end,
},
{ '<LEADER>c', group = 'code' },
{ '<LEADER>f', group = 'file/find' },
{ '<LEADER>g', group = 'git' },
{ '<LEADER>gh', group = 'hunks' },
{ '<LEADER>n', group = 'notifications' },
{ '<LEADER>q', group = 'quit/session' },
{ '<LEADER>s', group = 'search' },
{ '<LEADER>u', group = 'ui', icon = { icon = i.ui, color = c.ui } },
{ '<LEADER>ur', icon = { icon = '', color = c.ui } },
{
'<LEADER>w',
group = 'windows',
expand = function()
return require('which-key.extras').expand.win()
end,
},
{
'<LEADER>x',
group = 'diagnostics/quickfix',
icon = { icon = '󱖫 ', color = c.diagnostics },
},
{ '<LEADER>|', icon = '' },
{ '<LEADER>-', icon = '' },
{ '0', desc = 'start of line', icon = i.first },
{ 'b', desc = 'previous word', icon = i.word },
{ 'B', desc = 'previous WORD', icon = i.word },
{ 'c', desc = 'change' },
{ 'd', desc = 'delete' },
{ 'e', desc = 'next end of word', icon = i.word },
{ 'E', desc = 'next end of WORD', icon = i.word },
{ 'f', desc = 'find next char' },
{ 'F', desc = 'find previous char' },
{ 'g', group = 'goto', icon = { icon = i.go_to, color = c.go_to } },
{ 'gc', group = 'toggle comment' },
{ 'ge', desc = 'previous end of word', icon = i.word },
{ 'gf', desc = 'file under cursor' },
{ 'gg', desc = 'first line', icon = i.first },
{ 'gi', desc = 'last insert' },
{ 'gn', desc = 'search forward & select' },
{ 'gN', desc = 'search backward & select' },
{ 'gO', desc = 'document symbols', icon = '󰊕' },
{ 'gt', desc = 'next tab page' },
{ 'gT', desc = 'previous tab page' },
{ 'gu', desc = 'make lowercase', icon = '󰬵' },
{ 'gU', desc = 'make uppercase', icon = '󰬶' },
{ 'gv', desc = 'last visual selection' },
{ 'w', desc = 'format' },
{
'gs',
group = 'surround',
icon = { icon = '󰅲', color = c.surround },
},
{ 'gx', desc = 'open with system app', icon = '󰏋' },
{ 'g%', desc = 'cycle backward through results' },
{ 'g~', desc = 'toggle case' },
{ 'G', desc = 'last line', icon = i.last },
{ 'M', desc = 'middle line of window', icon = i.center },
{ 'r', desc = 'replace' },
{ 't', desc = 'find before next char' },
{ 'T', desc = 'find before previous char' },
{ 'v', desc = 'visual' },
{ 'V', desc = 'visual line' },
{ 'w', desc = 'next word', icon = i.word },
{ 'W', desc = 'next WORD', icon = i.word },
{ 'y', desc = 'yank' },
{ 'Y', desc = 'yank to end of line' },
{ 'z', group = 'fold/scroll/spell', icon = '' },
{ 'za', desc = 'toggle fold under cursor' },
{ 'zA', desc = 'toggle all folds under cursor' },
{ 'zb', desc = 'bottom this line', icon = i.bottom },
{ 'zc', desc = 'close fold under cursor' },
{ 'zC', desc = 'close all fold under cursor' },
{ 'zd', desc = 'delete fold under cursor' },
{ 'zD', desc = 'delete all folds under cursor' },
{ 'ze', desc = 'right this line', icon = i.right },
{ 'zE', desc = 'delete all folds in file' },
{ 'zf', desc = 'create fold' },
{ 'zg', desc = 'mark word as correctly spelled' },
{ 'zH', desc = 'half screen to the left', icon = i.left },
{ 'zi', desc = 'toggle folding' },
{ 'zL', desc = 'half screen to the right', icon = i.right },
{ 'zm', desc = 'fold more' },
{ 'zM', desc = 'close all folds' },
{ 'zo', desc = 'open fold under cursor' },
{ 'zO', desc = 'open all folds under cursor' },
{ 'zr', desc = 'fold less' },
{ 'zR', desc = 'open all folds' },
{ 'zs', desc = 'left this line', icon = i.left },
{ 'zt', desc = 'top this line', icon = i.top },
{ 'zv', desc = 'show cursor line' },
{ 'zw', desc = 'mark word as mispelled' },
{ 'zx', desc = 'update folds' },
{ 'zz', desc = 'center this line', icon = i.center },
{ 'z<CR>', desc = 'top this line', icon = i.top },
{ 'z=', group = 'spelling suggestions' },
{ '[', group = 'previous', icon = i.prev },
{ ']', group = 'next', icon = i.next },
{ '!', desc = 'run program', icon = '' },
{ '$', desc = 'end of line', icon = i.last },
{ '%', desc = 'matching (){}[]', icon = '󰅪' },
{ '&', desc = 'repeat last subsitute' },
{ ',', desc = 'repeat last char search (backwards)' },
{ '/', desc = 'search forward' },
{ ';', desc = 'repeat last char search' },
{ '<', desc = 'indent decrease', icon = i.indent.decrease },
{ '>', desc = 'indent increase', icon = i.indent.increase },
{ '?', desc = 'search backwards' },
{ '^', desc = 'first char of line', icon = i.first },
{ '_', desc = 'first char of line', icon = i.first },
{ '{', desc = 'previous empty line', icon = i.prev },
{ '}', desc = 'next empty line', icon = i.next },
{ '~', desc = 'toggle case' },
{
'<C-L>',
desc = 'clear & redraw',
icon = { icon = '', color = 'red' },
},
},
{
mode = { 'n', 'i' },
hidden = true,
{ '<DOWN>' },
{ '<UP>' },
{ '<LEFT>' },
{ '<RIGHT>' },
},
{
mode = { 'n', 'x' },
hidden = true,
{ 'j' },
{ 'k' },
{ 'h' },
{ 'l' },
{ '<PLUG>' },
},
},
icons = {
rules = {
{ pattern = 'fold', icon = i.fold, color = c.fold },
{ pattern = 'buffer', color = c.buffer },
{ pattern = 'change', icon = i.change, color = c.change },
{ pattern = 'comment', icon = i.comment },
{ pattern = 'delete', icon = i.delete, color = c.delete },
{
pattern = 'diagnostic',
icon = i.diagnostics.Info,
hl = 'DiagnosticInfo',
},
{
pattern = 'error',
icon = i.diagnostics.Error,
hl = 'DiagnosticError',
},
{
pattern = 'explorer',
icon = i.explorer,
color = c.explorer,
},
{ pattern = 'format', icon = i.format, color = c.format },
{ pattern = 'hunk', color = c.git },
{ pattern = 'lazygit', icon = i.git, color = c.git },
{
pattern = 'message',
icon = i.notifications,
color = c.notifications,
},
{
pattern = 'notification',
icon = i.notifications,
color = c.notifications,
},
{ pattern = 'registers', icon = i.registers, color = c.yank },
{ pattern = 'replace', icon = i.replace, colors = c.replace },
{ pattern = 'session', icon = i.sessions, color = c.sessions },
{ pattern = 'spell', icon = i.spell, color = c.spell },
{ pattern = 'subsitute', icon = i.search, color = c.search },
{ pattern = 'visual', icon = i.visual, color = c.visual },
{
pattern = ' warning',
icon = i.diagnostics.Warning,
hl = 'DiagnosticWarn',
},
{ pattern = 'yank', icon = i.yank, color = c.yank },
},
},
})
end,
}

View file

@ -1,96 +0,0 @@
return {
'conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<LEADER>cf',
function()
require('conform').format()
end,
desc = 'format',
},
{
'<LEADER>cF',
function()
require('conform').format({
formatters = { 'injected' },
timeout_ms = 3000,
})
end,
mode = { 'n', 'v' },
desc = 'format injected langs',
},
},
after = function()
require('conform').setup({
format_on_save = function(buf)
if (vim.g.autoformat == false) or (vim.b[buf].autoformat == false) then
return
end
return { timeout_ms = 3000, lsp_format = 'fallback' }
end,
-- Prettier is last but only activated if there is a config available,
-- thereby giving it priority only when it is wanted.
formatters_by_ft = {
blade = { 'blade-formatter', 'rustywind' },
css = { 'stylelint', 'biome', 'prettier' },
fish = { 'fish_indent' },
graphql = { 'biome', 'prettier' },
handlebars = { 'prettier' },
html = { 'prettier' },
javascript = { 'biome', 'prettier' },
javascriptreact = { 'biome', 'prettier' },
json = { 'biome', 'prettier' },
jsonc = { 'biome', 'prettier' },
liquid = { 'prettier' },
lua = { 'stylua' },
less = { 'prettier' },
markdown = { 'prettier' },
['markdown.mdx'] = { 'prettier' },
nix = { 'alejandra' },
php = { 'pint', 'php_cs_fixer', stop_after_first = true },
ruby = { 'prettier' },
scss = { 'stylelint', 'prettier' },
sh = { 'shfmt' },
toml = { 'taplo' },
typescript = { 'biome', 'prettier' },
typescriptreact = { 'biome', 'prettier' },
vue = { 'biome', 'prettier' },
yaml = { 'prettier' },
},
formatters = {
biome = {
require_cwd = true,
},
pint = {
meta = { url = 'https://github.com/laravel/pint' },
command = require('conform.util').find_executable({
'vendor/bin/pint',
}, 'pint'),
args = { '$FILENAME' },
stdin = false,
},
prettier = {
condition = function(_, ctx)
return MarleyVim.prettier.has_parser(ctx)
and MarleyVim.prettier.has_config(ctx)
end,
},
shfmt = {
prepend_args = {
'--indent=2',
'--case-indent',
'--binary-next-line',
'--func-next-line',
},
},
},
})
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
}

View file

@ -1,5 +0,0 @@
local req = MarleyVim.local_require('plugins.formatting')
return {
req('conform-nvim'),
}

View file

@ -1,5 +0,0 @@
local req = MarleyVim.local_require('plugins.languages')
return {
req('vim-caddyfile'),
}

View file

@ -1,4 +0,0 @@
return {
'vim-caddyfile',
lazy = false,
}

View file

@ -1,5 +0,0 @@
local req = MarleyVim.local_require('plugins.linting')
return {
req('nvim-lint'),
}

View file

@ -1,48 +0,0 @@
return {
'nvim-lint',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
after = function()
local lint = require('lint')
lint.linters_by_ft = {
bash = { 'shellcheck' },
fish = { 'fish' },
nix = { 'statix' },
scss = { 'stylelint' },
sh = { 'shellcheck' },
yaml = { 'yamllint' },
}
local linters = {
shellcheck = {
args = {
'-x',
},
},
}
for name, linter in pairs(linters) do
if type(linter) == 'table' and type(lint.linters[name]) == 'table' then
lint.linters[name] =
vim.tbl_deep_extend('force', lint.linters[name], linter)
if type(linter.prepend_args) == 'table' then
lint.linters[name].args = lint.linters[name].args or {}
vim.list_extend(lint.linters[name].args, linter.prepend_args)
end
else
lint.linters[name] = linter
end
end
vim.api.nvim_create_autocmd(
{ 'BufWritePost', 'BufReadPost', 'InsertLeave' },
{
group = vim.api.nvim_create_augroup('nvim-lint', { clear = true }),
callback = function()
require('lint').try_lint()
end,
}
)
end,
}

View file

@ -1,6 +0,0 @@
local req = MarleyVim.local_require('plugins.test')
return {
req('neotest'),
req('nvim-nio'),
}

View file

@ -1,146 +0,0 @@
return {
'neotest',
keys = {
{ '<LEADER>t', '', desc = '+test' },
{
'<LEADER>tl',
function()
require('neotest').run.run_last()
end,
desc = 'run last',
},
{
'<LEADER>to',
function()
require('neotest').output.open({ enter = true, auto_close = true })
end,
desc = 'show output',
},
{
'<LEADER>tO',
function()
require('neotest').output_panel.toggle()
end,
desc = 'toggle output panel',
},
{
'<LEADER>tr',
function()
require('neotest').run.run()
end,
desc = 'run nearest',
},
{
'<LEADER>ts',
function()
require('neotest').summary.toggle()
end,
desc = 'toggle summary',
},
{
'<LEADER>tS',
function()
require('neotest').run.stop()
end,
desc = 'stop tests',
},
{
'<LEADER>tt',
function()
require('neotest').run.run(vim.fn.expand('%'))
end,
desc = 'run file tests',
},
{
'<LEADER>tT',
function()
require('neotest').run.run(vim.uv.cwd())
end,
desc = 'run all tests',
},
{
'<LEADER>tw',
function()
require('neotest').watch.toggle(vim.fn.expand('%'))
end,
desc = 'toggle watch',
},
},
before = function()
require('lz.n').trigger_load({
'nvim-nio',
'plenary.nvim',
'nvim-treesitter',
})
end,
after = function()
local neotest_ns = vim.api.nvim_create_namespace('neotest')
vim.diagnostic.config({
virtual_text = {
format = function(diagnostic)
-- Replace newline/tab chars with spaces.
return diagnostic.message
:gsub('\n', ' ')
:gsub('\t', ' ')
:gsub('%s+', ' ')
:gsub('^%s+', ' ')
end,
},
}, neotest_ns)
local consumers = {}
-- Refresh and auto-close trouble after running tests.
local has_trouble, _ = pcall(require, 'trouble')
if has_trouble then
---@type neotest.Consumer
consumers.trouble = function(client)
client.listeners.results = function(adapter_id, results, partial)
if partial then
return
end
local tree =
assert(client:get_position(nil, { adapter = adapter_id }))
local failed = 0
for pos_id, result in pairs(results) do
if result.status == 'failed' and tree:get_key(pos_id) then
failed = failed + 1
end
end
vim.schedule(function()
local trouble = require('trouble')
if trouble.is_open() then
trouble.refresh()
if failed == 0 then
trouble.close()
end
end
end)
end
return {}
end
end
require('neotest').setup({
status = { virtual_text = true },
output = { virtual_text = true },
quickfix = {
open = function()
if has_trouble then
require('trouble').open({ mode = 'quickfix', focus = false })
else
vim.cmd('copen')
end
end,
},
consumers = consumers,
})
end,
}

View file

@ -1,4 +0,0 @@
return {
'nvim-nio',
lazy = true,
}

View file

@ -1,7 +0,0 @@
local req = MarleyVim.local_require('plugins.treesitter')
return {
req('nvim-treesitter-textobjects'),
req('nvim-treesitter'),
req('nvim-ts-autotag'),
}

View file

@ -1,7 +0,0 @@
return {
'nvim-treesitter-textobjects',
event = 'DeferredUIEnter',
before = function()
require('lz.n').trigger_load('nvim-treesitter')
end,
}

View file

@ -1,73 +0,0 @@
return {
'nvim-treesitter',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile', 'DeferredUIEnter' },
keys = {
{ '<C-space>', desc = 'increment selection' },
{ '<BS>', desc = 'decrement selection', mode = 'x' },
},
before = function()
require('lz.n').trigger_load('which-key.nvim')
end,
after = function()
vim.filetype.add({
extension = { rasi = 'rasi', rofi = 'rasi', wofi = 'rasi', env = 'conf' },
filename = { ['.env'] = 'conf' },
pattern = {
['.*/waybar/config'] = 'jsonc',
['.*/mako/config'] = 'dosini',
['.*/kitty/.+%.conf'] = 'kitty',
['.*/hypr/.+*.conf'] = 'hyprlang',
['%.env%.[%w_.-]+'] = 'conf',
},
})
-- Use the bash parser for kitty files.
vim.treesitter.language.register('bash', 'kitty')
---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup({
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<C-space>',
node_incremental = '<C-space>',
scope_incremental = false,
node_decremental = '<BS>',
},
},
textobjects = {
move = {
enable = true,
goto_next_start = {
[']f'] = '@function.outer',
[']c'] = '@class.outer',
[']a'] = '@parameter.inner',
},
goto_next_end = {
[']F'] = '@function.outer',
[']C'] = '@class.outer',
[']A'] = '@parameter.inner',
},
goto_previous_start = {
['[f'] = '@function.outer',
['[c'] = '@class.outer',
['[a'] = '@parameter.inner',
},
goto_previous_end = {
['[F'] = '@function.outer',
['[C'] = '@class.outer',
['[A'] = '@parameter.inner',
},
},
},
})
require('which-key').add({
{ '<BS>', desc = 'decrement selection', mode = 'x' },
{ '<C-space>', desc = 'increment selection', mode = { 'x', 'n' } },
})
end,
}

View file

@ -1,11 +0,0 @@
return {
'nvim-ts-autotag',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
after = function()
require('nvim-ts-autotag').setup({
opts = {
enable_close_on_slash = true,
},
})
end,
}

View file

@ -1,53 +0,0 @@
return {
'alpha-nvim',
before = function()
require('lz.n').trigger_load('plenary.nvim')
require('lz.n').trigger_load('mini.icons')
end,
after = function()
local theta = require('alpha.themes.theta')
local header = [[
]]
theta.header.val = vim.split(header, '\n')
local button = require('alpha.themes.dashboard').button
theta.buttons.val = {
{
type = 'text',
val = 'Shortcuts',
opts = { hl = 'SpecialComment', position = 'center' },
},
{ type = 'padding', val = 1 },
button(
'f',
'󰈞 Find file',
'<CMD>lua require("lz.n").trigger_load("fzf-lua"); require("fzf-lua").files()<CR>'
),
button(
'g',
' Live grep',
'<CMD>lua require("lz.n").trigger_load("fzf-lua"); require("fzf-lua").live_grep()<CR>'
),
button(
's',
' Restore session',
'<CMD>lua require("lz.n").trigger_load("persistence.nvim"); require("persistence").load()<CR>'
),
button('q', ' Quit', '<CMD>qa<CR>'),
}
require('alpha').setup(theta.config)
end,
}

View file

@ -1,109 +0,0 @@
return {
'bufferline.nvim',
event = 'DeferredUIEnter',
keys = {
{
'<LEADER>bp',
'<CMD>BufferLineTogglePin<CR>',
desc = 'toggle buffer pin',
},
{
'<LEADER>bP',
'<CMD>BufferLineGroupClose ungrouped<CR>',
desc = 'delete non-pinned buffers',
},
{
'<LEADER>br',
'<CMD>BufferLineCloseRight<CR>',
desc = 'delete buffers to the right',
},
{
'<LEADER>bl',
'<CMD>BufferLineCloseLeft<CR>',
desc = 'delete buffers to the left',
},
{ '<S-H>', '<CMD>BufferLineCyclePrev<CR>', desc = 'previous buffer' },
{ '<S-L>', '<CMD>BufferLineCycleNext<CR>', desc = 'next buffer' },
{ '[b', '<CMD>BufferLineCyclePrev<CR>', desc = 'previous buffer' },
{ ']b', '<CMD>BufferLineCycleNext<CR>', desc = 'next buffer' },
{ '[B', '<CMD>BufferLineMovePrev<CR>', desc = 'move buffer left' },
{ ']B', '<CMD>BufferLineMoveNext<CR>', desc = 'move buffer right' },
},
before = function()
require('lz.n').trigger_load({ 'mini.icons', 'which-key.nvim' })
if vim.g.colors_name == 'rose-pine' then
require('lz.n').trigger_load('rose-pine')
end
end,
after = function()
local opts = {
options = {
always_show_bufferline = true,
close_command = function(n)
Snacks.bufdelete(n)
end,
right_mouse_command = function(n)
Snacks.bufdelete(n)
end,
diagnostics = 'nvim_lsp',
diagnostics_indicator = function(_, _, diag)
local icons = require('icons').diagnostics
local ret = (diag.error and icons.Error .. diag.error .. ' ' or '')
.. (diag.warning and icons.Warn .. diag.warning or '')
return vim.trim(ret)
end,
offsets = {
{
filetype = 'neo-tree',
text = 'Explorer',
highlight = 'Directory',
text_align = 'center',
},
},
get_element_icon = function(elem)
local icon, hl, _ =
require('mini.icons').get('filetype', elem.filetype)
return icon, hl
end,
},
}
if vim.g.colors_name == 'rose-pine' then
opts.highlights = require('rose-pine.plugins.bufferline')
end
require('bufferline').setup(opts)
vim.api.nvim_create_autocmd({ 'BufAdd', 'BufDelete' }, {
desc = 'Fix bufferline when restoring a session',
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
})
local colors = require('colors')
local mkKey = MarleyVim.wkSpec(colors.buffers)
require('which-key').add({
mkKey('<LEADER>bp', nil, ''),
mkKey('<LEADER>bP', nil, '󰐄'),
mkKey('<LEADER>br', nil, ''),
mkKey('<LEADER>bl', nil, ''),
mkKey('<S-H>', nil, ''),
mkKey('<S-L>', nil, ''),
mkKey('[b', nil, ''),
mkKey(']b', nil, ''),
mkKey('[B', nil, ''),
mkKey(']B', nil, ''),
})
end,
}

View file

@ -1,17 +0,0 @@
return {
'diffview.nvim',
cmd = {
'DiffviewOpen',
'DiffviewClose',
'DiffviewToggleFiles',
'DiffviewFocusFiles',
'DiffviewRefresh',
'DiffviewFileHistory',
},
before = function()
require('lz.n').trigger_load({ 'mini.icons' })
end,
after = function()
require('diffview').setup({})
end,
}

View file

@ -1,41 +0,0 @@
return {
'indent-blankline.nvim',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
after = function()
require('ibl').setup({
indent = {
char = '',
tab_char = '',
},
scope = { show_start = false, show_end = false },
exclude = {
filetypes = {
'Trouble',
'alpha',
'dashboard',
'help',
'lazy',
'mason',
'neo-tree',
'notify',
'snacks_dashboard',
'snacks_notif',
'snacks_terminal',
'snacks_win',
'toggleterm',
'trouble',
},
},
})
Snacks.toggle({
name = 'Indent guides',
get = function()
return require('ibl.config').get_config(0).enabled
end,
set = function(state)
require('ibl').setup_buffer(0, { enabled = state })
end,
}):map('<LEADER>ug')
end,
}

View file

@ -1,14 +0,0 @@
local req = MarleyVim.local_require('plugins.ui')
return {
req('alpha-nvim'),
req('bufferline-nvim'),
req('diffview-nvim'),
req('indent-blankline-nvim'),
req('lualine-nvim'),
req('mini-animate'),
req('mini-icons'),
req('no-neck-pain-nvim'),
req('noice-nvim'),
req('nvim-treesitter-context'),
}

View file

@ -1,146 +0,0 @@
return {
'lualine.nvim',
event = 'DeferredUIEnter',
beforeAll = function()
vim.g.lualine_laststatus = vim.o.laststatus
if vim.fn.argc(-1) > 0 then
-- Set an empty statusline until lualine loads.
vim.o.statusline = ' '
else
-- Hide the statusline on the starter page.
vim.o.laststatus = 0
end
end,
before = function()
require('lz.n').trigger_load({ 'mini.icons', 'aerial.nvim' })
if vim.g.colors_name == 'rose-pine' then
require('lz.n').trigger_load('rose-pine')
end
end,
after = function()
local icons = require('icons')
vim.o.laststatus = vim.g.lualine_laststatus
require('lualine').setup({
options = {
theme = 'auto',
globalstatus = vim.o.laststatus == 3,
disabled_filetypes = {
statusline = {
'dashboard',
'alpha',
'ministarter',
'snacks_dashboard',
},
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'branch' },
lualine_c = {
{
'diagnostics',
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
{
'filetype',
icon_only = true,
separator = '',
padding = { left = 1, right = 0 },
},
{
'filename',
path = 4,
symbols = { readonly = ' 󰌾 ', modified = '' },
},
{
'aerial',
sep = ' ',
sep_icon = '',
depth = 5,
dense = false,
dense_sep = '.',
colored = true,
},
},
lualine_x = {
{
function()
---@alias NoiceStatusOv {has:(fun():boolean), get:(fun():string), get_hl:(fun():string)}
return require('noice')
.api
.status
.command --[[@as NoiceStatusOv]]
.get()
end,
cond = function()
return package.loaded['noice']
and require('noice')
.api
.status
.command --[[@as NoiceStatusOv]]
.has()
end,
color = function()
return MarleyVim.fg('Statement')
end,
},
{
function()
return '' .. require('dap').status()
end,
cond = function()
return package.loaded['dap'] and require('dap').status ~= ''
end,
color = function()
return MarleyVim.fg('debug')
end,
},
{
'diff',
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = function()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end,
},
},
lualine_y = {
{ 'progress', separator = ' ', padding = { left = 1, right = 0 } },
{ 'location', padding = { left = 0, right = 1 } },
},
lualine_z = {
function()
return '' .. os.date('%R')
end,
},
},
extensions = { 'neo-tree' },
},
})
end,
}

View file

@ -1,56 +0,0 @@
return {
'mini.animate',
enabled = vim.g.neovide == nil,
event = { 'DeferredUIEnter' },
after = function()
local mouse_scrolled = false
for _, scroll in ipairs({ 'UP', 'DOWN' }) do
local key = '<SCROLLWHEEL' .. scroll .. '>'
vim.keymap.set({ '', 'i' }, key, function()
mouse_scrolled = true
return key
end, { expr = true })
end
vim.api.nvim_create_autocmd('FileType', {
pattern = 'grug-far',
callback = function()
vim.b.minianimate_disable = true
end,
})
Snacks.toggle({
name = 'mini animate',
get = function()
return not vim.g.minianimate_disable
end,
set = function(state)
vim.g.minianimate_disable = not state
end,
}):map('<LEADER>ua')
local animate = require('mini.animate')
local opts = {
resize = {
timing = animate.gen_timing.linear({ duration = 50, unit = 'total' }),
},
scroll = {
timing = animate.gen_timing.linear({ duration = 50, unit = 'total' }),
subscroll = animate.gen_subscroll.equal({
predicate = function(total_scroll)
if mouse_scrolled then
mouse_scrolled = false
return false
end
return total_scroll > 1
end,
}),
},
}
animate.setup(opts)
end,
}

View file

@ -1,20 +0,0 @@
return {
'mini.icons',
after = function()
require('mini.icons').setup({
file = {
['.keep'] = { glyph = '󰊢', hl = 'MiniIconsGrey' },
['devcontainer.json'] = { glyph = '', hl = 'MiniIconsAzure' },
},
filetype = {
dotenv = { glyph = '󰌋', hl = 'MiniIconsYellow' },
},
})
package.preload['nvim-web-devicons'] = function()
require('mini.icons').mock_nvim_web_devicons()
return package.loaded['nvim-web-devicons']
end
end,
}

View file

@ -1,12 +0,0 @@
return {
'no-neck-pain-nvim',
cmd = {
'NoNeckPain',
'NoNeckPainResize',
'NoNeckPainToggleLeftSide',
'NoNeckPainToggleRightSide',
'NoNeckPainWidthUp',
'NoNeckPainWidthDown',
'NoNeckPainScratchPad',
},
}

View file

@ -1,113 +0,0 @@
return {
'noice.nvim',
event = 'DeferredUIEnter',
keys = {
{ '<LEADER>n', '', desc = '+notifications' },
{
'<S-ENTER>',
function()
require('noice').redirect(vim.fn.getcmdline())
end,
mode = 'c',
desc = 'redirect cmdline',
},
{
'<LEADER>nl',
function()
require('noice').cmd('last')
end,
desc = 'last message',
},
{
'<LEADER>nh',
function()
require('noice').cmd('history')
end,
desc = 'message history',
},
{
'<LEADER>na',
function()
require('noice').cmd('all')
end,
desc = 'all messages',
},
{
'<LEADER>nd',
function()
require('noice').cmd('dismiss')
end,
desc = 'dismiss all',
},
{
'<LEADER>nt',
function()
require('noice').cmd('pick')
end,
desc = 'message picker',
},
{
'<C-f>',
function()
if not require('noice.lsp').scroll(4) then
return '<C-f>'
end
end,
mode = { 'i', 'n', 's' },
silent = true,
expr = true,
desc = 'scroll forward',
},
{
'<C-b>',
function()
if not require('noice.lsp').scroll(-4) then
return '<C-b>'
end
end,
mode = { 'i', 'n', 's' },
silent = true,
expr = true,
desc = 'scroll backward',
},
},
before = function()
require('lz.n').trigger_load({ 'nui.nvim', 'which-key.nvim' })
end,
after = function()
require('noice').setup({
lsp = {
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
['cmp.entry.get_documentation'] = true,
},
},
routes = {
{
filter = {
event = 'msg_show',
any = {
{ find = '%d+L, %d+B' },
{ find = '; after #%d+' },
{ find = '; before #%d+' },
},
},
view = 'mini',
},
},
presets = {
command_palette = true,
long_message_to_split = true,
lsp_doc_border = true,
},
})
local mkKey = MarleyVim.wkSpec(require('colors').notifications)
require('which-key').add({
mkKey('<S-ENTER>', nil, '', { mode = 'c' }),
mkKey('<C-f>', nil, '', { mode = { 'i', 'n', 's' } }),
mkKey('<C-b>', nil, '', { mode = { 'i', 'n', 's' } }),
})
end,
}

View file

@ -1,24 +0,0 @@
return {
'nvim-treesitter-context',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
after = function()
local tsc = require('treesitter-context')
Snacks.toggle({
name = 'treesitter context',
get = tsc.enabled,
set = function(state)
if state then
tsc.enable()
else
tsc.disable()
end
end,
}):map('<LEADER>ut')
tsc.setup({
mode = 'cursor',
max_lines = 3,
})
end,
}

View file

@ -1,10 +0,0 @@
local req = MarleyVim.local_require('plugins.util')
return {
req('mini-hipatterns'),
req('nerdy-nvim'),
req('nui-nvim'),
req('persistance-nvim'),
req('plenary'),
req('project-nvim'),
}

View file

@ -1,85 +0,0 @@
return {
'mini.hipatterns',
event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' },
after = function()
local hipatterns = require('mini.hipatterns')
-- Tailwind CSS support.
local hls = {}
local tailwindFts = {
'astro',
'css',
'heex',
'html',
'html-eex',
'javascript',
'javascriptreact',
'rust',
'svelte',
'typescript',
'typescriptreact',
'vue',
}
-- Reset hl groups when colorscheme changes.
vim.api.nvim_create_autocmd('ColorScheme', {
callback = function()
hls = {}
end,
})
hipatterns.setup({
highlighters = {
hex_color = hipatterns.gen_highlighter.hex_color({ priority = 2000 }),
shorthand = {
pattern = '()#%x%x%x()%f[^%x%w]',
group = function(_, _, data)
---@type string
local match = data.full_match
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
local hex_color = '#' .. r .. r .. g .. g .. b .. b
return MiniHipatterns.compute_hex_color_group(hex_color, 'bg')
end,
extmark_opts = { priority = 2000 },
},
tailwind = {
pattern = function()
if not vim.tbl_contains(tailwindFts, vim.bo.filetype) then
return
end
return '%f[%w:-]()[%w:-]+%-[a-z%-]+%-%d+()%f[^%w:-]'
end,
group = function(_, _, m)
---@type string
local match = m.full_match
---@type string, number?
local color, shade = match:match('[%w-]+%-([a-z%-]+)%-(%d+)')
shade = tonumber(shade)
local c = require('colors')
local bg = vim.tbl_get(c.tailwind, color, shade)
if bg then
local hl = 'MiniHipatternsTailwind' .. color .. shade
if not hls[hl] then
hls[hl] = true
local bg_shade = shade == 500 and 950
or shade < 500 and 900
or 100
local fg = vim.tbl_get(c.tailwind, color, bg_shade)
vim.api.nvim_set_hl(0, hl, { bg = '#' .. bg, fg = '#' .. fg })
end
return hl
end
end,
extmark_opts = { priority = 2000 },
},
},
})
end,
}

View file

@ -1,13 +0,0 @@
return {
'nerdy.nvim',
cmd = 'Nerdy',
keys = {
{
'<LEADER>ci',
function()
require('nerdy').list()
end,
desc = 'pick nerd icon',
},
},
}

View file

@ -1,4 +0,0 @@
return {
'nui.nvim',
lazy = true,
}

View file

@ -1,37 +0,0 @@
return {
'persistence.nvim',
event = 'BufReadPre',
keys = {
{
'<LEADER>qs',
function()
require('persistence').load()
end,
desc = 'Restore session',
},
{
'<LEADER>qS',
function()
require('persistence').select()
end,
desc = 'Select session',
},
{
'<LEADER>ql',
function()
require('persistence').load({ last = true })
end,
desc = 'Restore last session',
},
{
'<LEADER>qd',
function()
require('persistence').stop()
end,
desc = "Don't save current session",
},
},
after = function()
require('persistence').setup({})
end,
}

View file

@ -1,4 +0,0 @@
return {
'plenary.nvim',
lazy = true,
}

View file

@ -1,19 +0,0 @@
return {
'project.nvim',
event = { 'DeferredUIEnter' },
after = function()
require('project_nvim').setup({
manual_mode = true,
})
local history = require('project_nvim.utils.history')
history.delete_project = function(project)
for k, v in pairs(history.recent_projects) do
if v == project.value then
history.recent_projects[k] = nil
return
end
end
end
end,
}

View file

@ -1,135 +0,0 @@
-- Snacks needs to be loaded very early, so it gets its own special file.
local set = vim.keymap.set
require('snacks').setup({
bigfile = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
statuscolumn = { enabled = true },
words = { enabled = true },
scroll = { enabled = false },
})
-- Debuggers -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
_G.dd = function(...)
Snacks.debug.inspect(...)
end
_G.bt = function()
Snacks.debug.backtrace()
end
vim.print = _G.dd
-- Notifier -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>un', function()
Snacks.notifier.hide()
end, { desc = 'dismiss all notifications' })
-- Buffers -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>bd', function()
Snacks.bufdelete()
end, { desc = 'delete buffer' })
set({ 'n' }, '<LEADER>bo', function()
Snacks.bufdelete.other()
end, { desc = 'delete other buffers' })
-- Toggles -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
local toggle = Snacks.toggle
toggle.option('spell', { name = 'spelling' }):map('<LEADER>us')
toggle.option('wrap', { name = 'wrap' }):map('<LEADER>uw')
toggle.option('relativenumber', { name = 'relative number' }):map('<LEADER>uL')
toggle.line_number():map('<LEADER>ul')
toggle.diagnostics():map('<LEADER>ud')
toggle
.option(
'conceallevel',
{ off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }
)
:map('<LEADER>uc')
toggle.treesitter():map('<LEADER>uT')
if vim.lsp.inlay_hint then
toggle.inlay_hints():map('<LEADER>uh')
end
toggle({
name = 'auto format (global)',
get = function()
return vim.g.autoformat == nil or vim.g.autoformat
end,
set = function(enable)
vim.g.autoformat = (enable == nil and true) or enable
vim.b.autoformat = nil
end,
}):map('<LEADER>uf')
toggle({
name = 'auto format (buffer)',
get = function()
local buf = vim.api.nvim_get_current_buf()
local gopt = vim.g.autoformat
local bopt = vim.b[buf].autoformat
if bopt ~= nil then
return bopt
end
return gopt == nil or gopt
end,
set = function(enable)
vim.b.autoformat = (enable == nil and true) or enable
end,
}):map('<LEADER>uF')
-- Git -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
set({ 'n' }, '<LEADER>gb', function()
Snacks.git.blame_line()
end, { desc = 'git blame line' })
set({ 'n' }, '<LEADER>gB', function()
Snacks.gitbrowse()
end, { desc = 'git browse (open)' })
set({ 'n' }, '<LEADER>gY', function()
Snacks.gitbrowse({
open = function(url)
vim.fn.setreg('+', url)
end,
})
end, { desc = 'git browse (copy)' })
-- LazyGit -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
if vim.fn.executable('lazygit') == 1 then
set({ 'n' }, '<LEADER>gg', function()
Snacks.lazygit({ cwd = MarleyVim.root() })
end, { desc = 'lazygit (root dir)' })
-- set({ 'n' }, '<LEADER>gG', function()
-- Snacks.lazygit()
-- end, { desc = 'Lazygit (cwd)' })
set({ 'n' }, '<LEADER>gf', function()
Snacks.lazygit.log_file()
end, { desc = 'lazygit current file history' })
set({ 'n' }, '<LEADER>gl', function()
Snacks.lazygit.log({ cwd = MarleyVim.root() })
end, { desc = 'Lazygit log' })
-- set({ 'n' }, '<LEADER>gL', function()
-- Snacks.lazygit.log()
-- end, { desc = 'Lazygit log (cwd)' })
end

View file

@ -1,107 +0,0 @@
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local fmt = require("luasnip.extras.fmt").fmt
local fill = require("snippets.helpers").fill
return {
s(
{ trig = "dc", desc = "divider comment" },
f(fill, {}, { user_args = { "#%- " } })
),
s({ trig = "#!", desc = "shebang" }, t("#!/usr/bin/env fish")),
s(
{ trig = "if", desc = "if ... end" },
fmt(
[[
if {}
{}
end
]],
{ i(1), i(0) }
)
),
s(
{ trig = "elif", desc = "else if ..." },
fmt(
[[
else if {}
{}
]],
{ i(1), i(0) }
)
),
s(
{ trig = "fori", desc = "for ... in ... end" },
fmt(
[[
for {} in {}
{}
end
]],
{ i(1), i(2), i(0) }
)
),
s(
{ trig = "wh", desc = "while ... end" },
fmt(
[[
while {}
{}
end
]],
{ i(1), i(0) }
)
),
s(
{ trig = "wht", desc = "while true ... end" },
fmt(
[[
while true
{}
end
]],
{ i(0) }
)
),
s(
{ trig = "sw", desc = "switch ... case ... end" },
fmt(
[[
switch {}
case {}
{}
end
]],
{ i(1), i(2), i(0) }
)
),
s(
{ trig = "func", desc = "function ... end" },
fmt(
[[
function {}
{}
end
]],
{ i(1), i(0) }
)
),
s({ trig = "dn", desc = "&>/dev/null" }, t("&>/dev/null")),
s(
{ trig = "abbr", desc = "abbr -a ... --position ..." },
fmt('abbr -a {} --position {} "{}"', { i(1), i(2, "command"), i(3) })
),
}

View file

@ -1,8 +0,0 @@
local ls = require("luasnip")
local s = ls.snippet
local f = ls.function_node
local helpers = require("snippets.helpers")
return {
s({ trig = "dc", desc = "divider comment" }, f(helpers.fill, {}, { user_args = { "#%- " } })),
}

View file

@ -1,40 +0,0 @@
local ls = require('luasnip')
local sn = ls.snippet_node
local i = ls.insert_node
local M = {}
M.fill = function(_, parent, args)
local title = ''
local chars = {}
if type(parent.snippet.env.LS_SELECT_RAW) == 'table' then
for _, ele in ipairs(parent.snippet.env.LS_SELECT_RAW) do
title = title .. ele .. ' '
end
end
for str in string.gmatch(args, '([^%%]+)') do
table.insert(chars, str)
end
local snip = chars[1] .. ' ' .. title
local _, c = unpack(vim.api.nvim_win_get_cursor(0))
while #snip < (vim.bo.tw - c - 1) do
snip = snip .. chars[2]
end
return snip
end
M.get_visual = function(_, parent)
if #parent.snippet.env.LS_SELECT_RAW > 0 then
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
else -- If LS_SELECT_RAW is empty, return a blank insert node
return sn(nil, i(1))
end
end
return M

Some files were not shown because too many files have changed in this diff Show more