304
u/ipha Feb 20 '14
Not nearly as bad as ed:
^[
?
^C
?
^X
?
:q
?
:q!
?
omgwtfbbqhax
?
^Z
zsh: suspended ed
# killall edModern distros don't actually ship the original ed. To save space they've replaced it with this script:
#!/bin/sh
while true; do
read
echo "?"
done 36
u/mpyne Feb 20 '14
7
Feb 20 '14
It reminds me of Time Cube.
10
→ More replies (1)5
u/DeductiveFallacy Feb 20 '14
OK, this might be strange, but I'm pretty sure that has been updated since I last went to that website
→ More replies (2)55
u/lengau Feb 20 '14
Modern distros that are space constrained still ship with actual ed because its binary is smaller than the shell script above.
32
Feb 20 '14
Wait, that can't actually be true.
The smallest ELF executable is 45 bytes, and it's a really dodgy version of /bin/false. A program that has the ability to do things is at least 2 KB.
→ More replies (12)12
u/oddsonicitch Feb 20 '14
Not nearly as bad as mistakenly running 'e' on an AIX system.
Once launched, the IT/PFM presents a two paned text window, with the narrower pane on the left containing a listing of the current directory (by default). The cursor is positioned at the beginning of the first filename in the listing. At this point, any typing followed by a carriage return will result in the immediate renaming of the file at the cursor and advancement of the cursor to the next filename in the list. IT/PFM does not ask for confirmation before renaming the file, nor does it provide any feedback that the renaming has occurred.
5
u/hex_m_hell Feb 20 '14
I actually love using ed. Every now and then I take it out to make really small edits, like taking a classic car to get groceries.
also, it's q
4
u/drivers9001 Feb 20 '14
Use pkill not killall. Some day you will be root on a system where killall means kill ALL processes.
0
6
3
2
2
2
3
Feb 20 '14
There's nothing worse than typing crontab -e and finding out the default EDITOR variable isn't set and defaults to ed.
Gee I love managing old ass servers.
→ More replies (4)2
→ More replies (3)1
475
u/brezzz Feb 20 '14
It's simple really.
You press esc.
Then look at the corner. WTF does that mean I don't remember it.
Fuck what mode am I in. :q!
A?
~
~
~
~
~
~
~
▲
▲ ▲
Oh god how did this get in here I am not good with computers
49
u/IICVX Feb 20 '14
It's funny, my first interaction with Vim was hitting ctrl-C and getting that message about "use :quit<enter> to quit vim".
Then :quit didn't work because I'd somehow managed to modify my buffer...
64
u/Sorten Feb 20 '14
When I use vim I sometimes hit ctrl+s for save, like a normal text editor. Except in vim, ctrl+s freezes the screen until you grab a different computer, google "why is vim frozen", and figure out that you have to press ctrl+q. Then you get to see all of the awpjifnrljkesank^Cwdjq!q!nak you typed while the screen was frozen.
16
Feb 20 '14
That's just XON and XOFF though, its just that VI(M) doesn't trap it like most console apps do these days
→ More replies (1)→ More replies (6)37
u/Gibybo Feb 20 '14 edited Feb 20 '14
TIL how to unfreeze Vim after pressing ctrl+s. I thought it just caused a crash and I had to kill/start a new one :( I've been using Vim almost exclusively for 6 years. Sigh.
EDIT: Man, one mistake with an abbreviation and it's like I killed a kitten :(
→ More replies (8)23
→ More replies (7)206
u/neofatalist Feb 20 '14
u just triforced. you must be oldfag LOL.
38
65
u/Ajenthavoc Feb 20 '14
Why did I upvote you? Somehow on any other subreddit you would have gotten downvoted for that comment despite it's satirical nature, but here... the satiricalness of it is funny.
→ More replies (1)63
u/neofatalist Feb 20 '14
other subreddits are full of teh newfags and full of cancer...
damn, I can't believe 4chan is still embedded in me even after years of not visiting. I swear.
41
→ More replies (5)5
74
Feb 20 '14
:q
49
26
u/unisyst Feb 20 '14
:q quit normally :q! force quit (if you've edited something) :x save and quit :w save and stay in39
13
3
99
u/slick8086 Feb 20 '14 edited Feb 20 '14
All joking aside, learn vi, your life will get easier.
user1:~$ sudo apt-get install vim-nox
user1:~$ vimtutorLesson 1.1: MOVING THE CURSOR
Lesson 1.2: EXITING VIM
29
u/garf12 Feb 20 '14
im guessing you are not talking to the guy who uses nano to edit a firewall rule or make changes to .htaccess a few times a month at most.
27
u/slick8086 Feb 20 '14
definitely, vi was designed to use the most minimal set of keys on a keyboard.
If you ever have to log in to something remotely with a funky terminal, knowing the basics of vi will let you do things.
And for the regular times of editing a firewall rule it can be just as fast. Once you understand the reason why vi works like it does, it isn't all that hard to figure out or remember.
7
Feb 20 '14
It's amazing how the guy who first designed it did it when you think about it. On the surface it doesn't look intuitive at all but when you really get into it your text editing gets much faster and accurate. You can also dive as deep into is as you like and it will still beat your previous text editor in performance/efficiency/speed.
5
u/redwall_hp Feb 20 '14
I imagine it was designed by someone using a slow terminal to a timeshare mainframe. Moving the cursor quickly and accurately would make the latency a lot less irritating.
10
u/redwall_hp Feb 20 '14
Vim can jump directly to the end of a long server config. That alone makes it worth learning over nano.
→ More replies (1)14
2
u/schoscho Feb 20 '14
exactly that. i use nano when i want to do some quick editing in a remote shell. for nano, i do not have to learn anything.
for more sophisticated editing i open the file via sshfs or similar in gedit. also - vim is not so great in non-english keyboard layouts.
5
u/iFreilicht Feb 20 '14
as a happy joe user, what does vim offer?
26
5
u/nevinera Feb 20 '14
Operational efficiency.
Fewer operations to make a given set of changes to a file, and composing powerful commands of individual operations makes on-the-fly macro creation and usage very effective.
And a huge plugin ecosystem of course.
3
u/slick8086 Feb 20 '14 edited Feb 20 '14
let's say you want to delete a word, how would you do it in joe?
there are lots of way in both I'm sure but in vi you can move your cursor to the first letter of the word and hit "dw" (delete word) want to delete the next 3 words? "3dw" want to delete from the cursor to the end of the line? "d$"
I think the thing is that vi uses the same "language" as the bash shell sort of. The things you learn in vi can often be applied to things like grep and sed. It is a lot like learning regular expressions. It seems really complicated, but once you get semi proficient it is like knowing magic.
One thing is that there are very few simultaneous key presses, most everything is key sequences.
→ More replies (1)2
Feb 21 '14
Never used joe (first I've ever heard of it actually). For me, vim's strength is the combination of a rich set of plugins, completely terminal-based, and with a control scheme that won't give me carpal tunnel (unlike emacs).
→ More replies (5)0
Feb 20 '14
[deleted]
3
u/iFreilicht Feb 20 '14
Yeah I used nano when starting with the command line, but joe can pretty much do everything you just said, plus macros and additional stuff I don't ever use.
I guess I'm not geeky enough to understand your joke :(2
Feb 20 '14 edited Feb 20 '14
raises hand Can someone just explain to me how I can change my configuration in vim so I have tab output 2 spaces when editing only py files?
edit: 4 spaces, I reread the PEP guide my bad.
7
u/Vibster Feb 20 '14 edited Feb 20 '14
File type plugins.
put a file called
python.vimin~/.vim/ftplugin/
Put the following inpython.vimset smartindent set tabstop=2 set shiftwidth=2 set expandtabThe settings in
python.vimwill only effect python files and nothing else. So you can have tab mean tab normally but in python files tab will be 2 spaces.But if you care about PEP8 you should use 4 spaces.
→ More replies (3)3
2
u/HX50 Feb 20 '14
This... I fought leaving sublime forever... now I live in tmux/vim world and find it to be MUCH easier than my heathen ways
1
1
u/youRFate Feb 20 '14
I use emacs as my main editor and nano when I ssh into things that don't have emacs, I'm pretty happy with it.
1
0
15
u/bateller Feb 20 '14
My process... 'Esc' 'Esc' 'Esc' ':q!' (I'm obsessive about making sure I'm out of insert mode because of some bad oops edits over the years)
Oddly enough I don't use shift-ZZ ever either... always ':wq!'
→ More replies (1)1
21
13
47
u/WordCloudBot2 Feb 20 '14
0
6
11
16
u/m3ckano Feb 20 '14
2
9
18
Feb 20 '14
I'd like to know why the fuck vim doesn't ignore all characters after :q!
Who the fuck cares if there are extra characters! The quit string is there! Fucking quit!
I am a 4 year vim user and it still angers me.
0
Feb 20 '14
[deleted]
→ More replies (1)24
u/Perkelton Feb 20 '14
There is something funny about rage quitting being a factor in a text editor.
3
33
u/fenrirGrey Feb 20 '14
True story. Psst: Try emacs
72
u/wmil Feb 20 '14
At least VIM docs tell you how to quit using keys you actually have on your keyboard instead of insisting that the 'Meta' key will be making a come back any day.
→ More replies (4)7
u/not-brodie Feb 20 '14
what commands require the meta key? i've been using emacs for over a year and never had to use any command with a meta key
30
u/wmil Feb 20 '14
It looks like they finally gave up in 2008, but all of the official Emacs docs used to call the Alt key Meta. And short cuts were listed like "M-x M-c".
The meta key was only on a few terminal systems in the 70s.
→ More replies (1)6
11
u/tekknolagi Feb 20 '14
M-x shell,M-x gnus, etc
M-x compileis my main one5
u/not-brodie Feb 20 '14
it may start with m, but it still uses the alt key, so it's just semantics at this point
→ More replies (3)42
11
Feb 20 '14
I would need at least 3 more hands to use emacs properly.
3
u/senatorpjt Feb 20 '14 edited Dec 18 '24
cover payment afterthought shocking light lock repeat door disgusted entertain
This post was mass deleted and anonymized with Redact
→ More replies (1)2
3
3
u/JamMythOffender Feb 20 '14
I'm surprised I have not seen this here yet (or maybe I missed it):
→ More replies (1)2
u/kevstev Feb 20 '14
You know, what got me hooked on Emacs over Vim is pretty much what op talked about. In a text editor, I thought it was fairly important that when you open one up, you should just be able to start typing and getting on with your day. Similarly, while learning how to exit emacs was not exactly intuitive, I found it far easier than figuring out how to exit VIM.
Later, I found that kind of remembering things in emacs was far more useful than kind of remembering things in vim. A little fumbling around I can figure out that highlight line mode is hl-line-mode, while equivalent fumbling in VIM can potentially launch nuclear strikes.
2
u/lookatmetype Feb 20 '14
Wait you mean the text editor that gives you carpal tunnel?
→ More replies (3)→ More replies (3)1
3
5
5
4
4
5
u/DanParts Feb 20 '14
I too get stuck in vim all the time. I always have to ask one of the better nerds around how to get out of it.
38
u/drwtsn32 Feb 20 '14
Answer: open another terminal window and type "killall vim"
→ More replies (2)14
5
2
u/zoolex Feb 20 '14
Happened with me first time I used Linux. Had to power-cycle the computer to get rid of vim. :(
2
u/chickmagnet3 Feb 20 '14
Tried vim. didnt like it went back to the one thing i know, good old nano!
2
u/losthalo7 Feb 21 '14
If your machine and your editor session are still running after two years, what else does one need? ;-)
4
4
u/Crosshack Feb 20 '14
Can someone explain what Vim is?
0
Feb 20 '14
[deleted]
3
3
u/youRFate Feb 20 '14
vim and emacs are probably still the most used editors of professional programmers.
→ More replies (11)2
u/terevos2 Feb 20 '14
Since it is all keyboard based, it is also very confusing to use for people new to it.
It is keyboard based, but that's not why it's confusing to use for people new to it. There are plenty of easy to use text editors that are completely keyboard based.
3
Feb 20 '14
I've been using VI(M) for longer than I can remember.. something silly like ten years (!).. yes I was 8 when I started using GNU/Linux on an old Pentium 3 machine - it's been my editor of choice since, as hitting control+something combos is a pain in the arse (I'm looking at you, emacs!)
3
u/terevos2 Feb 20 '14
I have been using vi and emacs longer than you have been alive.
EDIT: I'm not old!!! Stop saying that!
1
2
u/strikerJAG Feb 20 '14
Can someone explain this to me? Guess im not geeky enough
3
u/fizzl Feb 20 '14
Open a console (you are using Linux, right?). Type 'vi'. Try to figure out how to exit the program using your keyboard.
→ More replies (9)
2
2
u/youlleatitandlikeit Feb 20 '14
First and only thing I learned to do in vim.
:q!
$ export EDITOR="nano -w"2
u/mcspdx Feb 20 '14
As a long-time Vim user I take serious offense to this thread. Now, if you'll excuse me I need to figure out how to save my work and exit...
(hours later) FFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCK!
→ More replies (1)
2
Feb 20 '14
shift+zz
Its called reading the documentation, and also how I know which "developers" to weed out as bad.
1
u/brim4brim Feb 20 '14
You just need to install vim tutorial and go through it a few times. I started using gvim on Windows so I don't get rusty.
1
1
u/HX50 Feb 20 '14
http://nathanmlong.com/writing/vanquish/ here's one of the best vim intros I've ever encountered...
1
u/Suppafly Feb 20 '14
People that have never tried to use VIM might think this is a joke. Let me clear this up right now, it's not. VIM is a great program but even using a cheat sheet, it's pretty easy to get stuck in the program.
1
1
1
u/buba1243 Feb 20 '14
ctrl + d should exit like almost all other Linux programs. Why won't vim add that. Should be a default key combo for all terminal apps.
1
u/fani Feb 20 '14
About 18 years ago, I first encountered vi when programming and doing other stuff.
It was a toss up between vi or emacs. After 15 mins of playing with emacs and vi, I said, emacs is for people who like Windows and vi is for people who like Unix.
And it was hard initially. It took something like printing out the vi best commands and constantly referencing it for at least a couple of hours. Then it all came naturally like how someone plays the piano effortlessly smiling at the crowd, not even looking at the keyboard.
That is how vi/vim are to me today. I use it everywhere now. Even on my phone!!
1
u/peruytu Feb 20 '14
I tried learning it and it was a complete failure. Looking back in hindsight I wasn't really prepared for something as advanced as that... I went from installing my first distribution of Linux to trying to learn that right away. I should have started with baby steps. But I gave up too early.
1
u/spyderman4g63 Feb 20 '14
The very basics you need in VI are:
:i - insert
:w - write/save
:q - quit
:q! - quit without saving
:wq - write and quit
It's way more powerful than that but if all you ever do is edit a config file now and then this should be enough.
3
1
1
1
u/-wizard- Feb 20 '14
Personally I don't understand why you'd want to use vim? Vim ignores headers etc and doesn't show the true content, only pre-processed.
I've been using vi (not vim) for 25+ years and I'm in full control. I even code in vi and it is my favourite editor - not to mention the fastest!
1
u/neokrisys Feb 20 '14
First time I managed to install linux as a teenager I had to turn off the computer to exit vi ...
LOL
1
u/Werner__Herzog Feb 20 '14
I have the same issue with irssi, I use it once a month. And I never know the command to leave the channel, so I end up just closing the terminal.
1
1
u/oooqqq Feb 21 '14
+/u/fedoratips 100 tips
1
u/fedoratips Feb 21 '14
__[Verified]__: /u/oooqqq → /u/benmarvin TIPS 100.000000 ^Fedoracoin(s) [help]
1
1
u/DukeMikeofG Feb 20 '14
escape colon queue. Wheres the confusion? Please don't tell me you guys are all using pico/nano/emacs -.-
8
4
u/Stingray88 Feb 20 '14
I don't have a reason not to use pico/nano. Everything I do in terminal is pretty basic.
1
1
1
-1
175
u/phordee Feb 20 '14
I get laughed at for using nano but at least I can exit the damn thing.