mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-23 05:40:44 +00:00
Merge branch 'main' into feature/neovim0.9
This commit is contained in:
commit
81421e529b
15 changed files with 202 additions and 9 deletions
10
.github/README.md
vendored
10
.github/README.md
vendored
|
@ -123,22 +123,26 @@ instead of the `maximal` output. This will reduce size by a lot, but you will lo
|
||||||
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that are small and fast. And the binary cache, so at least you don't have to build it from source.
|
**A**: Yes. As a matter of fact, I am actively working on making this flake smaller. Unfortunately the process of providing everything possible by itself makes the flake large. Best I can do is to optimize the flake as much as possible by selecting plugins that are small and fast. And the binary cache, so at least you don't have to build it from source.
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
|
|
||||||
**Q**: Will you use a plugin manager?
|
**Q**: Will you use a plugin manager/language server installer?
|
||||||
<br/>
|
<br/>
|
||||||
**A**: No. If you feel the need to ask that question, then you have missed the whole point of using nix and ultimately this flake. We load plugins with raw lua.
|
**A**: No. If you feel the need to ask that question, then you have missed the whole point of using nix and ultimately this flake. The whole reason we use nix is to be able to handle EVERYTHING declaratively, well including the LSP and plugin installations.
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
|
|
||||||
**Q**: Can you add *X*?
|
**Q**: Can you add *X*?
|
||||||
<br/>
|
<br/>
|
||||||
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to add every plugin that is in existence, but I will consider it, should it offer something useful to the flake.
|
**A**: Maybe. Open an issue using the appropriate template and I will consider it. I do not intend to add *every plugin that is in existence*, but I will consider it, should it offer something useful to the flake.
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
|
Special thanks to
|
||||||
|
|
||||||
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts
|
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts
|
||||||
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work
|
- [@FlafyDev](https://github.com/FlafyDev) - For getting the home-manager to work
|
||||||
|
|
||||||
|
and everyone who has submitted issues or pull requests!
|
||||||
|
|
||||||
### Inspiration
|
### Inspiration
|
||||||
|
|
||||||
This configuration borrows from and is based on a few other configurations, including:
|
This configuration borrows from and is based on a few other configurations, including:
|
||||||
|
|
6
.github/workflows/cachix.yml
vendored
6
.github/workflows/cachix.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: build-and-cache
|
name: "Set up binary cache"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
@ -11,7 +11,7 @@ on:
|
||||||
- .gitignore
|
- .gitignore
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nix:
|
cahix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -44,5 +44,5 @@ jobs:
|
||||||
run: git config --global init.defaultBranch main
|
run: git config --global init.defaultBranch main
|
||||||
- name: Validate Flakes
|
- name: Validate Flakes
|
||||||
run: nix flake check
|
run: nix flake check
|
||||||
- name: Build Hneovim-flake with default settings
|
- name: Build neovim-flake with default settings
|
||||||
run: nix build .#${{ matrix.package }} --print-build-logs
|
run: nix build .#${{ matrix.package }} --print-build-logs
|
||||||
|
|
44
.github/workflows/check-docs.yml
vendored
Normal file
44
.github/workflows/check-docs.yml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
name: "Validate flake & check documentation"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- docs/**
|
||||||
|
jobs:
|
||||||
|
flake-docs-check:
|
||||||
|
name: Validate Flake Documentation
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
package:
|
||||||
|
- docs
|
||||||
|
- docs-html
|
||||||
|
- docs-manpages
|
||||||
|
- docs-json
|
||||||
|
steps:
|
||||||
|
- uses: easimon/maximize-build-space@v6
|
||||||
|
with:
|
||||||
|
overprovision-lvm: true
|
||||||
|
remove-android: true
|
||||||
|
remove-dotnet: true
|
||||||
|
remove-haskell: true
|
||||||
|
- uses: cachix/install-nix-action@v20
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
auto-optimise-store = true
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set default git branch (to reduce log spam)
|
||||||
|
run: git config --global init.defaultBranch main
|
||||||
|
- name: Validate Flakes
|
||||||
|
run: nix flake check
|
||||||
|
- name: Build neovim-flake with default settings
|
||||||
|
run: nix build .#${{ matrix.package }} --print-build-logs
|
||||||
|
|
||||||
|
|
2
.github/workflows/manual.yml
vendored
2
.github/workflows/manual.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Github Pages docs
|
name: "Build and deploy documentation"
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
|
|
|
@ -21,6 +21,8 @@ Tidal is an alternative config that adds vim-tidal on top of the plugins from th
|
||||||
|
|
||||||
Maximal is the ultimate configuration that will enable basically everything. Keep in mind, however, that this will pull a lot of dependencies.
|
Maximal is the ultimate configuration that will enable basically everything. Keep in mind, however, that this will pull a lot of dependencies.
|
||||||
|
|
||||||
|
You are strongly recommended to use the binary cache if you would like to try the Maximal configuration.
|
||||||
|
|
||||||
|
|
||||||
=== Using Prebuilt Configs
|
=== Using Prebuilt Configs
|
||||||
|
|
||||||
|
|
34
flake.lock
34
flake.lock
|
@ -337,6 +337,38 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"elixir-ls": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681462421,
|
||||||
|
"narHash": "sha256-pIwZFiCLJ0f7OXi1iTza04KSn7rpFpvUsNYrFh0FoEM=",
|
||||||
|
"owner": "elixir-lsp",
|
||||||
|
"repo": "elixir-ls",
|
||||||
|
"rev": "85cfc5604edeadb0a6a683c41abff60a0c959de7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "elixir-lsp",
|
||||||
|
"repo": "elixir-ls",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"elixir-tools": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681453321,
|
||||||
|
"narHash": "sha256-7QgWrdq4p5t8WVnFhL5P948JFPR0i2C06kisxl30D2U=",
|
||||||
|
"owner": "elixir-tools",
|
||||||
|
"repo": "elixir-tools.nvim",
|
||||||
|
"rev": "8ccb696c048eca667486ee005f4386c0db8c5e14",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "elixir-tools",
|
||||||
|
"repo": "elixir-tools.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fidget-nvim": {
|
"fidget-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1262,6 +1294,8 @@
|
||||||
"diffview-nvim": "diffview-nvim",
|
"diffview-nvim": "diffview-nvim",
|
||||||
"dracula": "dracula",
|
"dracula": "dracula",
|
||||||
"dressing-nvim": "dressing-nvim",
|
"dressing-nvim": "dressing-nvim",
|
||||||
|
"elixir-ls": "elixir-ls",
|
||||||
|
"elixir-tools": "elixir-tools",
|
||||||
"fidget-nvim": "fidget-nvim",
|
"fidget-nvim": "fidget-nvim",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
|
19
flake.nix
19
flake.nix
|
@ -74,22 +74,27 @@
|
||||||
url = "github:neovim/nvim-lspconfig";
|
url = "github:neovim/nvim-lspconfig";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
lspsaga = {
|
lspsaga = {
|
||||||
url = "github:tami5/lspsaga.nvim";
|
url = "github:tami5/lspsaga.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
lspkind = {
|
lspkind = {
|
||||||
url = "github:onsails/lspkind-nvim";
|
url = "github:onsails/lspkind-nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
trouble = {
|
trouble = {
|
||||||
url = "github:folke/trouble.nvim";
|
url = "github:folke/trouble.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
nvim-treesitter-context = {
|
nvim-treesitter-context = {
|
||||||
url = "github:nvim-treesitter/nvim-treesitter-context";
|
url = "github:nvim-treesitter/nvim-treesitter-context";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
nvim-lightbulb = {
|
nvim-lightbulb = {
|
||||||
url = "github:kosayoda/nvim-lightbulb";
|
url = "github:kosayoda/nvim-lightbulb";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
@ -99,18 +104,22 @@
|
||||||
url = "github:weilbith/nvim-code-action-menu";
|
url = "github:weilbith/nvim-code-action-menu";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp-signature = {
|
lsp-signature = {
|
||||||
url = "github:ray-x/lsp_signature.nvim";
|
url = "github:ray-x/lsp_signature.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
null-ls = {
|
null-ls = {
|
||||||
url = "github:jose-elias-alvarez/null-ls.nvim";
|
url = "github:jose-elias-alvarez/null-ls.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
sqls-nvim = {
|
sqls-nvim = {
|
||||||
url = "github:nanotee/sqls.nvim";
|
url = "github:nanotee/sqls.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
rust-tools = {
|
rust-tools = {
|
||||||
url = "github:simrat39/rust-tools.nvim";
|
url = "github:simrat39/rust-tools.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
@ -121,6 +130,16 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
elixir-ls = {
|
||||||
|
url = "github:elixir-lsp/elixir-ls";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
elixir-tools = {
|
||||||
|
url = "github:elixir-tools/elixir-tools.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Copying/Registers
|
# Copying/Registers
|
||||||
registers = {
|
registers = {
|
||||||
url = "github:tversteeg/registers.nvim";
|
url = "github:tversteeg/registers.nvim";
|
||||||
|
|
|
@ -80,6 +80,8 @@ with lib; let
|
||||||
"vim-repeat"
|
"vim-repeat"
|
||||||
"smartcolumn"
|
"smartcolumn"
|
||||||
"project-nvim"
|
"project-nvim"
|
||||||
|
"elixir-ls"
|
||||||
|
"elixir-tools"
|
||||||
];
|
];
|
||||||
# You can either use the name of the plugin or a package.
|
# You can either use the name of the plugin or a package.
|
||||||
pluginsType = with types;
|
pluginsType = with types;
|
||||||
|
|
|
@ -24,6 +24,7 @@ with builtins; {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = nvim.nmd.asciiDoc ''map <CR> on insert mode'';
|
description = nvim.nmd.asciiDoc ''map <CR> on insert mode'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
map_complete = mkOption {
|
map_complete = mkOption {
|
||||||
|
|
|
@ -45,6 +45,7 @@ in {
|
||||||
if client.supports_method("textDocument/formatting") then
|
if client.supports_method("textDocument/formatting") then
|
||||||
local params = require'vim.lsp.util'.make_formatting_params({})
|
local params = require'vim.lsp.util'.make_formatting_params({})
|
||||||
client.request('textDocument/formatting', params, nil, bufnr)
|
client.request('textDocument/formatting', params, nil, bufnr)
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -60,4 +61,5 @@ in {
|
||||||
${optionalString usingNvimCmp "capabilities = require('cmp_nvim_lsp').default_capabilities()"}
|
${optionalString usingNvimCmp "capabilities = require('cmp_nvim_lsp').default_capabilities()"}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,8 @@ _: {
|
||||||
./lightbulb
|
./lightbulb
|
||||||
./lspkind
|
./lspkind
|
||||||
|
|
||||||
# flutter-tools
|
# language specific modules
|
||||||
./flutter-tools-nvim
|
./flutter-tools-nvim # dart & flutter
|
||||||
|
./elixir # elixir
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
67
modules/lsp/elixir/config.nix
Normal file
67
modules/lsp/elixir/config.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
with builtins; let
|
||||||
|
cfg = config.vim.lsp.elixir;
|
||||||
|
in {
|
||||||
|
config = mkIf (cfg.enable) {
|
||||||
|
vim.startPlugins = [
|
||||||
|
"elixir-tools"
|
||||||
|
"plenary-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
|
vim.luaConfigRC.elixir-tools = nvim.dag.entryAnywhere ''
|
||||||
|
local elixir = require("elixir")
|
||||||
|
local elixirls = require("elixir.elixirls")
|
||||||
|
|
||||||
|
elixir.setup {
|
||||||
|
elixirls = {
|
||||||
|
|
||||||
|
|
||||||
|
-- alternatively, point to an existing elixir-ls installation (optional)
|
||||||
|
-- not currently supported by elixirls, but can be a table if you wish to pass other args `{"path/to/elixirls", "--foo"}`
|
||||||
|
cmd = "${lib.getExe pkgs.elixir-ls}",
|
||||||
|
|
||||||
|
-- default settings, use the `settings` function to override settings
|
||||||
|
settings = elixirls.settings {
|
||||||
|
dialyzerEnabled = true,
|
||||||
|
fetchDeps = false,
|
||||||
|
enableTestLenses = false,
|
||||||
|
suggestSpecs = false,
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
local map_opts = { buffer = true, noremap = true}
|
||||||
|
|
||||||
|
-- run the codelens under the cursor
|
||||||
|
vim.keymap.set("n", "<space>r", vim.lsp.codelens.run, map_opts)
|
||||||
|
-- remove the pipe operator
|
||||||
|
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", map_opts)
|
||||||
|
-- add the pipe operator
|
||||||
|
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", map_opts)
|
||||||
|
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", map_opts)
|
||||||
|
|
||||||
|
-- bindings for standard LSP functions.
|
||||||
|
vim.keymap.set("n", "<space>df", "<cmd>lua vim.lsp.buf.format()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gd", "<cmd>lua vim.diagnostic.open_float()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>dt", "<cmd>lua vim.lsp.buf.definition()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>K", "<cmd>lua vim.lsp.buf.hover()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gD","<cmd>lua vim.lsp.buf.implementation()<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>1gD","<cmd>lua vim.lsp.buf.type_definition()<cr>", map_opts)
|
||||||
|
-- keybinds for fzf-lsp.nvim: https://github.com/gfanto/fzf-lsp.nvim
|
||||||
|
-- you could also use telescope.nvim: https://github.com/nvim-telescope/telescope.nvim
|
||||||
|
-- there are also core vim.lsp functions that put the same data in the loclist
|
||||||
|
vim.keymap.set("n", "<space>gr", ":References<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>g0", ":DocumentSymbols<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<space>gW", ":WorkspaceSymbols<cr>", map_opts)
|
||||||
|
vim.keymap.set("n", "<leader>d", ":Diagnostics<cr>", map_opts)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
6
modules/lsp/elixir/default.nix
Normal file
6
modules/lsp/elixir/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
_: {
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./elixir-tools.nix
|
||||||
|
];
|
||||||
|
}
|
10
modules/lsp/elixir/elixir-tools.nix
Normal file
10
modules/lsp/elixir/elixir-tools.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
with builtins; {
|
||||||
|
options.vim.lsp.elixir = {
|
||||||
|
};
|
||||||
|
}
|
|
@ -22,6 +22,7 @@ in {
|
||||||
description = nvim.nmd.asciiDoc ''
|
description = nvim.nmd.asciiDoc ''
|
||||||
List of treesitter grammars to install. For supported languages
|
List of treesitter grammars to install. For supported languages
|
||||||
use the `vim.language.<lang>.treesitter` option
|
use the `vim.language.<lang>.treesitter` option
|
||||||
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue