config/users/pbsds/home/profiles/micro.nix

58 lines
1.8 KiB
Nix
Raw Normal View History

{ pkgs, lib, ... }:
2023-03-03 23:33:37 +01:00
{
# TODO: upstream this
2023-03-04 01:48:55 +01:00
imports = [ ../modules/micro.nix ];
2023-03-03 23:33:37 +01:00
disabledModules = [ "programs/micro.nix" ];
home.shellAliases.ed = "$EDITOR"; # ed is the standard editor
home.shellAliases.de = "$EDITOR"; # de is the standard typo
2023-03-04 00:09:57 +01:00
home.sessionVariables.EDITOR = "micro";
2023-03-12 05:14:28 +01:00
home.packages = with pkgs; [
2024-07-10 00:31:00 +02:00
micro
2023-03-12 05:14:28 +01:00
aspell
aspellDicts.en
aspellDicts.nb
];
programs.bash.initExtra = ''
if [ "$COLORTERM" = "truecolor" ] || [ "$TERM" == "xterm" ]; then
export TERM=xterm-256color
export MICRO_TRUECOLOR=1
fi
'';
2023-03-03 23:33:37 +01:00
programs.micro.enable = true;
programs.micro.trueColor = true;
programs.micro.settings.colorscheme = "railscast";
programs.micro.settings.rmtrailingws = true;
programs.micro.settings.tabstospaces = true;
2024-10-11 12:28:49 +02:00
programs.micro.settings.autoclose = false;
2023-03-03 23:33:37 +01:00
#xdg.configFile."micro/bindings.json".source = (pkgs.formats.json {}).generate "micro-bindings" {
programs.micro.bindings = {
"Alt-/" = "lua:comment.comment";
"Alt-d" = "SpawnMultiCursor";
"Alt-j" = "lua:joinLines.joinLines";
"Alt-l" = "command:lower";
"Alt-u" = "command:upper";
"AltLeft" = "PreviousTab";
"AltRight" = "NextTab";
"Ctrl-j" = "EndOfLine,CursorRight,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,OutdentLine,Backspace";
"CtrlDown" = "None";
"CtrlUnderscore" = "lua:comment.comment";
"CtrlUp" = "None";
"Escape" = "RemoveAllMultiCursors";
"Shift-PageDown" = "SelectPageDown";
"Shift-PageUp" = "SelectPageUp";
};
programs.micro.ensurePlugins = [
"aspell"
"detectindent"
"editorconfig"
"joinLines"
"manipulator"
"quoter"
];
}