4 ms·
"... similar to the command line mode ... Unlike the command-line mode you won't return to normal mode automatically ... enter ... by typing a Q in normal mode"
by k__ 12y ago
"... similar to the command line mode ... Unlike the command-line mode you won't return to normal mode automatically ... enter ... by typing a Q in normal mode"
So they have a mode you enter when pressing q (which quits many other programs) that you can't leave if you don't know the leave command?
This is comedy gold. :D
- icebraining 12y agoIt was in fact the original mode. vi was the visual mode for ex.
- seszett 12y agoNot "q", but "Q". Actually, when entering Ex mode you get a little helpful message that says Type "visual" to go to Normal mode. If you do press "q" though, you're in macro mode, and you don't get any helpful message that tells you that you have to press "q" another time to exit it.
- k__ 12y agoI see, thanks for the clarification :) Vim always seems like magic to me. I always use nano/pico when I need to edit something in the command line.
- cwyers 12y agoYeah, I remember when I was first learning Linux, I was pretty much thrown into the deep end with nobody to help me much. I got into vim to edit a text file, and was... completely lost at sea. I figured out how to install nano and have never touched another Linux text editor since.
- sejje 12y agoVim is a programmer's dream. If my only use were editing files in CLI, though, I'd have always used nano and not learned vim, as well.
- chongli 12y agovi is a sysadmin's dream. I use it for editing any and all files on myriad remote machines. I especially love the ! command which lets me pipe parts of a buffer through shell commands such as column.
- k__ 12y agoI thought IDEs were a programmer's dream :D
- rspeer 12y agoIDEs are a programmer's depressing reality.
- dllthomas 12y agoIt seems like "perform a bunch of pretty similar changes across most lines of a file with a couple hundred lines" is the kind of thing that shows up far more regularly for sysadmins than for programmers, and it's something where vim shines. The last time I worked somewhere with someone in an explicit "sysadmin" role, they were regularly bugging me for vim tips (not that I minded).
- drostie 12y agoI'll tell you the dinky stupid reason why I started using vim over nano: I like my shells to have white backgrounds. I don't know why, but it's just restful to my eyes. Nano's default syntax highlighting on bash scripts is to highlight strings in bright yellow, which on a black backdrop makes sense, but on white is impossible to read. It took years of working with shell scripts, and a familiar litany of "I'll just look up how to change this... [one hour later] I have no idea, let's just change my Konsole background to black for a little while..." before one day I was like, "Dammit, I just need to change this one little thing over here" and typed vi instead, thinking that it was so simple that surely it'd have no highlighting. But it did have highlighting, and it was highlighting which wasn't bonkers like nano's was. I had struggled with vi a lot before. I did not like it. Still don't. The thing is, they could probably have won me over a million years earlier by starting me off at insert mode on the first line! It is modal, and I don't even like the modality of my cruise control system on my car, let alone the modal nature of vi -- but at least a text editor should dump a beginner in the mode which, y'know, edits text. I'm only just getting used to hjkl keys, and only then because of nethack. I don't know enough to make super expert use of vim. But, all that aside, it won because it didn't force me to squint at yellow-on-white text every time I was SSH'ed into a system which needed me to edit string-laden syntax-highlighted files.
- k__ 12y agoI always used IDEs when I wanted highlighting. Used nano just for some small changes when using SSH.
- dllthomas 12y ago"The thing is, they could probably have won me over a million years earlier by starting me off at insert mode on the first line!" I wouldn't like "open in insert mode" at all - if I'm opening an existing file, I probably want to edit it, not just add text (especially not at the beginning) - which means the first thing I'm probably wanting to do is navigate, which is much easier done in command mode. When opening a new file, there's a better argument for starting in insert mode, but even then I'm likely to want to populate the buffer with the output of some command. Of course, hitting escape first isn't disastrous - but neither is hitting i before you type. All of that said, my defaults don't need to be your defaults! Add startinsert to your vimrc to get the behavior you want: echo startinsert >>~/.vimrc
- dllthomas 12y agoTo be clear, it's q at the : prompt to quit vim, whether in visual mode or ex mode. It's Q in normal mode to enter ex mode (or you can start that way with -E).
- djm_ 12y ago>you can't leave if you don't know the leave command? Hah, for many that is Vim itself!
- goldfeld 12y agoAs much as vim is known as the modal editor, that sounds like you're describing Emacs (I'm using evil-mode instead of vim these days.) Whereas vim has dual-modality as its core, it's very well-defined and self-contained as far as modes go, and with the exception of this Ex mode, you can get out of any weird state by pressing Esc. Emacs, on the other hand, has potentially dozens of different 'modes' you can accidentally find yourself in, and each one seeming to have a different way of getting out, it drives me insane! Even a question in Emacs which can only be answered by typing out 'yes' or 'no', and by no other frigging escape sequence, is a mode come from hell. Worse yet, press Esc and Emacs goes into the mode of a mode where it briefly becomes unresponsive as it lets you know that you are WRONG. Vim to me is like having a smooth technical conversation with a work partner. Emacs is like conversing with my partially deaf grandpa.
- thegeomaster 12y agoI'm interested to hear why you're using evil-mode instead of vim if that's how you feel. I'm using vim with slimv for Lisp hacking at the moment and I have to admit that there are some whoopsies, but not enough to make me learn to use a whole new editor :)
- goldfeld 12y agoWell, rant and occasional surprise aside, I've found evil-mode to truly be a better implementation of vi than vim itself, at least where it concerns me (as formerly a pretty advanced vim user and plugin developer, it took me some adapting to stop using all the ex vim idioms and the like.) It's faster to handle big files and execute macros, overall snappier and has a profoundly better %s///g with real time preview. I really did start using Emacs when I started learning Clojure(/Script), though, and made it my main language and platform investment. And org-mode had been playing a part in my want of switching for a while, building up for years. I also told myself it'd be better to hack in a lisp but Elisp is so fucked up I still haven't mustered up the courage to properly learn all its old and unexpressive idiosyncracies (god, even creating a closure requires explicit verbosity!) Meanwhile I don't think I can bear VimScript anymore--since getting into Clojure my language standards have gone considerably up. As a result I do the odd hack but haven't developed more powerful plugins in a while, not in elisp nor vimscript; I'm in a psychological limbo there. Kinda hoping Guile-Emacs takes off so I can do stuff in scheme.