All Projects → nick-paul → Acorn.jl

nick-paul / Acorn.jl

Licence: other
A pure julia text editor

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Acorn.jl

SpineOpt.jl
A highly adaptable modelling framework for multi-energy systems
Stars: ✭ 25 (-39.02%)
Mutual labels:  julia-language
noteworthy
Markdown editor with bidirectional links and excellent math support, powered by ProseMirror. (In Development!)
Stars: ✭ 178 (+334.15%)
Mutual labels:  text-editor
Expronicon.jl
Collective tools for metaprogramming on Julia Expr
Stars: ✭ 36 (-12.2%)
Mutual labels:  julia-language
writebar
Experimental distraction-free text editor, based on the Macbook pro TouchBar
Stars: ✭ 37 (-9.76%)
Mutual labels:  text-editor
LinearOperators.jl
Linear Operators for Julia
Stars: ✭ 126 (+207.32%)
Mutual labels:  julia-language
kodbox
kodbox is a file manager for web. It is a newly designed product based on kodexplorer. It is also a web code editor, which allows you to develop websites directly within the web browser.You can run kodbox either online or locally,on Linux, Windows or Mac based platforms
Stars: ✭ 1,188 (+2797.56%)
Mutual labels:  text-editor
DataFrames
Welcome to DataFrames.jl with Bogumił Kamiński
Stars: ✭ 106 (+158.54%)
Mutual labels:  julia-language
CuteMarkEd-NG
Markdown Editor in Qt 5
Stars: ✭ 55 (+34.15%)
Mutual labels:  text-editor
juliaimages.github.io
Documentation For JuliaImages
Stars: ✭ 25 (-39.02%)
Mutual labels:  julia-language
DataScienceTutorials.jl
A set of tutorials to show how to use Julia for data science (DataFrames, MLJ, ...)
Stars: ✭ 94 (+129.27%)
Mutual labels:  julia-language
Bonobo.jl
A general branch and bound framework
Stars: ✭ 26 (-36.59%)
Mutual labels:  julia-language
text-style-editor
Text style editor widget for flutter
Stars: ✭ 25 (-39.02%)
Mutual labels:  text-editor
Note.it
A Cut Down, Simple, Text Editor For Mac And iOS. Built With SwiftUI (Mostly).
Stars: ✭ 20 (-51.22%)
Mutual labels:  text-editor
svelte-slate
slate svelte view layer
Stars: ✭ 43 (+4.88%)
Mutual labels:  text-editor
PredictEd
A rich edit control based text editor with text prediction and other smart features.
Stars: ✭ 32 (-21.95%)
Mutual labels:  text-editor
BenchmarksPythonJuliaAndCo
Benchmark(s) of numerical programs with Python (and Scipy, Pythran, Numba), Julia and C++.
Stars: ✭ 19 (-53.66%)
Mutual labels:  julia-language
ProximalOperators.jl
Proximal operators for nonsmooth optimization in Julia
Stars: ✭ 119 (+190.24%)
Mutual labels:  julia-language
Fortran-Tools
Fortran compilers, preprocessors, static analyzers, transpilers, IDEs, build systems, etc.
Stars: ✭ 31 (-24.39%)
Mutual labels:  text-editor
Oracle.jl
Oracle Database driver for the Julia language.
Stars: ✭ 32 (-21.95%)
Mutual labels:  julia-language
static-export-template
A template to automatically convert Pluto notebooks to an HTML website with GitHub Pages. Demo page:
Stars: ✭ 70 (+70.73%)
Mutual labels:  julia-language

Acorn.jl

Build Status Build status

Acorn.jl is a small text editor written purely in julia.

Note: This project was written to learn more about and demonstrate julia as a general purpose language, it was not originally intended to be a practical solution to editing text within the REPL (considering one can just type ;vim for a feature complete text editor in the REPL).

Basic Demo

Creating a new text file and writing contents from the julia REPL.

Features include:

  • Use in REPL or from command line
  • Commands like find, help, save + easy to create your own.
  • Customizable key bindings and settings

Commands

Acorn's command mode allows users to change settings and execute commands on the fly. It also provides a way to easily add, remove, or change keybindings from within the application

Installing

Pkg.clone("https://github.com/nick-paul/Acorn.jl.git")

Usage

From within the REPL:

julia> using Acorn
julia> acorn("filename")

From the command line

$ julia -E "using Acorn;acorn()" filename

Use an alias to make command line easier:

$ alias acornjl='julia -E "using Acorn;acorn()"'
$ acornjl filename

Commands

Press Ctrl-P to enter command mode. Type 'help COMMAND' for more information on that command.

arguments in [brackets] are optional

  • help [CMD]: display help information for CMD
  • quit: quit the editor
  • open FILE: open a file, create a new one if needed
  • save [FILE]: save the file, if a new filename is provided, save as that name
  • find [STR]: start interactive find. if STR is provided, start interactive search with STR. Use the up and down arrows to go to the prev/next occurance in the test.
  • echo STR: display STR as a message
  • set param_name param: set parameter param_name to param. ex: set tab_stop 4
  • bind char command: bind Ctrl-(char) to the command command. ex: bind s save, bind h echo Hello world!. Type bind char ~ to unbind.

Settings

Change settings by pressing ctrl-p to enter command mode and then typing set <cmd name> <value>. All settings remain for the duration of the editor session. When opening a new editor, the default configuration is used.

To change the default values, use the following in your .juliarc.jl:

using Acorn
Acorn.configSet(:param_name, value)

where :param_name is a symbol with the parameter's name and value is the new default value.

Acorn currently supports the following settings:

  • tab_stop: Tab width in number of spaces. (default: 4,)
  • expandtab: If true, insert spaces when pressing the tab key.
  • status_fullpath: If true, display the full path to the file in the status bar. If false, just display the name.

Customization / Contributing

Commands

Commands are easy to create and allow for greater editor usability. To create your own command, create a julia file in the cmds folder, name it after your command, and include it in the Acorn module. Below is an example definition of the command sample. For more examples, see the cmds/ folder. If you have written a command that you would like to see implemented in Acorn, feel free to send a pull request.

cmds/sample.jl

# The command must have the signature
#   function(::Editor, ::String)
function sampleCommand(ed::Editor, args::String)
    # Perform operation here

    # If you need to store state variables use ed.params
    # ed.params[:YOUR CMD NAME][VAR NAME]
    ed.params[:sample][:var_name] = some_val

    # If you need to request input from the user:
    editorPrompt(ed, "Enter your name: ",
            callback=sampleCallback     # Callback function: function(ed::Editor, buf::String, key::Char
            buf="",             # Starting point for the input buffer. This text is
                                #   'automatically' typed into the input when the
                                #   prompt loads
            showcursor=true)    # Move the cursor to the prompt

end

# Optional: If you request input from the user and need a
#   callback function, use the following format:
function sampleCallback(ed::Editor, buf::String, key::Char)
    # Perform callback action here...
end


# Call `addCommand` to add
addCommand(:sample,                         # The command name
            sampleCommand,                  # The command function
            help="description of sample")   # Displayed when user runs 'help sample'

Including your command

Include your command in Acorn.jl

# Load commands
#...
include("cmds/save.jl")
include("cmds/find.jl")
include("cmds/sample.jl") # Add this line
#...

Please also create a test file test/cmds/test_sample.jl and include it in test/runtests.jl.

include("cmds/test_sample.jl")

Features

Many features have not yet been implemented. I will slowly be adding features and I will try to keep up with issues and pull requests so feel free to add whatever you like to the editor. Some things I may eventually add to the editor are:

  • Text selection
    • Copy/paste
  • Tab completion
  • Syntax highlighting
  • Line numbers
  • Auto indent
  • ...

Bug Fixes / Compatibility

Acorn has not been tested on OSX and currently has compatibility issues with Windows. If you run into any problems on your platform feel free to patch it and send a pull request.

If you experience any bugs, please submit an issue or patch it and send a pull request.

Credits

  • Much of the core code and design in src/editor.jl is based off of antirez's kilo.
  • The kilo tutorial by snaptoken was a huge help when writing the core editor features.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].