News for hackers. Stuff that matters.
Re:Tmux and Vim – better together by juandazapata on Thursday April 20, 2017 @09:18AM (#14156336)
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.
Re:Tmux and Vim – better together by Touche on Thursday April 20, 2017 @10:37AM (#14156999)
Why is it weird? You created yours 10 years ago, great. For those of us who didn't it is a bit of a hassle.
Re:Tmux and Vim – better together by dmix on Thursday April 20, 2017 @11:00AM (#14157242)
Pretty much everyone knows the price of admission to using tools like Vim and Emacs is the time investment in config and learning the quirks.

What the OP is saying that this doesn't have to be a perpetual state. Once you invest effort early on getting it right you often don't need to touch it, beyond a few tweaks now and then. The maintenance burden definitely declines over time.

Then all you need is a storage solution like git and GNU Stow or the various clones (plenty of good ones around or just use a basic dir).

There are a few preconfigured configs on github, ala oh my ZSH but for Vim or Emacs. That's one solution.

But otherwise if you're not a fan of this config heavy approach then it's not for you. Just like using Linux desktop vs Mac. I love the configurability of Archlinux and I've similarily reached a mature point in my configs where setting up a new machine is zero work and I rarely need to tweak it, nor does it ever 'break' (which is a side effect of constant change).

Re:Tmux and Vim – better together by noam87 on Thursday April 20, 2017 @12:24PM (#14158133)
Honestly, I learned to code with vim, and it never struck me as particularly complicated. The commands follow a pretty consistent logic... the defaults aren't great but it took me one google search to find out what a vimrc file is.

emacs on the other hand, even as an experienced programmer, I found near unusable in its default and after a week of frustration with all the inconsistencies and oddities gave up on it. Which is a shame because obviously it is the more powerful of the two. I wish someone would create a modern editor in the spirit of emacs.

Re:Tmux and Vim – better together by thinbeige on Thursday April 20, 2017 @01:33PM (#14158885)
Agree on Emacs. Tried to get into Emacs few times because I am not the biggest fan of VimScript (I use it quite often though). So, I thought that it's worth learning Emacs with a proper Lisp underneath. But I failed everytime and getting back to Vim felt just natural and as easy as turning on my PS4.

One thing with emacs is that some Alt bindings do not work over remote connections. Maybe it was my fault but I could not get all Alt bindings to work.

Re:Tmux and Vim – better together by saghm on Thursday April 20, 2017 @11:25PM (#14162886)
> One thing with emacs is that some Alt bindings do not work over remote connections. Maybe it was my fault but I could not get all Alt bindings to work.

Were you connecting from a Mac to Linux? Emacs on OS X has Esc as meta by default, which means you need to redefine the meta key to be Alt or else it's basically unusable.

Re:Tmux and Vim – better together by dp88sdf8 on Thursday April 20, 2017 @01:20PM (#14158725)
I get the feeling Emacs is where things like Atom and VS Code are looking for a lot of inspiration.

Unfortunately, they used bloated Electron framework.

Little over a year ago I began sketching out a native Mac OS editor, taking ideas from xiki, ia writer, emacs.

The core API was mostly fleshed out. I just got wrapped up in personal life stuff. Might have to take another look at that soon.

Re:Tmux and Vim – better together by saghm on Thursday April 20, 2017 @11:27PM (#14162889)
I think part of the reason Atom and VS Code use Electron is for cross-platform support. Assuming Github and Microsoft were going for market share, making a native Mac OS editor would somewhat limit their reach.
Re:Tmux and Vim – better together by wtbob on Thursday April 20, 2017 @10:21PM (#14162646)
You're right that emacs without any config is annoying. Check out Prelude (https://github.com/bbatsov/prelude); it's a really nice set of defaults for emacs.

I think emacs is the modern editor in its own spirit: none of the imitations come close.

Re:Tmux and Vim – better together by phaedrix on Thursday April 20, 2017 @02:04PM (#14159189)
Recommend you checkout http://spacemacs.org/ It's an emacs with sane defaults and built around Evil (emacs vim plugin)
Re:Tmux and Vim – better together by Retra on Thursday April 20, 2017 @06:07PM (#14161343)
As a counterpoint, you shouldn't have to tell anybody about storage solutions and preconfigured configs. Once you start doing that, you're talking about solving problems that don't exist in other editors.
Re:Tmux and Vim – better together by saghm on Thursday April 20, 2017 @11:31PM (#14162906)
Given that there are quite a few editors where people tend not to like the defaults (Vim, Emacs, VS Code, and Atom come to mind, at least for me), it sounds like what you're saying is "editors that beyond the specific set that have these problems don't have these problems", which doesn't seem terrible informative.
Re:Tmux and Vim – better together by ruleabidinguser on Thursday April 20, 2017 @12:45PM (#14158327)
No matter how much you tweak it, you will never even start to scratch an experience like Visual Studio. Vim is a fundamentally weaker platform.
Re:Tmux and Vim – better together by Tenhundfeld on Thursday April 20, 2017 @03:36PM (#14160047)
Meh. I've used both and disagree. Visual Studio is a better IDE. Vim is a better text editor.
Re:Tmux and Vim – better together by yamaneko on Thursday April 20, 2017 @07:30PM (#14161822)
Has anyone tried VsVim [1]? It is the best vim experience I've had in any other editor. And I've already tried Sublime's, VSCode's, and others. Most of the vim functions I use are there, but it's been a while since the last time I used VisualStudio, so I don't recall the ones with problem. You can even plug in relative line numbers [2].

[1]: https://marketplace.visualstudio.com/items?itemName=JaredPar...

[2]: https://marketplace.visualstudio.com/items?itemName=ZoltanKl...

Re:Tmux and Vim – better together by flukus on Thursday April 20, 2017 @08:24PM (#14162093)
The biggest issue is you're still tied to the real crappy windowing of VS, not the much better ones of vim or tmux.

VsVim is getting really good though, it even reads your vimrc these days.

Re:Tmux and Vim – better together by michaelmrose on Thursday April 20, 2017 @03:56PM (#14160252)
Either many many thousands of professionals are blind to the awesome power that is windows plus visual studio or maybe people value different things and having made an informed analysis decided to use other things.
Re:Tmux and Vim – better together by doktrin on Thursday April 20, 2017 @11:50AM (#14157758)
> Pretty much everyone knows the price of admission to using tools like Vim and Emacs is the time investment in config and learning the quirks.

To me, the real hurdle to vim (or emacs) isn't configuration : it's learning vim (or emacs). That muscle memory doesn't come from a .vimrc file, and it doesn't come overnight. Is that what you meant by "quirks"?

Re:Tmux and Vim – better together by pera on Thursday April 20, 2017 @12:48PM (#14158360)
Muscle memory only comes after using your editor of choice for a considerable amount of time. With Vim, as a mnemonic, internally talking with the editor is the best way to go: for instance, if you need to change the content of a string literal like "hello world" just think Change Inside ". To me learning Vim is essentially learning a live programming language.
Re:Tmux and Vim – better together by cholantesh on Thursday April 20, 2017 @12:22PM (#14158115)
This can be said about anything, though. You still have to develop muscle memory for shortcuts and menu paths in other applications.
Re:Tmux and Vim – better together by doktrin on Thursday April 20, 2017 @01:42PM (#14158963)
It can be said about anything, but it obviously applies more to CLI based editors since literally everything requires specialized muscle memory. Take a super simple example : Unless I've literally never used a computer before, I don't need new muscle memory to copy or cut out a block of text with VS Code, or Sublime, or Atom.
Re:Tmux and Vim – better together by Barrin92 on Thursday April 20, 2017 @11:57AM (#14157838)
It's the same story with the muscle memory though. Build it up once, then the effort of learning new things is not very large.

I don't think anybody doubts that there's a steep learning curve and some investment required to get set up, but you get a completely custom user experience out of it. And if you stick with it for years you're definitely getting your investment back.

Re:Tmux and Vim – better together by juandazapata on Thursday April 20, 2017 @11:27AM (#14157518)
My point is that after the initial investment in the setup, it takes almost no time to maintain them. In my particular case, I invested about 2 weeks tweaking settings here and there until I felt comfortable with it. After that initial setup, it just gets out of your way.
Re:Tmux and Vim – better together by bangvoidzero on Thursday April 20, 2017 @11:56PM (#14162998)
Personally, my biggest issue is getting vim to work the same way on multiple platforms. I have a mac at work and alternate between windows and linux at home. Each of those has been slightly different than the others. To some extent, yes, once you have the config set you can just leave it alone and be fine. But for me, switching to a full IDE has made life easier.
Re:Tmux and Vim – better together by Touche on Thursday April 20, 2017 @11:41AM (#14157649)
I disagree. Plugins breaking or interfering with other plugins is a regular thing.
Re:Tmux and Vim – better together by joshuamorton on Thursday April 20, 2017 @11:54AM (#14157796)
I'm really intrigued by what all you're doing that you have this kind of problem. I maintain a pretty complex vimrc, and deploying it is normally just a git clone. I've never had any of these issues, and when I started at google (which provides a nice collection of internal vim configs and plugins), combining the two and getting everything set up took me O(hours), not O(days). What are you doing?
Re:Tmux and Vim – better together by fakeslimshady on Thursday April 20, 2017 @01:01PM (#14158510)
I simply updated mvim and :E stopped working on OSX. I could work around with NERDtree, but its one of those things turned into a timesink when I didn't need it.
Re:Tmux and Vim – better together by joshuamorton on Thursday April 20, 2017 @01:37PM (#14158914)
Wait, that doesn't sound like a problem with your vim config, it just sounds like you had a broken version of macvim.
Re:Tmux and Vim – better together by michaelmrose on Thursday April 20, 2017 @03:45PM (#14160156)
Have you considered that your usage is at fault as opposed to vim? Out of 127 plugins installed and even more tried I cannot recall ever having an issue other than having bound a key that the new plugin would have bound.
Re:Tmux and Vim – better together by Touche on Monday April 24, 2017 @11:44AM (#14185207)
I know, I'm "holding it wrong". I don't care who's "fault" it is, I just don't have the energy to try and figure it out.
Re:Tmux and Vim – better together by juandazapata on Thursday April 20, 2017 @11:58AM (#14157847)
I guess I must be doing something terribly wrong, because I can't relate to that at all.
Re:Tmux and Vim – better together by aerique on Thursday April 20, 2017 @12:53PM (#14158401)
Perhaps some kind of package manager that auto-updates plugins?

My packages are static and I only update when there's a good reason to do so.

Re:Tmux and Vim – better together by tcoff91 on Thursday April 20, 2017 @02:34PM (#14159469)
Huh? my plugins never interfere with each other.
Re:Tmux and Vim – better together by dp88sdf8 on Thursday April 20, 2017 @01:14PM (#14158654)
I feel like the amount of hassle in terms of time spent is probably more imagined than real.

I tried VS Code for a couple months last year. It felt like less of a hassle than vim from 10 years ago. But with pathogen, cloning into .vim/bundle doesn't feel any more burdensome than finding the best plugins on VS Code did.

I mean, to each their own.

Re:Tmux and Vim – better together by rublev on Thursday April 20, 2017 @09:27AM (#14156389)
How do you store them? Just backup into a dotfiles repo or what? I've been looking into dotfiles + gnu stow.
Re:Tmux and Vim – better together by juandazapata on Thursday April 20, 2017 @09:34AM (#14156449)
I use a Github repo + gnu stow. I wrote a little post about it (http://juanda.me/managing-your-dotfiles-with-gnu-stow). Notice that I've made my dotfiles repo private since then so you can't check it out, but the post still draws the general idea.
Re:Tmux and Vim – better together by dylanz on Thursday April 20, 2017 @09:43AM (#14156517)
+1 for this method! Good post. I originally learned about this through: http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to...
Re:Tmux and Vim – better together by xutopia on Thursday April 20, 2017 @10:26AM (#14156892)
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 by wyclif on Thursday April 20, 2017 @12:36PM (#14158235)
That's the post that inspired me to start cloning my config files from GitHub.
Re:Tmux and Vim – better together by mcintyre1994 on Thursday April 20, 2017 @07:22PM (#14161776)
I was searching for this earlier, I came across a HN post which someone from Atlassian write up really nicely: https://developer.atlassian.com/blog/2016/02/best-way-to-sto...

No extra tools (just git), no symlinks.

Re:Tmux and Vim – better together by nitemice on Thursday April 20, 2017 @11:25PM (#14162881)
I have different needs in my dotfiles for different contexts, so I've created a system where each file is represented by a folder, which contains separate file snippets for each context.

So in my vimrc folder, I've got a work file, a school file, a home file, and a base file (which applies everywhere). Then I have a bash script that stitches all the relevant chunks together into a cohesive file for a given location. It can even do sub-locations by adding underscores to the name. E.g. 'work_nas' will produce a file consisting of the base, work and work_nas files, concatenated together.

This all sits in a private git repo, and I just manually copy the output files to wherever they belong whenever there's an update to them. I've been thinking for a while about writing a script to copy them into place, but GNU stow looks pretty interesting.

Re:Tmux and Vim – better together by bphogan on Thursday April 20, 2017 @10:02AM (#14156678)
I use a Github repo, but I actually store it on Dropbox. I then symlink everything into place on a new computer.

Any change I make to a dotfile then shows up on any other machines.

http://github.com/napcs/dotfiles/

Re:Tmux and Vim – better together by cicloid on Thursday April 20, 2017 @12:53PM (#14158406)
Stow is probably the simplest way to do it. The only weird thing is the directory structure I have with `.` prefixes in order to be linked as I want them inside my home.

Besides that, I don't see how a better way to do it.

Re:Tmux and Vim – better together by Bluestrike2 on Thursday April 20, 2017 @10:35AM (#14156980)
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 by ansible on Thursday April 20, 2017 @11:09AM (#14157344)
I use vcsh:

https://github.com/RichiH/vcsh

I have separate repos for SSH, Bash, VIM, and other stuff (like .inputrc).

Re:Tmux and Vim – better together by falcolas on Thursday April 20, 2017 @09:32AM (#14156432)
I do exactly this myself, and it works remarkably well. I had a few conflicts I had to work around between different packages, but the updated vim package directory structure has mostly solved that problem.

EDIT: The biggest problem, for me, is that since they are all dotfiles, they are invisible to normal ls operations within the stow directory. It's a minor nit, but it can be quite annoying to run up against.

Re:Tmux and Vim – better together by rublev on Thursday April 20, 2017 @10:02AM (#14156675)
I've aliased ls to `alias ls='ls -GFhal'` to get around hidden dotfiles.
Re:Tmux and Vim – better together by aerique on Thursday April 20, 2017 @11:41AM (#14157660)
I store my configs in a git repo on Seafile/Syncwerk (Dropbox alternative). This gives me a seamless experience on Unix, OSX and Windows where I just have to link to them from my home directory when on a new computer.

Yes, it took an initial investment but now it just works everywhere and maintenance is low.

(Some people say git repos in clouds sync are bad, but I have had zero problems with them over the years.)

Re:Tmux and Vim – better together by joshuamorton on Thursday April 20, 2017 @11:55AM (#14157812)
Its just bad because the .git folder means that any time you delete an old git repo or anything, you get a fevered email from dropbox reminding you that you just deleted 10000 files.