Open bshepherdson opened 9 years ago
I would love to have what you are proposing. Right now I'm using this suboptimal folding comment in my forth source files: \ vim:set filetype=forth foldmarker=\:,; foldmethod=marker :
What do others use when writing Forth?
Emacs. But not with the forth.el
that's floating around online. I started writing my own forth-mode
, but I don't feel any great need for editor support.
I use vim whenever I can, in other words when it's not arrayForth or polyFORTH. I wasn't even aware of this YCM thing and I've never used code folding either. I'll look into both. In my case most of my colon definitions are only one line, so I don't think folding would gain me anything, right?
As far as I'm concerned you're not a heretic, and so what if you were? I've never been able to get the hang of emacs, vim seems much simpler to use.
On 4/7/2015 6:28 AM, Braden Shepherdson wrote:
I use and love Vim. In particular I'm a fan of code folding (at the function/word level, anyway) and of autocomplete as I type, using YCM https://github.com/Valloric/YouCompleteMe. I've been missing support for both of those while writing Forth over the last few weeks.
YCM's general-purpose identifier autocomplete doesn't work for Forth; it doesn't realize |hyphenated-words-are-identifiers|. I want to fix that.
I also want to write a basic folding plugin that will fold at the colon definition level, with a useful summary (probably the exact defining word, the name of the word, and the stack comment if any.
Would anyone else find one or both of those plugins useful? Am I a terrible heretic for not embracing Emacs or another tool for writing my Forth? What do others use when writing Forth?
— Reply to this email directly or view it on GitHub https://github.com/ForthHub/discussion/issues/5.
Folding won't really help with one-liner definitions. I've got a project with some long narrative comments on tricky portions, so even though the definition might contain perhaps a modest 12 or 14 words, each step is carefully explained.
I've also got some words in my current projects that are much too long and complicated, and badly need simplification into short definitions, though. I need more practice at factoring.
Here's the folding plugin. Please feel free to file issues and PRs against it if it's not working for you.
There are two points I'd appreciate feedback on if you use it:
I use and love Vim. In particular I'm a fan of code folding (at the function/word level, anyway) and of autocomplete as I type, using YCM. I've been missing support for both of those while writing Forth over the last few weeks.
YCM's general-purpose identifier autocomplete doesn't work for Forth; it doesn't realize
hyphenated-words-are-identifiers
. I want to fix that.I also want to write a basic folding plugin that will fold at the colon definition level, with a useful summary (probably the exact defining word, the name of the word, and the stack comment if any.
Would anyone else find one or both of those plugins useful? Am I a terrible heretic for not embracing Emacs or another tool for writing my Forth? What do others use when writing Forth?