tangled
alpha
login
or
join now
oppi.li
/
journal
star
18
fork
atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
journaling system cobbled together with nix, vim, coreutils
star
18
fork
atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
overview
issues
pulls
pipelines
init
oppi.li
2 years ago
5acd9236
+100
3 changed files
expand all
collapse all
unified
split
.nvimrc
flake.lock
flake.nix
+43
.nvimrc
reviewed
···
1
1
+
" insert fancy signifiers with abbrevs
2
2
+
iabbrev todo ·
3
3
+
iabbrev done ×
4
4
+
5
5
+
" select the task list and hit `gq` to group by status
6
6
+
" selecting clever status symbols can determine the ordering of tasks
7
7
+
set formatprg=sort\ -V
8
8
+
9
9
+
" syntax highlighting
10
10
+
augroup JournalSyntax
11
11
+
autocmd!
12
12
+
autocmd BufReadPost * set filetype=journal
13
13
+
14
14
+
autocmd BufReadPost * syntax match JournalAll /.*/ " captures the entire buffer
15
15
+
autocmd BufReadPost * syntax match JournalDone /^×.*/ " lines containing 'done' items: ×
16
16
+
autocmd BufReadPost * syntax match JournalTodo /^·.*/ " lines containing 'todo' items: ·
17
17
+
autocmd BufReadPost * syntax match JournalEvent /^o.*/ " lines containing 'event' items: o
18
18
+
autocmd BufReadPost * syntax match JournalNote /^- .*/ " lines containing 'note' items: -
19
19
+
autocmd BufReadPost * syntax match JournalMoved /^>.*/ " lines containing 'moved' items: >
20
20
+
autocmd BufReadPost * syntax match JournalHeader /\<\u\+\>/ " words containing capitals
21
21
+
22
22
+
autocmd BufReadPost * highlight link JournalAll Noise
23
23
+
autocmd BufReadPost * highlight link JournalHeader Noise
24
24
+
autocmd BufReadPost * highlight link JournalDone Noise
25
25
+
autocmd BufReadPost * highlight link JournalMoved Noise
26
26
+
autocmd BufReadPost * highlight JournalEvent ctermfg=6 " cyan
27
27
+
autocmd BufReadPost * highlight JournalMoved ctermfg=5 " pink
28
28
+
autocmd BufReadPost * highlight JournalNote ctermfg=3 " yellow
29
29
+
autocmd BufReadPost * highlight VertSplit ctermfg=0 ctermbg=0 " hide vert splits
30
30
+
augroup END
31
31
+
32
32
+
augroup JournalHideUIElements
33
33
+
autocmd!
34
34
+
" hide junk
35
35
+
autocmd VimEnter * set laststatus=0
36
36
+
autocmd VimEnter * set noruler nonumber nocursorline nocursorcolumn norelativenumber
37
37
+
38
38
+
" pin scrolling
39
39
+
autocmd VimEnter * set scrollbind
40
40
+
41
41
+
augroup END
42
42
+
43
43
+
syntax on
+24
flake.lock
reviewed
···
1
1
+
{
2
2
+
"nodes": {
3
3
+
"nixpkgs": {
4
4
+
"locked": {
5
5
+
"lastModified": 1674236650,
6
6
+
"narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=",
7
7
+
"path": "/nix/store/k8k9b995a68mixhfbszmygp109vk77xr-source",
8
8
+
"rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5",
9
9
+
"type": "path"
10
10
+
},
11
11
+
"original": {
12
12
+
"id": "nixpkgs",
13
13
+
"type": "indirect"
14
14
+
}
15
15
+
},
16
16
+
"root": {
17
17
+
"inputs": {
18
18
+
"nixpkgs": "nixpkgs"
19
19
+
}
20
20
+
}
21
21
+
},
22
22
+
"root": "root",
23
23
+
"version": 7
24
24
+
}
+33
flake.nix
reviewed
···
1
1
+
{
2
2
+
description = "journal";
3
3
+
4
4
+
outputs = { self, nixpkgs }:
5
5
+
let
6
6
+
pkgs = nixpkgs.legacyPackages.x86_64-linux;
7
7
+
f = "%Y/%m";
8
8
+
in
9
9
+
{
10
10
+
11
11
+
packages.x86_64-linux.default =
12
12
+
# starts nvim with 2 months of journal entries ahead and behing
13
13
+
# nvim --cmd 'source .nvimrc' -O 2023/10 2023/11 2023/12 2024/01
14
14
+
pkgs.writeScriptBin "journal" ''
15
15
+
nvim --cmd 'source .nvimrc' -O $(
16
16
+
${pkgs.dateutils}/bin/dateseq \
17
17
+
"$(date --date "2 months ago" +${f})" \
18
18
+
"$(date --date "2 months" +${f})" \
19
19
+
-i ${f} \
20
20
+
-f ${f}
21
21
+
)
22
22
+
'';
23
23
+
24
24
+
devShell.x86_64-linux =
25
25
+
pkgs.mkShell
26
26
+
{
27
27
+
nativeBuildInputs = [
28
28
+
self.packages.x86_64-linux.default
29
29
+
];
30
30
+
};
31
31
+
32
32
+
};
33
33
+
}