mirror of
https://github.com/RGBCube/ncc
synced 2025-07-29 11:07:44 +00:00
editors: init
This commit is contained in:
parent
c7abad00b5
commit
8bf1de0fdc
6 changed files with 284 additions and 263 deletions
97
modules/common/editor/helix.nix
Normal file
97
modules/common/editor/helix.nix
Normal file
|
@ -0,0 +1,97 @@
|
|||
{ config, lib, pkgs, ... }: let
|
||||
inherit (lib) const enabled genAttrs mkAfter mkIf;
|
||||
|
||||
# CullOS Helix with Cab support:
|
||||
_package_cab = pkgs.helix.overrideAttrs (old: {
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/cull-os/helix/releases/download/ci-release-25.01.1/helix-ci-release-25.01.1-source.tar.xz";
|
||||
hash = "sha256-bvlzXRAdPvz8P49KENSw9gupQNaUm/+3eZZ1q7+fTsw=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
||||
inherit (pkgs.helix) src;
|
||||
hash = "sha256-soOnSRvWO7OzxYENFUBGmgSAk1Oy9Av+wDDLKkcuIbs=";
|
||||
};
|
||||
});
|
||||
|
||||
package = pkgs.helix.overrideAttrs (finalAttrs: _previousAttrs: {
|
||||
version = "25.07.2";
|
||||
src = pkgs.fetchzip {
|
||||
url = "https://github.com/bloxx12/helix/releases/download/${finalAttrs.version}/helix-${finalAttrs.version}-source.tar.xz";
|
||||
hash = "sha256-ZNsQwFfPXe6oewajx1tl68W60kVo7q2SuvTgy/o1HKk=";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
doInstallCheck = false;
|
||||
|
||||
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
||||
inherit (pkgs.helix) src;
|
||||
hash = "sha256-3poZSvIrkx8lguxxDeNfngW6+4hH8TV/LHcZx5W5aXg=";
|
||||
};
|
||||
});
|
||||
in {
|
||||
editor.defaultAlias = "hx";
|
||||
|
||||
home-manager.sharedModules = [{
|
||||
programs.nushell.configFile.text = mkIf /*(*/config.isDesktop/* && config.isLinux)*/ <| mkAfter /* nu */ ''
|
||||
def --wrapped hx [...arguments] {
|
||||
if $env.TERM == "xterm-kitty" {
|
||||
kitty @ set-spacing padding=0
|
||||
}
|
||||
|
||||
RUST_BACKTRACE=full ^hx ...($arguments | each { glob $in } | flatten)
|
||||
|
||||
if $env.TERM == "xterm-kitty" {
|
||||
kitty @ set-spacing padding=${toString config.theme.padding}
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
programs.helix = enabled {
|
||||
inherit package;
|
||||
|
||||
languages.language = config.editor.languageConfigsHelix;
|
||||
languages.language-server = config.editor.lspConfigsHelix;
|
||||
|
||||
settings.theme = "gruvbox_dark_hard";
|
||||
|
||||
settings.editor = {
|
||||
auto-completion = false;
|
||||
bufferline = "multiple";
|
||||
color-modes = true;
|
||||
cursorline = true;
|
||||
file-picker.hidden = false;
|
||||
idle-timeout = 0;
|
||||
shell = [ "nu" "--commands" ];
|
||||
text-width = 100;
|
||||
};
|
||||
|
||||
settings.editor.cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
|
||||
settings.editor.statusline.mode = {
|
||||
insert = "INSERT";
|
||||
normal = "NORMAL";
|
||||
select = "SELECT";
|
||||
};
|
||||
|
||||
settings.editor.indent-guides = {
|
||||
character = "▏";
|
||||
render = true;
|
||||
};
|
||||
|
||||
settings.editor.whitespace = {
|
||||
characters.tab = "→";
|
||||
render.tab = "all";
|
||||
};
|
||||
|
||||
settings.keys = genAttrs [ "normal" "select" ] <| const {
|
||||
D = "extend_to_line_end";
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue