Live data from Hacker News

Vim After 11 Years

statico.github.com

81–90 of 254 posts

Re: Vim After 11 Years

#81
post #80

My single greatest tip to make vim even more amazing is to run it in a tmux session: It makes it super easy to split panes and create new windows for related things you need to do (git stuff, compilation, running tests, running a REPL, etc.)

You can easily split panes (called windows in vim) within vim. You can also create new tabs within vim for related things you need to do.

I still use tmux or screen to do other things which aren't convenient or elegant to do within vim, but splitting windows and creating tabs can be done just fine within vim itself (or, in my case, within gvim, which I prefer due to the increased color gamut and keybinding abilities over terminal vim).

Re: Vim After 11 Years

#82
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).

While that's true, clipboard interaction through tmux is awful.

Re: Vim After 11 Years

#83
post #81
post #80

My single greatest tip to make vim even more amazing is to run it in a tmux session: It makes it super easy to split panes and create new windows for related things you need to do (git stuff, compilation, running tests, running a REPL, etc.)

You can easily split panes (called windows in vim) within vim. You can also create new tabs within vim for related things you need to do. I still use tmux or screen to do other things which aren't convenient or elegant to do within vim, but splitting windows and creating tabs can be done just fine within vim itself (or, in my case, within gvim, which I prefer due to the increased color gamut and keybinding abilities…

When I said split panes in tmux, I meant to put shells, repls, or servers. I also use split panes and tabs within vim for extra buffers.

Re: Vim After 11 Years

#84
post #81
post #80

My single greatest tip to make vim even more amazing is to run it in a tmux session: It makes it super easy to split panes and create new windows for related things you need to do (git stuff, compilation, running tests, running a REPL, etc.)

You can easily split panes (called windows in vim) within vim. You can also create new tabs within vim for related things you need to do. I still use tmux or screen to do other things which aren't convenient or elegant to do within vim, but splitting windows and creating tabs can be done just fine within vim itself (or, in my case, within gvim, which I prefer due to the increased color gamut and keybinding abilities…

His/her point is to use tmux for splitting the editor and terminal windows, because vim sucks at subshells.

Re: Vim After 11 Years

#85
post #64

Earlier quoted context omitted.

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

All of that can be done much more efficiently without the mouse: - scrolling with a mouse wheel :h scroll.txt - selecting/resizing a split window :h window-resize :h window-move-cursor - jumping to a specific place in the code /foo or the myriad of cool things in :h motion.txt - making a selection v{motion}

> All of that can be done much more efficiently without the mouse:

Surely we don't need to get into this sort of thing here.

If you don't know how to do it without the mouse, then it's more efficient to do it with the mouse. If you don't remember how to do it without the mouse, then it's more efficient to do it with the mouse. If you just like using the mouse better, then ….

Anyway, and perhaps more importantly, it doesn't hurt any of us if anyone else values ease of use (even if it's illusory or temporary!) over efficiency.

Re: Vim After 11 Years

#86
post #24

Every time I read an article like this, it's how a power user installs an array of plugins and customizations to really soup up Vim, which to me kind of misses the point. 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 enviro…

He said he tried using Eclipse, and his Vim setup was more productive. Apparently that means that Vim can not only beat Eclipse at being a sparse minimalistic editor, but also at being a whiz-bang IDE.

In short, according to the OP, if you want that level whiz-bang, you should switch from Eclipse (and presumably Coda or Sublime Text 2) to Vim.

Re: Vim After 11 Years

#87
post #24

Every time I read an article like this, it's how a power user installs an array of plugins and customizations to really soup up Vim, which to me kind of misses the point. 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 enviro…

"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: 11 Jul 91 03:17:31 GMT
  Newsgroups: alt.religion.emacs,alt.slack
  
  When I log into my Xenix system with my 110 baud teletype, both vi
  *and* Emacs are just too damn slow.  They print useless messages like,
  'C-h for help' and '"foo" File is read only'.  So I use the editor
  that doesn't waste my VALUABLE time.
  
  Ed, man!  !man ed
  
  ED(1)               UNIX Programmer's Manual                ED(1)
  
  NAME
       ed - text editor
  
  SYNOPSIS
       ed [ - ] [ -x ] [ name ]
  DESCRIPTION
       Ed is the standard text editor.
  ---
  
  Computer Scientists love ed, not just because it comes first
  alphabetically, but because it's the standard.  Everyone else loves ed
  because it's ED!
  
  "Ed is the standard text editor."
  
  And ed doesn't waste space on my Timex Sinclair.  Just look:
  
  -rwxr-xr-x  1 root          24 Oct 29  1929 /bin/ed
  -rwxr-xr-t  4 root     1310720 Jan  1  1970 /usr/ucb/vi
  -rwxr-xr-x  1 root  5.89824e37 Oct 22  1990 /usr/bin/emacs
  
  Of course, on the system *I* administrate, vi is symlinked to ed.
  Emacs has been replaced by a shell script which 1) Generates a syslog
  message at level LOG_EMERG; 2) reduces the user's disk quota by 100K;
  and 3) RUNS ED!!!!!!
  
  "Ed is the standard text editor."
  
  Let's look at a typical novice's session with the mighty ed:
  
  golem> ed
  
  ?
  help
  ?
  ?
  ?
  quit
  ?
  exit
  ?
  bye
  ?
  hello? 
  ?
  eat flaming death
  ?
  ^C
  ?
  ^C
  ?
  ^D
  ?
  
  ---
  Note the consistent user interface and error reportage.  Ed is
  generous enough to flag errors, yet prudent enough not to overwhelm
  the novice with verbosity.
  
  "Ed is the standard text editor."
  
  Ed, the greatest WYGIWYG editor of all.
  
  ED IS THE TRUE PATH TO NIRVANA!  ED HAS BEEN THE CHOICE OF EDUCATED
  AND IGNORANT ALIKE FOR CENTURIES!  ED WILL NOT CORRUPT YOUR PRECIOUS
  BODILY FLUIDS!!  ED IS THE STANDARD TEXT EDITOR!  ED MAKES THE SUN
  SHINE AND THE BIRDS SING AND THE GRASS GREEN!!
  
  When I use an editor, I don't want eight extra KILOBYTES of worthless
  help screens and cursor positioning code!  I just want an EDitor!!
  Not a "viitor".  Not a "emacsitor".  Those aren't even WORDS!!!! ED!
  ED! ED IS THE STANDARD!!!
  
  TEXT EDITOR.
  
  When IBM, in its ever-present omnipotence, needed to base their
  "edlin" on a UNIX standard, did they mimic vi?  No.  Emacs?  Surely
  you jest.  They chose the most karmic editor of all.  The standard.
  
  Ed is for those who can *remember* what they are working on.  If you
  are an idiot, you should use Emacs.  If you are an Emacs, you should
  not be vi.  If you use ED, you are on THE PATH TO REDEMPTION.  THE
  SO-CALLED "VISUAL" EDITORS HAVE BEEN PLACED HERE BY ED TO TEMPT THE
  FAITHLESS.  DO NOT GIVE IN!!!  THE MIGHTY ED HAS SPOKEN!!!
  
  ?

Re: Vim After 11 Years

#88
Some small vim tweaks I've recently been using myself that I find very nice:

nmap :write

cabbrev w nope

Re-map enter to save the file. If you try to do a :w it will yell at you until you take out the cabbrev so you can retrain your muscle memory. Took me about a day to retrain.

let g:EasyMotion_leader_key = ';'

nmap s ;w

nmap S ;b

Remap s and S to be easymotion forward and backward. I never use s, since it's largely a redundant command, and didn't like having to do a two key command for easymotion. (You can set the leader key to whatever here, the nmap's are the important part.)

noremap h

noremap l

noremap j

noremap k

Move between panes with motion keys with control held down.

Also the YouCompleteMe plugin got some HN airtime but it really needs to get more. It's amazing.

http://valloric.github.com/YouCompleteMe/

And as others have mentioned using vim inside of tmux is very nice. It's especially helpful to remap the entire tmux keymap to be vim-like.

Also, does anyone have any suggestions for what to re-map Space to? I am amazed Enter and Space in command mode both do relatively useless things. Remapping space to page down is OK but I use ctrl-f/b which is just as fast imho.

Re: Vim After 11 Years

#89
post #87
post #24

Every time I read an article like this, it's how a power user installs an array of plugins and customizations to really soup up Vim, which to me kind of misses the point. 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 enviro…

"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.

Re: Vim After 11 Years

#90
post #39

The author mentioned CtrlP for fuzzy filename matching. Its great because it's in pure Vimscript, but in my experience it becomes unusably slow for moderately sized projects. A month or two ago, I switched back to CommandT (requires Vim to be compiled with Ruby support, engine written in C) and haven't thought twice about it since then.

I use CommandT primarily on my main machine but I also have CtrlP installed and they are both mapped to the same key (f) in a conditional. If I'm on a machine that has Vim compiled with Ruby, I get CommandT, otherwise CtrlP. Best of both worlds.
Post reply on HN