Skip to content

Commit

Permalink
Merge pull request #61 from curlpipe/0.2.6
Browse files Browse the repository at this point in the history
0.2.6
  • Loading branch information
curlpipe authored Nov 7, 2020
2 parents 2ca56d8 + b4d22bc commit 6248bdd
Show file tree
Hide file tree
Showing 18 changed files with 1,553 additions and 592 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
*.log
bomb.txt
src/]
32 changes: 32 additions & 0 deletions .rpm/ox.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
%define __spec_install_post %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define debug_package %{nil}

Name: ox
Summary: A Rust powered text editor.
Version: @@VERSION@@
Release: @@RELEASE@@%{?dist}
License: GPL-2.0
Group: Applications/System
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/curlpipe/ox

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
%{summary}

%prep
%setup -q

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}
cp -a * %{buildroot}

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/*
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ox"
version = "0.2.5"
authors = ["Curly <[email protected]>"]
version = "0.2.6"
authors = ["Curlpipe <[email protected]>"]
edition = "2018"
description = "A Rust powered text editor."
homepage = "https://github.com/curlpipe/ox"
Expand All @@ -27,3 +27,12 @@ ron = "0.6.2"
serde = "1.0.117"
regex = "1.4.1"
directories = "3.0.1"

[package.metadata.rpm]
package = "ox"

[package.metadata.rpm.cargo]
buildflags = ["--release"]

[package.metadata.rpm.targets]
ox = { path = "/usr/bin/ox" }
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ Here is the current summary
- [X] Replacing text (0.2.3) [1549 lines]
- [X] Syntax highlighting (0.2.4) [1894 lines]
- [X] Tabs for multitasking (0.2.5) [2050 lines]
- [ ] Macros (0.2.6)
- [ ] Tweaks #1 (0.2.7)
- [ ] Tweaks #2 (0.2.8)
- [ ] Mouse support (0.2.9)
- [X] Macros (0.2.6) [2633 lines]
- [ ] Tweaks (0.2.7)
- [ ] Mouse support (0.2.8)
- [ ] Auto indentation (0.3.0)
- [ ] Prettifier / Automatic code formatter (0.3.0)
- [ ] Built In linter (0.3.0)
Expand Down
118 changes: 97 additions & 21 deletions config/ox.ron
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,108 @@
line_number_padding_left: 1, // Line number padding on the left
tab_width: 4, // The amount of spaces for a tab
undo_period: 5, // Seconds of inactivity for undo
// Values:
// %f - File name
// %F - File name with full path
// %I - Language specific icon with leading space
// %i - Language specific icon
// %n - Language name
// %l - Current line number in the document
// %L - Total number of lines in the document
// %x - X position of the cursor
// %y - Y position of the cursor
// %v - Version of the editor (e.g. 0.2.6)
// %d - Dirty file indicator text
// %D - Dirty file indicator icon
status_left: " %f%d %D │ %n %i", // Left part of status line
status_right: "並 %l / %L │ 﫦(%x, %y) ", // Right part of status line
tab: "%I%f%d", // Tab formatting
),

// Custom defined macros
macros: {
// Macro to move a line up
"move line up": [
"store line 1", // Store current line in bank #1
"delete 0", // Delete current line
"move 1 up", // Move cursor up by 1
"line above", // Insert an empty line above
"move 1 up", // Move cursor up to the empty line
"load line 1", // Load line in bank #1 over the empty line
],
// Macro to move a line down
"move line down": [
"store line 1", // Store the current line in bank #1
"delete 0", // Delete the current line
"line below", // Create an empty line below
"move 1 down", // Move cursor down to empty line
"load line 1", // Overwrite empty line with line in bank #1
],
},
// RGB values for the colours of Ox
theme: Theme(
editor_bg: (41, 41, 61), // The main background color
editor_fg: (255, 255, 255), // The default text color
status_bg: (59, 59, 84), // The background color of the status line
status_fg: (35, 240, 144), // The text color of the status line
line_number_fg: (65, 65, 98), // The text color of the line numbers
editor_bg: (41, 41, 61), // The main background color
editor_fg: (255, 255, 255), // The default text color
status_bg: (59, 59, 84), // The background color of the status line
status_fg: (35, 240, 144), // The text color of the status line
line_number_fg: (65, 65, 98), // The text color of the line numbers
active_tab_fg: (255, 255, 255), // The text color of the active tab
active_tab_bg: (41, 41, 61), // The background color of the active tab
inactive_tab_fg: (255, 255, 255), // The text color of the inactive tab(s)
inactive_tab_bg: (59, 59, 84), // The text color of the inactive tab(s)
default_theme: "default", // The default syntax highlights to use
),
// Colours for the syntax highlighting
highlights: {
"comments": (113, 113, 169),
"keywords": (134, 76, 232),
"references": (134, 76, 232),
"strings": (39, 222, 145),
"characters": (40, 198, 232),
"digits": (40, 198, 232),
"booleans": (86, 217, 178),
"functions": (47, 141, 252),
"structs": (47, 141, 252),
"macros": (223, 52, 249),
"attributes": (40, 198, 232),
"headers": (47, 141, 252),
"symbols": (47, 141, 252),
"global": (86, 217, 178),
"default": {
"comments": (113, 113, 169),
"keywords": (134, 76, 232),
"references": (134, 76, 232),
"strings": (39, 222, 145),
"characters": (40, 198, 232),
"digits": (40, 198, 232),
"booleans": (86, 217, 178),
"functions": (47, 141, 252),
"structs": (47, 141, 252),
"macros": (223, 52, 249),
"attributes": (40, 198, 232),
"headers": (47, 141, 252),
"symbols": (47, 141, 252),
"global": (86, 217, 178),
},
"alternative": {
"comments": (113, 113, 169),
"keywords": (64, 86, 244),
"references": (64, 86, 244),
"strings": (76, 224, 179),
"characters": (110, 94, 206),
"digits": (4, 95, 204),
"booleans": (76, 224, 179),
"functions": (4, 95, 204),
"structs": (4, 95, 204),
"macros": (110, 94, 206),
"attributes": (4, 95, 204),
"headers": (141, 129, 217),
"symbols": (249, 233, 0),
"global": (76, 224, 179),
},
},
// Key bindings
keys: {
// Keybinding: [Oxa commands]
Ctrl('q'): ["quit"], // Quit current document
Ctrl('s'): ["save"], // Save current document
Ctrl('w'): ["save ?"], // Save current document as
Ctrl('p'): ["save *"], // Save all open documents
Ctrl('n'): ["new"], // Create new document
Ctrl('o'): ["open"], // Open document
Ctrl('d'): ["prev"], // Move to previous tab
Ctrl('h'): ["next"], // Move to next tab
Ctrl('z'): ["undo"], // Undo last edit
Ctrl('y'): ["redo"], // Redo last edit
Ctrl('f'): ["search"], // Trigger search command
Ctrl('r'): ["replace"], // Trigger replace command
Ctrl('a'): ["replace *"], // Trigger replace all command
Alt('a'): ["cmd"], // Open the command line
},
// Language specific settings
languages: [
Expand Down Expand Up @@ -98,7 +174,7 @@
"\\b([a-z_][a-zA-Z0-9_]*!)",
],
"attributes": [
"^\\s*(#(?:!|)\\[.*?\\])",
"(?ms)^\\s*(#(?:!|)\\[.*?\\])",
],
"references": [
"&str", "&mut", "&self",
Expand Down
Loading

0 comments on commit 6248bdd

Please sign in to comment.