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

56 lines
1.8 KiB
Nix
Raw Normal View History

2023-03-03 23:33:37 +01:00
{ pkgs, ... }:
{
# 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";
2023-03-04 00:09:57 +01:00
home.sessionVariables.EDITOR = "micro";
2023-03-12 05:14:28 +01:00
home.packages = with pkgs; [
micro
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;
#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"
];
}