Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: MelbourneBen on June 27, 2010, 04:54:56 AM

Title: Intergating program into Shell - VI editor
Post by: MelbourneBen 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
Title: Re: Intergating program into Shell - VI editor
Post by: squidbass 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
Title: Re: Intergating program into Shell - VI editor
Post by: Mark 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.
Title: Re: Intergating program into Shell - VI editor
Post by: DBAlex 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) (http://www.amiga.org/forums/images/icons/icon11.gif)

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
Title: Re: Intergating program into Shell - VI editor
Post by: MelbourneBen on June 28, 2010, 03:53:26 AM
Thanks for your help, will give that a try. :)