This repository was archived by the owner on Mar 14, 2025. It is now read-only.
File tree 5 files changed +39
-2
lines changed
5 files changed +39
-2
lines changed Original file line number Diff line number Diff line change 1
- # VIM Do Too v0.13.2 [ ![ CircleCI] ( https://circleci.com/gh/dhruvasagar/vim-dotoo.svg?style=svg )] ( https://circleci.com/gh/dhruvasagar/vim-dotoo )
1
+ # VIM Do Too v0.13.3 [ ![ CircleCI] ( https://circleci.com/gh/dhruvasagar/vim-dotoo.svg?style=svg )] ( https://circleci.com/gh/dhruvasagar/vim-dotoo )
2
2
An awesome task manager & clocker inspired by org-mode written in pure viml.
3
3
4
4
## Pre-requisites
@@ -24,6 +24,7 @@ accurate agenda information and also for faster updates to these files.
24
24
* <kbd >\< C-C\>\< C-C\> </kbd >: Normalize a date (fixes day name if incorrect)
25
25
* <kbd >\< Tab></kbd >: Cycle headline visibility similar to Org mode
26
26
* <kbd >\< CR></kbd >: Follow link under cursor
27
+ * <kbd >\< BS></kbd >: Go back to previous document after following a link
27
28
28
29
The <kbd >\< C-X\> </kbd >, <kbd >\< C-A\> </kbd >, and <kbd >cic</kbd > commands all work with <kbd >.</kbd >
29
30
if you have [ repeat.vim] ( http://github.com/tpope/vim-repeat ) installed
Original file line number Diff line number Diff line change @@ -12,10 +12,29 @@ function! s:parse_links()
12
12
return result
13
13
endfunction
14
14
15
+ let s: link_stack = []
16
+ function ! s: add_to_link_stack (bufnr )
17
+ let winid = winnr ()
18
+ let item = {' bufnr' : a: bufnr , ' from' : extend ([bufnr ()], getcurpos ())}
19
+ call add (s: link_stack , item)
20
+ endfunction
21
+
22
+ function ! s: pop_from_link_stack ()
23
+ if empty (s: link_stack ) | return | endif
24
+
25
+ let last_entry = remove (s: link_stack , -1 )
26
+ let bfnr = last_entry.from[0 ]
27
+ if bufnr () != bfnr
28
+ exec ' buffer' bfnr
29
+ endif
30
+ call setpos (' .' , last_entry.from[1 :])
31
+ endfunction
32
+
15
33
function ! s: goto_headline (headline)
16
34
if empty (a: headline )
17
35
return 0
18
36
endif
37
+ call s: add_to_link_stack (bufnr (a: headline .file ))
19
38
call dotoo#agenda#goto_headline (' edit' , a: headline )
20
39
return 1
21
40
endfunction
@@ -60,9 +79,11 @@ function! s:goto_file(link)
60
79
61
80
if filereadable (file )
62
81
let found = 1
82
+ call bufload (file ) " ensure buffer is loaded
63
83
endif
64
84
65
85
if found == # 1
86
+ call s: add_to_link_stack (bufnr (file ))
66
87
exe ' edit' file
67
88
return 1
68
89
endif
@@ -111,3 +132,11 @@ function! dotoo#link#follow(cmd) abort
111
132
endif
112
133
endfor
113
134
endfunction
135
+
136
+ function ! dotoo#link#stack () abort
137
+ return string (s: link_stack )
138
+ endfunction
139
+
140
+ function ! dotoo#link#back () abort
141
+ call s: pop_from_link_stack ()
142
+ endfunction
Original file line number Diff line number Diff line change 2
2
-------------------------------------------------------------------------------
3
3
4
4
DoToo, the awesome TODO management system inspired by Org-Mode.
5
- Version 0.13.2
5
+ Version 0.13.3
6
6
7
7
Author: Dhruva Sagar (http://dhruvasagar.com)
8
8
License: MIT (http://opensource.org/licenses/MIT)
@@ -44,6 +44,7 @@ GETTING STARTED *dotoo-getting-started
44
44
`<C-C><C-C>`: Normalize a date (fixes day name if incorrect)
45
45
`<Tab>`: Cycle headline visibility similar to Org mode
46
46
`<CR>`: Follow link under cursor
47
+ `<BS>`: Go back to previous document after following a link
47
48
48
49
They `<C-X>`, `<C-A>` and `cic` commands are repeatable using |.|
49
50
Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ if !g:dotoo_disable_mappings
91
91
if ! hasmapto (' <Plug>(dotoo-link-follow)' )
92
92
nmap <buffer> <CR> <Plug> (dotoo-link-follow)
93
93
endif
94
+ if ! hasmapto (' <Plug>(dotoo-link-back)' )
95
+ nmap <buffer> <BS> <Plug> (dotoo-link-back)
96
+ endif
94
97
if ! hasmapto (' <Plug>(dotoo-date-normalize)' )
95
98
nmap <buffer> <C-C><C-C> <Plug> (dotoo-date-normalize)
96
99
endif
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ nnoremap <silent> <Plug>(dotoo-capture)
50
50
nnoremap <silent> <Plug> (dotoo-link-follow)
51
51
\ :<C-U> call dotoo#link#follow('edit')<CR>
52
52
53
+ nnoremap <silent> <Plug> (dotoo-link-back)
54
+ \ :<C-U> call dotoo#link#back()<CR>
55
+
53
56
nnoremap <silent> <Plug> (dotoo-date-increment)
54
57
\ :<C-U> call dotoo#date#increment(v:count1)<CR>
55
58
nnoremap <silent> <Plug> (dotoo-date-decrement)
You can’t perform that action at this time.
0 commit comments