loading an EDITOR: does not set it as your editor; calling SET-EDITOR: does this.
"editors.ui" run ! will also set/change your editor
Recommended editor setup:
scaffold-factor-boot-rc
USE: editors
SET-EDITOR: visual-studio-code
namespaces sequences system ;
IN: editors.10x
-SINGLETON: 10x-editor
-
-editor-class [ 10x-editor ] initialize
+EDITOR: 10x-editor
SYMBOL: 10x-editor-path
kernel make math.parser namespaces sequences ;
IN: editors.acme
-SINGLETON: acme
-
-editor-class [ acme ] initialize
+EDITOR: acme
: plan9-path ( -- path )
\ plan9-path get [
math.parser namespaces sequences system ;
IN: editors.aquamacs
-SINGLETON: aquamacs
-
-editor-class [ aquamacs ] initialize
+EDITOR: aquamacs
HOOK: find-aquamacs-path os ( -- path )
math.parser namespaces sequences system ;
IN: editors.atom
-SINGLETON: atom
-
-editor-class [ atom ] initialize
+EDITOR: atom
SYMBOL: atom-path
USING: editors kernel make namespaces ;
IN: editors.bbedit
-SINGLETON: bbedit
-
-editor-class [ bbedit ] initialize
+EDITOR: bbedit
M: bbedit editor-command
drop
USING: editors kernel make namespaces ;
IN: editors.bluefish
-SINGLETON: bluefish
-
-editor-class [ bluefish ] initialize
+EDITOR: bluefish
M: bluefish editor-command
drop
namespaces system vocabs ;
IN: editors.brackets
-SINGLETON: brackets
-
-editor-class [ brackets ] initialize
+EDITOR: brackets
HOOK: brackets-path os ( -- path )
math.parser namespaces ;
IN: editors.coteditor
-SINGLETON: coteditor
-
-editor-class [ coteditor ] initialize
+EDITOR: coteditor
: find-cot-bundle-path ( -- path/f )
"com.coteditor.CotEditor" find-native-bundle [
IN: editors.cudatext
-SINGLETON: cudatext
-
-editor-class [ cudatext ] initialize
+EDITOR: cudatext
HOOK: find-cudatext-path os ( -- path )
scan-new-class [ define-singleton-class ] [ editors get-global adjoin ] bi ;
SYNTAX: SET-EDITOR:
- scan-token [ "editors." prepend require ] [ search ] bi editor-class set-global ;
+ scan-token [ "editors." prepend use-vocab ] [ search ] bi editor-class set-global ;
HOOK: editor-command editor-class ( file line -- command )
kernel make namespaces ;
IN: editors.editpadlite
-SINGLETON: editpadlite
-
-editor-class [ editpadlite ] initialize
+EDITOR: editpadlite
: editpadlite-path ( -- path )
\ editpadlite-path get [
kernel make math.parser namespaces sequences ;
IN: editors.editpadpro
-SINGLETON: editpadpro
-
-editor-class [ editpadpro ] initialize
+EDITOR: editpadpro
: editpadpro-path ( -- path )
\ editpadpro-path get [
namespaces ;
IN: editors.editplus
-SINGLETON: editplus
-
-editor-class [ editplus ] initialize
+EDITOR: editplus
: editplus-path ( -- path )
\ editplus-path get [
kernel make math.parser namespaces sequences system vocabs ;
IN: editors.emacs
-SINGLETON: emacs
-
-editor-class [ emacs ] initialize
+EDITOR: emacs
SYMBOL: emacsclient-path
SYMBOL: emacsclient-args
namespaces ;
IN: editors.emeditor
-SINGLETON: emeditor
-
-editor-class [ emeditor ] initialize
+EDITOR: emeditor
: emeditor-path ( -- path )
\ emeditor-path get [
IN: editors.espresso
-SINGLETON: espresso
-
-editor-class [ espresso ] initialize
+EDITOR: espresso
M: espresso editor-command
drop
namespaces ;
IN: editors.etexteditor
-SINGLETON: etexteditor
-
-editor-class [ etexteditor ] initialize
+EDITOR: etexteditor
: etexteditor-path ( -- str )
\ etexteditor-path get [
kernel make math.parser namespaces system ;
IN: editors.geany
-SINGLETON: geany
-
-editor-class [ geany ] initialize
+EDITOR: geany
SYMBOL: geany-path
math.parser namespaces sequences ;
IN: editors.gedit
-SINGLETON: gedit
-
-editor-class [ gedit ] initialize
+EDITOR: gedit
: gedit-path ( -- path )
\ gedit-path get [
! This code builds on the code in editors.vim; see there for
! more information.
-SINGLETON: gvim
+EDITOR: gvim
INSTANCE: gvim vim-base
-editor-class get-global dup [ vim? not ] when
-[ gvim editor-class set-global ] unless
-
HOOK: find-gvim-path io-backend ( -- path )
M: object find-gvim-path f ;
system ;
IN: editors.jedit
-SINGLETON: jedit
-
-editor-class [ jedit ] initialize
+EDITOR: jedit
HOOK: find-jedit-path os ( -- path )
namespaces sequences strings ;
IN: editors.kakoune
-SINGLETON: kakoune
-
-editor-class [ kakoune ] initialize
+EDITOR: kakoune
SYMBOL: kak-path
IN: editors.kate
-SINGLETON: kate
-
-editor-class [ kate ] initialize
+EDITOR: kate
HOOK: find-kate-path os ( -- path )
IN: editors.lapce
-SINGLETON: lapce
-
-editor-class [ lapce ] initialize
+EDITOR: lapce
HOOK: find-lapce-path os ( -- path )
io.standard-paths kernel make namespaces strings system ;
IN: editors.lite-xl
-SINGLETON: lite-xl
-
-editor-class [ lite-xl ] initialize
+EDITOR: lite-xl
SYMBOL: lite-xl-editor-path
namespaces ;
IN: editors.macvim
-SINGLETON: macvim
+EDITOR: macvim
INSTANCE: macvim vim-base
-editor-class get-global dup [ vim? not ] when
-[ macvim editor-class set-global ] unless
-
: find-macvim-bundle-path ( -- path/f )
"org.vim.MacVim" find-native-bundle [
"Contents/MacOS/Vim" append-path
namespaces sequences ;
IN: editors.notepad++
-SINGLETON: notepad++
-
-editor-class [ notepad++ ] initialize
+EDITOR: notepad++
: notepad++-path ( -- path )
\ notepad++-path get [
IN: editors.notepad
-SINGLETON: notepad
-
-editor-class [ notepad ] initialize
+EDITOR: notepad
: notepad-path ( -- path )
\ notepad-path get [
namespaces sequences windows.shell32 make io.pathnames ;
IN: editors.notepad2
-SINGLETON: notepad2
-
-editor-class [ notepad2 ] initialize
+EDITOR: notepad2
: notepad2-path ( -- path )
\ notepad2-path get [
USING: editors kernel make namespaces ;
IN: editors.nova
-SINGLETON: nova
-
-editor-class [ nova ] initialize
+EDITOR: nova
M: nova editor-command
drop
namespaces sequences system ;
IN: editors.scite
-SINGLETON: scite
-
-editor-class [ scite ] initialize
+EDITOR: scite
SYMBOL: scite-path
USING: editors kernel make namespaces ;
IN: editors.smultron
-SINGLETON: smultron
-
-editor-class [ smultron ] initialize
+EDITOR: smultron
M: smultron editor-command
drop
system ;
IN: editors.sublime
-SINGLETON: sublime
-
-editor-class [ sublime ] initialize
+EDITOR: sublime
HOOK: find-sublime-path os ( -- path )
math.parser namespaces sequences make ;
IN: editors.ted-notepad
-SINGLETON: ted-notepad
-
-editor-class [ ted-notepad ] initialize
+EDITOR: ted-notepad
: ted-notepad-path ( -- path )
\ ted-notepad-path get [
namespaces sequences system vocabs ;
IN: editors.textadept
-SINGLETON: textadept
-
-editor-class [ textadept ] initialize
+EDITOR: textadept
HOOK: find-textadept-path os ( -- path )
namespaces prettyprint editors make ;
IN: editors.textedit
-SINGLETON: textedit
-
-editor-class [ textedit ] initialize
+EDITOR: textedit
M: textedit editor-command
drop
namespaces prettyprint editors make ;
IN: editors.textmate
-SINGLETON: textmate
-
-editor-class [ textmate ] initialize
+EDITOR: textmate
M: textmate editor-command
[ "mate" , "-a" , "-l" , number>string , , ] { } make ;
namespaces sequences ;
IN: editors.textpad
-SINGLETON: textpad
-
-editor-class [ textpad ] initialize
+EDITOR: textpad
: textpad-path ( -- path )
\ textpad-path get-global [
! Note that launching with ``open -a`` does not support line numbers.
-SINGLETON: textwrangler
-
-editor-class [ textwrangler ] initialize
+EDITOR: textwrangler
M: textwrangler editor-command
"edit" find-in-path [
! Copyright (C) 2018 Doug Coleman.
! See https://factorcode.org/license.txt for BSD license.
-USING: accessors editors kernel namespaces sequences ui
-ui.gadgets ui.gadgets.borders ui.gadgets.buttons
+USING: accessors editors kernel namespaces sequences splitting
+ui ui.gadgets ui.gadgets.borders ui.gadgets.buttons
ui.gadgets.packs ui.gadgets.scrollers ui.tools.listener
-vocabs.loader ;
+vocabs.loader vocabs.parser ;
IN: editors.ui
: <reload-editor-button> ( editor -- button )
dup '[
- drop
- [ f editor-class set-global _ reload ]
+ drop
+ [ _ [ reload ] [ use-vocab ] [ "editors." ?head drop search editor-class set-global ] tri ]
\ run call-listener
] <border-button> ;
math.parser namespaces system ;
IN: editors.ultraedit
-SINGLETON: ultraedit
-
-editor-class [ ultraedit ] initialize
+EDITOR: ultraedit
HOOK: find-ultraedit os ( -- path )
namespaces sequences strings ;
IN: editors.vim
-SINGLETON: vim
+EDITOR: vim
MIXIN: vim-base
INSTANCE: vim vim-base
-editor-class [ vim ] initialize
-
SYMBOL: vim-path
HOOK: find-vim-path editor-class ( -- path )
tools.which ;
IN: editors.visual-studio-code-exploration
-SINGLETON: visual-studio-code-exploration
+EDITOR: visual-studio-code-exploration
INSTANCE: visual-studio-code-exploration visual-studio-code-base
-editor-class [ visual-studio-code-exploration ] initialize
-
M: visual-studio-code-exploration find-visual-studio-code-path
os {
{ linux [ "code-exploration" which ] }
tools.which ;
IN: editors.visual-studio-code-insiders
-SINGLETON: visual-studio-code-insiders
+EDITOR: visual-studio-code-insiders
INSTANCE: visual-studio-code-insiders visual-studio-code-base
-editor-class [ visual-studio-code-insiders ] initialize
-
M: visual-studio-code-insiders find-visual-studio-code-path
os {
{ linux [ "code-insiders" which ] }
MIXIN: visual-studio-code-base
-SINGLETON: visual-studio-code
+EDITOR: visual-studio-code
INSTANCE: visual-studio-code visual-studio-code-base
-editor-class [ visual-studio-code ] initialize
-
HOOK: find-visual-studio-code-path editor-class ( -- path )
M: visual-studio-code-base find-visual-studio-code-path
tools.which ;
IN: editors.visual-studio-codium
-SINGLETON: visual-studio-codium
+EDITOR: visual-studio-codium
INSTANCE: visual-studio-codium visual-studio-code-base
-editor-class [ visual-studio-codium ] initialize
-
M: visual-studio-codium find-visual-studio-code-path
os {
{ linux [ "codium" which ] }
USING: arrays editors io.standard-paths kernel namespaces ;
IN: editors.wordpad
-SINGLETON: wordpad
-
-editor-class [ wordpad ] initialize
+EDITOR: wordpad
: wordpad-path ( -- path )
\ wordpad-path get [
USING: editors kernel make namespaces ;
IN: editors.xcode
-SINGLETON: xcode
-
-editor-class [ xcode ] initialize
+EDITOR: xcode
M: xcode editor-command
drop