9 ms·
Without starting a religious war, it's essential to learn the basics of vi for it is ubiquitous on all UNIX variants. Even if you use emacs, it's essential kno
by pointyhat 15y ago
Without starting a religious war, it's essential to learn the basics of vi for it is ubiquitous on all UNIX variants. Even if you use emacs, it's essential knowledge.
- jrockway 15y agoWhy? vi isn't even the default editor on many Linux distributions anymore.
- pointyhat 15y agoIt is on Debian and CentOS server installs and is available on a Ubuntu default install. It's the common denominator. Why frig around with emacs, pico, nano etc when vi is always there and is the same?
- rat 15y agoI'm pretty sure its vim-tiny
- pointyhat 15y agoPlease substitute "vi" in my comments for "vi or appropriate compatible substitute" such as nvi, vim, elvis etc. They all work the same with the usual subset of commands :)
- jrockway 15y agoThe Debian base system comes with both vim-tiny and nano. Nano is the default; when the installer wants you to edit something, you get nano: $ ls -l ./etc/alternatives/editor lrwxrwxrwx 1 root root 9 Sep 7 06:19 ./etc/alternatives/editor -> /bin/nano If you want to use vim for development, use vim. But "it's the default" is simply an untrue statement. Vim (-full) is no more "the default" than Emacs. Both need to be manually installed on nearly every operating system. (OpenBSD ships with both nvi and mg, FWIW.)
- darklajid 15y agoI'm serious, not trying to be an ass here: Is emacs? It seems to me that both religions are not 'standard' anymore. I tend to see pico, nano, joe etc. - occasionally vi (but not vim).
- officemonkey 15y ago"Ed is the standard text editor."
- lachenmayer 15y agoReal programmers use a magnetized needle and a steady hand.
- ez77 15y agoReference: http://xkcd.com/378/ http://xkcd.com/378/
- rbanffy 15y agoExcuse me, but real programmers use butterflies.
- arethuza 15y agoReal programmers use a hand drill. I knew a guy who actually did this - he worked for a company that maintained process control systems for "serious" customers (steel mills, nuclear power stations). One steel plant had some ancient mainframe controlling things and it originally booted from paper tape that had long since worn out in the eons since it was installed and been replaced with a sturdy leather belt. He had to patch the boot code - so hence had to resort to a handdrill to drill some new holes in the leather belt.
- pnathan 15y agoThat would be an amazingly awesome writeup.
- 15y ago
- davidw 15y agoWhile this argument might have held weight once, I think these factors undermine it: Emacs used to be considered 'expensive' in terms of disk/memory. These days, it really isn't. Non-Linux unixes are less and less of a factor these days, and even most of those have some sort of packaging system where installing emacs is a quick operation, rather than a laborious download/compile/install. Emacs itself has remote editing capabilities with Tramp, via ssh that obviates the need to fire up an editor on the target machine in some cases. If your job involves sitting down at HPUX/Irix/AIX/whatever machines that haven't been updated since 1998, and don't allow remote access, yes, vi is probably a valuable skill. Otherwise, I think this argument is less important than it once was.
- pointyhat 15y agoIf you use a default server install of debian, ubuntu or centos, it doesn't have emacs installed. The installation media and recovery CDs don't either. That is enough justification, especially when you're at a single user mode console on a ILO card when the machine won't boot and flames are coming out of everything. Vi is there for you and emacs SSH won't be saving you when the network is not up so you cant apt-get or yum emacs. It's also not the sort of time you want to start having to learn vi. I know this because I've been there. It's as important as it always was, much as pen and paper are.
- natnat 15y agoI'm pretty sure that Ubuntu, Debian, and Centos come with nano preinstalled. nano isn't nearly as powerful of an editor as emacs or vi, but it's got most of the basic features you'll need when you're just trying to get the network up and running, for instance. I'm not entirely convinced that, for an emacs user, the added power of vi over nano is worth it in the corner cases where you can't use emacs through SSH, considering how difficult an editor it is to learn.
- pointyhat 15y agoI tend to just use vi for everything. Saves worrying about switching around all the time. Consistency over context-switching is more important to me.
- dramaticus3 15y agocough ed cough though you wont find either on your fresh gentoo install
- pointyhat 15y agoNo because it'd take 9 years to compile it all ;-)
- dramaticus3 15y agoIt comes with nano. Which I found totally weird, I'm compiling the frigging kernel and I need a curses UI to edit text files !
- josteink 15y agoWhy? vi and its derivates has their own (weird) usage-convention which you will find in no other software anywhere on the planet. Learning them gives you very few transferable skills. Any "Unixy" thing you have around these days will have more resources than most computes did in the mid 90s, and the need for a "lightweight" editor like vi is much, much smaller now than it was back then. Even my Buffalo router has nano. For most Linux distros you install, you typically have nano, pico, joe, jedit or emacs or lots of other editors which (apart from emacs which is its own universe) largely follows the same conventions and at large gives transferable skills. These are IMO much more useful to know. Why should I bother learning an archaic, non-standard editor from an era when "line-editors" were considered bloated? Why should it even be considered "relevant" today? Even more so, why should it be considered "essential"? I really don't agree and I really don't see why vi-users insist everyone need to learn their favourite editor.
- sixtofour 15y ago"Why? vi and its derivates has their own (weird) usage-convention which you will find in no other software anywhere on the planet. Learning them gives you very few transferable skills." Arrgghhh! man readline, and search (/) for inputrc. ANY app that uses readline can be set to use vi OR emacs keystrokes and history, by setting an entry in .inputrc. If you use either editor regularly this will set your command line skills in lots of software all over the planet to warp speed. If you write python command line programs, try "import readline." Harumph!
- josteink 15y agoWhile I'm still not going to bother with vi, I do have to admit this is probably just another one of those not-widely-known things about "Unix" which deserves some attention. God knows I didn't know about it. Other cute things I have discovered lately: You can actually click in ncurses dialogs running in your terminal, even over SSH, if you run a proper terminal. Coming from a PuTTYish background, that is definitely not obvious ;)
- sixtofour 15y ago
- sixtofour 15y agoReply to above, and siblings. FTA: "If you learn to use Emacs, you will automatically learn the hotkeys and keybindings in hundreds of applications in Unix." His point here is not to learn Emacs because it's a good editor, but because the keystrokes transfer to "hundreds of applications in Unix." Which is true enough. In the (bash etc) shell you can change that to vi keystrokes with set -o vi, and you can change the behavior of those hundreds of applications (like mysql, e.g) by having a .inputrc file, but by default, lots of those apps use emacs keystrokes. Use whatever editor you want, for whatever reason you want. His suggestion is worth considering, for the reason he states.
- rbanffy 15y ago> His point here is not to learn Emacs because it's a good editor, Without starting a flamewar, I'd like to point out Emacs is a good editor.
- archivator 15y agoI'd especially like to point out that vi is the de facto editor in embedded Linux installs, since it comes with busybox. Unless you want to constantly shuffle files around between your machine and the embedded one, you just have to learn vi.
- chalst 15y agoed/ex is well worth learning. The other vi commands are less so, unless you prefer to use vim as your main editor. If you are a vim power user, finding yourself using traditional BSD vi is likely to be an unpleasant experience, making the vim is great because vi is installed everywhere weak as an argument.
- davidw 15y ago(From http://www.gnu.org/fun/jokes/ed.msg.html http://www.gnu.org/fun/jokes/ed.msg.html ) “Ed is the standard text editor.” Let's look at a typical novice's session with the mighty ed: golem$ ed ? help ? ? ? quit ? exit ? bye ? hello? ? eat flaming death ? ^C ? ^C ? ^D ? --- Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet prudent enough not to overwhelm the novice with verbosity.
- super_mario 15y agoNot really. VIM has vi as subset, and plain vanilla vi is still quite powerful text editor. It doesn't have a lot of bells and whistles, and I would not choose to use it as the primary editor for all tasks, but if I'm on a system where I have to edit something using plain vi, I won't have a hard time doing it and doing it fast.
- chalst 15y agoYou really don't find yourself trying to use vim extensions when you use vanilla vi?
- super_mario 15y agoNo, because I know I'm using plain vi :D. I spent a good deal of my life working with plain vi, and the company I work for makes a port of POSIX APIs, UNIX shells and all typical command line utilities for Windows, which includes vanilla vi. So I'm used to it. I use VIM with only a few extensions (taglist, command-t and snipMate). I also use ctags and cscope, but support for those is built into vim. I really try not to get too dependent on extensions. They are more like convenience rather than something you don't know how to do without. Command+T for example is useful, but you still should know how to get to your files from the command line.
- ryanklee 15y ago> Without starting a religious war Famous last words ;-)
- pointyhat 15y agoIndeed. It's almost as if Godwin is beckoning to be invoked.
- seewhat 15y agoAnecdote here... While I find myself using Emacs more that Vi/Vim these days, I still find Vi key-bindings useful in the less(1) pager, which I use extensively. I've just discovered that less responds to Emacs movements, but for searching text I rely on the vi slash. Secondly, when navigating multiple files in less, the vi/vim "next/prev file/buffer" commands (n/p) apply.
- larsberg 15y agoIndeed. As part of my PhD duties, I've been the lab tutor for the first serious UNIX/systems programming course for the last three years, and I always teach vi: ESC : q! Because you never know when some commandline tool is going to drop you into vi (I teach them about the EDITOR variable, but sometimes you ssh somewhere and, you know...), and you need to know how to get out. True story: the number one cause of issues with source code control systems is a vi session that the students accidentaly opened, managed to flee from with C-z, and didn't realize was still around with an open file holding the subversion lock and preventing them from committing their source code. I'd say I got 5-10 a quarter (~60 students in each quarter's session).
- tehjones 15y agoIts worse getting dropped into $USER_FRIENDLY_EDITOR_OF_THE_MOMENT. It's cool that the sys admin or the distro developer loves to use pico, nano, joe whatever, but I just want to make my change and move on.
- pnathan 15y agoI suggest using hg or git, neither of which have a lock.
- larsberg 15y agoThat's certainly a possibility down the road. Our tech staff has a gForge installation that has LDAP configured and all the other goop, but only supports svn. Not managing accounts, password resets, and the inevitable extra map from student id jgordon to login SassySystemsHax0r is a big win. Since it's their first time using SCC, I already have to deal with "but I just forgot to commit!" for the first two weeks. I'm a little worried that with a DVCS, I'd then also have to deal with "but I committed -- what do you mean I have to push, too? Well, can you grade against the local timestamp?" And that will happen all quarter...