Live data from Hacker News

Vim Creep

rudism.com

181–190 of 237 posts

Re: Vim Creep

#181

Earlier quoted context omitted.

Some of my coworkers use sublime, and have been very excited about it. I used vim for several years and use emacs now, so probably a hard sell. Still, I get curious when people are Really Excited about other editors (because there may be ideas worth stealing and adding to emacs ;) ). What's the "minimap", the scrollbar that is a shrunken version of the document? The "multiple carets" feature seems handy. Are there an…

Yes, the minimap is what you guessed it was. Other ST features that Vim/Emacs don’t have (by default, at least): • You can use proportional fonts (I use Verdana) • The interface chrome is graphical, not text in a grid. This allows nice details such as a drop-shadow from the minimap when it covers the text and proportional fonts in the file tree’s filenames. • On a Mac with smooth scrolling, you can scroll smoothly pi…

> You can use proportional fonts (I use Verdana)

Vim uses what my terminal uses. No ideas if my terminal(terminator) allows proportional fonts, but I always have used monospaced. Proportional looks ugly to me when it comes to code.

> The interface chrome is graphical, not text in a grid. This allows nice details such as a drop-shadow from the minimap when it covers the text and proportional fonts in the file tree’s filenames.

Drop shadows? Umm, no thanks.

> On a Mac with smooth scrolling, you can scroll smoothly pixel-by-pixel, instead of choppily line-by-line.

Either I search for what I am looking for, jump to definition, or move screen by screen. I don't scroll - at all. If I did, I am reading lines of code, not rows of pixels.

> You can easily rename a variable,

I don't use ST and can't exactly understand what is unique here, but I am pretty sure renaming something is something vim is very good at. You want to limit the scope, select visually and run :s on it.

> It uses Python as its scripting language, so you can use Python libraries easily, and don’t have to learn an editor-specific language. Similarly, it uses JSON for settings.

Python is much more mainstream than vimscript, yes, but there are still people who don't know python and don't want to learn it. Learning python for them isn't very different from learning vimscript.

Re: Vim Creep

#182
post #96

This is an extremely awesome, fantastic, exhilarating use of hyperbole. What I gained from the article wasn't any explanation of why Vim is great; indeed, there was little included in this respect, aside from moving "entire blocks of code with the flick of a finger." Even the cool feeling of proficiency you get from knowing a tool well, and the fun of getting to show off a skill to a "how did he do that!?" audience w…

I recently discovered a way to learn Vim without fear: learn undo ('u') first! If you know that, you can just mess around with Vim commands until you inevitably screw something up, undo the changes, relax, take a deep breath, and Google whatever you're trying to do.

If you are familiar with vim, install gundo.vim and enjoy traversing your undo tree.

Re: Vim Creep

#183

Earlier quoted context omitted.

Also, years of evangelism will teach you that you cannot convince someone that Vim is better , let alone great . A lot of the propaganda out there starts by telling people "you're doing it wrong! Let me show you the better way!". Vim is one of these tools that isn't obviously better, so that you don't really understand its power until you try it (for a few months or so). I enjoyed this article exactly because the aut…

I love Vim, but I don't ever recommend it to anyone. I think it gives me an advantage. Whey would I want other people using it and thus lose that advantage?

Even if it was for purely selfish reasons, it can make great sense to recommend better things to improve others. The world is not zero sum.

Re: Vim Creep

#184
post #34

This feels like an article about a religion or cult, not a software program. I just don't get it. Ever since newer editors got block editing or multiple insertion cursors, and RegEx find & replace across multiple files, and searching filenames to open... I feel like I've already got everything I need! What am I missing out on? I don't feel like my text editor holds back my productivity. Using something like Sublime,…

You really have to sit down and see a vim user work to start to understand. In vim you don't just move around with arrows, then delete and then replace the text you want. What happens is you can use noun-verb associations to do things. For example on a line like this: var foo = "bar"; I could be at the beginning of the line and type the following keys to change the inside of the quotation marks: ci"baz In sublime I w…

First time users of vim would use the arrow keys too. Only after you gain some experience do you start thinking with motions.

The same holds true for Sublime Text. Instead of using the arrow keys, you could do any of the following:

  Ctrl+H : Replace
  bar : Find what
  baz : Replace with
  Ctrl+Shift+H : Replace first match
   : Exit replace mode
or

  Ctrl + I : Incremental Find (finds and selects finding)
  bar : Find & select text
  baz : Overwrite selection
or

  Ctrl++++ : Reach the word bar
  Ctrl+d : Select word under cursor
  baz : Overwrite selection
or

  Ctrl+P : GoTo Anything
  # : Goto word
  bar : Goto word 'bar' & select it
  baz : Overwrite selection
I agree that vim's vocabulary is very expressive and very powerfull. I switched to Sublime Text because tweaking vim to meet my needs was just too much effort, even for simple things. Couple this with even more effort to make it play nice with Greek (my native language), and the switch came naturally.

Re: Vim Creep

#185

Earlier quoted context omitted.

I don't understand vimmers, but I use Emacs and I can say that having your work environment be 100% programmable is pretty damned nice.

So what kind of stuff do you program inside of it? What kinds of problems do you solve? I mean, I've never really felt the need to program an add-on to text editor. I download syntax highlighting packages, and there are common macros like "remove trailing whitespace" already installed. Keyboard shortcuts can be changed in lots of editors and OS's. In the past, I've definitely been upset that a particular editor didn'…

> So what kind of stuff do you program inside of it? What kinds of problems do you solve?

It's not always about programming. It's about configuring and extending to suit it to your problem.

Pylinting and running python code. ,c(mapped to :make, not shown here) to pylint(not need as I run syntastic but still), ,x to run

    augroup python
        au!
        autocmd FileType python nnoremap ,x :w:!/usr/bin/env python % 
        autocmd FileType python setlocal nosmartindent
        autocmd FileType python setlocal makeprg=pylint\ --reports=n\ --output-format=parseable\ %:p
        autocmd FileType python setlocal errorformat=%f:%l:\ %m
        autocmd BufRead python setlocal efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
        autocmd FileType python setlocal path+=$PYTHONDIRS
      augroup end
ERB and Jinja2 shortcuts. \1 for , \2 for etc

    inoremap \1 %>2hi
    inoremap \2 %>2hi
    inoremap \3 {%%}2hi
    inoremap \4 {{}}2hi
A mini calculator function, lots of snippets, some saved macros etc.

It's not about changing keyboard shortcuts. It implies you can only remap what already exists. It's about giving you infinite canvas to paint on. This isn't unique to Vim. I am just saying having the capability to do so is important.

Re: Vim Creep

#186
post #89

Earlier quoted context omitted.

No, good point. You'd then have to type "baz". However, if I was actually faced with this problem, I'd use End, Ctrl + Left, Ctrl + D, baz, which is a total of 7 keystrokes. (if you don't release Ctrl) The vim example was 8 keystrokes. (" is shift + ') I have no doubt that you could manufacture an example that shows a benefit for vim, but I think that the advantages are overestimated by heavy vim users. Edit: Your lo…

A commonly overlooked aspect to the vim way of describing what you're doing in verbs and nouns and prepositions is that the "." character in vim means "repeat my previous edit". So if you can find a way to "phrase" your edit as a single change (i.e., 6sasdf would delete six characters starting under the cursor and leaving me in insert mode, then insert the letters asdf and exit insert mode) instead of many (i.e., xxx…

Sublime Text supports multiple cursors, which I find to be a more natural way to do things where you might use those tiny repetitions-- you select all the regions you want to edit first (usually by repeatedly adding the next match to the selection), then any typing or movements you do occur in parallel.

Re: Vim Creep

#187
"Knife skills" don't make you a good developer. Cook a great steak and worry less about cutting it. Tools are boring. People are far more important. A post like this is akin to "I LOVE BRITNEY SPEARS." Please God, make the programmer pop culture stop.

Re: Vim Creep

#188
post #79

This is an extremely awesome, fantastic, exhilarating use of hyperbole. What I gained from the article wasn't any explanation of why Vim is great; indeed, there was little included in this respect, aside from moving "entire blocks of code with the flick of a finger." Even the cool feeling of proficiency you get from knowing a tool well, and the fun of getting to show off a skill to a "how did he do that!?" audience w…

Just watch the video of the page http://blog.extracheese.org/2010/11/screencast-custom-vim-re... to get the gist of "entire blocks of code with the flick of a finger".

I'm pretty sure that "re-factoring" could've been accomplished equally fast with the mouse. In most editors, you can double-click to select a token and triple-click to select a line. So the mouse version would be: double-click 10, copy, double-click ten, paste, triple click the line you want to delete, press delete. Pretty fast, really; especially if you're using a laptop where the cost of moving your hand to the mouse is negligible.

I tried Vim for several months and got reasonably competent. But then I timed myself doing the Vim tutorial with Vim and Gedit, and Gedit won handily. For this reason I'm convinced that Vim is only popular because using it gives you hacker cred.

I'm open to changing my mind based on solid experimental evidence, but for now I only use Vim occasionally, for the macros.

Re: Vim Creep

#189

Earlier quoted context omitted.

Languages don't just fall into two black and white categories of whether or not it requires an IDE that understands the language. It's a spectrum, which means that all languages should benefit from an IDE that understands the language. If not, then you've just found the perfect holy grail of computer languages. Until then, face the fact that language integration is nice. Unless I'm missing something, specialized non-…

I've used both IDEs (Eclipse, IntelliJ IDEA) and Emacs. Originally I preferred the IDEs, but then I learned how to use Emacs properly. Besides, Emacs actually combines the best of both worlds for some languages like Scala or any sort of Lisp. (But, notably, not Java.) I may be crazy about Emacs, but I'd probably still use an IDE if I had to do significant Java development. This says far less about IDEs and editors th…

You spend as much time reading code as writing it. An IDE that can show you context relevant info at all time and facilitate browsing is interesting in any language. (like where is this set, where else it is used, what the doc for it, ...)

You can also see it as a "problem" of the language if you cannot create an IDE that improve your productivity over a text editor.

Re: Vim Creep

#190

This is an extremely awesome, fantastic, exhilarating use of hyperbole. What I gained from the article wasn't any explanation of why Vim is great; indeed, there was little included in this respect, aside from moving "entire blocks of code with the flick of a finger." Even the cool feeling of proficiency you get from knowing a tool well, and the fun of getting to show off a skill to a "how did he do that!?" audience w…

>Addendum: I use vim and pentadactyl. They are extremely awesome, fantastic, and exhilarating.

Hell yeah! In fact, I came to Vim through pentadactyl because I wanted a way to browse without using the mouse. I second the description of "exhilarating": navigating pages from the keyboard is much, much faster than clicking on links (except in those cases where the poor site design makes the clickable buttons undetectable to pentadactyl... Psst, HN search result navigation, that means you)

Post reply on HN