4 ms·
In Visual Studio, creating a custom keybinding appears to involve three dropdown menus, a dialog box, and at least two UI controls. In Emacs or Vim, it's a sin
by throwanem 11y ago
In Visual Studio, creating a custom keybinding appears to involve three dropdown menus, a dialog box, and at least two UI controls.
In Emacs or Vim, it's a single line of code you add to your initialization file.
I think there may be different definitions of "easy" in play here. I'll concede that Visual Studio makes custom keybindings possible, but so does any text editor worthy of even momentary consideration as a professional tool.
And I'll take your challenge. Here's something I can do in Emacs: I can take a spreadsheet received from a client, full of intended configuration settings for a custom internal application. I can export it as CSV, load it in Emacs as such, and extract the relevant sections of the content into tables in a plaintext Org-mode document. I can then add a function to that document, in whatever language I choose, which will receive the contents of those tables as structured data in the language's own idiom, and generate the collection of complex SQL statements necessary to implement the desired configuration. From there I can decide whether I want this SQL script inserted into the document I'm writing, or written out to a file that I can copy to a remote host and feed to the SQL monitor. Or I can instead have Emacs itself connect to the target RDBMS and apply the configuration directly. Or any combination of those. And once the document's written, I can do all this with a single keystroke. Another single keystroke exports the document to HTML, so I can share it with the client to demonstrate exactly how their intent has been translated to reality, and with colleagues so they can see what's been done.
Perhaps that sounds fantastic to some. For me, it's Thursday before last. It took a little less than an hour.
I'm sure Visual Studio suits your needs quite well. I'm glad of that; everyone should have a tool that does what they need it to. But Visual Studio, from all I've seen of it, does very little to expand the scope of what you can do. Those of us who are fond of Emacs or Vim are so because, by comparison with something like Visual Studio, Emacs and Vim give you superpowers.
- ZenoArrow 11y ago> "And I'll take your challenge. Here's something I can do in Emacs: I can take a spreadsheet received from a client, full of intended configuration settings for a custom internal application. I can export it as CSV, load it in Emacs as such, and extract the relevant sections of the content into tables in a plaintext Org-mode document. I can then add a function to that document, in whatever language I choose, which will receive the contents of those tables as structured data in the language's own idiom, and generate the collection of complex SQL statements necessary to implement the desired configuration. From there I can decide whether I want this SQL script inserted into the document I'm writing, or written out to a file that I can copy to a remote host and feed to the SQL monitor. Or I can instead have Emacs itself connect to the target RDBMS and apply the configuration directly. Or any combination of those. And once the document's written, I can do all this with a single keystroke. Another single keystroke exports the document to HTML, so I can share it with the client to demonstrate exactly how their intent has been translated to reality, and with colleagues so they can see what's been done." Okay, so let's look at this. If I've understood correctly, you want to be able to generate data migration code based on a CSV file, and export that code so that it's ready to be inserted into documentation, is that a fair assessment? So for Visual Studio, one way to do this would be to write a custom runner for Fluent Migrator: https://github.com/schambers/fluentmigrator https://github.com/schambers/fluentmigrator https://www.nuget.org/packages/FluentMigrator/ https://www.nuget.org/packages/FluentMigrator/ https://www.nuget.org/packages/FluentMigrator.Tools/ https://www.nuget.org/packages/FluentMigrator.Tools/
- throwanem 11y agoNope. This isn't a migration; it's one-off data population. Fluent Migrator can do that, from its documentation, but it wouldn't be required, and since this isn't a migration, Fluent Migrator doesn't really bring anything to the table that I can see. So you're building a custom software project in your language of choice, with all the overhead that implies. In the workflow I described, you create a file and activate Org-mode. (Or just create a file whose name ends with ".org".) There's also the documentation task, which has to include the source data and resulting SQL script, as well as the transformation code. I'm not seeing anything here that would simplify that in the slightest; you'd have to either write the HTML document by hand, or write code to generate HTML. In the workflow I described, all that code is already written, and you can invoke it with a single keystroke. And beyond that, there's the matter of data ingestion. You're starting from CSVs, so you have to read those and parse them just to have the data you need to work with in a form which you can use. Any serious language has a CSV parsing library, of course, so that's not a difficult task in its own right, but it's still more code you have to write, and more effort you have to put in - selecting a CSV parser, adding it to the project, learning its API, et cetera. In the workflow I described, it's a copy-paste operation. Don't get me wrong - I didn't say, or assume, that anything I described couldn't be done in Visual Studio. But at this point we're talking about, what, a few hours at least? And you're spending a fair chunk of that time on overhead, especially in document generation. You have to find, vet, and install libraries, write or modify a bunch of code, and so forth. By the time you're done, you've probably had to spend the better part of a day on this one task. In the workflow I described, the only code I needed to write was that in which I expressed the actual transformation from tabular data to SQL statements. Everything else, Emacs and Org-mode took care of for me; all I needed to know was how to invoke capabilities already present. And I had the job done and dusted in less than an hour, with plenty of time left in my day for other work. That's what I mean when I say Emacs and Vim give you superpowers - not that there's anything you can do in one of those editors that (with enough effort) you can't do in another environment, but that those editors are better than anything else (at least anything else I or anyone I know has ever encountered) at helping you get more done, faster, without having to spend time on ancillaries that distract you from the meat of the task at hand.
- 11y ago
- peatmoss 11y agoAnd you're hardly alone in doing Magic Things in org-mode. Org-mode is like the storied elephant being groped by blind men, all finding a different piece of anatomy, and each concluding that the elephant is something different. Org-mode is a best-of-breed outlining application. It's a dead-simple workflow management and time tracking application. Org-mode is a better Markdown than Markdown integrated with a multi-format publication generation capability. Org-mode is a literate programming environment facilitating reproducible research that allows embedding code inside documentation, but unlike some alternatives supports a zillion languages and lets you pass values between them. I haven't found anything that I like as well as org-mode for any of those individual tasks, much ALL of them. Org-mode somehow does all these things and manages simplicity. It's all plain text that I never have to fret compatibility or corruption.
- throwanem 11y ago> Org-mode is a better Markdown than Markdown integrated with a multi-format publication generation capability. It can even export to Markdown! (And I'll only author in Markdown under duress anymore.) It's funny that you chose the phrase "Magic Things". Before I settled on the "superpower" metaphor, I was going to talk about the times when I've done things with Emacs, in and out of Org-mode, that have made my colleagues say things like "wow, that's really cool" or "holy shit how did you even just do that". I opted not to because I figured it would sound like bragging, on the one hand, and on the other because you can do things in Emacs that really do have to be seen to be believed. But "magic" is the word I was going to use. (It's not always an advantage, either. I've had people show contempt for things like Org-mode tables, on the assumption that because they're rendered in text, they can't possibly be anything other than text, and I must be wasting insane amounts of time making columns line up and the like. I used to work for one of those people. I'm really glad I don't work for him any more.)