├── .gitignore ├── LICENSE.txt ├── README.md ├── autoload └── logbook.vim ├── doc └── vim-logbook.txt └── plugin └── logbook.vim /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/macos,linux,windows,vim 3 | 4 | ### Linux ### 5 | *~ 6 | 7 | # temporary files which can be created if a process still has a handle open of a deleted file 8 | .fuse_hidden* 9 | 10 | # KDE directory preferences 11 | .directory 12 | 13 | # Linux trash folder which might appear on any partition or disk 14 | .Trash-* 15 | 16 | # .nfs files are created when an open file is removed but is still being accessed 17 | .nfs* 18 | 19 | ### macOS ### 20 | *.DS_Store 21 | .AppleDouble 22 | .LSOverride 23 | 24 | # Icon must end with two \r 25 | Icon 26 | 27 | # Thumbnails 28 | ._* 29 | 30 | # Files that might appear in the root of a volume 31 | .DocumentRevisions-V100 32 | .fseventsd 33 | .Spotlight-V100 34 | .TemporaryItems 35 | .Trashes 36 | .VolumeIcon.icns 37 | .com.apple.timemachine.donotpresent 38 | 39 | # Directories potentially created on remote AFP share 40 | .AppleDB 41 | .AppleDesktop 42 | Network Trash Folder 43 | Temporary Items 44 | .apdisk 45 | 46 | ### Vim ### 47 | # swap 48 | .sw[a-p] 49 | .*.sw[a-p] 50 | # session 51 | Session.vim 52 | # temporary 53 | .netrwhist 54 | # auto-generated tag files 55 | tags 56 | 57 | ### Windows ### 58 | # Windows thumbnail cache files 59 | Thumbs.db 60 | ehthumbs.db 61 | ehthumbs_vista.db 62 | 63 | # Folder config file 64 | Desktop.ini 65 | 66 | # Recycle Bin used on file shares 67 | $RECYCLE.BIN/ 68 | 69 | # Windows Installer files 70 | *.cab 71 | *.msi 72 | *.msm 73 | *.msp 74 | 75 | # Windows shortcuts 76 | *.lnk 77 | 78 | 79 | # End of https://www.gitignore.io/api/macos,linux,windows,vim 80 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2018 James Routley 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vim-logbook 2 | 3 | vim-logbook is a minimalist vim plugin which makes keeping a programming logbook 4 | easier. I find that keeping a logbook improves my learning, debugging and focus. 5 | 6 | I've [blogged about keeping a 7 | logbook](https://routley.io/tech/2017/11/23/logbook.html), and I highly 8 | recommend [Peter Lyons](https://peterlyons.com/)' [article on the same 9 | topic](https://peterlyons.com/leveling-up#your-work-journal). 10 | 11 | vim-logbook assumes the following structure: 12 | - Each day's logs are stored in a separate file, stored at 13 | `~/logbook/yyyy-mm-dd.md` 14 | - Each logbook entry is marked with a timestamp 15 | 16 | ## Commands 17 | 18 | vim-logbook implements two commands: 19 | - `:Lb` - open today's logbook in the current buffer 20 | - `:Ts` - insert a timestamp under the cursor 21 | 22 | ## Example log file 23 | 24 | ```markdown 25 | Tue 23 Jan 23:24:00 2018 26 | - TODO: 27 | - Write README for vim-logbook 28 | - Write help doc for vim-logbook 29 | 30 | Tue 23 Jan 23:27:57 2018 31 | - Vim help doc guidelines can be found with `:help help-writing` 32 | - http://stevelosh.com/blog/2011/09/writing-vim-plugins/#write-a-vim-help-document 33 | 34 | Tue 23 Jan 23:38:55 2018 35 | - Updated vim-logbook readme with logbook example 36 | ``` 37 | 38 | 39 | ## Install 40 | 41 | vim-logbook can be installed with your favourite plugin manager. 42 | 43 | - [vim-plug](https://github.com/junegunn/vim-plug): 44 | 1. Add `Plug 'jamesroutley/vim-logbook'` to your `.vimrc` 45 | 2. Run `:PlugInstall` 46 | -------------------------------------------------------------------------------- /autoload/logbook.vim: -------------------------------------------------------------------------------- 1 | "" 2 | " Open today's logbook in the current buffer 3 | function! logbook#Execute() 4 | let logfile = "~/logbook/" . strftime("%F") . ".md" 5 | execute "edit " . logfile 6 | endfunction 7 | 8 | "" 9 | " Insert a timestamp under the cursor 10 | function! logbook#Timestamp() 11 | execute "normal! i" . strftime("%c") . "\n- \" 12 | endfunction 13 | 14 | 15 | -------------------------------------------------------------------------------- /doc/vim-logbook.txt: -------------------------------------------------------------------------------- 1 | *vim-logbook.txt* 2 | *vim-logbook* 3 | 4 | ============================================================================== 5 | CONTENTS *vim-logbook-contents* 6 | 1. Commands...........................................|vim-logbook-commands| 7 | 8 | ============================================================================== 9 | COMMANDS *vim-logbook-commands* 10 | 11 | :Lb *:Lb* 12 | Open today's logbook in the current buffer 13 | 14 | :Ts *:Ts* 15 | Insert a timestamp under the cursor 16 | 17 | 18 | vim:tw=78:ts=8:ft=help:norl: 19 | -------------------------------------------------------------------------------- /plugin/logbook.vim: -------------------------------------------------------------------------------- 1 | "" 2 | " Open today's logbook in the current buffer 3 | command! -nargs=0 Lb call logbook#Execute() 4 | 5 | "" 6 | " Insert a timestamp under the cursor 7 | command! -nargs=0 Ts call logbook#Timestamp() 8 | --------------------------------------------------------------------------------