Installing gForth on the Raspberry Pi

I was working with some folks who run Linux in their network boxes. I couldn't do anything without specific instructions because they are so used to the command line editor. They would do stuff and it would be in a "mode" where I couldn't type and didn't know to hit esc to get out. lol I think he said it was like vi. You point may be very valid.

Thanks, I'll take a look at that.

--

Rick
Reply to
rickman
Loading thread data ...

Yes, sorry, was meant more as a general directive: "How to look for xyz in available software packages." To show more info for a specific package, use "apt-cache show xyz" (for a package named xyz).

Before you install anything, make sure to run "sudo apt-get update" to download the latest package info & dependencies etc., then install with "sudo apt-get install xyz".

See also "man apt-get". It's the standard Debian package manager. Raspbian is Debian for the Raspberry Pi. (Ubuntu is also based on Debian.)

Reply to
A. Dumas

Sure. It helps to learn one sequence by heart: :q! This is a sure way to leave vi whatever state it is in. Start with the habit to move around by hjkl. vi was never my first choice but it is an unfailing backup.

There may be an other reason, at least for early rPi, like I have one. Some keyboards may have intermittent failures because the current available is really low. (So much for: "I've usb keyboards lying around") And the usb driver sucks, such that it misses characters, especially annoying while typing passwords.

(It has been mentioned, the blackbeards feel more solid.)

Groetjes Albert

--
Albert van der Horst, UTRECHT,THE NETHERLANDS 
Economic growth -- being exponential -- ultimately falters. 
 Click to see the full signature
Reply to
Albert van der Horst

Raspbian installs vi as part of the standard installation and vim is also available. vim definitely offers syntax colouring regardless of whether its being run as in an xterm console or as a GUI application and later versions of vi do the same. Both leave it off by default but it can ve enabled globally by editing /etc/virc (for vi) or /etc/vimrc (for vim) or you can control it locally from within vi/vim by typing the colon command ":syntax on".

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

vi isn't installed, it's vim. vi is merely a symlink via the "alternatives" system to vim.

A possibly somewhat pendantic point though.

I don't think there is a Debian (Raspbian) pacakge of the original vi though (BICBW)

Gordon (vi/vim user of 25+ years)

Reply to
Gordon Henderson

If you're going to be pedantic, at least get the spelling right :)

(signed) A Pedant.

Reply to
Tony van der Hoff

I'm dyslexic and don't give a toss. It still looks right to me.

Gordon

Reply to
Gordon Henderson

Geany is nice Lightweight, runs on the PI & is available for windows (it is a gui app but X-tunneling via SSH works well without needingto have a GUI desktop on the PI)

--
It's amazing how nice people are to you when they know you're going away. 
		-- Michael Arlen
Reply to
alister

Thats certainly the case on my Fedora boxes, but this RPi is a bit different.

When I tried the colon command :syntax on earlier today I got "E319: Sorry, the command is not available in this version" and which told me that vi was /usr/bin/vi and that vim didn't exist,

so I installed vim and now which told me that both /usr/bin/vi and /usr/ bin/vim existed. Of course vim accepted the syntax colouring colouring command and I didn't bother to try vi

Now I did an apt-get dist-upgrade, since I'd thought it was about time I did one, which pulled down a shedload of packages.

After this, both vi and vim accepted syntax colouring.

I've just had a closer look and found, after chasing round the usual alternatives symlinks, that both vi and vim are now synonyms for /usr/bin/ vim.basic, which is a 1.5MB executable.

However, there's also another file, /usr/bin/vim.tiny, a 648 KB executable and this, when run explicitly also raises the E319 error when asked to turn on syntax colouring. Both vim.basic and vim.tiny share the same date: Feb 20 2013.

I think that my original Raspbian install only installed vim.tiny, calling it /usr/bin/vi via the alternatives system. This explains why I saw the E319 error this morning. I also think that the dist-upgrade readjusted alternatives so that now vi and vim are synonyms for vim.basic and so both do syntax colouring. Does this sound like a reasonable explanation of what I've seen during the day?

Its possible that its now been rejigged to produce the vim.tiny executable. Of course, its equally possible that the vim sources compile into both vim.basic and vim.tiny - that would explain them having identical datestamps.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

It's a Debian thing rather than being Raspian specific - you get vim.tiny by default and have to explicitly install the full vim.

Gordon

Reply to
Gordon Henderson

nvi is about the closest you'll get to the original vi on Debian based systems.

"Nvi is intended as a "bug-for-bug compatible" clone of the original BSD vi editor. As such, it doesn't have a lot of snazzy features as do some of the other vi clones such as elvis and vim. However, if all you want is vi, this is the one to get."

Reply to
Dom

Thanks: I'll remember that.

My other boxes run Fedora. Its default is to install vim and arrange links so both vi and vim execute vim.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Thanks. I normally use microEmacs and have done so from before Linux existed: it was the standard editor for Microware's OS/9, and *that* OS predates MS-DOS. However, knowing how to use vi has saved my bacon more than once in the past.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

Yes, thank you. Someone already explained the update thing. I assume that once I run update I don't need to run it again for a few days. It's not like this stuff gets updated every week or more often, no?

--

Rick
Reply to
rickman

I use this script:

==================== start of rpi_update ======================= #!/bin/bash if [ "$1" == '-?' ] then echo "Syntax: rpi_update" echo "Function: Runs apt_get update and apt_get upgrade" echo "Options: none" exit 1 fi

apt-get update if [ $? -ne 0 ] then echo "apt-get update failed: apt-get upgrade not run" else apt-get dist-upgrade fi ==================== end of rpi_update =======================

and run it weekly immediately after backing up the RPi.

You'll notice that I recently replaced the second (upgrade) run with a dist-upgrade run. A straight upgrade assumes that the names of all packages haven't change and so it just looks for and installs any later packages with exactly the same name as those already on my system. IOW, but just running upgrades you're assuming that the names never change but this ain't so: from time to time package contents get revised as a huge package gets split or package maintainers realise that two small packages are always installed together, so may as well be combined. this ids where dist-upgrade comes in: it spots this sort of package revision and fetches and installs any new packages that may be needed while discarding any that are no longer needed. I've made the change because I decided that, while dist-upgrade may take a little longer to run, I'd rather track packaging changes as they happen.

HTH

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

If you use the Raspbian desktop, rather than connecting remotely, then I suggest that the first thing that you install is the GUI package manager:

synaptic

You'll find that easier to use than apt-get.

Reply to
Dave Farrance

There are easier, and possibly cheaper ways of doing that with COTS kit, such as fitting a Lantronix Xport or a DS203 to each of the devices you want to connect to your LAN :

formatting link

formatting link

Cheaper, because there's no programming and no messing round with handling multiple RS232 ports on a common server shared between several devices wanting network access: connect one end of the module to the UART in the thing you want to talk to, plug your LAN into its RJ45 socket and configure it. I said LAN because I wouldn't connect anything like this without making sure there is a firewall between it and the Internet: AFAICT, while most of these devices support telnet connections, none support SSH or any other encrypted protocol.

--
martin@   | Martin Gregorie 
gregorie. | Essex, UK 
 Click to see the full signature
Reply to
Martin Gregorie

vi is horrible. It's like one of those early 20th century electric tools with no safety features whatsoever, so you couldn't just pick it up and use it, you had to learn how to not electrocute yourself first.

There are some other command line editors about that aren't quite so bloody: 'nano' usually ships with most Linux distros. It actually has an on-screen prompt that tells you what the keypresses are. So you can edit a file without having to learn anything.

nano is a bit limiting, but enough to get by. For more serious editing I prefer 'joe', which again has an on-screen help bar, but has lots more editing features than nano. joe usually has to be installed with the package manager.

emacs might come in handy here too, except its keypresses are more arcane and it's harder to find them out in the program.

(eg I start emacs, it tells me to press Ctrl-h for help, I do that, says press ? for more, then splits the screen and shows me a list of help topics including 'b' for key bindings, press that and a list of keystrokes come up in the bottom split of the screen. But the input focus is in the window in the top half of the screen, and the key bindings that I can see don't tell me how to switch focus to get to the key bindings list to scroll them. So the help isn't actually helpful at all)

For some of these tools, discoverability is a complete disaster.

Theo

Reply to
Theo Markettos

While I prefer EDIT, on MS-DOS, or a very similar editor, Leafpad, on Linux, you only need to know 6 VI commands and 3 EX/ED commands to use VI very effectively. If you use GREP, you probably already familiar the regular expressions that VI uses. One of the areas where VI excels, due to the EX/ED commands, is matching many lines on a line-by-line basis from a command instead of visually editing, although it has a visual editing mode too, at least on Linux nowadays. The line-by-line ability makes VI excellent for processing lists or word dictionaries or DNS names or Usenet groups list or C program output or system logs, etc. The other area where VI excels is that good ports of it are available on nearly every platform, even including DOS. It's probably worth learning just for that.

Rod Pemberton

Reply to
Rod Pemberton

vi, or more likely these days Vim, is very powerful but you don't need to learn much to use it for basic editing. It's worth spending a few minutes with it, because it's the editor most likely to be installed on any UNIX-like machine. GVim can also be useful in the GUI - you can point-and-click if you want to avoid using the keyboard commands, and it works well with large or binary files.

Reply to
Rob Morley

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.