mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 17:38:29 +02:00
feat: neovim - scheme lang
This commit is contained in:
7
Justfile
7
Justfile
@@ -154,3 +154,10 @@ fmt:
|
|||||||
# format the nix files in this repo
|
# format the nix files in this repo
|
||||||
nix fmt
|
nix fmt
|
||||||
|
|
||||||
|
test-nvim:
|
||||||
|
use utils.nu *; \
|
||||||
|
make-editable $"($env.HOME)/.config/astronvim/lua"
|
||||||
|
|
||||||
|
test-nvim-clean:
|
||||||
|
rm -rf $"($env.HOME)/.config/astronvim/lua"
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ return {
|
|||||||
|
|
||||||
plugins = {
|
plugins = {
|
||||||
"AstroNvim/astrocommunity",
|
"AstroNvim/astrocommunity",
|
||||||
|
-- Motion
|
||||||
|
{ import = "astrocommunity.motion.mini-surround" },
|
||||||
|
-- https://github.com/echasnovski/mini.ai
|
||||||
|
{ import = "astrocommunity.motion.mini-ai" },
|
||||||
|
{ import = "astrocommunity.motion.flash-nvim" },
|
||||||
|
-- diable toggleterm.nvim, zellij's terminal is far better than neovim's one
|
||||||
|
{ "akinsho/toggleterm.nvim", enabled = false },
|
||||||
|
{ "folke/flash.nvim", vscode = false },
|
||||||
-- colorscheme - catppuccin
|
-- colorscheme - catppuccin
|
||||||
{ import = "astrocommunity.colorscheme.catppuccin" },
|
{ import = "astrocommunity.colorscheme.catppuccin" },
|
||||||
-- Highly experimental plugin that completely replaces
|
-- Highly experimental plugin that completely replaces
|
||||||
@@ -51,19 +59,67 @@ return {
|
|||||||
{ import = "astrocommunity.pack.cpp" },
|
{ import = "astrocommunity.pack.cpp" },
|
||||||
-- { import = "astrocommunity.pack.nix" }, -- manually add config for nix, comment this one.
|
-- { import = "astrocommunity.pack.nix" }, -- manually add config for nix, comment this one.
|
||||||
{ import = "astrocommunity.pack.proto" },
|
{ import = "astrocommunity.pack.proto" },
|
||||||
|
|
||||||
---- Operation & Cloud Native
|
---- Operation & Cloud Native
|
||||||
{ import = "astrocommunity.pack.terraform" },
|
{ import = "astrocommunity.pack.terraform" },
|
||||||
{ import = "astrocommunity.pack.bash" },
|
{ import = "astrocommunity.pack.bash" },
|
||||||
{ import = "astrocommunity.pack.docker" },
|
{ import = "astrocommunity.pack.docker" },
|
||||||
{ import = "astrocommunity.pack.helm" },
|
{ import = "astrocommunity.pack.helm" },
|
||||||
-- Motion
|
|
||||||
{ import = "astrocommunity.motion.mini-surround" },
|
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
||||||
-- https://github.com/echasnovski/mini.ai
|
{
|
||||||
{ import = "astrocommunity.motion.mini-ai" },
|
"nvim-treesitter/nvim-treesitter",
|
||||||
{ import = "astrocommunity.motion.flash-nvim" },
|
opts = function(_, opts)
|
||||||
-- diable toggleterm.nvim, zellij's terminal is far better than neovim's one
|
local utils = require("astronvim.utils")
|
||||||
{ "akinsho/toggleterm.nvim", enabled = false },
|
opts.incremental_selection = {
|
||||||
{ "folke/flash.nvim", vscode = false },
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "<C-space>", -- Ctrl + Space
|
||||||
|
node_incremental = "<C-space>",
|
||||||
|
scope_incremental = "<A-space>", -- Alt + Space
|
||||||
|
node_decremental = "<bs>", -- Backspace
|
||||||
|
},
|
||||||
|
}
|
||||||
|
opts.ignore_install = { "gotmpl" }
|
||||||
|
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, {
|
||||||
|
-- neovim
|
||||||
|
"vim",
|
||||||
|
"lua",
|
||||||
|
-- operation & cloud native
|
||||||
|
"dockerfile",
|
||||||
|
"hcl",
|
||||||
|
"jsonnet",
|
||||||
|
"regex",
|
||||||
|
"terraform",
|
||||||
|
"nix",
|
||||||
|
"csv",
|
||||||
|
-- other programming language
|
||||||
|
"diff",
|
||||||
|
"gitignore",
|
||||||
|
"gitcommit",
|
||||||
|
"latex",
|
||||||
|
"sql",
|
||||||
|
-- customized languages:
|
||||||
|
"scheme",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- add support for scheme
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
parser_config.scheme = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/6cdh/tree-sitter-scheme", -- local path or git repo
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
-- optional entries:
|
||||||
|
branch = "main", -- default branch in case of git repo if different from master
|
||||||
|
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||||
|
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||||
|
},
|
||||||
|
}
|
||||||
|
-- use scheme parser for filetypes: scm
|
||||||
|
vim.treesitter.language.register("scheme", "scm")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- Lua implementation of CamelCaseMotion, with extra consideration of punctuation.
|
-- Lua implementation of CamelCaseMotion, with extra consideration of punctuation.
|
||||||
{ import = "astrocommunity.motion.nvim-spider" },
|
{ import = "astrocommunity.motion.nvim-spider" },
|
||||||
-- AI Assistant
|
-- AI Assistant
|
||||||
@@ -88,17 +144,6 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Provide a comparable s-expression editing experience in Neovim to that provided by Emacs.
|
|
||||||
-- Do not support scheme.
|
|
||||||
-- https://github.com/julienvincent/nvim-paredit
|
|
||||||
-- {
|
|
||||||
-- "julienvincent/nvim-paredit",
|
|
||||||
-- ft = { "scm" },
|
|
||||||
-- config = function()
|
|
||||||
-- require("nvim-paredit").setup()
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
|
|
||||||
-- markdown preview
|
-- markdown preview
|
||||||
{
|
{
|
||||||
"0x00-ketsu/markdown-preview.nvim",
|
"0x00-ketsu/markdown-preview.nvim",
|
||||||
@@ -231,45 +276,8 @@ return {
|
|||||||
|
|
||||||
-- full signature help, docs and completion for the nvim lua API.
|
-- full signature help, docs and completion for the nvim lua API.
|
||||||
{ "folke/neodev.nvim", opts = {} },
|
{ "folke/neodev.nvim", opts = {} },
|
||||||
|
-- automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
|
||||||
{ "RRethy/vim-illuminate", config = function() end },
|
{ "RRethy/vim-illuminate", config = function() end },
|
||||||
|
|
||||||
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
opts = function(_, opts)
|
|
||||||
local utils = require("astronvim.utils")
|
|
||||||
opts.incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "<C-space>", -- Ctrl + Space
|
|
||||||
node_incremental = "<C-space>",
|
|
||||||
scope_incremental = "<A-space>", -- Alt + Space
|
|
||||||
node_decremental = "<bs>", -- Backspace
|
|
||||||
},
|
|
||||||
}
|
|
||||||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, {
|
|
||||||
-- neovim
|
|
||||||
"vim",
|
|
||||||
"lua",
|
|
||||||
-- operation & cloud native
|
|
||||||
"dockerfile",
|
|
||||||
"hcl",
|
|
||||||
"jsonnet",
|
|
||||||
"regex",
|
|
||||||
"terraform",
|
|
||||||
"nix",
|
|
||||||
"csv",
|
|
||||||
-- other programming language
|
|
||||||
"diff",
|
|
||||||
"gitignore",
|
|
||||||
"gitcommit",
|
|
||||||
"latex",
|
|
||||||
"sql",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- implementation/definition preview
|
-- implementation/definition preview
|
||||||
{
|
{
|
||||||
"rmagatti/goto-preview",
|
"rmagatti/goto-preview",
|
||||||
@@ -342,22 +350,23 @@ return {
|
|||||||
diagnostics.deadnix, -- Scan Nix files for dead code.
|
diagnostics.deadnix, -- Scan Nix files for dead code.
|
||||||
|
|
||||||
-- Formatting
|
-- Formatting
|
||||||
formatting.prettier, -- js/ts/vue/css/html/json/... formatter
|
formatting.prettier, -- js/ts/vue/css/html/json/... formatter
|
||||||
diagnostics.hadolint, -- Dockerfile linter
|
diagnostics.hadolint, -- Dockerfile linter
|
||||||
formatting.black, -- Python formatter
|
formatting.black, -- Python formatter
|
||||||
formatting.ruff, -- extremely fast Python linter
|
formatting.ruff, -- extremely fast Python linter
|
||||||
formatting.goimports, -- Go formatter
|
formatting.goimports, -- Go formatter
|
||||||
formatting.shfmt, -- Shell formatter
|
formatting.shfmt, -- Shell formatter
|
||||||
formatting.rustfmt, -- Rust formatter
|
formatting.rustfmt, -- Rust formatter
|
||||||
formatting.taplo, -- TOML formatteautoindentr
|
formatting.taplo, -- TOML formatteautoindentr
|
||||||
formatting.terraform_fmt, -- Terraform formatter
|
formatting.terraform_fmt, -- Terraform formatter
|
||||||
formatting.stylua, -- Lua formatter
|
formatting.stylua, -- Lua formatter
|
||||||
formatting.alejandra, -- Nix formatter
|
formatting.alejandra, -- Nix formatter
|
||||||
formatting.sqlfluff.with({ -- SQL formatter
|
formatting.sqlfluff.with({ -- SQL formatter
|
||||||
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
||||||
}),
|
}),
|
||||||
formatting.nginx_beautifier, -- Nginx formatter
|
formatting.nginx_beautifier, -- Nginx formatter
|
||||||
null_ls.builtins.formatting.verible_verilog_format, -- Verilog formatter
|
formatting.verible_verilog_format, -- Verilog formatter
|
||||||
|
formatting.emacs_scheme_mode, -- using emacs in batch mode to format scheme files.
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -91,7 +91,6 @@
|
|||||||
actionlint # GitHub Actions linter
|
actionlint # GitHub Actions linter
|
||||||
buf # protoc plugin for linting and formatting
|
buf # protoc plugin for linting and formatting
|
||||||
proselint # English prose linter
|
proselint # English prose linter
|
||||||
racket-minimal # scheme language(racket cli only tools)
|
|
||||||
|
|
||||||
#-- Misc
|
#-- Misc
|
||||||
tree-sitter # common language parser/highlighter
|
tree-sitter # common language parser/highlighter
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
zstd
|
zstd
|
||||||
caddy
|
caddy
|
||||||
gnupg
|
gnupg
|
||||||
|
rsync
|
||||||
|
|
||||||
# nix related
|
# nix related
|
||||||
#
|
#
|
||||||
|
|||||||
15
utils.nu
15
utils.nu
@@ -8,7 +8,20 @@ export def nixos-switch [
|
|||||||
nixos-rebuild switch --use-remote-sudo --flake $".#($name)" --show-trace --verbose
|
nixos-rebuild switch --use-remote-sudo --flake $".#($name)" --show-trace --verbose
|
||||||
} else {
|
} else {
|
||||||
nixos-rebuild switch --use-remote-sudo --flake $".#($name)"
|
nixos-rebuild switch --use-remote-sudo --flake $".#($name)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ====================== Misc =============================
|
||||||
|
|
||||||
|
export def make-editable [
|
||||||
|
path: string
|
||||||
|
] {
|
||||||
|
let tmpdir = (mktemp -d)
|
||||||
|
rsync -avz --copy-links $"($path)/" $tmpdir
|
||||||
|
rsync -avz --copy-links --chmod=D2755,F744 $"($tmpdir)/" $path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user