From 5acd923652560638c7d32f99937b0fc7b57ffeb6 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 17 Jun 2023 13:56:20 +0530 Subject: init --- .nvimrc | 43 +++++++++++++++++++++++++++++++++++++++++++ flake.lock | 24 ++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 .nvimrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.nvimrc b/.nvimrc new file mode 100644 index 0000000..cfae74c --- /dev/null +++ b/.nvimrc @@ -0,0 +1,43 @@ +" insert fancy signifiers with abbrevs +iabbrev todo · +iabbrev done × + +" select the task list and hit `gq` to group by status +" selecting clever status symbols can determine the ordering of tasks +set formatprg=sort\ -V + +" syntax highlighting +augroup JournalSyntax + autocmd! + autocmd BufReadPost * set filetype=journal + + autocmd BufReadPost * syntax match JournalAll /.*/ " captures the entire buffer + autocmd BufReadPost * syntax match JournalDone /^×.*/ " lines containing 'done' items: × + autocmd BufReadPost * syntax match JournalTodo /^·.*/ " lines containing 'todo' items: · + autocmd BufReadPost * syntax match JournalEvent /^o.*/ " lines containing 'event' items: o + autocmd BufReadPost * syntax match JournalNote /^- .*/ " lines containing 'note' items: - + autocmd BufReadPost * syntax match JournalMoved /^>.*/ " lines containing 'moved' items: > + autocmd BufReadPost * syntax match JournalHeader /\<\u\+\>/ " words containing capitals + + autocmd BufReadPost * highlight link JournalAll Noise + autocmd BufReadPost * highlight link JournalHeader Noise + autocmd BufReadPost * highlight link JournalDone Noise + autocmd BufReadPost * highlight link JournalMoved Noise + autocmd BufReadPost * highlight JournalEvent ctermfg=6 " cyan + autocmd BufReadPost * highlight JournalMoved ctermfg=5 " pink + autocmd BufReadPost * highlight JournalNote ctermfg=3 " yellow + autocmd BufReadPost * highlight VertSplit ctermfg=0 ctermbg=0 " hide vert splits +augroup END + +augroup JournalHideUIElements + autocmd! + " hide junk + autocmd VimEnter * set laststatus=0 + autocmd VimEnter * set noruler nonumber nocursorline nocursorcolumn norelativenumber + + " pin scrolling + autocmd VimEnter * set scrollbind + +augroup END + +syntax 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 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1674236650, + "narHash": "sha256-B4GKL1YdJnII6DQNNJ4wDW1ySJVx2suB1h/v4Ql8J0Q=", + "path": "/nix/store/k8k9b995a68mixhfbszmygp109vk77xr-source", + "rev": "cfb43ad7b941d9c3606fb35d91228da7ebddbfc5", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..71c6301 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "journal"; + + outputs = { self, nixpkgs }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + f = "%Y/%m"; + in + { + + packages.x86_64-linux.default = + # starts nvim with 2 months of journal entries ahead and behing + # nvim --cmd 'source .nvimrc' -O 2023/10 2023/11 2023/12 2024/01 + pkgs.writeScriptBin "journal" '' + nvim --cmd 'source .nvimrc' -O $( + ${pkgs.dateutils}/bin/dateseq \ + "$(date --date "2 months ago" +${f})" \ + "$(date --date "2 months" +${f})" \ + -i ${f} \ + -f ${f} + ) + ''; + + devShell.x86_64-linux = + pkgs.mkShell + { + nativeBuildInputs = [ + self.packages.x86_64-linux.default + ]; + }; + + }; +} -- cgit v1.2.3