Giter Site home page Giter Site logo

Comments (5)

gelguy avatar gelguy commented on July 17, 2024 1

This can be done with gelguy/Cmd2.vim with the following mappings.

function! s:Peekaboo()
    call peekaboo#peek(1, 'ctrl-r',  0)
endfunction

let g:Cmd2_cmd_mappings = {
    \ 'Peekaboo': {'command': function('s:Peekaboo'), 'type': 'function'},
    \ }

cmap <C-R> <Plug>(Cmd2)Peekaboo

from vim-peekaboo.

junegunn avatar junegunn commented on July 17, 2024

Peekaboo needs full control over the command-line to start itself (:call peekaboo#peak(...)). So on <CTRL-R> it should,

  1. Remember what's currently on the command-line. Also remember the position of the cursor.
  2. Clear the command-line and use it to start the sidebar
  3. When sidebar is closed, rebuild the command-line and restore the position of the cursor, and let Vim inject the content of the selected register.
    It's quite complicated, but probably not impossible. Special care must be taken to make it compatible with g:peekaboo_delay. I'll look into in when I get some time.

from vim-peekaboo.

junegunn avatar junegunn commented on July 17, 2024

Yeah, what @gelguy suggested could be a better way to handle this. I've tried implementing the aforementioned scheme, but realized that it has to rely on fragile hacks with extensive use of feedkeys(). I'll mark this issue as wontfix and close it. Thanks.

from vim-peekaboo.

jmlucjav avatar jmlucjav commented on July 17, 2024

@gelguy tested this and works like a charm. Thanks both. @junegunn maybe it's worth mentioning this on the readme so this great usage does not go unnoticed?

from vim-peekaboo.

junegunn avatar junegunn commented on July 17, 2024

@jmlucjav Okay, I'll update the FAQ section.

from vim-peekaboo.

Related Issues (20)

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.