├── screenshots
└── bujo.gif
├── ftdetect
└── markdown.vim
├── templates
└── md.skeleton
├── ftplugin
└── markdown_bujo.vim
├── doc
└── bujo.txt
├── README.md
└── plugin
└── bujo.vim
/screenshots/bujo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vuciv/vim-bujo/HEAD/screenshots/bujo.gif
--------------------------------------------------------------------------------
/ftdetect/markdown.vim:
--------------------------------------------------------------------------------
1 | " Makes us able to read
2 | au BufRead,BufNewFile *.md set filetype=markdown
3 |
--------------------------------------------------------------------------------
/templates/md.skeleton:
--------------------------------------------------------------------------------
1 | __________ ____ ____
2 | /_ __/ __ \/ __ \/ __ \
3 | / / / / / / / / / / / /
4 | / / / /_/ / /_/ / /_/ /
5 | /_/ \____/_____/\____/
6 |
7 | Date
8 |
--------------------------------------------------------------------------------
/ftplugin/markdown_bujo.vim:
--------------------------------------------------------------------------------
1 | " markdown_bujo.vim - A minimalist todo list manager
2 | " Maintainer: Jersey Fonseca
3 | " Version: 0.5
4 |
5 | " SearchCheck() searches for whether or not BujoCheck... was called on a
6 | " checked or unchecked task. We need to call search() twice with and without
7 | " the 'b' tag because search() only allows you to search forward or backwards,
8 | " not both ways.
9 | "
10 | " search() returns 0 if it the pattern was not found
11 | function SearchCheck()
12 | return (search('\[\]', 'nc', line('.')) || search('\[\]', 'nbc', line('.')))
13 | endfunction
14 |
15 | " Edit markdown lists
16 | " Add and remove bullets with ease
17 | " If we are already checked then we uncheck
18 | nnoremap BujoChecknormal SearchCheck() ? ':.s/\[\]/\[x\]' : ':.s/\[x\]/\[\]'
19 | nnoremap BujoAddnormal i-[]
20 | inoremap BujoAddinsert -[]
21 | inoremap BujoCheckinsert SearchCheck() ? ':.s/\[\]/\[x\]' : ':.s/\[x\]/\[\]'
22 |
--------------------------------------------------------------------------------
/doc/bujo.txt:
--------------------------------------------------------------------------------
1 |
2 | *bujo.txt*
3 | Bujo~
4 | Bullet Journal Vim Plugin~
5 |
6 | Author: Jersey Fonseca
7 |
8 | Version: 0.5
9 |
10 | 1. Overview
11 | 2. Features
12 | 3. FAQ
13 |
14 | =======================================================
15 | *bujo-overview*
16 | 1. Overview~
17 |
18 | This plugin allows people to easily access and
19 | manage todo lists for their projects.
20 |
21 | You can access Todo lists of specific projects just
22 | by being inside of that git repo. In addition, you
23 | can access a general todo list from any folder.
24 |
25 | You can find stable versions of this plugin at:
26 |
27 | https://github.com/jfonseca8/vim-bujo
28 |
29 | Feedback and bug reports are welcomed and encouraged.
30 | If you want new features, please do let me know. I
31 | would be honored at the opportunity to make a tool
32 | better.
33 |
34 | I built this because I wanted the ease of vim bindings
35 | with the benefits of keeping a todo list on hand. It is
36 | very simple and minimialist.
37 |
38 | =======================================================
39 | *bujo-features*
40 | 2. Features~
41 |
42 | * Open project specific todo:
43 | :Todo // from inside project
44 | * Open general todo:
45 | :Todo g
46 | * Use mods
47 | : Todo
48 | * Insert a new task:
49 | nmap BujoAddTodoNormal
50 | imap BujoAddTodoInsert
51 | * Check off a task:
52 | nmap BujoChecknormal
53 | imap BujoCheckinsert
54 | * Change cache directory:
55 | let g:bujo#todo_file_path = $HOME . "/.cache/bujo"
56 | * Change window open width:
57 | let g:bujo#window_width = 40
58 |
59 |
60 | =======================================================
61 | *bujo-notes*
62 | 3. Notes
63 |
64 | Please always feel free to do make recommendations and
65 | join me!
66 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vim-bujo
2 |
3 | This plugin allows people to easily access and manage todo lists for their projects from vim.
4 |
5 | You can easily access and manage Todo lists of specific projects or a general Todo list.
6 |
7 | ## Installation
8 |
9 | If you use a plugin manager, such as [vim-plug], follow its instructions on how to install plugins from github.
10 |
11 | To install the stable version of the plugin, if using [vim-plug], put this in your `vimrc`/`init.vim`:
12 |
13 | ```
14 | Plug 'vuciv/vim-bujo'
15 | ```
16 |
17 |
18 |
19 | ## Use / Mappings
20 |
21 | * Open Todo of current git repo:
22 | ```
23 | :Todo // from git repo
24 | ```
25 | * Open general Todo:
26 | ```
27 | :Todo g
28 | ```
29 |
30 | * Using mods:
31 | ```
32 | :botright Todo
33 | :botright Todo g
34 | ```
35 | __You can see more mod commands at [:h mods]__
36 |
37 | * Insert a new task:
38 | ```
39 | nmap BujoAddnormal
40 | imap BujoAddinsert
41 | ```
42 | * Check off a task:
43 | ```
44 | nmap BujoChecknormal
45 | imap BujoCheckinsert
46 | ```
47 |
48 | * Change cache directory:
49 | ```
50 | let g:bujo#todo_file_path = $HOME . "/.cache/bujo"
51 | ```
52 |
53 | * Change todo window width:
54 | ```
55 | let g:bujo#window_width = 40
56 | ```
57 | * Press ```Ctrl-W n <``` replace _n_ with the number of steps you want to move to the left
58 | * Press ```Ctrl-W n >``` replace _n_ with the number of steps you want to move to the right
59 |
60 |
61 | ## Screenshots
62 |
63 | This gif shows how the Todo list opens up in vim.
64 |
65 | 
66 |
67 | We can also see that the task list is very easy to manage.
68 |
69 | The ascii art is inserted manually, but you can do that yourself with the file 'templates/md.skeleton'
70 |
71 |
72 | ## Notes
73 |
74 | Feedback and bug reports are welcomed and encouraged.
75 | If you want new features, please do let me know. I
76 | would be honored at the opportunity to make a tool
77 | better for the community.
78 |
79 | I built this because I wanted the ease of vim bindings
80 | with the benefits of keeping a todo list on hand. It is
81 | very simple and minimialist.
82 |
83 | I plan to add diary capabilities, and all the fun little
84 | quotes and activities that make actual bullet journaling fun!
85 |
86 | If you would like to work on this project with me, please
87 | reach out to me on [twitter]
88 |
89 |
90 | [twitter]: https://twitter.com/FonsecaJersey
91 | [vim-plug]: https://github.com/junegunn/vim-plug
92 | [:h mods]: https://vimhelp.org/map.txt.html#%3Cmods%3E
93 |
94 | ## License
95 |
96 | Copyright (c) Jersey Fonseca. Distributed under the same terms as Vim itself.
97 | See `:help license`.
98 |
--------------------------------------------------------------------------------
/plugin/bujo.vim:
--------------------------------------------------------------------------------
1 | " bujo.vim - A minimalist todo list manager
2 | " Maintainer: Jersey Fonseca
3 | " Version: 0.5
4 |
5 | " Get custom configs
6 | let g:bujo#todo_file_path = get(g:, "bujo#todo_file_path", $HOME . "/.cache/bujo")
7 | let g:bujo#window_width = get(g:, "bujo#window_width", 30)
8 |
9 | " Make bujo directory if it doesn't exist"
10 | if empty(glob(g:bujo#todo_file_path))
11 | call mkdir(g:bujo#todo_file_path)
12 | endif
13 |
14 | " InGitRepository() tells us if the directory we are currently working in
15 | " is a git repository. It makes use of the 'git rev-parse --is-inside-work-tree'
16 | " command. This command outputs true to the shell if so, and a STDERR message
17 | " otherwise.
18 | "
19 | " We will use this function to know whether we should open a specific
20 | " project's todo list, or a global todo list.
21 | function s:InGitRepository()
22 | :silent let bool = system("git rev-parse --is-inside-work-tree")
23 |
24 | " The git function will return true with some leading characters
25 | " if we are in a repository. So, we split off those characters
26 | " and just check the first word.
27 | if split(bool, '\v\n')[0] == 'true'
28 | return 1
29 | endif
30 | endfunction
31 |
32 |
33 | " GetToplevelFolder() gives us a clean name of the git repository that we are
34 | " currently working in
35 | function s:GetToplevelFolder()
36 | let absolute_path = system("git rev-parse --show-toplevel")
37 | let repo_name = split(absolute_path, "/")
38 | let repo_name_clean = split(repo_name[-1], '\v\n')[0]
39 | return repo_name_clean
40 | endfunction
41 |
42 |
43 | " GetBujoFilePath() returns which file path we will be using. If we are in a
44 | " git repository, we return the directory for that specific git repo.
45 | " Otherwise, we return the general file path.
46 | "
47 | " If we are passed an argument, it means that the user wants to open the
48 | " general bujo file, so we also return the general file path in that case
49 | function s:GetBujoFilePath(general)
50 | if a:general || !s:InGitRepository()
51 | return g:bujo#todo_file_path . "/todo.md"
52 | else
53 | let repo_name = s:GetToplevelFolder()
54 | let todo_path = g:bujo#todo_file_path . "/" . repo_name
55 | if empty(glob(todo_path))
56 | call mkdir(todo_path)
57 | endif
58 | return todo_path . "/todo.md"
59 | endif
60 | endfunction
61 |
62 |
63 | " OpenTodo() opens the respective todo.md file from $HOME/.cache/bujo
64 | " If we are in a git repository, we open the todo.md for that git repository.
65 | " Otherwise, we open the global todo file.
66 | "
67 | " Paramaters :
68 | "
69 | " mods - allows a user to use (see :h mods)
70 | "
71 | " ... - any parameter after calling :Todo will mean that the user wants
72 | " us to open the general file path. We check this with a:0
73 | function s:OpenTodo(mods, ...)
74 | let general_bool = a:0
75 | let todo_path = s:GetBujoFilePath(general_bool)
76 | exe a:mods . " " . g:bujo#window_width "vs " . todo_path
77 | endfunction
78 |
79 | if !exists(":Todo")
80 | command -nargs=? Todo :call s:OpenTodo(, )
81 | endif
82 |
83 | " Update title upon file create.
84 | autocmd bufnewfile todo.md call append(0, "# " . split(expand('%:p:h:t'), '\v\n')[0] . " todo")
85 |
--------------------------------------------------------------------------------