dgrnbrg/vim-redl

Repl History in Tmux / cmdline Vim

Closed this issue · 7 comments

Repl history is working great in gvim, but it does not work in command line vim from tmux.

My dot files a here:

With changes from this stackoverflow answer I got the arrow keys working, but in the Redl repl buffer, '' appears to cycle it through some other mode then back to insert - it pastes nothing.

Again, gvim works fine...it seems to be something tmux related?

In any case, something else I might try is changing the keybinding for repl history, i.e. <C-P>/ <C-N>. Where / how to do that correctly?

I had to add this to my .vimrc, to get history to work in Tmux:

  imap <silent> <C-S-K> <Plug>clj_repl_uphist.
  imap <silent> <C-S-J> <Plug>clj_rbepl_downhist.

which is just what was in vim-redl source code, but without the .

Oh, you might have noticed what I didn't mention : I use <C-S-K> instead of <C-K>, because <C-K> is a Tmux binding for me.

Is there some way that I can integrate this into the main vim-redl? Or @mascip, would you be willing to write a pull request to add these instructions to the README for tmux users?

Can you try my solution @noahlz ?

On my two machines it's the <buffer> that make the history commands not work, even when I don't use Tmux! (even though my machines don't mind for other commands... no idea why).

What <buffer> is for: "If the first argument to one of these commands is "" the mapping will be effective in the current buffer only"

Although it does make sense to only define the vim-redl mappings in a vim-redl buffer, we could delete these in the code, for the two history commands.
Or I can write this in the doc:
"If some of these key bindings don't work, you can try to redefine them like this in your .vimrc:

imap <silent> <C-K> <Plug>clj_repl_uphist.

Tell me which solution you prefer @dgrnbrg .

Either way, I can add a piece of doc for people who are not familiar with <Plug> or won't think about defining their own binding, saying:
"If you don't like these default key bindings or if they don't work, you can define your own. For example:

imap <silent> <C-S-K> <Plug>clj_repl_uphist.

PS: I will be away from tomorrow (Sunday), so won't be able to contribute until the end of the week.

I like either one--it's been so long since I've written VimScript that I
don't have an opinion on style any more.

On Sat, Aug 2, 2014 at 9:01 AM, Pierre Masci notifications@github.com
wrote:

Can you try my solution @noahlz https://github.com/noahlz ?

On my two machines it's the that make the history commands not work, even
when I don't use Tmux! (even though my machines don't mind for other
commands... no idea why).

What is for: "If the first argument to one of these commands is "" the
mapping will be effective in the current buffer only"

Although it does make sense to only define the vim-redl mappings in a
vim-redl buffer, we could delete these in the code, for the two history
commands.
Or I can write this in the doc:
"If some of these key bindings don't work, you can try to redefine them
like this in your .vimrc:

imap clj_repl_uphist.

Tell me which solution you prefer @dgrnbrg https://github.com/dgrnbrg .

Either way, I can add a piece of doc for people who are not familiar with
or won't think about defining their own binding, saying:
"If you don't like these default key bindings or if they don't work, you
can define your own. For example:

imap clj_repl_uphist.

PS: I will be away from tomorrow (Sunday), so won't be able to contribute
until the end of the week.


Reply to this email directly or view it on GitHub
#24 (comment).

@mascip Your solution worked for me, thanks!!! 👍

And thanks @dgrnbrg for merging!