FreeBSD

Gurnox

One of Freddy's beloved
Joined
Dec 28, 2003
Messages
527
soulthief said:
Thanks for the advice Gurnox, I will do. It really is well overdue for me to partition my PC at home and get linux on it. The last distribution I installed was Red Hat 5 (proxy server at work), so it's been a while!

Jeez. It really has been a while. Modern versions have very little in common with the hell that the early ones put you through whilst trying to install. It's almost too easy in a way. :)

soultheif said:
Regarding editors, I agree with above posts. vi clearly owns, even if you need a degree in double escaping to do anything sophisticated with the substitute command. But then vi demonstrates one of the things that still makes Unix superior to Windows - the plethora of built in command line tools that enable you to do everyday tasks with ease.

Yep, Vi rocks. It's a steep learning curve, but once you get there..... Surprised nobody has come out in support of Emacs though. Surely some people must still use it?!

soultheif said:
However, I must admit to having a sneaking penchance for Windows Notepad :p Oh, and I noticed the other day that Microsoft enabled * in cd in Windows 2000 the other day - the sneaky gits!

Notepad?? Get thee behind me Satan!

There's a Windows port of Vi doing the rounds. I forget what it's called though (Probably, erm, vi?).
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
I seem to remember Shocko being an emacs fan. Haven't seen him around here though.
 

fatbusinessman

Fledgling Freddie
Joined
Dec 22, 2003
Messages
810
vim tbh :) I find it pretty easy and powerful, and that's even without having bothered to learn all the nifty tricks you can do with a couple of well-placed keystrokes.
 

Shovel

Can't get enough of FH
Joined
Dec 22, 2003
Messages
1,350
I can't get ViM to do anything. I can't even get it to fucking type.

Therefore I edit configs in NoteTab (save in UNIX format, ahem, must remember that), and SFTP them back to the router box... :p
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
You really need taught how to use vi then. What a hassle that is.

Quick Guide to Vi

arrows - Move cursor
i - insert text
a - append (starts from next box after cursor)
A - Append line (starts at end of current line)
x - delete
dd - delete line
ZZ - save changes
Escape - stop typing

:q - Quit
:q! - Quit without saving
:w blah.cfg - save as blah.cfg

Use the numbers before the command to do multiples

i.e. 17x deletes 17 characters
134 down arrow - moves you down 134 lines (great for fixing buggy code)
 

fatbusinessman

Fledgling Freddie
Joined
Dec 22, 2003
Messages
810
Will said:
You really need taught how to use vi then. What a hassle that is.
I think the existence of this says quite a lot about vi. Comes with recommendation from a hardcore Unix geek:

Linky

I'd like to see someone try that with bloody Notepad :p
 

Gurnox

One of Freddy's beloved
Joined
Dec 28, 2003
Messages
527
Shovel said:
I can't get ViM to do anything. I can't even get it to fucking type.

Therefore I edit configs in NoteTab (save in UNIX format, ahem, must remember that), and SFTP them back to the router box... :p

Quick Vi Lesson for you then:

I - Switches to 'Insert Mode' so you can type
Esc - Switches back to view mode
: while in view mode lets you issue commands (q quits, w writes, wq writes and quits e.t.c)
pressing / in view mode lets you search forward for a string
pressing ? ---- lets you search back
%s/[find regexp]/[replace string]/g = global replace

There, easy isn't it? There's loads more to it though.
 

Gurnox

One of Freddy's beloved
Joined
Dec 28, 2003
Messages
527
Will said:
You really need taught how to use vi then. What a hassle that is.

Quick Guide to Vi

[snip!]

Really should read the thread before I post :)
 

soulthief

Fledgling Freddie
Joined
Dec 24, 2003
Messages
11
My god, I've died and gone to heaven - a forum full of vi geeks :)

My top 5 all time favourite vi commands:

cw - (change word)
c$ to (change to end of line)
:.,+10w!ethel (write out this and next ten lines to file ethel)
. (redo, an elusive bugger that one though)
Oh, and of course the DEL key changes your characters from lower to upper case or vice versa - eat that one BILL!!

Really should get a multiple clipboard thing like Office XP for the yy command though :p

Anyone else got any cool vi commands - I'm not too old to learn you know!
 

Gurnox

One of Freddy's beloved
Joined
Dec 28, 2003
Messages
527
soulthief said:
My god, I've died and gone to heaven - a forum full of vi geeks :)

:clap:

Heh, could this be the end for Emacs? :)

What I like best about Vi is the way it handles regular expressions and it's interface in general. It just makes your job in general so much quicker than if you were to use another editor.

I just can not imagine a world without Vi, quite honestly.
 

moop

Fledgling Freddie
Joined
Dec 25, 2003
Messages
4
Another simple but handy Vi command that seems to have been missed out:

':<number><enter>' to jump to line <number>

great for jumping to an error from a compiler that gives a line number for each error :D
 

Gurnox

One of Freddy's beloved
Joined
Dec 28, 2003
Messages
527
xane said:

"Freely selectable background bitmap"......

Nooooo! How can it be Vi unless you're using it over a green-screened, 80-column Wyse terminal??

I tell you, kids these days........ ;)
 

TdC

Trem's hunky sex love muffin
Joined
Dec 20, 2003
Messages
30,804
soulthief said:
My god, I've died and gone to heaven - a forum full of vi geeks :)

Really should get a multiple clipboard thing like Office XP for the yy command though :p

it has that doesn't it? or was that vim?
 

xane

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,695
soulthief said:
Really should get a multiple clipboard thing like Office XP for the yy command though

You can prefix any command that sends into a buffer, i.e. y(ank), d(elete), c(hange) with quote followed by a letter, to distinguish between individual buffers.

For example:

"a20yy = yanks 20 lines into buffer a.
"ap = puts (inserts) the above buffer after the current line

You can use the designated buffer to cut and paste between files, as normally when you use the n(ext file) and e(dit) commands this will clear the default buffer.
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
Since the discussion has strayed into copy/paste, is there any way to yank text from BitchX and make it available to the shell or to vi?
 

xane

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,695
moop said:
':<number><enter>' to jump to line <number>

It's worth mentioning that vi is in fact the visual extension to the superior line editor ex, when you use the colon command you spawn an ex command line entry, as has been done in your example.

Originally you had to start ex then use the vi command to enter "visual" mode.

The ex editor was a vast improvement over the older ed editor, and incorporated the full range of regular expressions for the search and replace commands, plus lots more. You still access the substitute command (s) via the colon command from vi.

A good example:

:1,$s/\(.*\) \(.*\)/\2 \1/

swaps two columns (separated by a space).

Tsk, bloody System V n00bs, dunno what a line editor is nowdays.
 

xane

Fledgling Freddie
Joined
Dec 22, 2003
Messages
1,695
Will said:
Since the discussion has strayed into copy/paste, is there any way to yank text from BitchX and make it available to the shell or to vi?

Wouldn't you use the normal X select, cut and paste using the mouse ?

Remember in vi you need to i(nsert) or a(ppend) first :)
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
xane said:
Wouldn't you use the normal X select, cut and paste using the mouse ?

Remember in vi you need to i(nsert) or a(ppend) first :)
I don't have X running, I'm dealing with a pure console enviroment.
 

TdC

Trem's hunky sex love muffin
Joined
Dec 20, 2003
Messages
30,804
I think you have to run a console mouse daemon to get around that.
 

sibanac

Fledgling Freddie
Joined
Dec 19, 2003
Messages
824
TdC said:
I think you have to run a console mouse daemon to get around that.
he has no mouse on the box


btw TdC check NWN forum :twak:
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
TdC said:
I think you have to run a console mouse daemon to get around that.
Bah, I could do that, but I don't need the ability to copy/paste enough to bother. Its for those odd occasions when someone gives me a long complex link via IRC, which comes up about once a month.
 

TdC

Trem's hunky sex love muffin
Joined
Dec 20, 2003
Messages
30,804
Will said:
Bah, I could do that, but I don't need the ability to copy/paste enough to bother. Its for those odd occasions when someone gives me a long complex link via IRC, which comes up about once a month.


isn't there something in BX that catches links to a file?
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
TdC said:
isn't there something in BX that catches links to a file?
You say that like it has documentation.;)

I'll see what I can dig up next time I'm home.
 

sibanac

Fledgling Freddie
Joined
Dec 19, 2003
Messages
824
Will said:
You say that like it has documentation.;)

I'll see what I can dig up next time I'm home.
URL
Usage: /URL [http <on|off>] [ftp <on|off>]
  • [save <#>]
    - Enables/disable catching of http & ftp urls and can
    • or
      [save] them


      (thats actualy from the docs :p)
 

Will

/bin/su
Joined
Dec 17, 2003
Messages
5,259
sibanac said:
URL
Usage: /URL [http <on|off>] [ftp <on|off>]
  • [save <#>]
    - Enables/disable catching of http & ftp urls and can
    • or
      [save] them


      (thats actualy from the docs :p)

    • Wow, unexpected. I spend all my time using /help and /bhelp, and half the time, I get "Help is not available on that function".;)
 

lecter

Fledgling Freddie
Joined
Dec 24, 2003
Messages
69
One of the things I find useful is ":set (no)list". It displays the ctrl characters for tab etc.
Useful for formatting text files, and working out appropriate use of search/replace.

I'm one of those developers who tends to put an unneccessary amount of print statements so at every stage I can track what the program is doing. If you prefix with a unique string you comment them all out by doing this.
(perl example)
:g/UniqueString/s/^/#/
 

Users who are viewing this thread

Top Bottom