mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-24 04:18:03 +00:00
Compare commits
31 commits
b3bdf64f62
...
3b147f2d29
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3b147f2d29 | ||
![]() |
cc14a1c1f6 | ||
![]() |
a1718bbcd6 | ||
![]() |
fc08c34b9d | ||
![]() |
b12e24a564 | ||
![]() |
657b6fb0d2 | ||
![]() |
7b46366e53 | ||
![]() |
4163de716c | ||
![]() |
f6fb1ba498 | ||
![]() |
1ece52ed42 | ||
![]() |
dd2f73ba84 | ||
![]() |
be5832cf65 | ||
![]() |
c942c6ae23 | ||
![]() |
c5c026a185 | ||
![]() |
cf8764ff96 | ||
![]() |
5bbc68f5e9 | ||
![]() |
d8d834be35 | ||
![]() |
51710d33c6 | ||
![]() |
e12c9adec9 | ||
![]() |
19ae4946a2 | ||
![]() |
28edf0de19 | ||
![]() |
66c173748e | ||
![]() |
4f151d63be | ||
![]() |
06a296a32b | ||
![]() |
d61aba1e12 | ||
![]() |
3275ab221a | ||
![]() |
27c045bc9d | ||
![]() |
42d7294a5e | ||
![]() |
ae90ed1706 | ||
![]() |
a9aeabb5f3 | ||
![]() |
6915c3f764 |
5 changed files with 84 additions and 1 deletions
|
@ -51,6 +51,7 @@ isMaximal: {
|
||||||
css.enable = isMaximal;
|
css.enable = isMaximal;
|
||||||
sql.enable = isMaximal;
|
sql.enable = isMaximal;
|
||||||
java.enable = isMaximal;
|
java.enable = isMaximal;
|
||||||
|
kotlin.enable = isMaximal;
|
||||||
ts.enable = isMaximal;
|
ts.enable = isMaximal;
|
||||||
svelte.enable = isMaximal;
|
svelte.enable = isMaximal;
|
||||||
go.enable = isMaximal;
|
go.enable = isMaximal;
|
||||||
|
|
|
@ -80,13 +80,16 @@ everyone.
|
||||||
|
|
||||||
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
||||||
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
||||||
|
[neo-tree.nvim]: https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||||
|
|
||||||
- Add [ocaml-lsp] support
|
- Add [ocaml-lsp] support
|
||||||
|
|
||||||
- Fix "Emac" typo
|
- Fix "Emac" typo
|
||||||
|
|
||||||
- Add [new-file-template.nvim] to automatically fill new file contents using
|
- Add [new-file-template.nvim] to automatically fill new file contents using
|
||||||
templates.
|
templates
|
||||||
|
|
||||||
|
- Make [neo-tree.nvim] display file icons properly by enabling `visuals.nvimWebDevicons`
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
@ -208,3 +211,4 @@ everyone.
|
||||||
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
||||||
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
|
||||||
ccc
|
ccc
|
||||||
|
- Add LSP and Treesitter support for Kotlin under `vim.languages.kotlin`
|
||||||
|
|
|
@ -20,6 +20,8 @@ in {
|
||||||
"neo-tree-nvim"
|
"neo-tree-nvim"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
visuals.nvimWebDevicons.enable = true;
|
||||||
|
|
||||||
pluginRC.neo-tree = entryAnywhere ''
|
pluginRC.neo-tree = entryAnywhere ''
|
||||||
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
|
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -8,6 +8,7 @@ in {
|
||||||
./css.nix
|
./css.nix
|
||||||
./elixir.nix
|
./elixir.nix
|
||||||
./go.nix
|
./go.nix
|
||||||
|
./kotlin.nix
|
||||||
./html.nix
|
./html.nix
|
||||||
./java.nix
|
./java.nix
|
||||||
./lua.nix
|
./lua.nix
|
||||||
|
|
75
modules/plugins/languages/kotlin.nix
Normal file
75
modules/plugins/languages/kotlin.nix
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.types) package;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.kotlin;
|
||||||
|
|
||||||
|
# Creating a version of the LSP with access to the kotlin binary.
|
||||||
|
# This is necessary for the LSP to load the standard library
|
||||||
|
kotlinLspWithRuntime = pkgs.symlinkJoin {
|
||||||
|
name = "kotlin-language-server-with-runtime";
|
||||||
|
paths = [
|
||||||
|
pkgs.kotlin-language-server
|
||||||
|
pkgs.kotlin
|
||||||
|
];
|
||||||
|
buildInputs = [pkgs.makeWrapper];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/kotlin-language-server \
|
||||||
|
--prefix PATH : ${pkgs.lib.makeBinPath [pkgs.kotlin]}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.kotlin = {
|
||||||
|
enable = mkEnableOption "kotlin/HCL support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "kotlin treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "kotlin";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "kotlin LSP support (kotlin_language_server)" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
description = "kotlin_language_server package with Kotlin runtime";
|
||||||
|
type = package;
|
||||||
|
default = kotlinLspWithRuntime;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.kotlin_language_server = ''
|
||||||
|
lspconfig.kotlin_language_server.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
root_dir = lspconfig.util.root_pattern("main.kt", ".git"),
|
||||||
|
on_attach=default_on_attach,
|
||||||
|
init_options = {
|
||||||
|
-- speeds up the startup time for the LSP
|
||||||
|
storagePath = "vim.fn.stdpath('state') .. '/kotlin'",
|
||||||
|
},
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/kotlin-language-server"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue