Live data from Hacker News

Tmux and Vim – better together

blog.bugsnag.com

81–90 of 297 posts

Re: Tmux and Vim – better together

#81
post #43

Earlier quoted context omitted.

Weird. I built my .rc files like 10 years ago, and only edit them about twice a year to add a plugin or modify a keybinding. Not a pain to maintain at all.

How do you store them? Just backup into a dotfiles repo or what? I've been looking into dotfiles + gnu stow.

Mine are on github. If you want to use this setup simply copy and paste the contents of your original files and use the `makesymlinks.sh` script to create the links. It takes me 30 seconds to setup a new computer with it.

https://github.com/garyharan/dotfiles

Re: Tmux and Vim – better together

#82
post #30

All this looks really great, however I think I just can't deal with the effort of maintaining these complex editor configurations anymore. I've been a multi-decade Vim user, until I switched to VSCode last year. It made me realize how much better the user experience can be for an editor. I had all kinds of complex vim configurations and plugins with special cases for linux vs. mac, server vs. desktop, GUI vs. termina…

I've taken a month or two off from plugging Kakoune on HN because I was worried about becoming tiresome, but I can't resist mentioning it in this context. I used vim for 20 years, although I always preferred to stick with the default configuration. I switched to kak a couple of months ago, and I couldn't be happier. It's got great tmux integration, it automatically runs a server so you can connect multiple clients to one buffer, and it has a novel selection-oriented modal interface that's not just an attempt to mimic Vim.

Re: Tmux and Vim – better together

#83
I use tmux and vim often, but man my mind turns to mush reading about about either one of them. The biggest hassle I have is with copy-paste with tmux which I find ugly and can never remember. And then the method differs if you need to copy from tmux to another program that is not in tmux. Like for example just clicking on a URL in a tmux pane won't work (for me), nor have I figured out how to copy them so I can paste them into Firefox. And whenever I go read about it or ask it's like, 14 steps to glory and my mind is mush on step 4.

No, I don't think I have a brain injury.

Re: Tmux and Vim – better together

#84
post #30

All this looks really great, however I think I just can't deal with the effort of maintaining these complex editor configurations anymore. I've been a multi-decade Vim user, until I switched to VSCode last year. It made me realize how much better the user experience can be for an editor. I had all kinds of complex vim configurations and plugins with special cases for linux vs. mac, server vs. desktop, GUI vs. termina…

Have you considered splitting up your vim config into multiple files, particularly for the conditional stuff? It doesn't cut down on the size of configurations as a whole but it does make it a bit easier to approach.

I was in a similar situation. I had a lot of junk in my config files from when I started learning vim seriously, a lot of which I never really used. I've recently started to rebuild them to try and simplify things, cut out the unused but "neat" stuff I added over time, etc. Kind of the nuclear option, and largely a result of a failure to adequately comment my dotfiles.

That's the tradeoff with editors like emacs and vim, unfortunately. Pretty much everything can be customized or tweaked, but it's mostly on you to explicitly do so. Spacemacs/SpaceVim/SpaceNeovim are some impressive default experiences, but they achieve that through large, complex config files that make it difficult for beginners to parse. I was recently talking to a friend who was thinking of switching to vim, and to be honest, I was a bit unsure about recommending one of those configurations when asked for a good default. They have some fairly well-defined conventions of their own, and while that allows some pretty neat stuff, it struck me as limiting for the beginner. With a configuration that's so tightly written (not sure if that's the best way to put it), I kind of felt like I was setting them up to use vim, but not be vim users. They might make tweaks in the future, but they might never dig deeper to really customize it. Or worse yet, even realize they can beyond a sort of intellectual acknowledgement of the possibility.

At that point, they might as well be using Atom, ST, or another GUI editor.

Re: Tmux and Vim – better together

#85
Nice article, I used tmux for a long time until I switched back to screen as it is default on most operating systems.

--

Dunno is it only me but I see a weird thing going on with "new" Vim community.

Everyone is starting to use it as a VSCode or Atom, trying to use hundreds plugins but most of them don't even know how to use tabs properly... I see most of this by new "neo" fans "you don't know how to make a thing in Vim? Download Neovim... or even Spacevim configuration." type of way. :)

Don't want to start a war here because every editor has it's own fans and I do not want to offend anybody either. But every one should learn to use vanilla version of their editor of choice before moving further.

Re: Tmux and Vim – better together

#86
post #75
post #45

Earlier quoted context omitted.

What are you guys doing with your configurations? I've been using vim since 2009 and tmux for the last 5 years. Initially, I had to figure out how things worked, and that took some time, but I never spent any time configuring it now except if I find a new plugin and figure out a new feature I'd like to add.

Nothing works out of the box, especially if you are trying to make two plugins work nicely with each other. If you want IDE like features i.e Autocomplete than you have to spend days to make it work and even after that it doesn't work like other "GUI" editors. + Terminal interface is very limiting to have nice plugins... I'm really glad I've switched to VSCode..

> Nothing works out of the box, especially if you are trying to make two plugins work nicely with each other.

Indeed, but it doesn't really matter since the default experience in VSCode or IntelliJ or Xcode or any other IDE or editor doesn't work for me out of the box either. I have to change things anyways, and I can't change VSCode or IntelliJ or Xcode to fit my liking, but I've been able to change tmux+vim to it, although it could be even better.

> If you want IDE like features i.e Autocomplete than you have to spend days to make it work and even after that it doesn't work like other "GUI" editors.

For stuff like Go, Rust, Elixir, Python and so on, it works fine with when just installing the default "brand" plugin. Taking python as an example: even though "intellisense" in vim is worse than in pycharm, the rest of pycharm is so much worse than tmux+vim. "Intellisense" not being 100% in tmux+vim is not a dealbreaker for me at all. I can get by without "intellisense". But pycharm is so much worse for everything else than "intellisense", from basic editing to opening files to running shell commands and everything else I use all the time, which is a deal-breaker for me. For something like iOS+Mac development where I feel like I can't work without proper "intellisense", I do use Xcode.

> + Terminal interface is very limiting to have nice plugins...

Indeed, but still, even though tmux+vim sucks on some points because it's text-based, it doesn't suck enough to not be usable, and all these other editors and IDEs like IntelliJ, xcode, netbeans, sublimetext, vscode, atom and so on complete sucks for all the important things I need, which is a deal-breaker.

Re: Tmux and Vim – better together

#88
post #43

Earlier quoted context omitted.

Weird. I built my .rc files like 10 years ago, and only edit them about twice a year to add a plugin or modify a keybinding. Not a pain to maintain at all.

How do you store them? Just backup into a dotfiles repo or what? I've been looking into dotfiles + gnu stow.

I store them in a dotfiles repo that gets pushed to Github occasionally. They get symlinked to my home directory, and I use thoughtbot's rcm[0] tool for managing that. Then I just use a small script that I keep updated to handle installation and setup on a fresh computer. I'll need to take a look at gnu stow now. It seems like it'd be a slightly simpler alternative, and would keep my dotfiles folder a bit better organized.

0. https://github.com/thoughtbot/rcm

Re: Tmux and Vim – better together

#89
post #85

Nice article, I used tmux for a long time until I switched back to screen as it is default on most operating systems. -- Dunno is it only me but I see a weird thing going on with "new" Vim community. Everyone is starting to use it as a VSCode or Atom, trying to use hundreds plugins but most of them don't even know how to use tabs properly... I see most of this by new "neo" fans "you don't know how to make a thing in…

Neovim is not what you think it is. It is a vanilla vim, it's just a fork of the codebase/community. It's not a package/distribution like Spacevim is.

Re: Tmux and Vim – better together

#90
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?

The outmost program must do the copy&paste. So if the outmost program is tmux, then use tmux copy&paste.

https://awhan.wordpress.com/2010/06/20/copy-paste-in-tmux/

I'm just learning all of this, but since it's a suggestion from some smart people I bet, just like in vim, that you can do a lot more once you've overcome the first pain of using it correctly.

Post reply on HN