Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend PrtInsert to support multi character action #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Extend PrtInsert to support multi character action
    PrtInsert can be mapped to insert clipboard or some register.
    This extends PrtInsert to support insert any register (e.g "b
    register).
    Rationale: I mostly use " (unnamed register for work) so now
    let g:ctrlp_prompt_mappings = {
        \ 'PrtInsert("r\"")': ['<c-u>'],
        \ }
    will work.
    ( when user enters c-u the content of unnamed register is entered)
Kris2k committed Aug 8, 2014
commit 596d9db32750ce0137d94077dbd06cef2152c12e
4 changes: 4 additions & 0 deletions autoload/ctrlp.vim
Original file line number Diff line number Diff line change
@@ -681,6 +681,10 @@ fu! s:PrtInsert(...)
let regcont = s:getregs()
if regcont < 0 | retu | en
en
if type =~# '^r.$'
let regcont = s:regisfilter(type[1])
let type = 'r'
en
unl! s:hstgot
let s:act_add = 1
let s:prompt[0] .= type ==# 'w' ? s:crword