4 ms·
As a long-time (decades) vi user, I decided once to force myself to use Emacs for a full year just to see what people liked about it. I have to tell you - I wa
by commandlinefan 6y ago
As a long-time (decades) vi user, I decided once to force myself to use Emacs for a full year just to see what people liked about it. I have to tell you - I was so relieved when my year was up and I could go back to vi. I never "felt" emacs no matter how much time I spent using it.
- coliveira 6y agoI was a knowledgeable emacs user and felt the same thing when I finally started using vi. Emacs is like carrying around a foreign OS to do text editing. Vi is a tool that has been designed to blend into the system.
- daptaq 6y agoVi is the editor of the Unix programming environment (among other things the shell). Emacs is a shell, that introduces a different kind of programming environment. The OS is still Unix, it's wrong to say that it is it's own thing, but you relate to it differently, but neither is inherintly "better" fit for *nix in the abstract, it's just that the shell is more popular since it was historicall the default UI.
- dotancohen 6y agoVI is a text editing language, and the VIM and NeoVIM implementations are terrific. Emacs is a text editing platform, but its text editing language is good for writing only. Not good for editing, not good for copying or moving code, not good for navigating, not good for working with brackets or parenthesis despite the lisp language being almost native to Emacs. My recent exploration into org-mode introduced me to Evil. It's 95% of the VI language, in an amazing text editing platform. I'm currently only using Emacs for org-mode right now, but suddenly new worlds are opening. For instance, I've been looking for a good tool to navigate CSV files from the CLI (or any other keyboard-controlled environment) for over two decades. I'm not yet explored the possibilities with Emacs, but I'm told they are good. Then possibly browsing simple websites, such as HN and Wikipedia, maybe a better Git interface, maybe a good Telegram / Slack / IRC combined messenger, maybe a good email reader. Suggestions welcome!
- throwaway_pdp09 6y ago> Not good for editing, not good for copying or moving code, not good for navigating, not good for working with brackets or parenthesis Hmm. OK, I wonder why. For me M-h selects a a paragraph. Repeated M-h selects further. M-w copies it. S-M-{ or S-M-} to jump by paras. M-s . for symbol lookup. In that family you can do highlight regexp or line. M-s o - get an overview of every line that matches what you want ('occurs') etc. etc. Macros, registers (using these to store large chunks of text, basically class templates). etc.
- dotancohen 6y agoThank you. I would love nothing more that to be proven wrong! Some common things that I do in VIM: * Copy or cut everything between these quotes / parenthesis / brackets. * Delete up until the next X character. Now delete up until the next X character again. * Cut these rows then paste them over there. * Change all instances of "foo" to "bar". * Show all lines with (or without) "foo". * Reformat a line like so, now do it to the 351 line following it. * Reindent this section of text. * Go to the beginning of this if() / method / loop. * Go the the file where this Python / PHP class is defined. * In markdown files, open this hyperlink * Search for the first occurrence of this token in this method. * Search for the next occurrence of this word (actually learned to do this today, for the most part) These were just example off the top of my head in a few seconds, none of which had an easy answer in Emacs. Sure, I could spend ten minutes each to look for how to do each one. I probably did that during the Clinton administration with VIM, before one could just google their problems away. But in VIM, each one has an easy answer and most are actually built right into VIM with no customization necessary. In Emacs, I could implement that stuff but then I'll be implementing everything else I need. So I use Evil!
- throwaway_pdp09 6y agoHmm. This is tricky and I'm not sure I completely get your requirements, but let me try. Other emacs dudes will need to step in. In the following no customisation needed as I don't use elisp. Copy or cut everything between these quotes / parenthesis / brackets. Don't know. Never needed to. Trivial with a macro Delete up until the next X character. Now delete up until the next X character again. Never used it but https://www.gnu.org/software/emacs/manual/html_node/emacs/Other-Kill-Commands.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Ot... M-z char - Kill through the next occurrence of char (zap-to-char). Cut these rows then paste them over there. Well, select rows, kill, move to new place, yank. Not sure what else you want. Change all instances of "foo" to "bar". M-S-% - query replace (and variations such as regexp) Show all lines with (or without) "foo". Erm can only do with, but as in original post, M-s o (occurs) Reformat a line like so, now do it to the 351 line following it. Not sure your requirements but command align-regexp works for me. Don't know what else you want. Reindent this section of text. Depends on mode, but select text then TAB key. Go to the beginning of this if() / method / loop. Don't know. Perhaps Search reverse for { char? Go the the file where this Python / PHP class is defined. Mode specific. I'd be pretty sure that kind of functionality doesn't come built into vim. I use Omnisharp which does similar but it's an external package. In markdown files, open this hyperlink mode specific. Presumably also in Vim? Search for the first occurrence of this token in this method. Just search forward. That may not be quite what you want, maybe. Search for the next occurrence of this word (actually learned to do this today, for the most part) M-s . when on symbol. Subsequently C-s search forward, C-r searches reverse (backward). But I'm not trying to change your mind, use what suits best. Edit: M-S h is highlight-regexp which highlights all matches in the buffer in colour (does depend one some mode stuff, but works in most modes).