From 227ce0d7705c72297deabca4cc7adb855632e9f2 Mon Sep 17 00:00:00 2001 From: ahmedselim2017 Date: Thu, 25 Jun 2020 02:46:32 +0300 Subject: Defined mappings. --- ftplugin/markdown_bujo.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ftplugin/markdown_bujo.vim b/ftplugin/markdown_bujo.vim index cf79d6f..6838885 100644 --- a/ftplugin/markdown_bujo.vim +++ b/ftplugin/markdown_bujo.vim @@ -1,6 +1,6 @@ " Edit markdown lists " Add and remove bullets with ease -nnoremap i-[] -nnoremap :.s/\[\]/\[x\] -inoremap -[] -inoremap :.s/\[\]/\[x\] +nnoremap bujo#AddTodoNormal i-[] +nnoremap bujo#CheckTodoNormal :.s/\[\]/\[x\] +inoremap bujo#AddTodoInsert -[] +inoremap bujo#CheckTodoInsert :.s/\[\]/\[x\] -- cgit v1.2.3 From 727a5ab3612bfd7823a0608bf04c0fb1cc1d317c Mon Sep 17 00:00:00 2001 From: ahmedselim2017 Date: Thu, 25 Jun 2020 02:47:47 +0300 Subject: Added todo_file_path --- plugin/bujo.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin/bujo.vim b/plugin/bujo.vim index bc13304..d5203e9 100644 --- a/plugin/bujo.vim +++ b/plugin/bujo.vim @@ -1,18 +1,19 @@ "Make bujo directory if it doesn't exist" -if empty(glob('~/bujo')) - call mkdir($HOME . '/bujo', 'p') +let g:bujo#todo_file_path = get(g:, "bujo#todo_file_path", $HOME . "/.cache/bujo") +if empty(glob(g:bujo#todo_file_path)) + call mkdir(g:bujo#todo_file_path) endif autocmd bufnewfile todo.md call append(0, '#Todo') autocmd bufnewfile todo.md call append(1, 'Date: ') autocmd bufnewfile,bufreadpre todo.md exe "g/Date: */s/Date: /Date: " .strftime("%a %d %b %Y") -autocmd bufnewfile,Bufwritepre,filewritepre todo.md execute "normal G" +autocmd bufnewfile,Bufwritepre,filewritepre todo.md execute "normal Go" " Open the bujo todo list file function s:OpenTodo() "30 makes it open at width 30 - exe ":30vs ~/bujo/todo.md" + exe ":30vs" . g:bujo#todo_file_path . "/todo.md" endfunction if !exists(":Todo") -- cgit v1.2.3 From e126e779aefb5e6b1144a9f27d7f373595db2fb4 Mon Sep 17 00:00:00 2001 From: ahmedselim2017 Date: Thu, 25 Jun 2020 02:49:51 +0300 Subject: Added new mappings to readme and doc. --- README.md | 30 ++++++++++++++++++++++-------- doc/bujo.txt | 17 +++++++++++------ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b6b3294..31f21e2 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,28 @@ Plug 'jfonseca8/vim-bujo' ``` -## Use - -* Conveniently open your todo list in vim - - Run :Todo -* Easily insert a new task - - Press Ctrl-Enter -* Easily check off a task - - Press Ctrl-Backspace + +## Use / Mappings + +* Run: + ``` + :Todo + ``` +* Insert a new task: + ``` + nmap bujo#AddTodoNormal + imap bujo#AddTodoInsert + ``` +* Check off a task: + ``` + nmap bujo#CheckTodoNormal + imap bujo#CheckTodoInsert + ``` +* Change cache directory: + ``` + let g:bujo#todo_file_path = $HOME . "/.cache/bujo" + ``` + ## Screenshots diff --git a/doc/bujo.txt b/doc/bujo.txt index c74d128..74af942 100644 --- a/doc/bujo.txt +++ b/doc/bujo.txt @@ -34,12 +34,17 @@ very simple and minimialist. *bujo-features* 2. Features~ - * Conveniently open your todo list in vim - - Run :Todo - * Easily insert a new task - - Press - * Easily check off a task - - Press + * Run: + :Todo + * Insert a new task: + nmap bujo#AddTodoNormal + imap bujo#AddTodoInsert + * Check off a task: + nmap bujo#CheckTodoNormal + imap bujo#CheckTodoInsert + * Change cache directory: + let g:bujo#todo_file_path = $HOME . "/.cache/bujo" + ======================================================= *bujo-notes* -- cgit v1.2.3