Welcome, Guest. Please login or register.

Author Topic: Intergating program into Shell - VI editor  (Read 1992 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline MelbourneBenTopic starter

  • Full Member
  • ***
  • Join Date: May 2009
  • Posts: 240
  • Country: au
  • Gender: Male
    • Show only replies by MelbourneBen
Intergating program into Shell - VI editor
« on: June 27, 2010, 04:54:56 AM »
Hi All,

Basically I want to be able to launch VIM (VI editor) from the shell like you would in unix. So for example if I have a text file I want to view I want to be able to just type vim workbench:misc/text.txt

Is there a way I can intergrate Vim into the shell for this to work?

Cheers

Ben
Amiga 500 user
 

Offline squidbass

  • Newbie
  • *
  • Join Date: Dec 2009
  • Posts: 7
    • Show only replies by squidbass
Re: Intergating program into Shell - VI editor
« Reply #1 on: June 27, 2010, 08:08:09 AM »
Hello mate,

Yes it's straightforward...if you installed Vi according to the docs you should have a VIM: assign..so you just type VIM:vim workbench:misc/text.txt in your shell. You may want to consider installing Vinced which is soups up the basic shell (e.g. ansi colors).

G'day
 

Offline Mark

  • Jr. Member
  • **
  • Join Date: Apr 2002
  • Posts: 94
    • Show only replies by Mark
Re: Intergating program into Shell - VI editor
« Reply #2 on: June 27, 2010, 09:21:29 AM »
You can always add a shell alias to the s:Shell-Startup script that will call your editor from its real path using whatever alias you choose.

So, using the VIM: assign mentioned by squidbass for example:
Code: [Select]
Alias vi vim:vim



Or by using its full path, say it's "Work:Productivity/Vim/vim"
Code: [Select]
Alias vi "Work:Productivity/vim/vim"



Now, to edit that text file, you would simply type "vi workbench:misc/text.txt" in your shell.
 

Offline DBAlex

  • Sr. Member
  • ****
  • Join Date: Aug 2005
  • Posts: 304
    • Show only replies by DBAlex
Re: Intergating program into Shell - VI editor
« Reply #3 on: June 27, 2010, 11:42:03 AM »
Quote from: Mark;567502
You can always add a shell alias to the s:Shell-Startup script that will call your editor from its real path using whatever alias you choose.

So, using the VIM: assign mentioned by squidbass for example:
Code: [Select]
Alias vi vim:vim


Or by using its full path, say it's "Work:Productivity/Vim/vim"
Code: [Select]
Alias vi "Work:Productivity/vim/vim"


Now, to edit that text file, you would simply type "vi workbench:misc/text.txt" in your shell.

Yeah I always use shell aliases... just like UNIX hehe (don't tell anyone that though)

I used to have one setup for Python too, so I can just launch Python scripts easily. Maybe I had that or the Python dir was part of where AOS looks for programs... it's PATH, can't remember how to set that though...

EDIT: I think it's something like:

path add vim:vim
Machines:
- A1200, Blizzard 1260 w/ 64MB RAM, 1.2GB HD, PCMCIA WiFi, AGA w/ RGB Adapter, OS3.9
- Pegasos I, G3 600Mhz, 512MB, Radeon 9200se, 80GB HD, AmigaKit WiFi Card, MOS 1.4.5
- Mac Mini, G4 1.5ghz, 512MB (1GB Soon), Radeon 9200 64MB, 80GB HD, OSX 10.5 (Leopard)
- PCs, Laptops... *yawn*... :D
 

Offline MelbourneBenTopic starter

  • Full Member
  • ***
  • Join Date: May 2009
  • Posts: 240
  • Country: au
  • Gender: Male
    • Show only replies by MelbourneBen
Re: Intergating program into Shell - VI editor
« Reply #4 on: June 28, 2010, 03:53:26 AM »
Thanks for your help, will give that a try. :)
Amiga 500 user