summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-03 11:18:08 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-03 11:18:08 -0400
commitb04ec331c48a1668b0df21f24e9870acccec5e64 (patch)
tree081aa2548142bb52db2baa339f6c7e8e0cac68f3 /plugin
parentd48a2933d55a5aa2ca3c15e482a90bbffbb49b92 (diff)
feat: Add cool mapping for <C-R> in command mode
Diffstat (limited to 'plugin')
-rw-r--r--plugin/telescope.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugin/telescope.vim b/plugin/telescope.vim
index 837187a..347f887 100644
--- a/plugin/telescope.vim
+++ b/plugin/telescope.vim
@@ -6,6 +6,13 @@ highlight default link TelescopeSelection Visual
highlight default link TelescopeNormal Normal
+" This is like "<C-R>" in your terminal.
+" To use it, do `cmap <C-R> <Plug>(TelescopeFuzzyCommandSearch)
+cnoremap <silent> <Plug>(TelescopeFuzzyCommandSearch) <C-\>e
+ \ "lua require('telescope.builtin').command_history {
+ \ default_text = [=[" . escape(getcmdline(), '"') . "]=]
+ \ }"<CR><CR>
+
" let s:term_command = "rg preview_quit_map -l | fzf --preview 'bat --color=always --style=grid {-1}' --print0"
" let s:term_command = "rg preview_quit_map -l | fzf --preview 'bat --color=always --style=grid {-1}' > file.txt"
" let s:term_command = "(rg preview_quit_map -l | fzf --preview 'bat --color=always --style=grid {-1}')"