Comments (2)
Added FzfPreviewMarks instead of Bookmarks and removed them to reduce dependency on other plugins.
Also, I plan to add to the documentation, but you can easily add commands to fzf-preview.
vim-bookmarks is a bit complicated, but can be used like.
command! -nargs=* -complete=customlist,fzf_preview#args#complete_options FzfPreviewBookmarks
\ :call fzf_preview#runner#fzf_run(fzf_preview#initializer#initialize('FzfPreviewBookmarks', {}, <f-args>))
function! FzfPreviewBookmarks(additional, args) abort
let source = fzf_preview#converter#convert_for_fzf(filter(map(bm#location_list(), {
\ _, b -> s:bookmarks_format_line(b)
\ }), {
\ _, b -> b !=# ''
\ }), 1)
let optional = '--delimiter :'
let preview = g:fzf_preview_grep_preview_cmd . ' {}'
return {
\ 'source': source,
\ 'sink': function('fzf_preview#handler#handle_grep'),
\ 'options': fzf_preview#command#get_command_options('Bookmarks', preview, optional)
\ }
endfunction
function! s:bookmarks_format_line(line) abort
let line = split(a:line, ':')
let filename = fnamemodify(line[0], ':.')
if !filereadable(filename)
return ''
endif
let line_number = line[1]
let text = line[2]
if text ==# 'Annotation'
let comment = line[3]
else
let text = join(line[2:], ':')
endif
if text !=# 'Annotation'
return filename . ':' . line_number . ':' . text
else
return filename . ':' . line_number . ':' . text . ':' . comment
endif
endfunction
from fzf-preview.vim.
Thank you for the clarification and the code example
from fzf-preview.vim.
Related Issues (20)
- Document opening multiple files with TAB in preview window HOT 1
- [Feature Request] Open all files in fzf-preview HOT 2
- FZF search history feature request HOT 3
- [Question] $FZF_PREVIEW_PREVIEW_BAT_THEME has no effect? HOT 6
- Live grep HOT 3
- Ctags error
- Bunch of unknown characters showing on the first line HOT 2
- Support fzf_preview_command when doing ProjectGrep HOT 1
- Preview's highligt-line may not work in Vim HOT 4
- If the path of a file in the buffer list contains space, Bat preview fails
- FromResources aborts when any of the resources fail to load
- Issue when installing in Win 10
- bufferlines not working properly when working directory changed
- Feature request: add ability to use nerdfont.vim plugin to display filetype icons
- fish: Command substitutions not allowed HOT 1
- Use of ctags is hard coded as a constant HOT 1
- Older versions of Node throwing SyntaxError: Unexpected token '?' HOT 2
- Feature idea: include additional file search paths that are normally ignored by git / ripgrep
- Use project commands like `:FzfPreviewProjectFiles` and `:FzfPreviewProjectMruFiles` on non-git repos HOT 2
- :CocCommand fzf-preview.ProjectGrep . doesn't respect .gitignore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fzf-preview.vim.