News for hackers. Stuff that matters.
Re:Intermediate Vim tips by baby_wipe on Thursday December 21, 2017 @08:08PM (#15984466)
I’m probably the minority here but I don’t like to customize my Vim too much. 1 - it takes time. 2 - half the reason I like Vim is because I can use it anywhere. If I’m so used to a highly customized setup, then I am going to feel out of place when I log on somewhere else.
Re:Intermediate Vim tips by jitl on Thursday December 21, 2017 @08:42PM (#15984629)
It depends what you use Vim for. If Vim is your only code editor, it’s crazy that you’d leave tons of productivity enhancements on the table because you want that standardized, bottom-of-the-barrel experience. Nice things are nice!

I have tons of customizations in my Vim, and have very little trouble using vi or vanilla Vim when I log into production machines. It is frustrating to not have my magic this and that, but no less frustrating than it would be going from IntelliJ on my own box to Vim on someone else’s.

Re:Intermediate Vim tips by nemild on Friday December 22, 2017 @12:59AM (#15985555)
I wish I could upvote your comment many times. I wish the parent comment pointed out what use case they have for Vim, as this really dictates the "right" approach.

I wrote about this previously in the context of Vim vs Emacs, though it's similar to customized vimrc/plugins vs vanilla vimrc:

"One can reduce part of the [editor] debate down to a single question: how fully featured do you want your text editor out of the box? If you’re a DevOps engineer who spins up new environments constantly you’ll have different ideas about the best choice compared to a full stack engineer working in a single development environment that can be painstakingly setup. For the DevOps engineer, a light text editor that is installed by default is likely ideal, while for a developer with a single computer, a full-featured IDE (auto-completion, plug-ins, custom keys) is worth the high setup cost."

https://www.nemil.com/musings/betterdebates.html

Re:Intermediate Vim tips by dozzie on Friday December 22, 2017 @08:12AM (#15987162)
> it’s crazy that you’d leave tons of productivity enhancements on the table because you want that standardized, bottom-of-the-barrel experience

Like what exactly and compared to what environment?

Re:Intermediate Vim tips by crehn on Thursday December 21, 2017 @08:18PM (#15984524)
Same. I spend most of my time in a terminal and SSH into various boxes daily. I do customize my standard Unix toolset, but avoid plugins and non-standard configs that increase cognitive burden. It's very liberating to feel comfortable with shitty defaults. If you feel at home with the defaults, you feel at home anywhere.
Re:Intermediate Vim tips by oftenwrong on Thursday December 21, 2017 @11:05PM (#15985193)
You can remotely edit on any system accessible over ssh thanks to netrw:

    vim scp://some-remote-box/some/path
You can jump to a directory listing by including a trailing /

   :help netrw
Re:Intermediate Vim tips by dozzie on Friday December 22, 2017 @08:15AM (#15987171)
> You can remotely edit on any system accessible over ssh thanks to netrw:

Yeah, and either lose all the goods of path completion or gain atrocious lag on each tab. Because of that, I rarely use netrw.

Re:Intermediate Vim tips by icen on Friday December 22, 2017 @06:23AM (#15986712)
Emacs has Tramp, and you can do the same thing!
Re:Intermediate Vim tips by yjftsjthsd-h on Friday December 22, 2017 @07:30AM (#15986967)
Is there a way to combine this with sudo, to edit root's files remotely? Apparently tramp is supposed to support this, but I prefer vim.
Re:Intermediate Vim tips by lunchables on Thursday December 21, 2017 @11:03PM (#15985187)
Most people store their dot files (including their vim config) in a git repo and just check out a copy on any machine they use. That's what I do (git+stow). I can be up and running on a new system in just a few seconds.
Re:Intermediate Vim tips by vinceguidry on Friday December 22, 2017 @12:16AM (#15985415)
Does anybody know a saner way of doing this cross-platform? I've resorted to doing platform checks in my .bashrc and don't get me started on the OSX / Linux differences in .platform, .bash_platform, and .bashrc sourcing.

And when I tried termux on Android, oh dear lord. The whole thing breaks because of permissions issues. Had that issue on WSL too.

Re:Intermediate Vim tips by web007 on Friday December 22, 2017 @01:14AM (#15985611)
https://github.com/007/dotfiles

Lowest-common-denominator for linux and mac, mostly just "make it work if you notice it's broken". I have one file that's bash magic, and link it to everywhere it might be needed - bashrc, bash profile, etc. It's kind of monolithic, not great but at least 100% consistent for what ends up where, and avoids sourcing external stuff or requiring N different files to work. You'll see some of your pain in the repo history, change X to Y to make it osx or *nix compatible based on whichever is my primary platform.

Same goes for vim, just absolute basics for vimrc and a few very portable plugins and niceties hardwired. No package manager, just a bare directory.

Re:Intermediate Vim tips by ssivark on Friday December 22, 2017 @02:23PM (#15990146)
Across linux and OS X, I use a solution based on the this HN comment and it's follow-up discussion: https://news.ycombinator.com/item?id=11071754

Lot of other suggestions on the same HN thread: https://news.ycombinator.com/item?id=11070797

Re:Intermediate Vim tips by priomsrb on Friday December 22, 2017 @11:31AM (#15988649)
I use vimswitch (http://vimswitch.org) to copy my vim settings over to new machines.

(Disclaimer: I am the author of vimswitch)

Re:Intermediate Vim tips by yjftsjthsd-h on Friday December 22, 2017 @07:32AM (#15986976)
> I've resorted to doing platform checks in my .bashrc

This is what I do, too. Most of mine is portable, but I have a block in bashrc that branches on uname.

Re:Intermediate Vim tips by flukus on Thursday December 21, 2017 @08:55PM (#15984684)
I was a heavy customizer and used it with all sorts of plugins, but maintaining it across computers with little incompatibilities between OS's and version just got to be too much. I finally came around to the tmux side and now use vim as the editor and unix as the IDE. Going to give kakoune another shot in the new year as well.
Re:Intermediate Vim tips by joeskyyy on Thursday December 21, 2017 @08:35PM (#15984602)
Right there with you. While the power of vim is to be able to customize it, I hate getting used to something and then not being able to use it everywhere. I've managed to get by with no extra .vimrc things whatsoever for quite some time :D Does it take me longer to do some things compared to using what's in this article? Yup. Does it prevent me from doing good, and still relatively quick, work? Nope.

When I want the power of formatting and and all the goods, I use visual editors with no shame or remorse (VS Code is my current poison of choice).

Re:Intermediate Vim tips by arca_vorago on Friday December 22, 2017 @12:37AM (#15985485)
Just chiming in real fast that you can use ssh to edit files on remote systems even if they don't have emacs themselves via /user@host:~/filename.txt

So I also can use emacs almost anywhere. (I still advocate users and admins at least be functional in vi/vim regardless). Also don't forget GNU Nano isn't out of the game either as a small almost everywhere easy to use editor.

Re:Intermediate Vim tips by colordrops on Friday December 22, 2017 @01:17AM (#15985617)
I used to have this mindset, but now that I've got all my dot files on github I can get a machine set up pretty quickly. And for those times where I'm SSHing into a machine for whatever reason, using plain old vi hasn't been a problem. I typically do avoid overriding any of the main key bindings though so that I don't get confused when I do have to use plain vanilla vi.
Re:Intermediate Vim tips by perfmode on Thursday December 21, 2017 @11:37PM (#15985313)
Leverage your tools. Don’t let them leverage you.

Reduce the friction of importing your vim config non-destructively and on demand.

Re:Intermediate Vim tips by drbojingle on Thursday December 21, 2017 @09:37PM (#15984839)
My vim is pretty customized but I can't say I have any trouble personally with vims that aren't mine.
Re:Intermediate Vim tips by hi-im-mi-ih on Thursday December 21, 2017 @10:38PM (#15985092)
I agree with this, I use plain GVim on all my machines. I'm not interested in plugins that will slow it down - it's fine the way it is.