lainchan / λ

(untitled)

J.C. Denton · 2017-09-25 15:56
Considering that I have zero experience with both Vim and Emacs, what would be more profitable to learn?
Stallman · 2017-09-25 17:04
Profitable? Either or neither. No employer is gonna be like "What's that? You want to use the wrong text editor? Get out!" If you just mean which will go better for you, it's entirely personal preference. Give them a try and see which one you like.
Lukasiewicz · 2017-09-25 17:14
If you plan on getting to use the tools much, look at Emacs LIsp and look at either VimScript or Vim's other scripting APIs. Lots of Emacs/Vimmers tend to end up customizing their tools or fixing/hotpatching niche use-cases they want. Decide which seems the least painful. https://www.gnu.org/software/emacs/manual/html_node/eintr/index.html http://vimdoc.sourceforge.net/htmldoc/if_pyth.html http://www.terminally-incoherent.com/blog/2013/05/06/vriting-vim-plugins-in-python/
lietzu · 2017-09-25 18:54
First of all, if your going to use Vim use NeoVim instead. There's a reason their tagline is "Literally the future of vim". They're not joking about that. The changes are mostly back end so there's not really any noticable difference actually using the program. Really the only new feature it adds is a terminal emulator (which is pretty big). However, anyone using a lot of plugins will easily notice the performance boost from the asynchronous plugin API. It also comes by default with a slightly tweaked version of sensible.vim. That all said, even if you don't notice or use the changes, it's important that everyone starts making the change now, so vim can stay competitive and appealing.
Elliot Alderson · 2017-09-25 19:06
>>3732 You should use what you feel comfortable with, both are good. But to give you my opinion: Do both, learn Vim for the popular keybindings, and Emacs from the configuration and customization side. Emacs EVIL gives you the complete vim experience inside emacs, so you have no reason to decide.
Liet Kynes · 2017-09-25 19:39
You don't even have to decide anymore! Spacemacs is a preconfigured emacs that controls mostly like vim. IMO vim has the better keybind scheme for editing and emacs the more mature plugin ecosystem. If you're looking to learn, though, starting to learn text editing in vim is where you should start IMO.
() · 2017-09-25 20:38
I know I will probably be lynched for this, but why not nano?
Incognito · 2017-09-25 22:39
>>3741 Lack of modal editing. Key binds are cumbersome in my personal taste, but if it works for you, then it is good enough. Use what makes you must productive.
swap · 2017-09-26 08:25
>>3732 Personally: Emacs. If you are going to learn a text editor which forces you to re-learn everything, why not use the most powerful out there. Feature-wise emacs beats vim by orders of magnitudes. Just a crazy example: It is possible to create a Linux distribution using only the Kernel, naked X-Server and Emacs. Emacs becomes the window-manager. If you learn vim, you will have to learn other things too. If you learn Emacs its possible that you wont have to learn anything else afterwards.
hash table · 2017-09-26 10:09
If you are reading Sacha, emacs.
Yet Another Lainon · 2017-09-26 10:55
>>3748 >If you learn Emacs its possible that you wont have to learn anything else afterwards. As long as you learn how to deal with RSI beforehands ;) https://en.wikipedia.org/wiki/Emacs#Emacs_pinky
drop · 2017-09-26 16:20
>>3741 Nano for life.
JARGON · 2017-09-26 17:14
I would like to remind you all of the presence of the elegantly simple ed. The only text editor that truly follows the unix way and the only text editor suitable for the teletype environments that God intended. Let's look at a sample new user experience so you can get and idea of how beautiful ed is. $ ed help ? h Invalid command suffix ? ? ^C ? exit ? quit ? ^Z $ killall ed $ vi Magnificent. See how ed responds to the user's errors with the elegant '?'. Gently chiding them for making a mistake without overwhelming them with useless information. See how ed, knowing what's best for the user far better than they do, resists being closed by mere key combinations. Truly it is sublime. More than a mere text editor, I propose ed can only be adequately evaluated in the context of its true purpose: a work of art.
Unspecified · 2017-09-30 20:32
>>3732 it's a matter of personal preference. if you want a text editor just for editing text, and would rather externalize other functionality to the shell and programs invoked by it, learn vim. if you want your text editor to be a monolith, the place you do everything in, learn emacs. (there are people who use vim but load it up with a gazillion extensions so as to make it philosophically identical to emacs, those people are monsters though) personally I just picked vim because I used to type one-handed and modal seemed more practical than control keys for that reason
Nguoi La · 2017-09-30 23:12
learn vim first, it is the ubiquitous text editor, so you'll be able to edit text on any machine, learn emacs second, you can use it with evil-mode so all of your vim abilities are transferable, but emacs is more powerful and has more features, works more like an IDE. Well that's my plan rn.
St. IGNUcius · 2017-10-01 03:03
>>3754 That's not really a problem if you know how to type. Alternating hands to hit keys rather than getting through some really awkward twisting.
Junichi Fujiwara · 2017-10-01 09:36
I gave emacs an honest chance by reading "Mastering Emacs" by Mickey Petersen. There are just to many quirks to emacs, in fact that book is very good at pointing out all the weirdness about emacs that is just hold-over cruft that never got fixed. Someone really needs to completely rebuild emacs from the ground up if it is ever to become an editor that is worth using.
quote · 2017-10-01 09:37
>>3741 Lots of people use nano when the have to edit something in the console, but thats all its good for is quick edits, its a featureless editor, it would be like a professional programmer using gedit as his/her main editor
Eldon Tyrell · 2017-10-01 19:30
>>3732 Vi is everywhere but if you don't routinely use other people's servers then you should learn emacs. Emacs gets less in your face than vim. It is designed to be quick to use, instead of having to enter and exit modes constantly (vi). It also is written in lisp, which if you know how to use allows you to create your own functions and keybindings easily. I've used both, I use both, but I enjoy using emacs more.
Dujour · 2017-11-25 01:32
>>3760 I know you're joking, but if you are working on really old systems, or just want something to do, ed is acually kind of fun to work in. I recomend reading https://sanctum.geek.nz/arabesque/actually-using-ed/ I use ed sometimes for substitutions and merging because I find it is less cumbersome than oppening vim and doing it there or using sed. Plus, it has the ',' for substitutions: In vim, to change every instance of foo to bar, you do (at least to my knowlege) :1,$s/foo/bar/g In ed, you can do ,s/foo/bar/g
Trinity · 2017-11-25 01:49
whyNotBoth.png >>3739 bloat
Wirth · 2017-11-25 03:09
>>5249 >bloat FUD Spacemacs is going to make both vim and emacs obsolete very soon
Masami Eiri · 2017-11-25 05:21
>>5248 You can do it with :%s/foo/bar/g in vim instead of 1,$s
pop · 2017-11-25 12:13
>>5252 if it ever starts faster yeah maybe, until then certainely not
let · 2017-11-25 12:49
>>3732 >>3754 you could (and even should) remap caps lock --> ctrl or you could use evil mode. with evil mode you get the best of both worlds. >>3739 i would advise against spacemacs, because it is very bloated and it is better to start out with a simple config and build upon it as you go. Also, emacs has better tutorial (and documentation overall) than vim, imo
let · 2017-11-25 13:00
>>5262 oh, and if you are put off by the startup speed, you should try running GNU emacs as a daemon and use emacsclient. You could configure your init to start the daemon during system startup.
Sipho Nkosi · 2017-11-25 17:11
>>5252 Wishful thinking: the post
Jet Black · 2017-11-25 17:29
>>3734 I have a bit of a question here (am not OP btw). I just don't get why people seem to go by the principle that you *have to* bloat your vim with plugins or either it's unusable. Personally, I use vi (and sometimes vim, I like both), because I need to edit my files. Indeed if I were to add plugins I'd certainly go for emacs, but since all I usually do with my editor is edit text, and that on demand, I merely use vi. I don't even know what all those alledged "must-have" plugins are supposed to be about. You could say "oh it gives you tools to manage your git repo" though there is already a tool for that: git. And generally, all things an IDE facilitates are already there in my environment, which I must say, it's pretty vanilla. Maybe it's because I like to stick to standards, but I still don't see why people seem to deem Vim unusable if you don't fill it with plugins (which only adds to both the learning curve and the clutter of things one must maintain). I'm no hating on people who like to use plugins, I just really really don't understand why they feel they're oh so important.
Stallman · 2017-11-25 18:07
>>3741 I like nano because literally zero learning curve >arrow keys to navigate >keys to type >everything else is onscreen Some day I'll get around to learning vim, I guess I've done around 45 minutes of vimtutor but it's still so unintuitive
Hong, Guil Dong · 2017-11-25 18:09
>>5266 >all things an IDE facilitates are already there in my environment right but the point of an IDE is >Integrated >Development >Environment The whole point is the [u]integration[/u] Switch to shell, run your git command, switch back to editor is not integrated
Hououin Kyouma · 2017-11-25 18:38
>>5268 >Switch to shell, run your git command, switch back to editor is not integrated It is, just Unix becomes the IDE, not Vim.
Koos van der Merwe · 2017-11-25 19:22
>>5269 >if you dissolve the definition of "integration" to be "it's technically on the same computer" I don't know if you're actually this deluded or if you're parodying those who follow The Unix Way
Von Neumann · 2017-11-25 22:20
>>3909 I feel exactly the same, so I decided to have a go at re-doing emacs with Lua instead of Lisp. Like all the best ideas someone's already done it and it's pretty nice, check out https://howl.io . Obviously it doesn't have emacs' ecosystem yet, but it's a pretty comfy editor and Lua instead of Lisp probably makes it easier for people to add modules these days.
swap · 2017-11-25 23:22
>>5267 Well, if you can't touch-type then you won't be able to use vi* proficiently, but you won't be able to write swiftly either, or do it without a bunch of mistakes scattered all over your text, and you'll look silly and people will point at you and laugh because you watch your keyboard instead of the screen. But if you can touch type, you'll realize how much better it is to keep your hands in the default position and use hjkl to move around. Though to be honest, I barely use hjkl, I mostly use w and b which moves per word. Also 0 and $ to move to the beginning/end of line. But I digress. What I wanted to say is that you don't really need to "learn" vi and then use it. Instead, you just need to know a few things >i to go to Insert mode ><Esc> to go back to Normal mode >:w, :q, :wq and ZZ to write, quit, writequit, idem, respectively >hjkl You get comfortable with those very simple commands, and eventually you'll find yourself doing modal editing quite naturally, and you'll look into some of the more nifty commands such as: b, w, dd, gg, Ng (n a number), dw, d$, cw, c$, fC (c a character), /searchstring, n, and you'll realize how convenient is to be able to send sed-like commands such as :%s/search/replace/g instead of chasing a word you want to replace all over your file. It's one thing to just be able to delete characters, or point&click wherever you want to go (a convenient feature at times), but the reason I like vi is that you can do so much more with minimal work. Yes, there is a learning curve, but I learned those things on the go, once I had lost the fear of using vi (which, imo, it's just the fear of modal editing that one gets when running vi for the first time and having everything go wack when you tried to type something, and then not being able to get out).
Cereal Killer · 2017-11-26 01:48
>>5270 An operating system is just an integrated development environment that's already fully integrated with the operating system. Why would I use an IDE with its own windowing system, hot keys, plugin system, and scripting language, when I could just use my OS?
push · 2017-11-26 01:58
>>3909 >Someone really needs to completely rebuild emacs from the ground up if it is ever to become an editor that is worth using. Emacs is already being used by many people, and rewriting Emacs would force all developers to port their code over. Look at Python3 and WebExtensions for examples of how that goes.
Unknown · 2017-11-26 04:27
>vi or emacs? that's inconsequential,the real question here is: >is it pronounced "vee" or "vye"?
null · 2017-11-26 04:42
>>5277 vee eye
sizeof · 2017-11-26 05:30
>>5277 >>5278 6. dumdums
Switch · 2017-11-26 08:02
>>5277 someone here needs a history lesson: Names for utilities that are used a lot in unix tend to be very short, 2 to 3 letters, like cc, awk, pwd, etc . So when Ken Thompson created an editor, he called it ed, short for editor. Then Bill Joy made an improved version of ed which he called ex which is short for extended editor. ex has a visual mode that people preferred to go straight into so Bill created a shortcut into ex visual mode which is vi which is short for visual extended editor. So vi is a abbreviation not an acronym so it should be pronounced "vee".
Hopper · 2017-11-26 09:47
>>5275 Some people do not have access to Unix-like machines (e.g. me at work), so they have to use something that allows them to use their computer. At least that's the reason I started learning IDEs. Then I lernt emacs for lisp.
Nobody important · 2017-11-26 23:21
>>5282 >abbreviation of /ˈvɪʒʊəl/ >should be pronounced /viː/ wot
dictionary · 2017-11-27 00:12
>>5290 Youre one of those retards who pronounces char as care, right? What your pea brain doesnt bring into consideration is that abbreviations have their own pronunciation, off the top of my head: decaf, photo, memo, exam have accent on different syllable, different inflection and even different vowel sounds. Only an idiot would go through the english language and try and convert abbreviations back to the pronunciation of the word they originate from. Kind of interesting that *only* programmers seem to do this.(Always argue in good faith and avoid using personal attacks.)
Boris Grishenko · 2017-11-27 00:20
>>5293 you're making things up to back up your (wrong) claims, stop that.
Dox · 2017-11-27 01:39
>>5293 jesus. calm down person. You're hostile for no reason.
fsociety · 2017-11-27 02:25
>>5293 >abreviations are pronounced different from their origin word >vi is an abbreviation of visual so it's vee contradicting yourself much?
John Rain · 2017-11-27 02:49
>>5296 I wish there was no reason except there are people IRL who will try and correct you on the 'correct' pronunciation of an abbreviation when a abbreviation is by definition a socially accepted fabrication, in order for an abbreviation to function it has be aesthetically easy to recognize and pronounce and often shorted words dont sound right and so are altered. And yes I feel ridiculous for having to explain this but 'correct' pronunciation of abbreviations and acronyms comes up so often (like almost any tech talk and a conference will run into many of them) that I think this issue has to be clarified. >>5297 No its not a contradiction, if vi stood for visual implementation then it would be correct pronounce the letters individually. Of course acronyms can be pronounced as words such as CRUD or DRY, but in doesnt work the other way around
Cutter · 2017-11-27 07:42
>>5298 *nudges your writing implement receptacle slightly to the right*
Ivan Horvat · 2017-11-27 08:06
Emacs.
Unsigned · 2017-11-27 08:57
You should ideally learn both since they have totally different approaches. Vim defines a language for text manipulation, whereas Emacs creates a programmable environment.
Lunch · 2017-11-29 07:41
>>3760 >>5248 Ed's useful for more than just teleprinters. VT100 emulators might be common as muck right now but they weren't always; IRIX's termport doesn't do terminal emulation so anyone unfortunate enough to still be maintaining one probably knows that editing anything below runlevel 2 requires Ed or pals.
Hailvim · 2017-12-03 21:53
Here goes my opinion, take or leave it, though I am going to put some work on it. I must state that I do prefer vi (I use the vis reimplementation, which I find to be gorgeous) but I am using Emacs nowdays. Lets break this comparison into three categories: 1. Best text editor as is without the capability of being scriptable/expandable. (Neo)/Vi(m/s) is _the_ winner. The keybindings are just great. Emacs cannot compete, I really mean it, it is just horrible, even if you do the recommended changes to the keyboard (switching esc, duplicating M) and the subsequent learning curve, it is still bad as it gets. Vi _is_ the best text editor in this ~category~. There is a reason why many programs implement a vi emulation layer or they just go with the same keybindings and principles. It is efficient and fast, easy to learn and comfortable. 2. Best text editor as is _with_ the possibility of being scriptable/expandable. Here is where we start getting wet and a bit more realistic. Vi is still great, however vimscript lacks a lot behind Emacs-Lisp (that is one reason I use vis, whose scripting language is Lua), and here is where Emacs shines. It becomes a beast, it becomes what you dream about, you will just have to work it a bit, it may even become Vi! And org-mode is just plainly the best thing out there. Plus it offers the possibility to run a graphical interface, where you could for example render .pdfs (such as when you write LaTeX) without the need of external tools. The tools available in Emacs outshine the entire vim ecosystem. 3. The best in general. Emacs. Just take your time learning it and customizing it. I personally use evil-mode (vi emulation system). It is the best writing-programming-OS out there. However, I would still tell you to learn vi first for it's usefulness in the *NIX world, it's great keybindings and the low resource usage. >>3760 You genuinely made me cry. Oh, the memories and the fun I had the first time I typed ed in the command line.
hash table · 2017-12-04 16:47
>>5385 >vis Thanks, I'd never heard of that one. I generally don't like Vim but sometimes vi won't do it for me. And this one uses lua, neat!
Yu-ichi · 2017-12-04 18:28
>learning how to use a notepad people nowadays truly have nothing do do in their lives
Motoko Kusanagi · 2017-12-04 19:15
>>5392 Kakoune is also worth checking out since it no longer depends on boost.
Special Agent Bob · 2017-12-16 03:09
>>5396 Yeah, what the fuarrrk is a text editor? I thought it was an IDE this whole time I don't fuarrrking get it. Is it for coding? I just code everything in gedit
Cat Mother · 2017-12-16 18:44
>>5396 >people nowadays truly have nothing do do in their lives If you don't spend much time writing code then learning to use an advanced text editor is not a good use of your time. But if you don't spend much time writing code, why do you post in /lambda/?
DEBUG-CONTENTS · 2017-12-16 22:12
>>5722 Not him but if you do spend a lot of time writing code, you would probably just want to write code in your area of application without having to also write code for your editor. That's the reason I always end up back to vi* because I just want to edit code, and I don't really have the bandwidth to learn yet another runtime model, write code to write code, and then debug and go through the whole cycle when I have something else to do entirely.
Batou · 2017-12-16 22:43
>>5725 If your time is so valuable that you just can't take any off to learn how to use emacs you should probably quit wasting time on lainchan, sign up for Soylent and get coding.
Trinity · 2017-12-17 05:31
>>5728 Consider that not everybody likes Emacs and some people have other areas of interest which don't always overlap with lisp, perhaps there are even other aspects to technology that are very interesting in their own right, and text editors may not be something someone would want to go through manuals to figure out.
Jens Hansen · 2017-12-17 09:14
>>5725 >if you do spend a lot of time writing code, you would probably just want to write code in your area of application without having to also write code for your editor. If you spend a lot of time cutting down trees, you probably don't want to waste time sharpening your ax right? Text editor is one of the things that separates the professionals from the learn-python-on-the-weekend hoopleheads.
Dujour · 2017-12-23 03:57
I always were kinda jealous about the editor wars, since I can't really use any of the two big ones. Tried both, but having a swedish keymap really gets in the way, most keys get placed in real weird places and some don't actually even work because they have to be pressed using a modifier key, and then the software doesn't even interpret it as a button press for some reason. So it's kind of a choice between either getting and learning to touch type a US/UK keyboard specifically for programming in either of them, or having to remap everything without any idea of what would make a good setup or not, since just remapping as I go along all the prior bindings would be in the way. Was really annoying when trying out assembly too, it may sound like a small thing but having to make a really uncomfortable modifier key press every time writing a hex value really sucked. Thought it was just really really bad language design until I realized that the dollar sign isn't typed with AltGr in America.
Lunch · 2017-12-23 11:25
>>5803 Don't be jealous. I've learnt to use both Vim and Emacs to a point where I could use them in my daily work for months on end and be perfectly productive, and in the end I ended up using Visual Studio Code. It's a really good and polished editor. Of course when it comes to remote sessions and quick edits I use Vim.
Batou · 2017-12-24 14:51
>>5805 It's just that I really liked Vim for the parts that actually worked, and it's neat that it's almost always installed everywhere. Though the same issue would still be there, even if I "made it my own" by making a custom key config I would still have to have it with me. And I like not having to open X to code, easier to keep focused since you can't just open up a browser and get lost on the internet for hours. And keeping hands on keys really do well for me since my wrist gets really fatigued by using the mouse nowadays. Emacs made it worse though, all those chorded moves. Essentially I just want something that runs without X, has syntax highlighting and auto-indent. And that Vim way of moving around really saves alot of hand fatigue for me, so maybe I should just bite the bullet and try to come up with a new scheme since the mental overhead is worth not having to take as many breaks. And I don't really use other computers than my own at the moment anyway so not having my own config available is really only a theoretical issue.