summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2023-06-17 09:26:20 +0100
committerAkshay <[email protected]>2023-06-17 09:26:20 +0100
commit5acd923652560638c7d32f99937b0fc7b57ffeb6 (patch)
tree619c2fa9273378375e5595a16c40b9b57dee8f15
init
-rw-r--r--.nvimrc43
-rw-r--r--flake.lock24
-rw-r--r--flake.nix33
3 files changed, 100 insertions, 0 deletions
diff --git a/.nvimrc b/.nvimrc
new file mode 100644
index 0000000..cfae74c
--- /dev/null
+++ b/.nvimrc
@@ -0,0 +1,43 @@
1" insert fancy signifiers with abbrevs
2iabbrev todo ·
3iabbrev done ×
4
5" select the task list and hit `gq` to group by status
6" selecting clever status symbols can determine the ordering of tasks
7set formatprg=sort\ -V
8
9" syntax highlighting
10augroup JournalSyntax
11 autocmd!
12 autocmd BufReadPost * set filetype=journal
13
14 autocmd BufReadPost * syntax match JournalAll /.*/ " captures the entire buffer
15 autocmd BufReadPost * syntax match JournalDone /^×.*/ " lines containing 'done' items: ×
16 autocmd BufReadPost * syntax match JournalTodo /^·.*/ " lines containing 'todo' items: ·
17 autocmd BufReadPost * syntax match JournalEvent /^o.*/ " lines containing 'event' items: o
18 autocmd BufReadPost * syntax match JournalNote /^- .*/ " lines containing 'note' items: -
19 autocmd BufReadPost * syntax match JournalMoved /^>.*/ " lines containing 'moved' items: >
20 autocmd BufReadPost * syntax match JournalHeader /\<\u\+\>/ " words containing capitals
21
22 autocmd BufReadPost * highlight link JournalAll Noise
23 autocmd BufReadPost * highlight link JournalHeader Noise
24 autocmd BufReadPost * highlight link JournalDone Noise
25 autocmd BufReadPost * highlight link JournalMoved Noise
26 autocmd BufReadPost * highlight JournalEvent ctermfg=6 " cyan
27 autocmd BufReadPost * highlight JournalMoved ctermfg=5 " pink
28 autocmd BufReadPost * highlight JournalNote ctermfg=3 " yellow
29 autocmd BufReadPost * highlight VertSplit ctermfg=0 ctermbg=0 " hide vert splits
30augroup END
31
32augroup JournalHideUIElements
33 autocmd!
34 " hide junk
35 autocmd VimEnter * set laststatus=0
36 autocmd VimEnter * set noruler nonumber nocursorline nocursorcolumn norelativenumber
37
38 " pin scrolling
39 autocmd VimEnter * set scrollbind
40
41augroup END
42
43syntax on
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..b4361c4
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,24 @@
1{
2 "nodes": {
3 "nixpkgs": {
4 "locked": {
5 "lastModified": 1674236650,
6 "narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=",
7 "path": "/nix/store/k8k9b995a68mixhfbszmygp109vk77xr-source",
8 "rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5",
9 "type": "path"
10 },
11 "original": {
12 "id": "nixpkgs",
13 "type": "indirect"
14 }
15 },
16 "root": {
17 "inputs": {
18 "nixpkgs": "nixpkgs"
19 }
20 }
21 },
22 "root": "root",
23 "version": 7
24}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..71c6301
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,33 @@
1{
2 description = "journal";
3
4 outputs = { self, nixpkgs }:
5 let
6 pkgs = nixpkgs.legacyPackages.x86_64-linux;
7 f = "%Y/%m";
8 in
9 {
10
11 packages.x86_64-linux.default =
12 # starts nvim with 2 months of journal entries ahead and behing
13 # nvim --cmd 'source .nvimrc' -O 2023/10 2023/11 2023/12 2024/01
14 pkgs.writeScriptBin "journal" ''
15 nvim --cmd 'source .nvimrc' -O $(
16 ${pkgs.dateutils}/bin/dateseq \
17 "$(date --date "2 months ago" +${f})" \
18 "$(date --date "2 months" +${f})" \
19 -i ${f} \
20 -f ${f}
21 )
22 '';
23
24 devShell.x86_64-linux =
25 pkgs.mkShell
26 {
27 nativeBuildInputs = [
28 self.packages.x86_64-linux.default
29 ];
30 };
31
32 };
33}