Skip to content

Commit

Permalink
refactor(nvim): integrations with rescript lsp and treesitter
Browse files Browse the repository at this point in the history
  • Loading branch information
r17x committed May 26, 2024
1 parent 3badc1a commit 233ed35
Show file tree
Hide file tree
Showing 5 changed files with 301 additions and 24 deletions.
17 changes: 0 additions & 17 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
# e.g: rescript-nvim to be vimPlugins_rescript-nvim
# e.g usage: programs.neovim.plugins = p: [p.rescript-nvim] or [pkgs.vimPlugins.rescript-nvim];
vimPlugins_vim-rescript = { url = "github:rescript-lang/vim-rescript"; flake = false; };
vimPlugins_nvim-treesitter-rescript = { url = "github:nkrkv/nvim-treesitter-rescript"; flake = false; };

# others
ts-rescript = { url = "github:nkrkv/tree-sitter-rescript"; flake = false; };
Expand Down
12 changes: 7 additions & 5 deletions modules/overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
{
flake.overlays.default = final: prev: {

tree-sitter-grammars.tree-sitter-rescript = prev.tree-sitter.buildGrammar {
version = inputs.ts-rescript.lastModifiedDate;
language = "rescript";
generate = true;
src = inputs.ts-rescript;
tree-sitter-grammars = prev.tree-sitter-grammars // {
tree-sitter-rescript = prev.tree-sitter.buildGrammar {
version = inputs.ts-rescript.lastModifiedDate;
language = "rescript";
generate = true;
src = inputs.ts-rescript;
};
};

vimPlugins = prev.vimPlugins.extend (_: _: { } //
Expand Down
4 changes: 3 additions & 1 deletion nvim.nix/config/lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
extraConfigLuaPost = ''
require('telescope').load_extension('gh')
require'lspconfig'.ocamllsp.setup({
local lspconfig = require('lspconfig')
lspconfig.rescriptls.setup{}
lspconfig.ocamllsp.setup({
settings = {
codelens = {enable = false },
extendedHover = { enable = true },
Expand Down
291 changes: 291 additions & 0 deletions nvim.nix/config/ui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,297 @@
plugins.treesitter.folding = true;
plugins.treesitter.indent = true;
plugins.treesitter.nixvimInjections = true;
# plugins.treesitter.grammarPackages = pkgs.vimPlugins.nvim-treesitter.passthru.allGrammars ++ [ pkgs.tree-sitter-rescript ];
plugins.treesitter.ignoreInstall = [
# ┌─────────────────────────────────────┐
# │ move to ensureInstalled for enabled │
# └─────────────────────────────────────┘
"ada"
"agda"
"angular"
"apex"
"arduino"
"astro"
"authzed"
"awk"
"bass"
"beancount"
"bibtex"
"bicep"
"bitbake"
"blueprint"
"c_sharp"
"cairo"
"capnp"
"chatito"
"clojure"
"commonlisp"
"cooklang"
"corn"
"cpon"
"cpp"
"csv"
"cuda"
"cue"
"d"
"dart"
"devicetree"
"disassembly"
"djot"
"doxygen"
"dtd"
"earthfile"
"ebnf"
"eds"
"eex"
"elixir"
"elm"
"elsa"
"elvish"
"embedded_template"
"erlang"
"facility"
"faust"
"fennel"
"fidl"
"firrtl"
"foam"
"forth"
"fortran"
"fsh"
"func"
"fusion"
"gdscript"
"gdshader"
"gleam"
"glimmer"
"glsl"
"gn"
"gnuplot"
"godot_resource"
"gowork"
"groovy"
"gstlaunch"
"hack"
"hare"
"heex"
"hjson"
"hlsl"
"hlsplaylist"
"hocon"
"hoon"
"htmldjango"
"hurl"
"hyprlang"
"idl"
"ini"
"inko"
"ispc"
"janet_simple"
"java"
"json5"
"jsonc"
"jsonnet"
"julia"
"just"
"kconfig"
"kdl"
"kotlin"
"koto"
"kusto"
"lalrpop"
"ledger"
"leo"
"linkerscript"
"liquid"
"liquidsoap"
"llvm"
"m68k"
"matlab"
"menhir"
"meson"
"mlir"
"muttrc"
"nasm"
"nickel"
"nim"
"nim_format_string"
"ninja"
"nqc"
"objc"
"objdump"
"odin"
"org"
"pascal"
"pem"
"perl"
"php"
"php_only"
"phpdoc"
"pioasm"
"pod"
"poe_filter"
"pony"
"printf"
"prisma"
"promql"
"properties"
"prql"
"psv"
"pug"
"puppet"
"purescript"
"ql"
"qmldir"
"qmljs"
"r"
"racket"
"rasi"
"rbs"
"re2c"
"readline"
"rego"
"requirements"
"rnoweb"
"robot"
"roc"
"ron"
"rst"
"ruby"
"scala"
"scfg"
"scheme"
"scss"
"slang"
"slint"
"smali"
"smithy"
"snakemake"
"solidity"
"soql"
"sosl"
"sourcepawn"
"sparql"
"squirrel"
"starlark"
"strace"
"styled"
"supercollider"
"surface"
"svelte"
"swift"
"sxhkdrc"
"systemtap"
"t32"
"tablegen"
"tact"
"tcl"
"teal"
"thrift"
"tiger"
"tlaplus"
"tsv"
"turtle"
"twig"
"typespec"
"typoscript"
"typst"
"udev"
"ungrammar"
"unison"
"usd"
"uxntal"
"v"
"vala"
"vento"
"verilog"
"vue"
"wgsl"
"wgsl_bevy"
"wing"
"wit"
"xcompose"
"yang"
"yuck"
"zathurarc"
"zig"
];
plugins.treesitter.ensureInstalled = [
# ┌────────────────────────────────────┐
# │ move to ignoreInstall for disabled │
# └────────────────────────────────────┘
"asm"
"bash"
"c"
"cmake"
"comment"
"css"
"dhall"
"diff"
"dockerfile"
"dot"
"fish"
"git_config"
"git_rebase"
"gitattributes"
"gitcommit"
"gitignore"
"go"
"gomod"
"gosum"
"gotmpl"
"gpg"
"graphql"
"haskell"
"haskell_persistent"
"hcl"
"helm"
"html"
"http"
"javascript"
"jq"
"jsdoc"
"json"
"latex"
"lua"
"luadoc"
"luap"
"luau"
"make"
"markdown"
"markdown_inline"
"mermaid"
"nix"
"norg"
"norg_meta"
"ocaml"
"ocaml_interface"
"ocamllex"
"passwd"
"po"
"proto"
"pymanifest"
"python"
"query"
"regex"
"rust"
"rescript"
"sql"
"ssh_config"
"templ"
"terraform"
"textproto"
"tmux"
"todotxt"
"toml"
"tsx"
"typescript"
"vhs"
"vim"
"vimdoc"
"xml"
"yaml"
];

plugins.rainbow-delimiters.enable = true;
plugins.rainbow-delimiters.highlight = [
Expand Down

0 comments on commit 233ed35

Please sign in to comment.