Giter Club home page Giter Club logo

ox's Introduction


Logo

Ox editor

Ox is a code editor that runs in your terminal.


Build Status Build Status License

About The Project

Ox is a code editor. It was written in Rust using ANSI escape sequences. It assists developers with programming by providing several tools to speed up and make programming easier and a refreshing alternative to heavily bloated and resource hungry editors such as VS Code and JetBrains. Ox is lightweight so it can be used on older computers.

Bear in mind, this is a personal project and is nowhere near ready to replace your existing tools just yet.

It runs in the terminal and runs on platforms like Linux and macOS but doesn't work on Windows directly (it works if you use WSL) due to a lack of a good command line. There are many text editors out there and each one of them has their flaws and I hope to have a text editor that overcomes many of the burdens and issues.

Ox is not based on any other editor and has been built from the ground up without any base at all.

What features does Ox have and why should I use it?

Ox aims to be an editor that takes features from some of the most popular editors out there, gaining the best of all worlds.

Vim http://vim.org: Vim provides a plugin system for adding features to it as it is very minimal and only provides basic text editing functionality by default. It is quite extensive and has its own programming language for configuring and writing plugins for it. It has a steep learning curve due to being a “modal” text editor, having special modes for editing text. Ox is easier to use than Vim because it doesn’t have modes where the keyboard is repurposed, however it takes the idea of being a keyboard-only editor and being able to act just like an IDE after some configuration.

Nano https://www.nano-editor.org/: Nano is an editor that is very simple to grasp due to its intuitive key bindings such as Ctrl+S to save and Ctrl+? for the help menu etc. Ox took the idea for the key bindings from this editor, they are simple to remember, Ctrl+F for “Find”, Ctrl+Q for “Quit”, meaning that Ox doesn’t have as steep a learning curve.

Micro https://micro-editor.github.io/: Micro has a plugin system that is programmed with a language called Lua however I can’t seem to find any up to date plugins for it and it lacks features such as a file tree. It is micro that inspired me to add mouse functionality and other features.

Emacs https://www.gnu.org/software/emacs/: Emacs is still actively used today due to its freedom to modify and change the source code. Ox took the idea for the customization and extensibility of Emacs and made a configuration system where you can change the colours and appearance of the editor.

Xi https://xi-editor.io/: Xi is also written in Rust but is purely a backend at the moment, I decided to make Ox both a frontend and a backend because Xi has many frontends, but most of them are broken and it lacks a lot of features.

Kiro https://github.com/rhysd/kiro-editor: Kiro is an amazing text editor written in Rust and adds features such as Unicode support, a nicer colour scheme and small things like resizing and it is a very inspiring editor. Ox took the ideas for the improvements from Kiro, however implemented them differently. Kiro’s source code also seems to be quite advanced in some areas, so I decided to keep Ox as simple as I could.

Built With

Ox is super minimal and aims to use as few dependencies as possible, allowing for rapid compile time and low risk of breakage.

Getting Started

You can currently only build Ox from source. While this may sound daunting to many people, it really isn't that hard and takes 1 minute worst case scenario!

Prerequisites

Because Ox is written in Rust, you must have a modern and working version of rustc and cargo.

On Arch Linux, you can run this command:

sudo pacman -S rustup
rustup toolchain install stable

If you are not using Arch, you can easily set it up on other distros by running the distro-neutral command:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
/usr/bin/rustup toolchain install stable

You must have curl installed in order to run this command.

Installation

Icons

Ox uses NerdFonts to display icons. You can install nerdfonts from https://nerdfonts.com If you use Arch Linux, you can install it by installing the package ttf-nerd-fonts-symbols-mono. There is a potential that you will need to add it to your terminal emulator.

Manual

cargo install --git https://github.com/curlpipe/ox

Arch Linux

Install ox-bin or ox-git from the Arch User Repository.

That's all there is to it!

Fedora/CentOS

Install ox from the COPR Repository:

sudo dnf copr enable atim/ox -y
sudo dnf install ox

Homebrew

Install ox from Homebrew core tap.

brew install ox

MacPorts

On macOS, you can install ox via MacPorts

sudo port selfupdate
sudo port install ox

Usage

Opening files in Ox

At the moment, you can open ox by using the command

ox

This will open up an empty document.

If you wish to open a file straight from the command line, you can run

ox /path/to/file

To open and edit a file.

You can also open a file from within Ox by using the Ctrl + O Key binding

If at any time, you wish to create a new file, you can use Ctrl + N to do so.

You can find more command line options for Ox by typing:

ox --help

Moving the cursor around

You can use the arrow keys to move the cursor around

You can also use:

  • PageUp - Go to the top of the document
  • PageDown - Go to the bottom of the document
  • Home - Go to the start of the current line
  • End - Go to the end of the current line

Editing the file

You can use the keys Backspace and Return / Enter as well as all the characters on your keyboard to edit files!

Ox is controlled via your keyboard shortcuts. Here are the default shortcuts that you can use:

Keybinding What it does
Ctrl + Q Exits the current tab or the editor if only one tab open.
Ctrl + S Saves the open file to the disk.
Alt + S Prompts you for a file name and saves it to disk as that file name.
Ctrl + W Saves all the currently open files to the disk.
Ctrl + N Creates a new tab with a blank document.
Ctrl + O Prompts you for a file and opens that file in a new tab.
Ctrl + F Searches the document for a search query. Allows pressing of and to move the cursor to the previous occurance fof the query and and to move to the next occurance of the query. Press Return to cancel the search at the current cursor position or Esc to cancel the search and return to the initial location of the cursor. Note: this allows you to use regular expressions.
Ctrl + Z Undoes your last action. The changes are committed to the undo stack every time you press the space bar, create / destroy a new line and when there is no activity after a certain period of time which can be used to capture points where you pause for thought or grab a coffee etc...
Ctrl + Y Redoes your last action. The changes are committed to the undo stack every time you press the space bar, create / destroy a new line and when there is no activity after a certain period of time which can be used to capture points where you pause for thought or grab a coffee etc...
Ctrl + R Allows replacing of occurances in the document. Uses the same keybindings as the search feature: and to move the cursor to the previous occurance fof the query and and to move to the next occurance of the query. You can also press Return, y or Space to carry out the replace action. To exit replace mode once you're finished, you can press Esc to cancel and return back to your initial cursor position. Note: this allows you to use regular expressions.
Ctrl + A Carries out a batch replace option. It will prompt you for a target to replace and what you want to replace it with and will then replace every occurance in the document. Note: this allows you to use regular expressions.
Ctrl + Left Navigates to the previous tab.
Ctrl + Right Navigates to the next tab.
Alt + A Focuses the command line.

Configuring Ox

Ox features a configuration system that allows modification and personalization of the editor.

By default, Ox will look for a file here: $XDG_CONFIG_HOME/ox/ox.ron or ~/.config/ox/ox.ron.

Ox's configuration language is RON.

There is a default config in the 'config' folder. You will have to either download it and place it in the default config directory or create your own using the example ones as a reference. If you don't have a config file, don't worry :), Ox will just ignore it if you don't have one.

If you wish to specify the configuration file path, you can do so using the '--config' option (or '-c' if you prefer). For Example:

ox --config /path/to/my_config.ron file_to_edit.txt

Roadmap

You can see the tasks.todo.md file to see my full plans for the future of the editor!

Here is the current summary

  • Initial Research (0.1.0, 0.1.1) [741 lines]
  • Basic editing functions (0.2.0)
  • Line numbers (0.2.0)
  • Searching (0.2.0) [1040 lines]
  • Undo and Redo (0.2.1) [1282 lines]
  • Input bug (0.2.2) [1278 lines]
  • Good command line interface (0.2.3)
  • Config files (0.2.3)
  • Replacing text (0.2.3) [1549 lines]
  • Syntax highlighting (0.2.4) [1894 lines]
  • Tabs for multitasking (0.2.5) [2050 lines]
  • Macros (0.2.6) [3414 lines]
  • Tweaks (0.2.7) [3241 lines]
  • Mouse support (0.2.8)
  • Auto indentation (0.3.0)
  • Prettifier / Automatic code formatter (0.3.0)
  • Built In linter (0.3.0)
  • Auto brackets (0.3.1)
  • Auto complete (0.3.2)
  • File tree (0.3.4)
  • Start page (0.3.5)

License

Distributed under the GNU GPLv2 License. See LICENSE for more information.

Contact

You can contact me on Discord at curlpipe#1496. I'll be happy to answer any questions you may have!

Acknowledgements

ox's People

Contributors

cauebs avatar curlpipe avatar herbygillot avatar spikecodes avatar starorpheus avatar tim77 avatar vladimyr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ox's Issues

Mouse integration

Is your feature request related to a problem? Please describe.
The transition from a graphical text editor to a text based one is not an easy task. There is usually a huge learning curve. To ease that learning curve, mouse integration will allow Ox to be used just like a normal text editor.

Describe the solution you'd like
Add the ability to interact with the mouse by allowing mouse selection and moving the cursor when clicking the mouse.

Describe alternatives you've considered
Vim style selection (but after using that for a year and a half, I don't want to touch it ever again).

Replace feature to compliment the search feature

Is your feature request related to a problem? Please describe.
Most text editors have some kind of replace feature. It would be useful for Ox to have a command like it. Perhaps it could take in Regex (could add that later).

Describe the solution you'd like
Ctrl + R -> Prompt for target -> Prompt for replacement -> replace occurrences through the arrow keys.
Ctrl + Shift + R -> Prompt for target -> Prompt for replacement -> replace all occurrences.

Describe alternatives you've considered
N/A

Donations?

I really love this project, is there any way to donate to it? I want this editor to be great

Better command line interface

Is your feature request related to a problem? Please describe.
Ox currently reads the command line arguments straight from the environment and isn't able to be extended to support arguments which will come in handy for future releases (e.g. config files)

Describe the solution you'd like
Using CLAP to implement a neat command line interface with options and a help menu to make it more extensible and more friendly.

Describe alternatives you've considered
There are alternative Rust libraries for command line arguments that are lighter than CLAP however, I would like to think that in the future I could extend Ox's command line to allow for complex commands with subcommands (perhaps making ox it's own package manager? who knows!) CLAP is also the most popular and shouldn't add too much of a burden on the size of the binary.

Undo / Redo

Is your feature request related to a problem? Please describe.
Be able to handle changes like a pro with simple undo and redo key bindings

Describe the solution you'd like
Be able to press combinations like ctrl+u and ctrl+r to rewind / fast forward the file when editing. Changes are stored on a stack and can be popped and pushed.

Crash when erasing empty file

Describe the bug
If you try to erase an empty file, ox will crash.

To Reproduce
Steps to reproduce the behavior:

  1. Run ox
  2. Press backspace few times
  3. See error

Expected behavior
No crash.

Screenshots
Not required.

Desktop (please complete the following information):

  • OS: Fedora 33 (KDE)

Crash log

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/document.rs:385:21                                                           
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                                                                                                                                     
fish: “ox” terminated by signal SIGABRT (Abort)

Long line support.

Is your feature request related to a problem? Please describe.
When working with long lines, Ox has some strange behaviour.

Describe the solution you'd like
Ox wraps the long lines round onto the line underneath.

Describe alternatives you've considered
Cut the line off the end of the file and allow moving to it.

Selection support

Currently only editing feature I miss is text selection with shift-arrows and copy and pasting using ctrl-c, ctrl-v. These shortcuts are standard ones and they are in line with Ox philosophy of using standard shortcuts.

Change default keyboard shortcut with config

Is your feature request related to a problem? Please describe.
Change default keyboard shortcut with config (specially Ctrl + W)

Describe the solution you'd like
Change Ctrl + W to something else. It will drive MacOS users mad, because Ctrl + W is "Close Tab" on MacOS and I keep pressing it to close tab but end up in "Save As". Also, Esc does not get me out of "Save As".

Describe alternatives you've considered
None.

False claims of being "fast", terrible design unable to handle files with long lines

According to https://news.ycombinator.com/item?id=24976905, ox can't handle a file with a 1GB long line.

Obviously when you design a new editor, handling such files is the most important thing, since it means that you have properly designed the editor's algorithms and data structures.

Clearly you failed completely at the most basic task and showed utter lack of competence in the design of algorithms and data structures.

Also, the program is falsely advertised as "fast", when instead it should be described as "unusably slow", misleading users into thinking this is well-written software.

ox hangs when opening this file

Describe the bug
ox (v0.2.5 with no config) hangs (forever) if instructed to open this file

To Reproduce
Steps to reproduce the behavior:

  1. ox README.txt
  2. hangs

Expected behavior
File is opened and ox does not hang

Desktop (please complete the following information):

  • Mac OS X 10.15.7
  • rustc 1.48.0-beta.5 (4c78178b1 2020-10-21)
  • ox 0.2.5 installed via manual method (cargo install --git https://github.com/curlpipe/ox)

the file is attached here (it's the README.txt [1] file found in apache-maven-3.6.3 binary release .tar.gz). You might have to download the maven archive here http://maven.apache.org/download.cgi and extract it, then try to open it, as I don't know whether attaching the file to github messes up its line ending. a gzipped version [2] of the readme.txt is provided)

[1] README.txt
[2] README2.txt.gz

Advanced keyboard navigation

Is your feature request related to a problem? Please describe.
Cannot edit text using muscle memory, because some navigation keys are not working.

Describe the solution you'd like

Ctrl+Left/Right - jump word to left/right.
Shift+Left/Right - extend selection by char to left/right
Shift+Up/Down - extend selection by line up/down
Ctrl+Shift+Left/Right - extend selection by word to left/right
Ctrl+C - copy selection to buffer
Ctrl-V - paste selection from buffer
Ctrl+X - cut selection to buffer
Ctrl-T - new tab
Ctrl-H - search and replace

mcedit:

F1 - help screen
Ctrl-F - put selection into file. Default file name "/.config/ox/clipboard".
Shift-F5 - paste from file. Default file name "
/.config/ox/clipboard".
F3 - start selection mode for cases when Shift doesn't work. F3, or Ctrl-F, Ctrl-C, Ctrl-X, Delete to end.
Shift-F3 - start rectangle selection mode. F3, or Ctrl-F, Ctrl-C, Ctrl-X, Delete to end.
Ctrl-L - refresh screen
Ctrl-Y - delete line under cursor
F10 - show editor menu
F11 - show user menu with external filters or commands, such as "sort" or "date". For filter, current selection or whole file is sent to stdin and then replaced by stdout. A command output is just pasted under cursor. Command may prompt for command line options (e.g. "sed").

Describe alternatives you've considered

https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Text_editing

Feedback on a possibly interesting project

Yet another text editor... Well, it could be promising judging from the fundamental values and choices listed.

I started writing one myself a while back, inspired by Kilo, to try to make something fully useful under 1000 lines of code. I obviously had to sacrifice syntax highlighting then, and I'm still hoping to come back to the project. Anyway:

The major, perpetual hurdle and migraine-inducing annoyance with switching text editors is always the same:

LEARNING YET ANOTHER SET OF KEYBOARD SHORTCUTS!!!! (And: "My favorite feature is missing!")

I addressed this in my own project by focusing on the universal UNIX shortcuts(Ctrl+A, Ctrl+E, Ctrl+K, etc.) and primarily making features around them, also using external tools whenever possible, eg. grep/perl for search/replace, etc.

I use Emacs, because I've used it for so long, and it's (easily) available on all terminals. I use nano for simpler tasks. I tried vi, and as much as I respect it's combination of features and minimalism, the single keystroke dogma is just too weird.

My major problem with Emacs is it completely chokes and crashes on long lines (eg. 200K of inline JSON in a HTML file). Also, I will not switch to a new editor which doesn't have the ingenious Emacs interactive search (Ctrl+S).

In conclusions, I might be interested in this project if it meets with the following criteria:

  1. Full compatibility and utilization of legacy UNIX shortcuts
  2. No slowdowns on startup and handling of large files whatsoever
  3. VERY conservative feature set, perfect the basic functions before (not :P) adding fancy/advanced features

Actually, one of my choices was also to make the code so simple that to change the logic ("configure") the editor, you would just change the code rather than changing options. This way, you could have it any way you wanted.

I would even suggest to so ambitious that the goal should be to become a bundled text editor on a majority of UNIX distributions, ie. preferred over nano/vi/Emacs. Then you will have really achieved something, and not be "Yet Another"...

I hope my feedback will provide some inspiration and direction the project. Feel free to comment back.

Searching

Is your feature request related to a problem? Please describe.
Search feature to find code within the buffer

Describe the solution you'd like
Press Ctrl+F and be able to search on the fly and cancel (and subsequently go back to the original position).

Default Editor Theme on Mac

Describe the bug
Is there an issue with the default theme? It is a weird tint of red so I'm assuming this is not intentional.

To Reproduce
Steps to reproduce the behavior: Followed the steps of the README to install using homebrew.

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS Catalina 64bit

Syntax highlighting

Is your feature request related to a problem? Please describe.
Syntax highlighting for Ox.

Describe the solution you'd like
Should be done by having regex in a configuration file and have Ox read those regular expressions and highlighting it with the specified colour. Should also come with languages like Rust, JavaScript, Python and Ruby and C too.

Describe alternatives you've considered
Being a total chad and not using any syntax highlighting

Accept line number and column number in file name

Is your feature request related to a problem? Please describe.
Sometimes, I need to jump to a line in a source file, e.g. from backtrace listing.

Describe the solution you'd like
De facto convention for the line number is FILE_NAME:LINE_NUMBER[:COLUMN_NUMBER] . For example, mceditor/mcviewer (part of Midnight Commander) can open such file and jump to the line number.

Example: main.c:5:4

Describe alternatives you've considered
Open the file, then navigate to the line, e.g. by pressing Ctrl-J to jump to line/char.

Parse Error - ExpectedStruct

Describe the bug
Parse Error when you open a new blank file.

To Reproduce
Steps to reproduce the behavior:

  1. Go to ~/.config/ox/
  2. Run touch ox.ron
  3. Run ox ox.ron
  4. See error

Screenshots
Screen Shot 2020-11-02 at 11 37 52 PM

Desktop (please complete the following information):

  • OS: Ubuntu Linux (custom distro)

Open files from within the editor

Is your feature request related to a problem? Please describe.
Be able to open files from within the editor so you don't have to exit out and restart Ox.

Describe the solution you'd like
Open a file within the editor using Ctrl+O with save checking.

PHP syntax highlighting

Is your feature request related to a problem? Please describe.
It would be nice if we can add a support for PHP syntax highlighting.
I also think there are some similarities with the current JavaScript support (comments, functions...).

Why not have an issue where people can request support for a particular file extension and then they can vote ? To add support to the most requested in priority.

Thanks!

Macros and Special command mode

Is your feature request related to a problem? Please describe.
Ability to create custom actions in Ox is limited so being able to assign Alt keys to "macros" and access a special command line mode will make it more extensible.

Describe the solution you'd like
Being able to use a shortcut like Alt-A to access a special command mode where the user can run custom macros to execute a task (e.g. formatting a file or compiling automatically)

Better file opening

Is your feature request related to a problem? Please describe.
Be able to automatically create a new file when opening a path that doesn't exist.

Describe the solution you'd like
When providing a file as an argument that doesn't exist, have Ox create the file when the user saves.
Also be able to create a new file when not providing arguments to Ox. Save and Save As functionality should work perfectly fine.

Windows linebreaks not supported?

Environment: Windows 10 with WSL. Installed rustc/cargo without issues as per instructions.

When I opened a 3 line file to test it out, it seemed to just hang/pause after I hit enter on the command line.
Didn't manage to abort, Ctrl-C or anything, killall ox worked from another window.
After testing a few things, turns out when I converted the linebreaks to unix format it worked fine, but unix2dos made it hang again.

ps. was there any log I could have looked at, or something else I could have checked/tried?
Not really deep into software engineering..

Support for custom config directories set with the XDG_CONFIG_HOME variable.

Is your feature request related to a problem? Please describe.

I like to keep my configurations all in one place. I have a custom directory for the XDG_CONFIG_HOME variable set because it helps with that. However I noticed that ox doesn't respect this and doesn't look at my custom directory set at the XDG_CONFIG_HOME variable.

Describe the solution you'd like

I would like to see support for custom directories set using the XDG_CONFIG_HOME variables.

Describe alternatives you've considered

The only alternative I have considered currently is creating a symbolic link;
ln -s $XDG_CONFIG_HOME/ox/ox.toml $HOME/.config/ox/ox.toml

ox file hangs forever

Describe the bug
When opening a file from root folder with the ox file command, the terminal hangs and it's impossible to exit.

To Reproduce

Execute:

$ cd project/folder
$ ox main.tf

Expected behavior
Expected an editor to open and load the file, similar to executing ox by itself.

Desktop (please complete the following information):

  • OS: Windows 10 Pro using WSL2 Ubuntu 20.04.1 LTS (GNU/Linux 4.19.104-microsoft-standard x86_64)

Configuration File

Is your feature request related to a problem? Please describe.
Good text editors allow for extensibility and customizability. The ability to change the colours and functionality is not only fun but also allows room for a community to build.

Describe the solution you'd like
Have a TOML file in some directory somewhere and have Ox read it and apply it.

Describe alternatives you've considered
At the moment, Ox is suckless with a config.rs but that is daunting for newcomers and a toml file will be much more appreciated probably. (Also reads better!)

mouse selection is also pull editor line numbers

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

is easy to use mouse for selecting lines

Describe the solution you'd like
A clear and concise description of what you want to happen.

please don't include line numbers on mouse selection of text when copy/paste.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Editor panics when opening empty files.

Describe the bug
Opening empty files causes main to panic printing out the error;

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/editor.rs:318:17

To Reproduce
Steps to reproduce the behavior:

  1. touch foo.c (or any extension)
  2. xo foo.c
  3. Press any key and the error should pop up.

Expected behavior
I expect the editor to go into insert mode but instead this happens.

Screenshots
A screen cast

Desktop (please complete the following information):

  • OS: KISS Linux (KISS is a musl based OS.)
  • Kernal: 5.4.65

v0.2.6 broken

Describe the bug
After update 0.2.5 -> 0.2.6 ox doesn't work anymore.

To Reproduce
Try to run new ox.

$ ox
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { code: Message("missing field `status_left`"), position: Position { line: 0, col: 0 } }', src/config.rs:67:32
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    17096 IOT instruction (core dumped)  ox 1.txt

Desktop (please complete the following information):

  • OS: Fedora 33

Ox on the AUR!

Is your feature request related to a problem? Please describe.
Compiling Ox manually is a pain in the rear end! So perhaps it's time to start distributing it like a professional.

Describe the solution you'd like
Ox to exist on the AUR, as a package ox-git for building and perhaps ox-bin for binaries (but just the ox-git package would be fine)

Describe alternatives you've considered
Being annoying and forcing users to compile it. But I don't want to be annoying. :)

Unicode character support

Is your feature request related to a problem? Please describe.
Ox can only really support ASCII characters without breaking. The width of the characters simply don't work properly.

Describe the solution you'd like
Be able to open unicode characters e.g. Chinese chracters, emojis and other unicode characters

Save As

Is your feature request related to a problem? Please describe.
Being able to save a file to a specific path instead of relying on arguments passed to Ox

Describe the solution you'd like
Be able to use a key binding and get a prompt asking for a file name to save as and then save it there. This will not change the current path of the buffer unless the buffer has no path.

Offset Return Key Bug

Describe the bug
When the file is offset and return is pressed on the last line, it allows the cursor to travel out of bounds onto the status line.

To Reproduce
Steps to reproduce the behavior:

  1. Open a file longer than the terminal height
  2. Scroll down slightly
  3. Press PageDown to get to the last line
  4. Press return

Expected behavior
The offset will increase to keep the cursor in view

Don't load whole file into memory

Is your feature request related to a problem? Please describe.
Opening big files is slow. Other editors solve this problem by loading only visible part of the file. Ox loads whole file into memory, so working with big files (such as logs) is hard and uses a lot of RAM.

Describe the solution you'd like
File should be mmap'ed to memory or read part-by-part

Describe alternatives you've considered
Don't do anything. Working with big files will remain slow.

Create a new file

Is your feature request related to a problem? Please describe.
Be able to use a key binding to create a new file so that Ox doesn't need to be restarted.

Describe the solution you'd like
Be able to press ctrl+n and the current file to check whether its been saved, if it has, create a new empty buffer otherwise inform the user through an error.

Can't install dependencies on WSL2 Ubuntu 20.04.1

Describe the bug
When running the command specified to install dependencies for other distros and using WSL2 with Ubuntu 20.04.1, system returns sh: 0: Can't open /usr/bin/rustup.

To Reproduce
Steps to reproduce the behavior:
Run $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /usr/bin/rustup toolchain install stable

Expected behavior
Expected dependencies to install

Screenshots

From clipboard:

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /usr/bin/rustup toolchain install stable
sh: 0: Can't open /usr/bin/rustup
curl: (23) Failed writing body (0 != 15974)

Desktop (please complete the following information):

  • OS: Windows 10 Pro using WSL2 Ubuntu 20.04.1 LTS (GNU/Linux 4.19.104-microsoft-standard x86_64)

Read-only mode (viewer mode) when called as "rox" or with -r

Is your feature request related to a problem? Please describe.
It's better to use the same editor both as editor and as viewer or pager (e.g. as replacement for less). To use ox as viewer, readonly mode must be supported.

Describe the solution you'd like
When ox is invoked as "rox", it should read content of file from stdin or from file, if specified, and display it in readonly mode.

Describe alternatives you've considered
Currently, less or vim are used as pager.

Need a help page while inside ox

As a new user, I need a prominently listed hotkey while inside the app to access a help page with a list of commands.

Describe the solution you'd like
Instead of having to reference a separate website window with a list of hotkeys, I would like a page with a list or cheatsheet of hotkeys so i can quickly hit a hotkey (ex. ctrl-/) and get a list of accepted hotkeys. This help hotkey should always be listed at the bottom status bar.

Also if i hit invalid ctrl-[key] hotkey. a message should say "invalid hotkey: ctrl-[key]"

Line numbers

Is your feature request related to a problem? Please describe.
Line numbers to know where you are in a file.

Describe the solution you'd like
Have line numbers to the side of the file and they automatically shrink and grow to conserve line length space.

Support more shortcuts?

Not specifically lake vim, but things li'e dd to erase a line, or some shortcut to erase a word or replace it would be useful.

Thanks.

Windows OS Support

Hi,

I was really eager to try ox but wasn't able to compile it on my system.
It seems to be due to its dependency towards termion, which lacks for Windows support (as stated here). You can see my error log below :

error[E0433]: failed to resolve: unresolved import
--> C:\Users\cdeliquaire.cargo\registry\src\github.com-1ecc6299db9ec823\termion-1.5.5\src\lib.rs:24:9
|
24 | pub use sys::size::terminal_size;
| ^^^
| |
| unresolved import
| help: a similar path exists: color::env::sys

Do you plan to support Windows OS someday ?
If so, It seems that some people/projects successfuly switched to crossterm instead of termion to gain true multi-platform terminal support, I don't know if it supports the whole feature set ox requires, but this could be a lead.

Thanks by advance.

Paste bug

Describe the bug
Pasting into Ox with LXTerminal creates mangled data
Edit: Deepin Terminal as well
To Reproduce
Steps to reproduce the behaviour:

  1. run ox example.txt
  2. paste in a string/sentence
  3. see mangled version of string

Expected behavior
Paste in data without it becoming mangled

Desktop (please complete the following information):

  • OS: Debian Linux

Crash in Menu

Describe the bug
Hitting backspace twice in menu makes ox crash

To Reproduce

  • Launch ox
ox
  • Hit backspace twice
  • ox crash with following error:
 ~  thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/document.rs:385:21                                                    
 ~                                                                                                          note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                                                                                                                       
 ~                       Abandon (core dumped)  

Expected behavior
No crash

Desktop (please complete the following information):

  • Manjaro linux with ox-git r272.bb9184b-1 from AUR
  • CentOS 7.8.2003 + ox v0.2.6 built with rust 1.46

Multitasking with tabs

Is your feature request related to a problem? Please describe.
Another burden with Ox is that you can't open up multiple files and edit them in one instance, Ox only opens one file at a time, making it a total pain to work on a project of multiple files.

Describe the solution you'd like
To have tabs that one can switch between with a nice little tab bar at the top with the names and dirty status of them, Also with a save all command to save everything.

Describe alternatives you've considered
N/A

Smart rendering

Is your feature request related to a problem? Please describe.
Ox still uses too much CPU despite the improvements implemented in 0.1.1. It also flickers in the TTY whenever the keyboard is interacted with.

Describe the solution you'd like
I would like Ox to use far less CPU by rendering the necessary lines e.g. only the status line and actual cursor position when using the relevant keys.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.