Coder Social home page Coder Social logo

telescope-vim-bookmarks.nvim's Introduction

telescope-vim-bookmarks.nvim

Telescope picker for the vim-bookmarks plugin.

Installation

Install with your favorite plugin manager and add

require('telescope').load_extension('vim_bookmarks')

somewhere after loading telescope.

Usage

The extension provides two new pickers:

" Pick from all bookmarks
:Telescope vim_bookmarks all
" Only pick from bookmarks in current file
:Telescope vim_bookmarks current_file

Lua equivalent:

require('telescope').extensions.vim_bookmarks.all()
require('telescope').extensions.vim_bookmarks.current_file()

Customization

Both pickers take a table of options that you can use to customize them. Here's a list of available options along with their default values:

Option Explanation Default Value
hide_filename Whether to display the filename of bookmarks in the picker true for all, false for current_file
tail_path If true, display only the filename, otherwise display the full path Same as your global telescope config
shorten_path Whether to shorten the file path, works the same as with telescope's builtin pickers. (Only has an effect when tail_path=false) true
prompt_title Title of the search prompt 'vim-bookmarks'
width_line Width reserved for the line number in the picker 5
width_text Width reserved for the bookmark text in the picker 60
only_annotated Only display bookmarks that have an annotation false
attach_mappings See following section {}

Additionally, the table of options is passed on to your configured qflist_previewer and generic_sorter (See Telescope docs for details)

Actions

The extension also provides custom actions for managing bookmarks:

Action Explanation
delete_at_cursor Deletes the bookmark at current cursor position
delete_selected Deletes all bookmarks selected via Telescope's multi-selection
delete_selected_or_at_cursor If there's a multi selection, delete those bookmarks, otherwise delete the one at the curso position
delete_all Deletes all bookmarks (Same as :BookmarkClearAll)

For example:

local bookmark_actions = require('telescope').extensions.vim_bookmarks.actions
require('telescope').extensions.vim_bookmarks.all {
    attach_mappings = function(_, map) 
        map('n', 'dd', bookmark_actions.delete_selected_or_at_cursor)

        return true
    end
}

telescope-vim-bookmarks.nvim's People

Contributors

matheusfillipe avatar tom-anders avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.