Live data from Hacker News

Tmux and Vim – better together

blog.bugsnag.com

11–20 of 297 posts

Re: Tmux and Vim – better together

#12
post #2

I've shyed away from using tmux and Vim. For some reason, when I use tmux and Vim, if I 'copy' a snippet of text (using my mouse/cursor higlight -> right-click -> copy) it treats all of the empty space a actual "space" characters when I 'paste'. Why does it do this?

Expecting terminal programs to interact sanely with mouse gestures is somewhat futile. If I need to paste something from a vim buffer into a graphical application, I use :'!xsel -bi to copy the text. If I were doing it more often, I would probably add a keybinding to streamline the process, and solve minor annoyances like having to undo to get the copied lines back. Maybe there is a good plugin for clipboard integration?

Re: Tmux and Vim – better together

#13
I use vim 7.4 and it segfaults atleast four-five times everyday. I suspect it's some plugin that is causing it to crash but I don't really know. Does it happen to anyone else too?

I have mapped Ctrl-C to ESC and I use it often. One specific instance I have seen vim crash is when the cursor is at np.inf and I press Ctrl-C.

Re: Tmux and Vim – better together

#14
post #2

I've shyed away from using tmux and Vim. For some reason, when I use tmux and Vim, if I 'copy' a snippet of text (using my mouse/cursor higlight -> right-click -> copy) it treats all of the empty space a actual "space" characters when I 'paste'. Why does it do this?

Same, I don't use tmux with vim for exactly the reasons you gave.

Instead I use i3 to split screens, etc. much better imo.

Re: Tmux and Vim – better together

#15
post #12
post #2

I've shyed away from using tmux and Vim. For some reason, when I use tmux and Vim, if I 'copy' a snippet of text (using my mouse/cursor higlight -> right-click -> copy) it treats all of the empty space a actual "space" characters when I 'paste'. Why does it do this?

Expecting terminal programs to interact sanely with mouse gestures is somewhat futile. If I need to paste something from a vim buffer into a graphical application, I use :' !xsel -bi to copy the text. If I were doing it more often, I would probably add a keybinding to streamline the process, and solve minor annoyances like having to undo to get the copied lines back. Maybe there is a good plugin for clipboard integra…

https://github.com/wincent/clipper is what i have been using for clipboard integration. It is useful for remote server clipboard syncing too.

Re: Tmux and Vim – better together

#16

I use vim 7.4 and it segfaults atleast four-five times everyday. I suspect it's some plugin that is causing it to crash but I don't really know. Does it happen to anyone else too? I have mapped Ctrl-C to ESC and I use it often. One specific instance I have seen vim crash is when the cursor is at np.inf and I press Ctrl-C.

Vim has never crashed for me. And I've been using it almost exclusively for almost ten years.

I don't use any plugins though. I haven't found a single usable plugin. They are terrible hacks. I figure vim must have an API that's difficult to integrate (it's too general a text editor. Look at the amount of built-in settings that hardly play nice with each other).

Re: Tmux and Vim – better together

#17

I use vim 7.4 and it segfaults atleast four-five times everyday. I suspect it's some plugin that is causing it to crash but I don't really know. Does it happen to anyone else too? I have mapped Ctrl-C to ESC and I use it often. One specific instance I have seen vim crash is when the cursor is at np.inf and I press Ctrl-C.

Have you tried upgrading to a non-ancient vim?

Re: Tmux and Vim – better together

#18
post #2

I've shyed away from using tmux and Vim. For some reason, when I use tmux and Vim, if I 'copy' a snippet of text (using my mouse/cursor higlight -> right-click -> copy) it treats all of the empty space a actual "space" characters when I 'paste'. Why does it do this?

I believe this is because vim manages drawing the entire screen, rather than depending on its terminal emulator to wrap lines, etc. This may be dependent upon configuration, and the setting `t_ut` (which is the background clearing color).

Anyway, using tmux for selection in vim is a bad idea. You can give vim mouse support by `set mouse=a`, which will prevent tmux from capturing selection and scrollback control if you like. Achieving parity between vim, system, and tmux clipboard (and for bonus points, across a network) is left as a "fun" exercise.

Re: Tmux and Vim – better together

#19
post #12
post #2

I've shyed away from using tmux and Vim. For some reason, when I use tmux and Vim, if I 'copy' a snippet of text (using my mouse/cursor higlight -> right-click -> copy) it treats all of the empty space a actual "space" characters when I 'paste'. Why does it do this?

Expecting terminal programs to interact sanely with mouse gestures is somewhat futile. If I need to paste something from a vim buffer into a graphical application, I use :' !xsel -bi to copy the text. If I were doing it more often, I would probably add a keybinding to streamline the process, and solve minor annoyances like having to undo to get the copied lines back. Maybe there is a good plugin for clipboard integra…

You could use "y (and/or "+y, depending on your X clipboard setup) to yank to your clipboard. Similarly, "p paste from it.
Post reply on HN