journaling system cobbled together with nix, vim, coreutils

init

oppi.li 5acd9236

Changed files
+100
+43
.nvimrc
··· 1 + " insert fancy signifiers with abbrevs 2 + iabbrev todo · 3 + iabbrev 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 7 + set formatprg=sort\ -V 8 + 9 + " syntax highlighting 10 + augroup 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 30 + augroup END 31 + 32 + augroup 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 + 41 + augroup END 42 + 43 + syntax on
+24
flake.lock
··· 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 + }
+33
flake.nix
··· 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 + }