Post #264,362
8/10/06 9:46:17 AM
|
Never "learned" vi, eh? I like him already!
vi is to editors what BASIC is to programming languages. (Yes, that is an SAT question...or should be....)
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #264,381
8/10/06 11:24:25 AM
|
Sigh
Editor flame war.
No thanks.
Tell me one that:
Runs on Solaris and Linux. Windows would be nice as well to keep it the same. Works in character mode on Linux and Solaris. Has Perl,C, and PHP syntax highlighting. Show matching braces, parens, etc. Has word completion, ie: If I type a long variable name once, I never have to type it again.
Past that, I don't care.
|
Post #264,388
8/10/06 11:46:02 AM
8/10/06 1:22:03 PM
|
Well...
Not sure about working in character mode, but there's Visual SlickEdit, for one. There's also emacs (with which I am unfamiliar, but I'm sure Peter can fill me in on it.)
And tell me how that word completion thingie works in vi. No documentation I've ever seen on vi (not that documentation is any UNIX utility's strong suit) documents that little trick.
Oh, and syntax editing highlighting doesn't exist in vi...it does exist in vim, which most Unicies have mapped to the "vi" command....
[Edit: see strikeouts]
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
Edited by jb4
Aug. 10, 2006, 01:22:03 PM EDT
|
Post #264,391
8/10/06 11:50:34 AM
|
I think auto-complete is a macro
And anyone saying "vi" today really means "vim". Don't they?
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,415
8/10/06 1:23:37 PM
|
Depends on who you ask
Around here, we still have systems with good bad ol' plain vanilla vi.
And it still sucks!
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #264,423
8/10/06 1:42:41 PM
|
So have them fix it
I was tasked with working on a Sun box that was vanilla vi. Full gvim was on it the next day.
|
Post #264,431
8/10/06 2:08:21 PM
|
Yeah...comma...right
And the IT departemnt of Large Giant Corp., whose servers are located under a pile of dust in India somewhere, is gonna listen to me?!?
Whatever you're smokin, please pass some of it over to me, 'cause it's gotta be some serious good shit!
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #264,438
8/10/06 2:16:44 PM
|
Sigh
How do you access it? Can you scp files? If so, edit locally using the scp plugin.
|
Post #264,454
8/10/06 3:47:50 PM
8/10/06 3:50:03 PM
|
I don't make large edits on these systems
When I need to do real work, I use ED4W on a Windows system (the files I need to work with are generally on ClearCase servers, so access to them is just as fast on winders as on a Linux system...and the tools are much better).
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
Edited by jb4
Aug. 10, 2006, 03:50:03 PM EDT
|
Post #264,597
8/11/06 2:23:29 PM
|
Is vim the windows version of vi?
If so, I have both.
I still like the old one best.
Brenda
"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life." -- By Geoffrey F. Abert ****************************
"Be who you are and say what you feel, because those who mind, don't matter - and those who matter, don't mind." -- By Dr. Seuss ***********************************
"Sometimes it takes a whole lot more strength to walk away than to stand there and fight." -- By the character of John Abbott: said on Young & Restless on 5/19/06 *********************************
|
Post #264,599
8/11/06 2:34:31 PM
8/11/06 2:35:10 PM
|
Nope, 'vim' is 'vi, improved'
[link|http://www.linux.com/article.pl?sid=05/08/24/145234|http://www.linux.com...d=05/08/24/145234] For a comprehensive look at the differences between vi and vim, you can enter :help differences at the vim command line.
New features include multiple windows, syntax highlighting, multiple levels of undo, and color themes. All of these improvements are made possible by the use of vim plugins. Also, if your version has scroll bars and mouse support it's actually gvim. I haven't noticed any difference between Linux and Windows versions, assuming you have permissions set up correctly. (I haven't compared vi on Linux and Windows.)
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
Edited by drewk
Aug. 11, 2006, 02:35:10 PM EDT
|
Post #264,602
8/11/06 2:42:58 PM
8/11/06 2:50:41 PM
|
I seem to have both kinds
[link|http://www.linux.com/article.pl?sid=05/08/24/145234|http://www.linux.com...d=05/08/24/145234] For a comprehensive look at the differences between vi and vim, you can enter :help differences at the vim command line.
Hmmm, I can't tell what I have from that, does the DOS version tell you what it is somewhere when you open it?
New features include multiple windows, syntax highlighting, multiple levels of undo, and color themes. All of these improvements are made possible by the use of vim plugins. Also, if your version has scroll bars and mouse support it's actually gvim. I haven't noticed any difference between Linux and Windows versions, assuming you have permissions set up correctly. (I haven't compared vi on Linux and Windows.)
I actually have two versions, I have a DOS version that runs from the Dos Shell and is used with the C prompt, and I have a version that is windows supported with mouse and scroll bars that turned out to be easier to use with some of my specific editing needs. I still like the DOS one best though. ;) Edit: The Windows one (VIM) seems to be VIM 63. I can't find what the DOS one is. Brenda
"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life." -- By Geoffrey F. Abert ****************************
"Be who you are and say what you feel, because those who mind, don't matter - and those who matter, don't mind." -- By Dr. Seuss ***********************************
"Sometimes it takes a whole lot more strength to walk away than to stand there and fight." -- By the character of John Abbott: said on Young & Restless on 5/19/06 *********************************
Edited by Nightowl
Aug. 11, 2006, 02:49:02 PM EDT
Edited by Nightowl
Aug. 11, 2006, 02:50:41 PM EDT
|
Post #264,605
8/11/06 2:55:26 PM
|
If it has multiple levels of 'undo' it's probably vim
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,606
8/11/06 3:08:10 PM
|
Hmmm I only know of one undo command.
Do you mean that I can undo more than one move, is that what multiple levels of undo is in the DOS version? I'm really curious now as to which one I have. I'll have to ask John when he gets home.
Brenda
"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life." -- By Geoffrey F. Abert ****************************
"Be who you are and say what you feel, because those who mind, don't matter - and those who matter, don't mind." -- By Dr. Seuss ***********************************
"Sometimes it takes a whole lot more strength to walk away than to stand there and fight." -- By the character of John Abbott: said on Young & Restless on 5/19/06 *********************************
|
Post #264,617
8/11/06 7:37:30 PM
|
What's the command you use to start it?
Look in the shortcut. If it's 'vi', then it's vi. If it's 'vim', then it's vim.
--\n-------------------------------------------------------------------\n* Jack Troughton jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca] [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------
|
Post #264,619
12/31/03 8:17:05 PM
8/12/06 12:08:55 PM
|
vi :)
John checked the version and here's the official name:
Xvi 2.15 Oct 24, 1992.
Brenda
Edit: I'm adding to this post in hopes that it will show up again on the right date. (crossing my claws)
"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life." -- By Geoffrey F. Abert ****************************
"Be who you are and say what you feel, because those who mind, don't matter - and those who matter, don't mind." -- By Dr. Seuss ***********************************
"Sometimes it takes a whole lot more strength to walk away than to stand there and fight." -- By the character of John Abbott: said on Young & Restless on 5/19/06 *********************************
Edited by Nightowl
Aug. 12, 2006, 12:08:55 PM EDT
|
Post #264,953
8/15/06 3:08:41 PM
|
Of course vim can be aliased to "vi"...
Glad to be of some confusion... ;-)
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #265,024
8/16/06 2:32:36 AM
|
Re: Of course vim can be aliased to "vi"...
Of course. ;)
But I have both, the real vi, and vim. ;)
Brenda
"When you take charge of your life, there is no longer need to ask permission of other people or society at large. When you ask permission, you give someone veto power over your life." -- By Geoffrey F. Abert ****************************
"Be who you are and say what you feel, because those who mind, don't matter - and those who matter, don't mind." -- By Dr. Seuss ***********************************
"Sometimes it takes a whole lot more strength to walk away than to stand there and fight." -- By the character of John Abbott: said on Young & Restless on 5/19/06 *********************************
|
Post #264,416
8/10/06 1:25:05 PM
|
Yes, I mean vim
And here is how completion works.
my $long_variable_name = 'test'; my $short = 'y'; my $lopsided = 'tilt';
if ($l^N
The ^N says go find the Next word (wrapping, also will work through all other files in the current file list) that starts with 'l' and expand it. It immediately shows long_variable_name.
If I don't want that, I hit another ^N and it replaces is with lopsided. If I don't want that, another ^N just leaves it with the 'l' since there are no more word matches.
^P will match working your way backwards.
Emacs has something like it as well.
This functionality is a HUGE win in my programming style. I started using very long descriptive variable names that I NEVER typoed, and was able to code much faster at the same time.
|
Post #264,420
8/10/06 1:35:37 PM
|
Was I right about that being a plugin?
Because that is damn useful. One more trick to add to the toolbox. (Now where was that "learning curves for common editors" graph, anyway?)
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,424
8/10/06 1:44:20 PM
|
No idea
It is simply there on every gvim I've used for the past 3 years. I certainly didn't do anything to add it.
|
Post #264,427
8/10/06 2:02:46 PM
|
Hmm, gvim vs vim
I'm pretty sure I'm always using vim, not gvim. Mostly, gvim adds mouse support and scrollbars. I like vim mostly because I don't need the mouse to be productive.
Sticking with vim allows me to open within the current terminal rather than spawning a new window, which also allows me to do neat things with screen, like detaching when I leave work and reattaching when I get home. (Okay, it used to let me do that, when I still had a Linux box on my desk.)
While looking to see if there were other differences, I found [link|http://www.linux.com/article.pl?sid=05/08/24/145234|this list of other plugins]. Looks like there's a couple of flavors of directory views available. Might work remotely, like Scott described with Emacs.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,437
8/10/06 2:15:25 PM
|
I prefer gvim
I've never gotten a color scheme on vim that I like for syntax highlighting.
And I can't really envision a time I'd need a screen session for editing purposes.
|
Post #264,456
8/10/06 3:53:36 PM
|
No law says you have to use a mouse and scroolbars
Gvim is vim. The advantage is that when you're ripping through a 10,000 line file, grabbing the scroll bar and sliding it to where the offending line is is a whole lot easier IMnsHO than Page Downing for the better part of forever. YMMV
(Yes I know...but anybody who claims that 10,000 line files don't exist has got their head stuck up a cloud...or some other orifice!)
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #264,465
8/10/06 4:59:30 PM
|
:7000<ENTER> or 7000G
|
Post #264,467
8/10/06 5:01:30 PM
|
But the day goes faster hitting Page Down 200x. ;-)
|
Post #264,471
8/10/06 5:07:21 PM
|
Assuming, of course, that you know the target line...
...is in the same screen as line 7000. Gad, you must be psychic.
(And, if you're true to your craft, that would make you a faithful psychic...)
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #264,474
8/10/06 5:20:44 PM
|
No, that's not what I was going to say
I was going to say, that if I ever find a 10k line file, I'll find the jackass who wrote it and make him fix it.
Yeah, I know it doesn't work in real life.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,477
8/10/06 5:22:32 PM
|
I've seen enough of them.
And I also know how and why they get created. I'm not excusing, just saying.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,488
8/10/06 6:20:39 PM
|
Here
wc -l /etc/termcap 14761 /etc/termcap
|
Post #264,491
8/10/06 6:34:12 PM
|
And the last time you needed to edit /etc/termcap was...?
-YendorMike
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759 Historical Review of Pennsylvania
|
Post #264,492
8/10/06 6:49:46 PM
|
About 21 years ago
I used to write termcap entries for a living.
|
Post #264,493
8/10/06 7:00:14 PM
|
YPB
|
Post #264,494
8/10/06 7:15:49 PM
|
Wasn't so bad.
I worked for a company called Telexpress. They has a terminal emulater called Teleterm. The program was table driven, and allowed you to create new terminal definitions.
A customer might buy a canned system from a vertical market vendor that included a server (Unix, Pick, Vax, etc) and some terminals. The terminal could be ANYTHING. In those days, new ones were popping up all the time. They would want to hook up their PCs (days of original PC and XT) to the system.
So they would send us a terminal and the manual. I would review the manual and create a termcap entry for the terminal if it did not exist. I would then reverse that and create the table entries that our software would use to create a new terminal.
Was a great education. I owe them a lot for it.
|
Post #264,497
8/10/06 5:05:33 PM
|
I think the term would be "pathological example"
Do you have any other examples of what you would consider decent code -- meaning something that you wouldn't re-write if given the time -- that exceed 10k lines?
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,502
8/10/06 5:08:45 PM
8/11/06 10:25:23 AM
|
Oops, time travelling on the reboot
Do you have any other examples of what you would consider decent code -- meaning something that you wouldn't re-write if given the time -- that exceed 10k lines?
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
Edited by drewk
Aug. 11, 2006, 10:25:23 AM EDT
|
Post #264,504
8/10/06 5:10:16 PM
8/11/06 10:25:48 AM
|
No, really, that's what happened
Do you have any other examples of what you would consider decent code -- meaning something that you wouldn't re-write if given the time -- that exceed 10k lines?
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
Edited by drewk
Aug. 11, 2006, 10:25:48 AM EDT
|
Post #264,522
8/11/06 3:01:08 AM
|
10K lines? Pshaw.
Allow me to gloat/whimper at the time I had to edit a 3-million-line file. I'll also slide in some VMS advocacy.
It was a (very) large DXF, and I used the VMS editor, which is cunningly called "edit" and which has that "I was written by real programmers, me" feel about it. It never crashes. It never accidentally fucks you up. The box (1GHz 21264 with 2GB RAM and "lots" of disk) didn't even blink when I went from one end of the file to the other - this is always a good test to see if the programmer really wants you to edit Very Big Files with their editor. Didn't take long to save it, either. And I got a free version. And if you "diff/par somefile.dxf" without specifying the version number it automatically assumes you mean this version against the previous version, which is of course what you wanted. And you can do the diff right there in the editor.
VMS pwnz j00. But you knew that.
Peter [link|http://www.no2id.net/|Don't Let The Terrorists Win] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes! [link|http://kevan.org/brain.cgi?pwhysall|A better terminal emulator]
|
Post #264,954
8/15/06 3:10:51 PM
|
Yes, I **did** know that.
I just didn't know what you said to mean that...
jb4 "So don't pay attention to the approval ratings that say 68% of Americans disapprove of the job this man is doing. I ask you this, does that not also logically mean that 68% approve of the job he's not doing? Think about it. I haven't." — Stephen Colbert, at the White House Correspondent's Dinner 29Apr06
|
Post #264,476
8/10/06 5:22:12 PM
|
That's what incremental search is for...
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,390
8/10/06 11:50:13 AM
|
Emacs.
Best multiple-machine environment feature:
Open a dired (directory edit: ls on steroids) remotely via scp/ssh, then edit and save the files remotely as if they were local. This works over FTP as well.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,393
8/10/06 11:54:26 AM
|
You can do that in vi, too
I wouldn't be surprised if the interface is a little clunkier though. I remember setting up a bash alias to handle the remoting part. Something like 'alias vir = 'vim -r user@host:/'. (Don't use that command, it's pseudo-bash.)
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,396
8/10/06 12:26:49 PM
|
I don't see that in the man page.
The closest thing is "--remote", which isn't the same thing at all as it requires a "vim server" (shudder) running on the remote machine.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,399
8/10/06 12:38:20 PM
|
Nope, it's a plugin
[link|http://www.vim.org/tips/tip.php?tip_id=337|The tip on it] says the plugin is installed by default, though. To me that's close enough to "default behavior" as to make no difference.
Oh, and when I said the auto-completion above was done via a macro, I meant plugin.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,401
8/10/06 12:44:37 PM
|
Looks somewhat similar
Except for the remote file browsing capability you get with dired in Emacs.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,404
8/10/06 12:55:09 PM
|
Yeah, it's not as general-purpose
That's why I set up the alias. Actually probably a quick bash script, now that I think about it. I had to already know the remote file structure for it to be useful. And if I knew that, and had SSH access, I'd just connect to the remote box and edit in vim there.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #264,408
8/10/06 12:57:19 PM
|
Right.
I like to use Emacs to browse the file structure on the web servers in DEV. Sometimes I use it to make remote mods to Javascript files for testing as well.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,397
8/10/06 12:27:34 PM
|
nano can edit files on remote machines...
just not as pretty.
But I believe its simplicity is a big plus.
Basically it is reading a file into a new buffer, using the execute command from the read-file command
But still at this point the peep needs something simple in character mode.
-- [link|mailto:greg@gregfolkert.net|greg], [link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwetheyFreedom is not FREE. Yeah, but 10s of Trillions of US Dollars? SELECT * FROM scog WHERE ethics > 0;
0 rows returned.
|
Post #264,398
8/10/06 12:32:21 PM
|
Emacs is as simple as you make it.
"emacs somefile" <use arrow, page, home, end keys to move around> Type some stuff to put it in the file. C-x C-c to save and exit (That's the one key combo you *have* to learn, and even that could be rebound to F10 or something).
If they know the bash keybindings, then they know a good portion of the basic Emacs bindings as well.
The advantage of Emacs is that it grows with the user. It's a lot simpler for people to learn than vim if they are new to both (I've verified that here with QA people coming from Notepad to a Solaris environment). The modal nature of vi/vim kills newbies every time.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #264,406
8/10/06 12:55:19 PM
|
"Modal == teh sukc" for newbies, indeedly do.
If I had to do it all over again, I'd choose emacs... everyday and twice on Sunday.
The thing is, unlearning the bad habits vi/vim have taught me over the years would be very difficult. Its like learning to live with a chronic pain, you learn to love it after a while and define your life around and with it.
-- [link|mailto:greg@gregfolkert.net|greg], [link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwetheyFreedom is not FREE. Yeah, but 10s of Trillions of US Dollars? SELECT * FROM scog WHERE ethics > 0;
0 rows returned.
|
Post #264,764
8/14/06 1:10:34 AM
|
What bad habits would they be? (new thread)
Created as new thread #264763 titled [link|/forums/render/content/show?contentid=264763|What bad habits would they be?]
"Insert crowbar. Apply force."
|