Skip to content

Commit

Permalink
Show bookmarks using location list
Browse files Browse the repository at this point in the history
  • Loading branch information
sstallion authored and Steven Stallion committed Aug 15, 2016
1 parent c1cfec1 commit 7907d5f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -116,6 +116,7 @@ Put any of the following options into your `~/.vimrc` in order to overwrite the
| `let g:bookmark_show_toggle_warning = 0` | 1 | Enables/disables warning when toggling to clear a bookmark with annotation | | `let g:bookmark_show_toggle_warning = 0` | 1 | Enables/disables warning when toggling to clear a bookmark with annotation |
| `let g:bookmark_center = 1` | 0 | Enables/disables line centering when jumping to bookmark| | `let g:bookmark_center = 1` | 0 | Enables/disables line centering when jumping to bookmark|
| `let g:bookmark_no_default_key_mappings = 1` | 0 | Prevent any default key mapping from being created| | `let g:bookmark_no_default_key_mappings = 1` | 0 | Prevent any default key mapping from being created|
| `let g:bookmark_location_list = 1` | 0 | Use the location list to show all bookmarks |


### Bookmarks per working directory ### Bookmarks per working directory


Expand Down Expand Up @@ -274,6 +275,10 @@ autocmd BufEnter * :call BookmarkMapKeys()
autocmd BufEnter NERD_tree_* :call BookmarkUnmapKeys() autocmd BufEnter NERD_tree_* :call BookmarkUnmapKeys()
``` ```


> Why do my bookmarks disappear when running the `:make` command?
By default, the bookmark list is shown using the quickfix window, which can sometimes conflict with other commands. The location list may be used to show the bookmark list instead by setting the `g:bookmark_location_list` option documented above.

## Changelog ## Changelog


See the [release page](https://github.com/MattesGroeger/vim-bookmarks/releases) for all changes. See the [release page](https://github.com/MattesGroeger/vim-bookmarks/releases) for all changes.
Expand Down
6 changes: 6 additions & 0 deletions doc/bookmarks.txt
Expand Up @@ -243,6 +243,12 @@ Automatically close bookmarks split when jumping to a bookmark (default 0):
> >
let g:bookmark_auto_close = 1 let g:bookmark_auto_close = 1
< <

Use the location list to show all bookmarks (default 0):

>
let g:bookmark_location_list = 1
<
=============================================================================== ===============================================================================
6. EXTENDING *BookmarksExtending* 6. EXTENDING *BookmarksExtending*


Expand Down
10 changes: 8 additions & 2 deletions plugin/bookmark.vim
Expand Up @@ -30,6 +30,7 @@ call s:set('g:bookmark_manage_per_buffer', 0 )
call s:set('g:bookmark_auto_save_file', $HOME .'/.vim-bookmarks') call s:set('g:bookmark_auto_save_file', $HOME .'/.vim-bookmarks')
call s:set('g:bookmark_auto_close', 0 ) call s:set('g:bookmark_auto_close', 0 )
call s:set('g:bookmark_center', 0 ) call s:set('g:bookmark_center', 0 )
call s:set('g:bookmark_location_list', 0 )


function! s:init(file) function! s:init(file)
if g:bookmark_auto_save ==# 1 || g:bookmark_manage_per_buffer ==# 1 if g:bookmark_auto_save ==# 1 || g:bookmark_manage_per_buffer ==# 1
Expand Down Expand Up @@ -175,8 +176,13 @@ function! BookmarkShowAll()
else else
let oldformat = &errorformat " backup original format let oldformat = &errorformat " backup original format
let &errorformat = "%f:%l:%m" " custom format for bookmarks let &errorformat = "%f:%l:%m" " custom format for bookmarks
cgetexpr bm#location_list() if g:bookmark_location_list
belowright copen lgetexpr bm#location_list()
belowright lopen
else
cgetexpr bm#location_list()
belowright copen
endif
augroup BM_AutoCloseCommand augroup BM_AutoCloseCommand
autocmd! autocmd!
autocmd WinLeave * call s:auto_close() autocmd WinLeave * call s:auto_close()
Expand Down

0 comments on commit 7907d5f

Please sign in to comment.