News for hackers. Stuff that matters.
Re:Vim.js – JavaScript port of Vim by Tyr42 on Sunday November 30, 2014 @09:30AM (#8676877)
Wow, it's a full vim. I was expecting to find things it couldn't do, but I ran out of things to try. Great work.

It did take a little longer than vim to load, but I guess that's expected.

Re:Vim.js – JavaScript port of Vim by stevebmark on Sunday November 30, 2014 @03:02PM (#8677877)
It's missing some important Vimities:

q/

q:

:normal

ctrl-n in insert mode (or any completion like ctrl-x ctrl-l) of course plenty of command line options like virtualedit:

Though it does implement the expression register ( i CTRL-R = ), the regex class \x (among Vim's other rando regex classes), and :set synmaxcol which is pretty nitty gritty.

Re:Vim.js – JavaScript port of Vim by darklajid on Sunday November 30, 2014 @05:07PM (#8678316)
I'm a bit ashamed to ask, but .. as someone that is using vim quite a bit (but certainly no expert), I didn't recognize any of those.

Can you elaborate and explain what you're missing and what for?

Re:Vim.js – JavaScript port of Vim by MetaCosm on Monday December 01, 2014 @10:22AM (#8681460)
q/ and q: are improved versions of : and / -- when you type q: or q/ it brings up a split with your : or / history in it -- so now you can use normal vim editing commands to edit an existing command or type in a new one, and then hit return and it runs the / or : on that line.

Once you get used to using them, you will only use / or : when the search or command you want is absolutely simple and straightforward.

:normal lets you use normal commands at a command line, often used for automation or scripting stuff... so you can do :normal 5j to go down 5 lines.

C-n is just normal complete

Re:Vim.js – JavaScript port of Vim by stevebmark on Sunday November 30, 2014 @06:15PM (#8678617)
If you're using Vim and not using q: q/ :normal ( and hopefully :t, :m etc with relativenumber ) you're missing a lot of Vim's power, and would be better off in an IDE. The speed benefits from Vim are from knowing a large amount of the editor's features.

Practical Vim the book is a good place to start. You should be spending as much time learning Vim as using Vim for about the first two years of your Vim usage.

Re:Vim.js – JavaScript port of Vim by darklajid on Sunday November 30, 2014 @06:47PM (#8678726)
No offense, but

- you haven't answered my question. Like, at all.

- I don't quite like the 'would be better off in an IDE' part.

That said, at this point I'll better see what I can find about these oh-so-essential features and I might even add them to my routine/workflow (so far, I still don't know why though...).

Edit: As expected, the help page doesn't explain why I should care about those. q: and q/ are nothing I ever missed, :normal is weird and I cannot imagine what it is used for. Basically my whole reason to jump on this thread "Okay, now I don't know these. Why are they useful?" is absolutely still relevant. Reading the documentation isn't enough. I .. won't buy a book at this point.

Re:Vim.js – JavaScript port of Vim by stevebmark on Sunday November 30, 2014 @07:05PM (#8678802)
I'm not trying to be rude, but I'm not going to transcribe a book or help files here. The answer is read Practical Vim. It should be required reading for any Vim user.
Re:Vim.js – JavaScript port of Vim by mcpherrinm on Monday December 01, 2014 @02:53AM (#8679933)
Whether or not you're trying, you have succeeded.
Re:Vim.js – JavaScript port of Vim by sente on Monday December 01, 2014 @05:30AM (#8680304)
I'm incredibly quick with Vim and I rarely use `q:`, `q/`, `:normal`, etc.

In fact, I think I only type `q:` as a typo when I'm trying to `:q[uit]` :p

Re:Vim.js – JavaScript port of Vim by markus2012 on Sunday November 30, 2014 @11:12AM (#8677108)
It did not work well in Chrome: 36.0.1985.49 beta C-f, C-b didn't even work.

I then gave it a shot in Firefox nightly and it seemed to work really well. This brings me joy.

I don't like to edit forms/documents on the web; it's a constant struggle against my muscle memory. Vim.js could be the start of something that could change that. Well done!

Re:Vim.js – JavaScript port of Vim by Sephr on Sunday November 30, 2014 @02:11PM (#8677723)
Chrome 36 beta came out half a year ago. It's unreasonable to expect web developers to support very old versions of a browser that silently auto-updates. Most popular frameworks and libraries, such as jQuery (see https://jquery.com/browser-support/), only officially support the latest stable Chrome and one version prior.
Re:Vim.js – JavaScript port of Vim by e12e on Sunday November 30, 2014 @06:40PM (#8678699)
Right. So it eas pretty new in July, then?

https://github.com/coolwanglu/vim.js/commits/master

Re:Vim.js – JavaScript port of Vim by deathanatos on Sunday November 30, 2014 @04:05PM (#8678086)
(Edit: strike point about Chrome release date; had the release-release date, parent probably means when beta started.)

I'll also note that in the past, I've purposefully not upgraded due to serious bugs in the present version of Chrome. (There was a great one a while ago where entire websites — notably Wikipedia — were rendering in the wrong font, for example.)

> a browser that silently auto-updates

While I'll grant that this is true for the majority of users:

1. It requires a user to restart their browser. For me, this usually means the next weekend or Chrome/OS X crash, since during the week I'm usually busy with things other than restarting the browser…

2. Not all OS's auto-update, though this is a very small minority.

Re:Vim.js – JavaScript port of Vim by markus2012 on Sunday November 30, 2014 @04:26PM (#8678165)
It's unreasonable and unfair for you to assume I have any expectation for Vim.js to work with the version of Chrome I listed.

I was merely providing feedback / datapoint.

Re:Vim.js – JavaScript port of Vim by gibbonsd1 on Sunday November 30, 2014 @01:40PM (#8677588)
This doesn't work for me either. However, I am using the Vimium plugin for Chrome which may also cause issues.
Re:Vim.js – JavaScript port of Vim by rifung on Sunday November 30, 2014 @05:02PM (#8678299)
Did you try going into insert mode in vimium before trying it?
Re:Vim.js – JavaScript port of Vim by jonawesomegreen on Sunday November 30, 2014 @10:37AM (#8677019)
This was the first thing I tried. Lets see if I can find an unimplemented command. I likewise came up empty handed. Very cool stuff!
Re:Vim.js – JavaScript port of Vim by chr1 on Sunday November 30, 2014 @10:52AM (#8677059)
Well it _is_ the real vim, built with --with-features=small (see https://github.com/coolwanglu/vim.js#vim-features) so folding for instance doesn't work
Re:Vim.js – JavaScript port of Vim by jballanc on Sunday November 30, 2014 @11:31AM (#8677173)
Visual Block input doesn't work (at least not in the newest Safari).