Live data from Hacker News

Vim After 11 Years

statico.github.com

181–190 of 254 posts

Re: Vim After 11 Years

#181

One of Vim’s strengths is that it starts lightning fast, so starting Vim from the terminal is trivial. With a modern, 256-color terminal like iTerm2 or Gnome Terminal, it will even look like gVim. But the best part is that you can drop into the command line at any time with Ctrl-Z, which suspends Vim, and your working directory is where you left off. Is there any reason to do this instead of !sh within Vim to drop in…

[deleted]

Re: Vim After 11 Years

#182
post #42

I'm not sure why the author advocates job control (ie ctrl-z/fg/bg) instead of using tmux/screen. A multiplexer offers far more flexibility, and most importantly does not lose state even if your session ends (eg ssh connection drops).

[deleted]

Re: Vim After 11 Years

#183
post #21

Earlier quoted context omitted.

IIRC, !sh starts a new shell- so it depends on your context I suppose.

I think this is the explanation, I usually only find myself wanting to temporarily "stop" Vim and do something on the shell for quick one-off commands that are fine in a subshell - not to keep a backgrounded Vim instance around for longer than that. The blog author seems to have a different use in mind.

[deleted]

Re: Vim After 11 Years

#184
post #42

I'm not sure why the author advocates job control (ie ctrl-z/fg/bg) instead of using tmux/screen. A multiplexer offers far more flexibility, and most importantly does not lose state even if your session ends (eg ssh connection drops).

I didn't mean for them to come across as mutually exclusive. The ^Z/fg approach is great for keeping context: Go to a directory, run something, edit something, suspend editing to run something else, resume editing, finish back at the command prompt.

With tmux I'd need to create a new pane, navigate to the same directory, and reinitialize any environment stuff like virtualenv.

Use both! :)

Re: Vim After 11 Years

#185

One of Vim’s strengths is that it starts lightning fast, so starting Vim from the terminal is trivial. With a modern, 256-color terminal like iTerm2 or Gnome Terminal, it will even look like gVim. But the best part is that you can drop into the command line at any time with Ctrl-Z, which suspends Vim, and your working directory is where you left off. Is there any reason to do this instead of !sh within Vim to drop in…

:!sh will work, but it puts you in an entirely new context (environment and CWD). :sh is just plain awful and doesn't emulate anything correctly.

I recommended ^Z/fg/bg because it's the fastest, easiest way to get to a good, functional shell if you're not using a multiplexer (tmux/iTerm2). If you map ^Z in your shell to "fg\n" then switching is lightning fast.

Re: Vim After 11 Years

#186
post #21

Earlier quoted context omitted.

IIRC, !sh starts a new shell- so it depends on your context I suppose.

I think this is the explanation, I usually only find myself wanting to temporarily "stop" Vim and do something on the shell for quick one-off commands that are fine in a subshell - not to keep a backgrounded Vim instance around for longer than that. The blog author seems to have a different use in mind.

That's pretty much it. See above comments regarding context.

Re: Vim After 11 Years

#187
Does any vim plugin support context sensitive auto-complete like Visual Studio (auto-complete only with variables that are alive in the current block of code)? I code in perl and am currently using ctags for autocomplete, but it doesnt autocomplete based on the context.

Re: Vim After 11 Years

#188
post #64

Earlier quoted context omitted.

Why for?

Here are few things how I use it: - scrolling with a mouse wheel - selecting/resizing a split window - jumping to a specific place in the code - making a selection

I think the key is having the option to use the mouse, in addition to normal Vim keyboard shortcuts. If I'm switching back and forth between Vim and a browser, for instance, I have my right hand on the mouse already, and I can scroll with the wheel, select a tmux pane, copy and paste things, etc. very easily. If I didn't have that option, I'd have to switch back to the keyboard. If I have both hands on the keyboard already, I'm probably not going to use the mouse.

Re: Vim After 11 Years

#189
post #103

My new favorite toy: http://gh.codehum.com/nosami/Omnisharp/ It's 'real' intellisense for Vim/C#. It's fairly new and rough around the edges, but works great once you get it going.

Thanks for this!

Re: Vim After 11 Years

#190
post #89
post #87

Earlier quoted context omitted.

"If you want that level whiz-bang, use Coda or Sublime Text 2 or Eclipse or whatever. I don't recall where I saw this, but someone advised disabling syntax coloring in your editor to remove a crutch (and, secondarily, to visually simplify your environment)." Perhaps you might enjoy using ed... From: patl@athena.mit.edu (Patrick J. LoPresti) Sender: news@athena.mit.edu (News system) Subject: The True Path (long) Date:…

That's awesome.

... and it's from the Emacs distribution ($EMACS_SRC/etc/JOKES)... :]
Post reply on HN