Live data from Hacker News

Vim Creep

rudism.com

231–237 of 237 posts

Re: Vim Creep

#231
post #221
post #218

Earlier quoted context omitted.

"It’s too bad Sublime Text isn’t open source." Bad bad bad, if you are investing time in mastering a tool which could disappear tomorrow, or take a direction you don't like. This is one of the strongest reasons I chose GNU Emacs as my editor. I remember how burned I was when Visual Studio moved from VBScript to .NET as its macro language. All the time I had invested in learning its macro system and in writing macros…

To be completely fair, it's not like they are going to remotely delete it or anything, the current version which I like functions, and has no glaring bugs, and will continue to function. And if I did use emacs, and somehow it changed in a way that I hated, I really doubt I'd have the time to fix it. Work isn't going to pay me to sit around and write my own text editor.

I see your point. One day I'm going to write a guide to choosing your editor, or your trusty tools, for that matter. There are further advantages in choosing an open-source established editor.

It all boils down to a trade-off. As long as you don't invest too much time into learning a tool, you don't mind losing your investment. Recently I have switched to Opera as my default browser. I couldn't stand Firefox anymore, Chrome didn't suit me. Opera is proprietary and closed-source, but then I'm not going to dig too much into its internals.

Have a sweet day.

Re: Vim Creep

#232
post #230
post #228

Earlier quoted context omitted.

> The problem with application-specific extension languages is that they may start underpowered and ad-hoc, whilst general purpose languages have already proved their worth and done so in several domains. The embedded language has to be small, easy to learn, and most importantly, it should serve the purpose of extension. If it can serve other domains as well, that isn't really relevant as far as the editor is the con…

> Now vimscript doesn't do threading or evented io or thousands of other things - it isn't meant to do any of those. Neither does Emacs Lisp. But whilst Emacs Lisp started as a simplification of a battle-tested general-purpose language, Vim Script started as a hack and continued that way, with further functions being added on a "as-needed" basis. > As far as quirks go, all languages have quirks. PHP and JS probably h…

> Vim Script started as a hack and continued that way, with further functions being added on a "as-needed" basis.

Why shouldn't adding functions on "as-needed" basis be the case? No body can see what might be needed in the future. All programming languages evolve, so does vimscript. Other languages evolve in favor of language design and libraries, vimscript adds things which are needed.

> This is what we could name a "Perl fallacy": Perl scripts can be much shorter than scripts in other languages, but the former are more of a PITA to write.

"Perl fallacy" isn't something accepted and proved. It's mostly Python and Ruby folks bashing perl. I have written substantial amount of perl, python, ruby(and lots others, but these 3 are almost interchangeable) and I find perl easy to read and write.

> I can't write stand-alone applications with Vim Script. You may say this does not matter, because we are talking about extension languages here, but my view is different (and this was one of the original objections of mine).

You said it yourself, and I will repeat it. Vimscript exists only to extend vim, and everything that's added to it is added with that in mind. Anything that helps vimscript better at extending vim is good, anything else is not bad but is irrelevant.

> Why learn shell scripting (or something similar), different command-line text processing tools with their quirks when you can learn one framework well and use it for everything?

Well then there has got to be a reason we don't have this magical framework yet which we can use for everything. May be "right tool for the job"?

> Evidence shows that Emacs' packages can go beyond Vim's

Would love to look at some of that evidence. Apart from async stuff(debuggers, slime etc), I don't think that should be the case. I have looked at Tim Pope's and scrooloose's vim plugins, and have reasonable experience writing vimscript and looking at others' work to believe vimscript is powerful enough for the job.

> For instance, whilst Emacs programming packages parse - thus understand - code while perform syntax-highlighting, Vim's packages rely on regexps, thus messing syntax-highlighting when the syntax of a language is not quirky.

http://code.google.com/p/go/source/browse/misc/emacs/go-mode...

Look at the syntax highlighting section 28-107 and show me where it's parsing go code. I don't know what you meant by "parse and understand code", but a parser for a non-toy language isn't something you write in elisp for a syntax highlighter.

Syntax highlighters more or less work the same way. You have a colorscheme which says keywords are blue, and then the highlighter tells what is to be considered a keyword. Now keywords is cakewalk - a static list of tokens, and in most editors, if you name your variable `class`, it gets the same highlighting as the keyword class. Regions(multi-line comments, multi-line strings, function arguments falling down to next line) are a bit problematic, but editors have hooks for it.

    # Well, thank's slosh again.
    # http://learnvimscriptthehardway.stevelosh.com/chapters/47.html
    syntax region potionString start=/\v"/ skip=/\v\\./ end=/\v"/
    highlight link potionString String
Now,

    "She said: 
    \"Vimscript is tricky, but useful\"!".
will highlight as string just fine.

> Vim Script code is difficult to read because uses keyboard macros heavily, and suffers from accumulated cruft, where equivalent Emacs code would use named procedures with meaningful and consisten names.

It is difficult to read to whom? Unless it is difficult to read to someone who knows vimscript, it doesn't matter.

You are missing the point. When I am in the editor, and I need to copy 2 words, I do y2w. Making it a function call in vimscript isn't beneficial to me at all. What exactly would I gain if vimscript, instead of this:

    normal! `y
gave me a well-named function to call:

   copy_visual_mode_range_to_default_register()
How does it matter to me copy_visual... is more readable than `y to someone who doesn't use vim? Oh, vimscript has functions, lots of them http://vimdoc.sourceforge.net/htmldoc/usr_41.html#function-l...

But everytime I need them, I have to look them up, compared to vim normal mode and other commands which I already know and use in the editor.

> There is objectiveness. By learning Emacs, you are learning how to use a tool which is much more consistent and flexible

Unless you have objective proof of "emacs being much more consistent and flexible(where, how)" it's not objective at all.

> but the superiority of Emacs

Again, citations needed.

> Emacs has an effective editor implementation, Vim has an effective editing model. That's what is objective.

No, it's still not objective. You just delcared "vim has effective editing model" and "emacs has effective editor".

> Back to work ;-)

The only thing that matters.

Re: Vim Creep

#233
post #232
post #230

Earlier quoted context omitted.

> Now vimscript doesn't do threading or evented io or thousands of other things - it isn't meant to do any of those. Neither does Emacs Lisp. But whilst Emacs Lisp started as a simplification of a battle-tested general-purpose language, Vim Script started as a hack and continued that way, with further functions being added on a "as-needed" basis. > As far as quirks go, all languages have quirks. PHP and JS probably h…

> Vim Script started as a hack and continued that way, with further functions being added on a "as-needed" basis. Why shouldn't adding functions on "as-needed" basis be the case? No body can see what might be needed in the future. All programming languages evolve, so does vimscript. Other languages evolve in favor of language design and libraries, vimscript adds things which are needed. > This is what we could name a…

> Why shouldn't adding functions on "as-needed" basis be the case? No body can see what might be needed in the future. All programming languages evolve, so does vimscript. Other languages evolve in favor of language design and libraries, vimscript adds things which are needed.

When you add things when needed instead of thinking them through beforehand, you have two choices: - forsaking backward compatibility, thus breaking existing libraries; - striving for backward compatibility, thus ending up with an inconsistent framework and language quirks. Examples are not rare: - Perl and its flattened lists and many other quirks; - PHP; - Python warts; - C++ with weird syntax which is legit; - etc.

> It's mostly Python and Ruby folks bashing perl. I have written substantial amount of perl, python, ruby(and lots others, but these 3 are almost interchangeable) and I find perl easy to read and write.

Props, man. You must have a big brain, if you feel that both Python and Perl have almost the same cognitive load. I considered myself to be a sharp blade at programming C++, yet I have always found it to be a taxing task. Good for you. I'm not joking.

> Vimscript exists only to extend vim, and everything that's added to it is added with that in mind. Anything that helps vimscript better at extending vim is good, anything else is not bad but is irrelevant.

But you can't deny that an extension language which goes beyond its editor comes with a bonus.

> Well then there has got to be a reason we don't have this magical framework yet which we can use for everything. May be "right tool for the job"?

Such magical framework exists. Its name is GNU Emacs. Sometimes its magic has been overplayed, but still...

>> Evidence shows that Emacs' packages can go beyond Vim's > Would love to look at some of that evidence. Apart from async stuff(debuggers, slime etc), I don't think that should be the case. I have looked at Tim Pope's and scrooloose's vim plugins, and have reasonable experience writing vimscript and looking at others' work to believe vimscript is powerful enough for the job.

What about: - Gnus, RM, VM, Vanderlust, Meow: mail readers (IMO an aberration, but it proves the point); - Eshell (Emacs shell, written in Emacs Lisp); - Dired, Sunrise Commander: file browsers; None of these packages uses functionality which is alien to Vim, except a more expressive extension language and a richer library.

> http://code.google.com/p/go/source/browse/misc/emacs/go-mode.... > > Look at the syntax highlighting section 28-107 and show me where it's parsing go code. I don't know what you meant by "parse and understand code", but a parser for a non-toy language isn't something you write in elisp for a syntax highlighter.

That's a basic Emacs mode. Throw some Perl code to both CPerl in Emacs and to Vim and see which of the two copes better (with Perl you can't do better than coping).

>> Vim Script code is difficult to read because uses keyboard macros heavily, and suffers from accumulated cruft, where equivalent Emacs code would use named procedures with meaningful and consisten names.

> It is difficult to read to whom? Unless it is difficult to read to someone who knows vimscript, it doesn't matter.

It is difficult to read to everyone. There is a reason for we using named variables instead of codes of registers nowadays.

> You are missing the point. When I am in the editor, and I need to copy 2 words, I do y2w. Making it a function call in vimscript isn't beneficial to me at all.

What happens if the reader has remapped such keys on his Vim? I don't know, but either your code will break or the user will risk misunderstanding it. Maybe Vim doesn't offer you any facility to easily convert keyboard macros to named procedures, therefore you have to resort to hardcode such macros.

What if the reader uses a subset of Vim's commands and doesn't recognize the hard-coded macro at first sight? She has to decrypt it. In Emacs Lisp, you always have at least clue about what a command does.

>> Unless you have objective proof of "emacs being much more consistent and flexible(where, how)" it's not objective at all.

That Emacs is more flexible, I have proved. Documenting why Emacs is more consistent would be more work than I'm willing to put into a comment here. Since I have studied both Vim and Emacs and read experiences of users who have switched from one to the other, both ways, I believe I have a good idea about how they stack one against the other. I accept that you don't share my opinion.

>> Back to work ;-)

> The only thing that matters.

But a flame war is often a welcomed distraction.

Cheers.

Re: Vim Creep

#234
post #79

Earlier quoted context omitted.

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

Great screencast, and thanks for including it - but man, that guy really should get a quieter keyboard.

I love my clickety-clack IBM Model M, and they'll take it away when they pry my cold, dead fingers from it.

Re: Vim Creep

#235

Earlier quoted context omitted.

W.r.t your Todo list, have you tried VimOutliner? It's excellent for that, even having macros for checkboxes and such.

I haven't tried it. I will take a look. If it has a bunch of useful macros it might work. I might be able to program my own macros as well. The thing is that Cut this text and past it here is still a very useful paradigm for my todo list, while remove line 47, change the "* " at the beginning of the line to "3) " and replace the current line starting with "3) " is a little less helpful. Note that items in the queue t…

why not use Emacs Org mode/ VimOrganizer?

Re: Vim Creep

#236
post #194

Earlier quoted context omitted.

And the ring that binds them together is Pentadactyl's Ctrl+i, which opens the the textarea with focus in GVim, and then loads it back when you close the editor. I'm typing this in it ;)

Wow, and you learn new features every day. Thanks! (It probably teaches such a trick in the tutorial but early on I was busy de-Vimming the actual text input in browsers when I first installed it...)

gF to open the html source in vim

Re: Vim Creep

#237

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…

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

I'm not really a Python person (I prefer Common Lisp, but that's another talk for another time), but GNU Emacs has Pymacs

Post reply on HN