mirror of
https://github.com/nmasur/dotfiles
synced 2026-10-31 16:25:02 +00:00
neovim first init
This commit is contained in:
27 files changed
+107
-18
No files matched your search
+14
-3
@@ -1,7 +1,18 @@
|
||||
_final: prev:
|
||||
|
||||
let
|
||||
lib = prev.lib;
|
||||
packages = lib.pipe [
|
||||
(lib.filesystem.listFilesRecursive ../pkgs)
|
||||
(builtins.filter (name: (lib.hasSuffix "package.nix" name)))
|
||||
(builtins.map (package: prev.callPackage package))
|
||||
];
|
||||
in
|
||||
|
||||
{
|
||||
loadkey = prev.callPackage ../pkgs/tools/misc/loadkey.nix;
|
||||
aws-ec2 = prev.callPackage ../pkgs/tools/misc/aws-ec2/;
|
||||
docker-cleanup = prev.callPackage ../pkgs/tools/misc/docker-cleanup/;
|
||||
|
||||
loadkey = prev.callPackage ../pkgs/tools/misc/loadkey.nix { };
|
||||
aws-ec2 = prev.callPackage ../pkgs/tools/misc/aws-ec2 { };
|
||||
docker-cleanup = prev.callPackage ../pkgs/tools/misc/docker-cleanup { };
|
||||
nmasur-neovim = prev.callPackage ../pkgs/applications/editors/neovim/nmasur/neovim { };
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -13,7 +13,7 @@
|
||||
description = "Attrset of base16 colorscheme key value pairs.";
|
||||
};
|
||||
|
||||
config = {
|
||||
config = lib.mkIf config.colors {
|
||||
plugins = [ pkgs.vimPlugins.base16-nvim ];
|
||||
setup.base16-colorscheme = config.colors;
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+13
-13
@@ -28,7 +28,7 @@
|
||||
|
||||
{
|
||||
pkgs,
|
||||
colors,
|
||||
colors ? null,
|
||||
terraform ? false,
|
||||
github ? false,
|
||||
kubernetes ? false,
|
||||
@@ -46,17 +46,17 @@ pkgs.neovimBuilder {
|
||||
kubernetes
|
||||
;
|
||||
imports = [
|
||||
../config/align.nix
|
||||
../config/bufferline.nix
|
||||
../config/colors.nix
|
||||
../config/completion.nix
|
||||
../config/gitsigns.nix
|
||||
../config/lsp.nix
|
||||
../config/misc.nix
|
||||
../config/statusline.nix
|
||||
../config/syntax.nix
|
||||
../config/telescope.nix
|
||||
../config/toggleterm.nix
|
||||
../config/tree.nix
|
||||
./config/align.nix
|
||||
./config/bufferline.nix
|
||||
./config/colors.nix
|
||||
./config/completion.nix
|
||||
./config/gitsigns.nix
|
||||
./config/lsp.nix
|
||||
./config/misc.nix
|
||||
./config/statusline.nix
|
||||
./config/syntax.nix
|
||||
./config/telescope.nix
|
||||
./config/toggleterm.nix
|
||||
./config/tree.nix
|
||||
];
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -194,7 +194,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) {
|
||||
xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.isLinux) {
|
||||
name = "aerc";
|
||||
exec = "${config.terminalLaunchCommand} aerc %u";
|
||||
};
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.nmasur.presets.programs.neovim;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options.nmasur.presets.programs.neovim = {
|
||||
enable = lib.mkEnableOption "Neovim text editor";
|
||||
package = lib.mkPackageOption pkgs "neovim" { };
|
||||
colors = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = "Base16 color scheme.";
|
||||
default = config.theme.colors;
|
||||
};
|
||||
github.enable = lib.mkEnableOption "GitHub integration";
|
||||
terraform.enable = lib.mkEnableOption "Terraform integration";
|
||||
kubernetes.enable = lib.mkEnableOption "Kubernetes integration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
cfg.package = lib.mkDefault pkgs.nmasur-neovim.override {
|
||||
colors = cfg.colors;
|
||||
github = cfg.github.enable;
|
||||
terraform = cfg.terraform.enable;
|
||||
kubernetes = cfg.kubernetes.enable;
|
||||
};
|
||||
|
||||
# Use Neovim as the editor for git commit messages
|
||||
programs.git.extraConfig.core.editor = "${lib.getExe cfg.package}";
|
||||
programs.jujutsu.settings.ui.editor = "${lib.getExe cfg.package}";
|
||||
|
||||
# Set Neovim as the default app for text editing and manual pages
|
||||
home.sessionVariables = {
|
||||
EDITOR = "${lib.getExe cfg.package}";
|
||||
MANPAGER = "${lib.getExe cfg.package} +Man!";
|
||||
};
|
||||
|
||||
# Create quick aliases for launching Neovim
|
||||
programs.fish = {
|
||||
shellAliases = {
|
||||
vim = "${lib.getExe cfg.package}";
|
||||
nvim = "${lib.getExe cfg.package}";
|
||||
};
|
||||
shellAbbrs = {
|
||||
v = lib.mkForce "nvim";
|
||||
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
||||
vll = "nvim -c 'Telescope oldfiles'";
|
||||
};
|
||||
};
|
||||
|
||||
# Create a desktop option for launching Neovim from a file manager
|
||||
# (Requires launching the terminal and then executing Neovim)
|
||||
xdg.desktopEntries.nvim = lib.mkIf (pkgs.stdenv.isLinux) {
|
||||
name = "Neovim wrapper";
|
||||
exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} nvim %F"; # TODO: change to generic
|
||||
mimeType = [
|
||||
"text/plain"
|
||||
"text/markdown"
|
||||
];
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"text/markdown" = [ "nvim.desktop" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user