add vlang, update files
This commit is contained in:
parent
c8471e745f
commit
aa687d7909
6 changed files with 194 additions and 155 deletions
33
flake.nix
33
flake.nix
|
@ -39,6 +39,12 @@
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
systemToVAnalyzer = {
|
||||||
|
"x86_64-linux" = " v-analyzer-linux-x86_64.zip ";
|
||||||
|
"x86_64-darwin" = "v-analyzer-darwin-x86_64.zip ";
|
||||||
|
"aarch64-darwin" = "v-analyzer-darwin-arm64.zip ";
|
||||||
|
};
|
||||||
in
|
in
|
||||||
# Takes all top level attributes and changes them to `attribute.${system} = old value`
|
# Takes all top level attributes and changes them to `attribute.${system} = old value`
|
||||||
withSystem (
|
withSystem (
|
||||||
|
@ -48,6 +54,27 @@
|
||||||
overlays = [ (import inputs.rust-overlay) ];
|
overlays = [ (import inputs.rust-overlay) ];
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
|
||||||
|
# v_analyzer = pkgs.stdenv.mkDerivation rec {
|
||||||
|
# pname = "v_analyzer";
|
||||||
|
# version = "0.0.3-beta.1";
|
||||||
|
# src = pkgs.fetchgit {
|
||||||
|
# url = "https://github.com/v-analyzer/v-analyzer.git";
|
||||||
|
# rev = version;
|
||||||
|
# sha256 = "sha256-aZsStI/1/2CrMoRXrTRdNDRoBH/mA1FqC47tghSkCMo=";
|
||||||
|
# };
|
||||||
|
|
||||||
|
# buildInputs = with pkgs; [ vlang ];
|
||||||
|
# buildPhase = ''
|
||||||
|
# v install
|
||||||
|
# v build.vsh release
|
||||||
|
# '';
|
||||||
|
|
||||||
|
# installPhase = ''
|
||||||
|
# mkdir -p $out/bin
|
||||||
|
# cp -r ./bin/* $out/bin
|
||||||
|
# '';
|
||||||
|
# };
|
||||||
|
|
||||||
# Plugins provided in nixpkgs, match the naming scheme above for keys
|
# Plugins provided in nixpkgs, match the naming scheme above for keys
|
||||||
lazyPath = pkgs.vimPlugins.lazy-nvim;
|
lazyPath = pkgs.vimPlugins.lazy-nvim;
|
||||||
nixPkgsPlugins = with pkgs.vimPlugins; {
|
nixPkgsPlugins = with pkgs.vimPlugins; {
|
||||||
|
@ -140,6 +167,7 @@
|
||||||
# LSPs
|
# LSPs
|
||||||
nil # nix
|
nil # nix
|
||||||
lua-language-server
|
lua-language-server
|
||||||
|
# v_analyzer
|
||||||
vscode-langservers-extracted # HTML/CSS/JSON/ESLint
|
vscode-langservers-extracted # HTML/CSS/JSON/ESLint
|
||||||
nodePackages.typescript-language-server
|
nodePackages.typescript-language-server
|
||||||
tailwindcss-language-server
|
tailwindcss-language-server
|
||||||
|
@ -154,8 +182,7 @@
|
||||||
nodejs_20
|
nodejs_20
|
||||||
clang
|
clang
|
||||||
zig
|
zig
|
||||||
(pkgs.rust-bin.stable.latest.default.override
|
(pkgs.rust-bin.stable.latest.default.override {
|
||||||
{
|
|
||||||
extensions = [
|
extensions = [
|
||||||
"rust-src"
|
"rust-src"
|
||||||
"rust-analyzer"
|
"rust-analyzer"
|
||||||
|
@ -208,6 +235,8 @@
|
||||||
''export XDG_STATE_HOME="$NVIM_FLAKE_BASE_DIR/nvim_ringofstorms_${version}/state"''
|
''export XDG_STATE_HOME="$NVIM_FLAKE_BASE_DIR/nvim_ringofstorms_${version}/state"''
|
||||||
"--run"
|
"--run"
|
||||||
''export XDG_CACHE_HOME="$NVIM_FLAKE_BASE_DIR/nvim_ringofstorms_${version}/cache"''
|
''export XDG_CACHE_HOME="$NVIM_FLAKE_BASE_DIR/nvim_ringofstorms_${version}/cache"''
|
||||||
|
"--run"
|
||||||
|
''export TESTASDASD="${lib.concatStringsSep "|" (lib.attrValues pkgs.vimPlugins.nvim-treesitter.grammarPlugins)}"''
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,31 +6,35 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
||||||
group = group,
|
group = group,
|
||||||
desc = "Highlight when yanking (copying) text",
|
desc = "Highlight when yanking (copying) text",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.highlight.on_yank({ timeout = 300 })
|
vim.highlight.on_yank({ timeout = 200 })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- TODO is there a better way for these?
|
vim.filetype.add({
|
||||||
-- https://www.youtube.com/watch?v=NecszftvMFI vim.filetype.add
|
pattern = {
|
||||||
vim.api.nvim_create_autocmd("BufRead", {
|
[".*env*"] = "sh",
|
||||||
group = group,
|
[".*rc"] = "sh",
|
||||||
pattern = ".env*",
|
},
|
||||||
command = "set filetype=sh",
|
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd("BufRead", {
|
vim.filetype.add({
|
||||||
group = group,
|
pattern = {
|
||||||
pattern = ".*rc",
|
["Dockerfile.*"] = "dockerfile",
|
||||||
command = "set filetype=sh",
|
},
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd("BufRead", {
|
vim.filetype.add({
|
||||||
group = group,
|
extension = {
|
||||||
pattern = "Dockerfile.*",
|
http = "http",
|
||||||
command = "set filetype=dockerfile",
|
},
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd("BufRead", {
|
vim.filetype.add({
|
||||||
group = group,
|
extension = {
|
||||||
pattern = "*.http",
|
v = "vlang",
|
||||||
command = "set filetype=http",
|
vsh = "vlang",
|
||||||
|
vv = "vlang",
|
||||||
|
},
|
||||||
|
filename = {
|
||||||
|
["v.mod"] = "vlang",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Auto exit insert mode whenever we switch screens
|
-- Auto exit insert mode whenever we switch screens
|
||||||
|
@ -66,11 +70,7 @@ vim.api.nvim_create_autocmd({ "InsertLeave", "TextChanged", "TextChangedI", "Buf
|
||||||
local modifiable = vim.api.nvim_buf_get_option(event.buf, "modifiable")
|
local modifiable = vim.api.nvim_buf_get_option(event.buf, "modifiable")
|
||||||
local filetype = vim.api.nvim_buf_get_option(event.buf, "filetype")
|
local filetype = vim.api.nvim_buf_get_option(event.buf, "filetype")
|
||||||
local modified = vim.api.nvim_buf_get_option(event.buf, "modified")
|
local modified = vim.api.nvim_buf_get_option(event.buf, "modified")
|
||||||
if
|
if modifiable and modified and U.table_not_contains(auto_save_disallowed_filetypes, filetype) then
|
||||||
modifiable
|
|
||||||
and modified
|
|
||||||
and U.table_not_contains(auto_save_disallowed_filetypes, filetype)
|
|
||||||
then
|
|
||||||
if auto_save_debounce[event.buf] ~= 1 then
|
if auto_save_debounce[event.buf] ~= 1 then
|
||||||
auto_save_debounce[event.buf] = 1
|
auto_save_debounce[event.buf] = 1
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
|
|
|
@ -85,3 +85,5 @@ vim.opt.equalalways = false
|
||||||
|
|
||||||
-- enable colors for opacity changes
|
-- enable colors for opacity changes
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,17 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
-- https://github.com/stevearc/conform.nvim?tab=readme-ov-file#setup
|
-- https://github.com/stevearc/conform.nvim?tab=readme-ov-file#setup
|
||||||
notify_on_error = true,
|
notify_on_error = true,
|
||||||
|
formatters = {
|
||||||
|
v_fmt = {
|
||||||
|
command = "v",
|
||||||
|
args = { "fmt" },
|
||||||
|
},
|
||||||
|
},
|
||||||
-- Note that all these need to be available at runtime, add them to flake.nix#runtimeDependencies
|
-- Note that all these need to be available at runtime, add them to flake.nix#runtimeDependencies
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
nix = { "nixfmt" },
|
nix = { "nixfmt" },
|
||||||
|
vlang = { "v_fmt" },
|
||||||
typescript = { { "prettierd", "prettier" }, "rustywind" },
|
typescript = { { "prettierd", "prettier" }, "rustywind" },
|
||||||
typescriptreact = { { "prettierd", "prettier" }, "rustywind" },
|
typescriptreact = { { "prettierd", "prettier" }, "rustywind" },
|
||||||
javascript = { { "prettierd", "prettier" }, "rustywind" },
|
javascript = { { "prettierd", "prettier" }, "rustywind" },
|
||||||
|
|
|
@ -62,6 +62,7 @@ return {
|
||||||
"-",
|
"-",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- TODO add v vet? for v-lang?
|
||||||
-- -- Example of using selene only when a selene.toml file is present
|
-- -- Example of using selene only when a selene.toml file is present
|
||||||
-- selene = {
|
-- selene = {
|
||||||
-- -- `condition` is another LazyVim extension that allows you to
|
-- -- `condition` is another LazyVim extension that allows you to
|
||||||
|
|
|
@ -107,6 +107,7 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
nil_ls = {},
|
nil_ls = {},
|
||||||
|
v_analyzer = { filetypes = { "vlang", "v", "vsh", "vv" } },
|
||||||
tsserver = {
|
tsserver = {
|
||||||
-- typescript/javascript
|
-- typescript/javascript
|
||||||
implicitProjectConfiguration = {
|
implicitProjectConfiguration = {
|
||||||
|
@ -174,4 +175,3 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue