mirror of
https://github.com/fred-drake/neovim.git
synced 2026-06-05 14:59:28 -05:00
Added Golang support
This commit is contained in:
@@ -25,9 +25,8 @@ The default configuration performs editing without settings for any particular l
|
|||||||
|
|
||||||
- Rust `nix run github:fred-drake/neovim#rust`
|
- Rust `nix run github:fred-drake/neovim#rust`
|
||||||
- C# `nix run github:fred-drake/neovim#csharp`
|
- C# `nix run github:fred-drake/neovim#csharp`
|
||||||
|
- Go `nix run github:fred-drake/neovim#golang`
|
||||||
|
|
||||||
## Things To Do
|
## Things To Do
|
||||||
|
|
||||||
- TODO: Implement DAP for debugging
|
|
||||||
- TODO: Change fzf to only allow git-level root if applicable
|
- TODO: Change fzf to only allow git-level root if applicable
|
||||||
- TODO: Break up LSP, CMP and Tree-Sitter for lanuages like rust, go, etc.
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
plugins.dap.extensions.dap-go = {
|
||||||
|
enable = true;
|
||||||
|
delve.path = "${pkgs.delve}/bin/dlv";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
let
|
||||||
|
# Read all files in the current directory
|
||||||
|
files = builtins.readDir ./.;
|
||||||
|
|
||||||
|
# Filter out default.nix and non-.nix files
|
||||||
|
nixFiles = builtins.filter
|
||||||
|
(name: name != "default.nix" && builtins.match ".*\\.nix" name != null)
|
||||||
|
(builtins.attrNames files);
|
||||||
|
|
||||||
|
# Create a list of import statements
|
||||||
|
imports = map (name: ./. + "/${name}") nixFiles;
|
||||||
|
in {
|
||||||
|
# Import all configuration modules automatically
|
||||||
|
imports = imports;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
plugins = {
|
||||||
|
conform-nvim = {
|
||||||
|
enable = true;
|
||||||
|
settings = { formatters_by_ft.go = [ "golines" ]; };
|
||||||
|
};
|
||||||
|
lsp.servers.gopls.enable = true;
|
||||||
|
none-ls.sources.formatting.golines.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -42,6 +42,14 @@
|
|||||||
};
|
};
|
||||||
extraSpecialArgs = { };
|
extraSpecialArgs = { };
|
||||||
};
|
};
|
||||||
|
goNixvimModule = {
|
||||||
|
inherit pkgs;
|
||||||
|
module = { pkgs, ... }: {
|
||||||
|
imports = [ ./config ./config/golang ];
|
||||||
|
extraPackages = with pkgs; [ sops ];
|
||||||
|
};
|
||||||
|
extraSpecialArgs = { };
|
||||||
|
};
|
||||||
pkgs = import inputs.nixpkgs {
|
pkgs = import inputs.nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
@@ -49,6 +57,7 @@
|
|||||||
baseNvim = nixvim'.makeNixvimWithModule baseNixvimModule;
|
baseNvim = nixvim'.makeNixvimWithModule baseNixvimModule;
|
||||||
rustNvim = nixvim'.makeNixvimWithModule rustNixvimModule;
|
rustNvim = nixvim'.makeNixvimWithModule rustNixvimModule;
|
||||||
csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule;
|
csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule;
|
||||||
|
goNvim = nixvim'.makeNixvimWithModule goNixvimModule;
|
||||||
in {
|
in {
|
||||||
checks = {
|
checks = {
|
||||||
# Run `nix flake check .` to verify that your config is not broken
|
# Run `nix flake check .` to verify that your config is not broken
|
||||||
@@ -62,6 +71,8 @@
|
|||||||
rust = rustNvim;
|
rust = rustNvim;
|
||||||
# Lets you run `nix run .#csharp` to start nixvim with C# configuration
|
# Lets you run `nix run .#csharp` to start nixvim with C# configuration
|
||||||
csharp = csharpNvim;
|
csharp = csharpNvim;
|
||||||
|
# Lets you run `nix run .#golang` to start nixvim with Go configuration
|
||||||
|
golang = goNvim;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user