vim and FORTH-"IDE"-ish environment

202 views
Skip to first unread message

tu...@posteo.de

unread,
May 29, 2018, 12:24:12 PM5/29/18
to vim...@googlegroups.com
Hi,

(I am on Linux.)

just for fun, entertainment and doing something new, I installed
Mecrisp-Stellaris FORTH on a STM32F103C8T6 ( aka "Blue Pill" )
micorcontroller board.

FORTH is interactive (has a REPL) and is a interpretive
(interpretative?) and compiler language at the same time.

For ceating new compiled code on the microcontroller is
as easy as cat-ting the sourcecode this way:

cat sourcecode.fs > /dev/ttyACM0

Now you can execute your program via the prompt you get
with a serial terminal which is connected via /dev/ttyACM0.

But what has all this to do with vim?

I want to write code in FORTH with vim (what else? ;), send
the code to the microcontroller and - if possible - want to
replace the extern console of the serial terminal with something
inside vim. I not neccessarily want to avoid the serial terminal --
I want to avoid the "external"...the switching between windows.

I found some rudimentary attempts of something like that (still
in need of an external something), which call 'cat' to transfer
the code to the microprocessor.
But those posts are from a long time ago.

Since vim got tasks and pipes and subprocesses I would like to ask
for some keywords or pointers to start with to acchieve what I have
described above.

Where should I start while trying to read the wheel a second time...?
:)

Thank you very much in advance for any help!
Cheers!
Meino


Jason Felice

unread,
May 29, 2018, 12:39:52 PM5/29/18
to vim...@googlegroups.com
In Vim, it should be as easy as `:w /dev/ttyACM0`, and you could map something like so: `nmap <F12> :w /dev/ttyACM0<CR>`.



--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

tu...@posteo.de

unread,
May 29, 2018, 12:42:10 PM5/29/18
to vim...@googlegroups.com
Hi Jason,

thanks a lot. That's really neat! :)

What's about the other way around: How can get something
like the serial terminal inside vim?

Thanks a lot in advance!
Cheers!
Meino
> > email to vim_use+u...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.

David Woodfall

unread,
May 29, 2018, 1:08:09 PM5/29/18
to vim...@googlegroups.com
In-Reply-To: <20180529164204.r47eyb6yepa2n3j2@solfire>

On Tuesday 29 May 2018 18:42,
tu...@posteo.de <tu...@posteo.de> put forth the proposition:
> Hi Jason,
>
> thanks a lot. That's really neat! :)
>
> What's about the other way around: How can get something
> like the serial terminal inside vim?

In vim 8.1 there's the terminal plugin.

See :help terminal and :help terminal<tab> will bring a list of other
help files on aspects.

--

Only wimps use tape backup: _real_ men just upload their important stuff
on ftp, and let the rest of the world mirror it ;)
-- Linus Torvalds, about his failing hard drive on linux.cs.helsinki.fi

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

tu...@posteo.de

unread,
May 29, 2018, 1:14:52 PM5/29/18
to vim...@googlegroups.com

Hi David,

OH! AH! YEAH!
I didn't exspect it would be THAT easy...
That's very nice!
Thanks a lot!
Cheers
Meino

David Woodfall

unread,
May 29, 2018, 1:19:22 PM5/29/18
to vim...@googlegroups.com
On Tuesday 29 May 2018 19:14,
tu...@posteo.de <tu...@posteo.de> put forth the proposition:
>
> Hi David,
>
> OH! AH! YEAH!
> I didn't exspect it would be THAT easy...
> That's very nice!
> Thanks a lot!
> Cheers
> Meino
>

Alternatively, if you use screen you can make a vsplit window and
have vim on one side and the terminal on the other.

--

Microsoft Corp., concerned by the growing popularity of the free 32-bit
operating system for Intel systems, Linux, has employed a number of top
programmers from the underground world of virus development. Bill Gates stated
yesterday: "World domination, fast -- it's either us or Linus". Mr. Torvalds
was unavailable for comment ...
-- Robert Manners, r...@swift.eng.ox.ac.uk, in comp.os.linux.setup

.--. oo
(____)//
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

tu...@posteo.de

unread,
May 29, 2018, 1:23:28 PM5/29/18
to vim...@googlegroups.com
On 05/29 06:19, David Woodfall wrote:
> On Tuesday 29 May 2018 19:14,
> tu...@posteo.de <tu...@posteo.de> put forth the proposition:
> >
> > Hi David,
> >
> > OH! AH! YEAH!
> > I didn't exspect it would be THAT easy...
> > That's very nice!
> > Thanks a lot!
> > Cheers
> > Meino
> >
>
> Alternatively, if you use screen you can make a vsplit window and
> have vim on one side and the terminal on the other.
>

Thanks a lot for the hint, David.

I tried Mecrisp-Stellaris FORTH in conjunction with screen in
another context and it does not work that well...staircase effect...

Cheers!
Meino

: doubler over over ( n m -- n m n m )

:)



> --
>
> Microsoft Corp., concerned by the growing popularity of the free 32-bit
> operating system for Intel systems, Linux, has employed a number of top
> programmers from the underground world of virus development. Bill Gates stated
> yesterday: "World domination, fast -- it's either us or Linus". Mr. Torvalds
> was unavailable for comment ...
> -- Robert Manners, r...@swift.eng.ox.ac.uk, in comp.os.linux.setup
>
> .--. oo
> (____)//
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
>

tu...@posteo.de

unread,
May 29, 2018, 1:40:49 PM5/29/18
to vim...@googlegroups.com

Hi,

one problem with the terminal emulation...
I am running picocom to connect to the
FORTH sustem.
picocom can be instructed by C-A C-<someting>
key sequences similiar to screen.
These sequences are not passed through.

I skimmed through the help but didn't find
anything which seems to be linked to this.
Any idea?

Cheers
Meino
Reply all
Reply to author
Forward
0 new messages