Vim vs Emacs

Which one do you use and why?

Learning Vim recently. Tried Emacs, but the keyboard shortcuts didn't really appeal to me the way Vims do.

It is a shallow reason for picking one editor over another b/c the keys can be mapped to whatever you want.

Honestly, both are so customizable at this point they are basically equal in power. The editor wars of the early 90s are basically over and it resulted in a stalemate.

Vim, I'm almost always working on a remote test box over ssh

...

fuck off autist

Both are autism.

>1 KB

To be honest I just use Open Office. Any other stuff is gonna be autistic tier and not compatible with Microsoft Word, so yeah.

vi isn't that hard.

whoa a whole kb was saved

This. While useful for bash scripts and fizz buzz bullshit vim and emacs are both impractical for serious development (something no one on g does).

You're welcome

so what do you recommend for development, then?

Try harder

Out of curiousity, why do you consider them impractical for serious development? What are their shortcomings in your opinion?

Every single one of these has been artifacted to shit. They are in and of themselves a waste of data.

I like emacs because of how powerful it is. It's more than a text editor and can do anything. You can use evil mode if you want vim emulation

He's gone m80s, I reckon he's just repeating some shit he read somewhere.

Vim, it's smaller and doesn't require a display server.

No they aren't, my TA explained their use perfectly.

Say that you have to do some work on a computer that's not yours, most PCs on science, servers, etc, are running Linux. So no matter what they have installed, you can be sure that they're gonna have at the very least vi.

I'm not saying that you should use them for every day work, but you definitely have to know how to work with them.

Emacs, it's what my father used and what my son will one day use.

A tool crafted to perfection for the pass 40 years, there will never be a replacement for it.

emacs, because I was already using it for org-mode after being unable to find something else libre that handles repeating tasks the way I need.

When I have to absolutely do something on Linux I just end up using nano or gedit + command line

If I had to do any serious coding on Linux I'd just shoot myself

It's pretty rare to need that and also to need to do the work *on* the target computer (rather than copy file, edit it yourself, copy back).

What's your editor on other operating systems?

I'm using C# right now for work, if I weren't I would be using stuff like codeblocks, eclipse, or pycharm

> 4kb
Mate I'm Australian, are you TRYING to make my reach my month's data cap in a day?

>have to patch a small thing
>let me boot up my laptop, copy the file over, edit it and then paste it back

When you could've done that in one minute with vim.

Not knowing vim is literally computer illiteracy, it's one of the fundamentals. You have to know it, and that's coming from a raging Visual Studio fanboy.

>doing serious coding on Windows
nice try pajeet

both

Emacs if I'm going to code lisp
Vim if I'm going to mess with my OS
But I honestly like Vim more. Often in Emacs I miss the kinds of movements that can be done with Vim like dt% or f! or 15G
They are absolutely based
I could be using evil mode but it's not really the same and i feel awkward about using emacs as if it were vim, maybe I'm just stupid

Pied piper does it again

So if I learn emacs do I get trapped in time?

Yeah, that's why everyone who still uses emacs is stuck somewhere in the 90s.

I'm Notepad++ and what is this

Emacs + evil-mode

I prefer Vim because I liked the typing system. The [ctrl] combinations of Emacs feel awkward for me..

Also I prefer the logic that you are normally in the meta world where you can just do meta stuff and switch to the "what you see is what you type" only when you have to. It makes navigation damn fast, once you mastered it.


Anyway, I think Emacs is better as stand alone IDE. Right now I'm doing fine, but maybe I'll look into "emacs evil mode" in the future, who knows?

What is f!?

Notepad, because I'm not autistic

Underrated post

This, for the first part.

Fuck coding in a non-unix os. Fuck windows for coding. Serious code is done in linux, using the appropriate tool. Like a jetbrains ide for python and java (like a normie), and a simple editor like nano for scripts/anything over ssh.

been learning emacs from the oreily book for the past few weeks. they make a lot of claims about being able to do pretty much everything youll ever need to do on your computer in emacs, or script it if you know lisp which i do. is that really true?

SublimeText 3

Bitches please

Why does your code need to be compatible with ms word?

It jumps to the next occurence of "!".

vi/vim, depending on the system. Usually just use sed and cat for quick tasks

On the same line.

kek

user you're not supposed to use OO for code

>Which one do you use and why?
Vim.

I dunno, just everything beginner-orientated seemed to have explanations for vim when I was learning to use linux/bash/edit configs/etc. so I ended up using it.

Topkek

Good to know.

I always use "/" for that purpose..

Use f, seriously it's very handy
f find forward, F backward, t and T are the same as f and F but put the cursor before and after respectively
; jumps to the next occurence of f, F, t and T

the one not pictured: vim

>Use f, seriously it's very handy
What's the point in trying to micromanage small movements when it takes me less time to just hold down ‘l’ and get to the right place in the line than it does to figure out what character to type after ‘f’ that will take me there?

The only “complicated” movement commands I think are worth bothering myself with are the ones for large movements. ^], ^O, ^I and so forth. They let me navigate effortlessly throughout a codebase, which is the real benefit of vim.

Micromanaging navigation within a line feels like the vim equivalent of optimizing fizzbuzz.

Yeah ok mate, maybe you should just go back to sublimetext

best

and 555, nice

I use Vim but I'm not really a programmer and I am probably not using a lot of the more useful features. I just like deleting words and lines all at once and moving around without arrows mostly.

What are the key differences between vi and vim? I learned vim from the start and things like backspace seem to so weird things in vi.

>it takes me less time
sounds like pebcac

I use Visual Studio Code.

It's not like the regular versions of Visual Studio. It's basically a cross-platform Notepad++ with a solution explorer panel and git built in.

It tries to do Intellisense and plugins for additional language support, but just using it as a simple text editor is the best way to go IMO. The Intellisense is rather nice when it works though.

It works on Windows, OS X, and muh linux if you swing that way. Also open source.

Give it a shot, it may surprise you.

I use vim
>because of habit
>because it's pretty easy to get started (I don't have a very complicated vimrc but I can feel that it is a powerful text editor)

I didn't stick with emacs because
>it is too bloated
>I can't into their shortcut once I began with vim
>too many modifiers.
>(not a reason) some cringy chick I knew was all into emacs and I didn't want her to claim that I copied her and have some cringy flashback once in a while while editing some file.

>It's not like the regular versions of Visual Studio.

Indeed, it's Visual Studio rewritten in Javascript. I just bought a new PC so that I can run this upcoming AAA texteditors.

>it's Visual Studio rewritten in Javascript
seriously?

...

why

It's 2016.

No. It's an entirely different IDE written in JavaScript.

And since it's open source, you can go translate it to C or something if you give that much of a damn. Put it up on GitHub and do the community a service.

>And since it's open source, you can go translate it to C
Senpai, I'm good with vim.

What, don't like a challenge? Wimp.

But nah, vim's cool. I just really like Code, regardless of what language it's in. In fact, it's really easy to edit the appearance of everything since it's just a big blob of JS/HTML/CSS.

But to each their own. I don't understand why everyone on Sup Forums has to get so up in arms about differing preferences. You seem cool though fampai.

I see, so you save the [Enter] command when you use "f"..?

But what I like about "/" that you can put in a complete patter like: "/test 1/;/test" (find the first "test" after "test 1") if you want to.


You could just repeat it with ";" until you are there.

(Personally I would use "/!" for finding the next "!" and then use "n" to scroll forward..)


>The only “complicated” movement commands I think are worth bothering myself with

Look at OP's pic, it's pretty much true for Vim:
You have to learn many comments at the same time and it doesn't seem to make sense in the beginning.

When you start with Vim you are actually SLOWER than using notepad. Then you get familiar with the basic movement. Then you can somehow "keep up" with a normal editor...

[This is the point where you can complete the Vimtutor in 15 minutes]

But then you suddenly realize all the additional good stuff. Get faster and faster. Record a macro, use bash from within Vim..

For exmaple it's pretty comfy to jump into a loop and press "ci}" to rewrite this loop.

>But to each their own.
My man. Don't forget to name the Jew.

at least try

I don't think this image conveys 4KB of information.

I've been using vim for 7 years now, I'm pretty sure that's longer than ST has been relevant for.

protip: xset r rate 200 100

>protip:
Way ahead of you senpai:
xset r rate 250

>You could just repeat it with ";" until you are there.
Or I could just hold down l and get there in a shorter amount of time.

Say you are in this cursor position and you want to get to the MP_CSP_PRIM_BT_2020 near the top. What set of keys do you press where the time needed to come up with the keystrokes + execute them as necessary takes less time than it takes me to use hjkl?

(I timed it, it's about 1 second)

>But then you suddenly realize all the additional good stuff. Get faster and faster. Record a macro, use bash from within Vim..
I do these, what does this have to do with micromanaging short-range movement?

>For exmaple it's pretty comfy to jump into a loop and press "ci}" to rewrite this loop.
I do this as well. ‘c’ is probably my most used way of entering insert mode, next to ‘o’. stuff like ‘cw’ is a real time-save because it saves having to be precise with your movements. (You know, the very thing I'm generally avoiding when using hjkl)

>Say you are in this cursor position
fug

>Way ahead of you senpai:
actually try typing the command I gave you, I don't think you understand what it does

>actually try typing the command I gave you, I don't think you understand what it does
I do, senpai. 100 repeats per second is useless tho. To each his own.

Also, using bash inside vim if all you need is a terminal is stupid as fuck when you can just switch to an actual terminal.

Only time running shell commands inside vim actually helps is when using e.g. %!foo to process your buffer..

How do you write numbers 1 to 100 in vim?

Then I'm not sure why you're trying to suggest with “way ahead of you”. Your keyboard repeat rate is not only cripplingly slow (it would be faster to press the key repeatedly than wait for it to repeat...) but also has a higher waiting time before it kicks in

Either way, if you use that low keyboard repeat rate then I can actually understand why you need to micromanage movements this much. I guess it's just a non-issue for me since my keyboard repeat rate is high enough that I can just jk my way there before you've even finished reading the line number

but to each his own

>way ahead of you
Because I've already had this in my xinit for many years.

If I need to have a few identical lines with incrementing numerical constants, I'd use ^A to increment the lines as I'm pasting them. If it's more than, say, 5, I'd use a small macro (q). That's probably where my cut-off point is for “making a macro is faster than just repeating the keystrokes”.

Problem with most of the “vim tricks” is that they generally assume you're working in an empty buffer. But I'm probably working in a 1000-line .c file.

Well I'd just
:r! bash -c 'for i in $(seq 100); do echo $i; done'

But to each his own.

this is kind of a hack but,
:set nu
then type 100 I
finally highlight the the numbered margin with your mouse right-click and copy then paste.

Cool, but just one question: When's the last time you had to, while programming, insert a literal sequence of 100 incrementing integers on individual lines - not part of any source code, just raw integers?

Answer: Never, and that's where this method breaks down. Reason macros etc. are more used in reality is because you generally want to be making slight changes to those 100 lines as you go along, otherwise it's probably something you could instead just use a loop for.

Also, it's still faster for me to write seq 100 | xclip and press ‘p’ in vim than it is for you to write your silly bash -c '' and for x in $(); do; done boilerplate.

But whatever.

>Cool, but just one question: When's the last time you had to, while programming, insert a literal sequence of 100 incrementing integers on individual lines - not part of any source code, just raw integers?
Last week when I was working on exploiting a buffer overflow and had to input an easily recognizable sequence of digits to see in the memory dump where the buffer ended.

But not everyone can be this hardcore. To each his own.

>Last week when I was working on exploiting a buffer overflow and had to input an easily recognizable sequence of digits to see in the memory dump where the buffer ended.
Show me the .c source code that contained this verbatim list of 100 increasing integers on individual lines without any other code surrounding them

Of course there was code surrounding it, what nonsense are you talking?

:r! echo `seq 1 100` | sed s/' '/' \n'/g

oops, what the fuck am i doing.
i mean
:r! seq 100

HA

I just use vi since it comes pre-installed on literally everything

Good stuff. But in practice you often need more complicated stuff. E.g. in the exploit I was writing I used
:r !python -c "for i in range(1, 100): print('\\\\x{:02x}'.format(i), end='')"

archfag detected

>Say you are in this cursor position and you want to get to the MP_CSP_PRIM_BT_2020 near the top.

You see it's not an "either / or" decision. You can do both, depending on the situation..

My first reaction at your pic would be to press "20k" to jump 20 lines upwards.

I've counted it and yeah, it was pretty accurate, I just need to type "j" (one line down), "2n" (second next word) to get there.

But this was because I could see it and I'm pretty good at estimating lines. If I was lazy I could have typed:

"H" (jump to the top of the screen)
"/20" (jump to the first occurence of "20")

Don't you think this is faster?

>Don't you think this is faster?
Breaks about even for me. Typing H/20 is rather uncomfortable on the fingers, actually.

Part of that is due to the the shift-unshift-shift dance involved in that exact keystroke, though.

> "2n" (second next word) to get there

Sorry, I meant "2w".

It's like piano playing, once you are very familiar with the key strokes it difficult to explain exactly what you do..