-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathespanso.nix
executable file
·47 lines (45 loc) · 1.32 KB
/
espanso.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ config, lib, pkgs, ... }:
{
home.file.".config/espanso/match/base.yml".text = ''
matches:
- regex: ':bl\s?(?P<lang>.*):'
replace: "```{{lang}}\n$|$\n```"
# Struct
- regex: ':sn(?P<space>\s?)(?P<vis>(pub|pub\(crate\))?)\s(?P<ident>.+):' # Normal
replace: "{{vis}}{{space}}struct {{ident}} {\n $|$\n}"
- regex: ':st(?P<space>\s?)(?P<vis>(pub|pub\(crate\))?)\s(?P<ident>.+):' # Tuple
replace: "{{vis}}{{space}}struct {{ident}}($|$);"
- regex: ':su(?P<space>\s?)(?P<vis>(pub|pub\(crate\))?)\s(?P<ident>.+):' # Unit
replace: "{{vis}}{{space}}struct {{ident}};"
# Enum
- regex: ':en(?P<space>\s?)(?P<vis>(pub|pub\(crate\))?)\s(?P<ident>.+):'
replace: "{{vis}}{{space}}enum {{ident}} {\n $|$\n}"
# Enum
- regex: ':fn(?P<space>\s?)(?P<vis>(pub|pub\(crate\))?)\s(?P<ident>[a-z_]*)(?P<return>(\s->\s.+)?):'
replace: "{{vis}}{{space}}fn {{ident}}($|$){{return}} {\n \n}"
# Accents
- trigger: ':"o'
replace: ö
- trigger: ':"a'
replace: ä
- regex: ':(o|O)a'
replace: å
- trigger: ':"O'
replace: Ö
- trigger: ':"A'
replace: Ä
- regex: ':(o|O)A'
replace: Å
'';
services.espanso = {
enable = true;
configs = {
default = {
show_notifications = false;
keyboard_layout = {
layout = "dvorak";
};
};
};
};
}