Vim like mappings #12

Closed
wants to merge 11 commits into
from

Conversation

Projects
None yet
2 participants
@PeterRincker
Contributor

PeterRincker commented Mar 21, 2012

Provide vim-like mappings to send text to screen/tmux.

{Visual}<leader>s to send visually selected text.
<leader>s{motion} to send motion text.
<leader>ss to send the current line.

New commands:

:SlimeConfig
:SlimeSend

Supplied documentation to go along with the new mappings and commands.

Along with the new mappings and commands, I have updated slime.vim to follow the guidelines in :h write-plugin

General implementation improvements:

  • Pipe text to screen/tmux via stdin
  • Add tmux completion for panes
@jpalardy

This comment has been minimized.

Show comment Hide comment
@jpalardy

jpalardy Mar 21, 2012

Owner

This is really nice!

I don't have time to merge it tonight, but I'll take care of it tomorrow.

Owner

jpalardy commented Mar 21, 2012

This is really nice!

I don't have time to merge it tonight, but I'll take care of it tomorrow.

@jpalardy

This comment has been minimized.

Show comment Hide comment
@jpalardy

jpalardy Mar 24, 2012

Owner

I sat down to merge this and I must say it's a big improvement… except for the key bindings. I understand why the default key bindings changed (they were never really vim'y in the first place), but changing the default behavior and expecting people to remap doesn't seem like the friendliest solution.

How about a g:slime_no_emacs_mappings flag?

Owner

jpalardy commented Mar 24, 2012

I sat down to merge this and I must say it's a big improvement… except for the key bindings. I understand why the default key bindings changed (they were never really vim'y in the first place), but changing the default behavior and expecting people to remap doesn't seem like the friendliest solution.

How about a g:slime_no_emacs_mappings flag?

@PeterRincker

This comment has been minimized.

Show comment Hide comment
@PeterRincker

PeterRincker Mar 24, 2012

Contributor

Should slime.vim have 2 different set of key bindings? I believe it might be more pragmatic to keep the default mappings in the emacs style, but provide documentation on how to setup more vim-y mappings. Some documentation like the following would be nice:

To use vim like mappings instead of emacs use the following:
>
    let g:slime_no_mappings = 1
    xmap <leader>s <Plug>SlimeRegionSend
    nmap <leader>s <Plug>SlimeSend
    nmap <leader>ss <Plug>SlimeLineSend
<

Of course more of the documentation would have to change but that would need to happen anyway to provide documentation for the emacs style keybindings.

Contributor

PeterRincker commented Mar 24, 2012

Should slime.vim have 2 different set of key bindings? I believe it might be more pragmatic to keep the default mappings in the emacs style, but provide documentation on how to setup more vim-y mappings. Some documentation like the following would be nice:

To use vim like mappings instead of emacs use the following:
>
    let g:slime_no_mappings = 1
    xmap <leader>s <Plug>SlimeRegionSend
    nmap <leader>s <Plug>SlimeSend
    nmap <leader>ss <Plug>SlimeLineSend
<

Of course more of the documentation would have to change but that would need to happen anyway to provide documentation for the emacs style keybindings.

@jpalardy

This comment has been minimized.

Show comment Hide comment
@jpalardy

jpalardy Mar 27, 2012

Owner

Sounds great. The plugin was featured on Hacker News and I don't want to
change the bindings now.

Could you make that change and send the pull request? You've touched quite
a few things and your vim-fu is kicking my ass.

Thanks

On Sat, Mar 24, 2012 at 12:34 PM, PeterRincker <
reply@reply.github.com

wrote:

Should slime.vim have 2 different set of key bindings? I believe it might
be more pragmatic to keep the default mappings in the emacs style, but
provide documentation on how to setup more vim-y mappings. Some
documentation like the following would be nice:

To use vim like mappings instead of emacs use the following:

   let g:slime_no_mappings = 1
   xmap <leader>s <Plug>SlimeRegionSend
   nmap <leader>s <Plug>SlimeSend
   nmap <leader>ss <Plug>SlimeLineSend

<

Of course more of the documentation would have to change but that would
need to happen anyway to provide documentation for the emacs style
keybindings.


Reply to this email directly or view it on GitHub:
#12 (comment)

Owner

jpalardy commented Mar 27, 2012

Sounds great. The plugin was featured on Hacker News and I don't want to
change the bindings now.

Could you make that change and send the pull request? You've touched quite
a few things and your vim-fu is kicking my ass.

Thanks

On Sat, Mar 24, 2012 at 12:34 PM, PeterRincker <
reply@reply.github.com

wrote:

Should slime.vim have 2 different set of key bindings? I believe it might
be more pragmatic to keep the default mappings in the emacs style, but
provide documentation on how to setup more vim-y mappings. Some
documentation like the following would be nice:

To use vim like mappings instead of emacs use the following:

   let g:slime_no_mappings = 1
   xmap <leader>s <Plug>SlimeRegionSend
   nmap <leader>s <Plug>SlimeSend
   nmap <leader>ss <Plug>SlimeLineSend

<

Of course more of the documentation would have to change but that would
need to happen anyway to provide documentation for the emacs style
keybindings.


Reply to this email directly or view it on GitHub:
#12 (comment)

@PeterRincker

This comment has been minimized.

Show comment Hide comment
@PeterRincker

PeterRincker Mar 28, 2012

Contributor

I have changed the default mappings back to the emacs style mappings and updated the documentation. I have included more vim like mappings near the bottom of the documentation.

Contributor

PeterRincker commented Mar 28, 2012

I have changed the default mappings back to the emacs style mappings and updated the documentation. I have included more vim like mappings near the bottom of the documentation.

@jpalardy

This comment has been minimized.

Show comment Hide comment
@jpalardy

jpalardy Apr 4, 2012

Owner

Merged and tweaked. Everything looks fine on the tmux side -- but when I tested screen, it wasn't working.

-X readreg a -

That is supposed to read STDIN but it's not working for me. What version of screen does it require?

There's a branch called 'PeterRincker', have a go at it.

Owner

jpalardy commented Apr 4, 2012

Merged and tweaked. Everything looks fine on the tmux side -- but when I tested screen, it wasn't working.

-X readreg a -

That is supposed to read STDIN but it's not working for me. What version of screen does it require?

There's a branch called 'PeterRincker', have a go at it.

@jpalardy

This comment has been minimized.

Show comment Hide comment
@jpalardy

jpalardy Apr 17, 2012

Owner

Any thoughts on this?

Owner

jpalardy commented Apr 17, 2012

Any thoughts on this?

@jpalardy jpalardy closed this in 96d4463 Apr 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment