Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 56db8bd8d2 | |||
| a32ef2ff53 | |||
| 0c0c3d9ce5 | |||
| 7245003769 | |||
| 542b1d90a0 | |||
| a359f4e6c4 | |||
| a03dd0c433 | |||
| 561faf537c | |||
| 3a36b35c1f | |||
|
|
b1cb2532f6 | ||
| 9f33cdc0e4 | |||
| afcc33329f | |||
| 128235283c | |||
| af3c0eddc4 | |||
| f8f01f7dd6 | |||
| 8206ab0a40 | |||
| af8dcb847e | |||
| 9434a34116 | |||
| 3b2b60466c | |||
| 52e1f2dd8b | |||
| 8bb9228339 | |||
| e937e3398c | |||
| f147c866ab | |||
| 1227d0abf4 | |||
| d3591331a5 | |||
| 5eafc1a34b | |||
| a0103dd5aa | |||
| 3782880062 |
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15)
|
|||||||
project(ke C) # Specify C language explicitly
|
project(ke C) # Specify C language explicitly
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
set(KE_VERSION "1.1.1")
|
set(KE_VERSION "1.3.5")
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "-Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g")
|
set(CMAKE_C_FLAGS "-Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DEFAULT_SOURCE -D_XOPEN_SOURCE")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DEFAULT_SOURCE -D_XOPEN_SOURCE")
|
||||||
|
|||||||
9
Makefile
9
Makefile
@@ -1,8 +1,9 @@
|
|||||||
TARGET := ke
|
TARGET := ke
|
||||||
KE_VERSION := devel
|
KE_VERSION := devel
|
||||||
|
DEST := $(HOME)/.local/bin/$(TARGET)
|
||||||
|
|
||||||
CFLAGS := -Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g
|
CFLAGS := -Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g
|
||||||
|
CFLAGS += -Wno-unused-result
|
||||||
CFLAGS += -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
|
CFLAGS += -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
|
||||||
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||||
|
|
||||||
@@ -13,8 +14,14 @@ all: $(TARGET) test.txt
|
|||||||
$(TARGET): main.c
|
$(TARGET): main.c
|
||||||
$(CC) $(CFLAGS) -o $(TARGET) $(LDFLAGS) main.c
|
$(CC) $(CFLAGS) -o $(TARGET) $(LDFLAGS) main.c
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
#install: $(TARGET)
|
||||||
|
install:
|
||||||
|
cp $(TARGET) $(DEST)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(TARGET)
|
rm -f $(TARGET)
|
||||||
|
rm -f asan.log*
|
||||||
|
|
||||||
.PHONY: test.txt
|
.PHONY: test.txt
|
||||||
test.txt:
|
test.txt:
|
||||||
|
|||||||
@@ -16,3 +16,6 @@ To get verbose ASAN messages:
|
|||||||
export LSAN_OPTIONS=verbosity=1:log_threads=1
|
export LSAN_OPTIONS=verbosity=1:log_threads=1
|
||||||
|
|
||||||
Released under an ISC license.
|
Released under an ISC license.
|
||||||
|
|
||||||
|
Started by following along with kilo:
|
||||||
|
https://viewsourcecode.org/snaptoken/kilo/
|
||||||
|
|||||||
27
default.nix
Normal file
27
default.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
installShellFiles,
|
||||||
|
stdenv,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "ke";
|
||||||
|
version = "1.3.5";
|
||||||
|
|
||||||
|
src = lib.cleanSource ./.;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp ke $out/bin/
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
installManPage ke.1
|
||||||
|
'';
|
||||||
|
}
|
||||||
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1763835633,
|
||||||
|
"narHash": "sha256-HzxeGVID5MChuCPESuC0dlQL1/scDKu+MmzoVBJxulM=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "050e09e091117c3d7328c7b2b7b577492c43c134",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
18
flake.nix
Normal file
18
flake.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
description = "Kyle's Text Editor";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ self, nixpkgs }:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.x86_64-linux = {
|
||||||
|
default = pkgs.callPackage ./default.nix { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
35
ke.1
35
ke.1
@@ -19,21 +19,26 @@ is
|
|||||||
K-command mode is entered using C-k. This is taken from Wordstar and just
|
K-command mode is entered using C-k. This is taken from Wordstar and just
|
||||||
so happens to be blessed with starting with a most excellent letter of
|
so happens to be blessed with starting with a most excellent letter of
|
||||||
grandeur. Many commands work with and without control; for example,
|
grandeur. Many commands work with and without control; for example,
|
||||||
saving a file can be done with either C-k s or C-k C-s.
|
saving a file can be done with either C-k s or C-k C-s. Other commands work
|
||||||
.Pp
|
with ESC or CTRL.
|
||||||
|
.Sh K-COMMANDS
|
||||||
.Bl -tag -width xxxxxxxxxxxx -offset indent
|
.Bl -tag -width xxxxxxxxxxxx -offset indent
|
||||||
.It C-k BACKSPACE
|
.It C-k BACKSPACE
|
||||||
Delete from the cursor to the beginning of the line.
|
Delete from the cursor to the beginning of the line.
|
||||||
|
.It C-k SPACE
|
||||||
|
Toggle the mark.
|
||||||
.It C-k d
|
.It C-k d
|
||||||
Delete from the cursor to the end of the line.
|
Delete from the cursor to the end of the line.
|
||||||
.It C-k C-d
|
.It C-k C-d
|
||||||
Delete the entire link.
|
Delete the entire line.
|
||||||
.It C-k e
|
.It C-k e
|
||||||
Edit a new file. Also C-k C-e.
|
Edit a new file. Also C-k C-e.
|
||||||
.It C-k f
|
.It C-k f
|
||||||
Incremental find.
|
Incremental find.
|
||||||
.It C-k g
|
.It C-k g
|
||||||
Go to a specific line. Also C-k C-g.
|
Go to a specific line. Also C-k C-g.
|
||||||
|
.It C-k l
|
||||||
|
List the number of lines of code in a saved file.
|
||||||
.It C-k m
|
.It C-k m
|
||||||
Run make(1).
|
Run make(1).
|
||||||
.It C-k q
|
.It C-k q
|
||||||
@@ -42,9 +47,33 @@ exit the editor. Also C-k C-q.
|
|||||||
save the file, prompting for a filename if needed. Also C-k C-s.
|
save the file, prompting for a filename if needed. Also C-k C-s.
|
||||||
.It C-k x
|
.It C-k x
|
||||||
save the file and exit. Also C-k C-x.
|
save the file and exit. Also C-k C-x.
|
||||||
|
.It C-k y
|
||||||
|
Yank the killring.
|
||||||
.It C-k \[char92]
|
.It C-k \[char92]
|
||||||
Dump core.
|
Dump core.
|
||||||
.El
|
.El
|
||||||
|
.Sh OTHER KEYBINDINGS
|
||||||
|
.Bl -tag -width xxxxxxxxxxxx -offset indent
|
||||||
|
.It C-l
|
||||||
|
Refresh the display.
|
||||||
|
.It C-s
|
||||||
|
Incremental find.
|
||||||
|
.It C-w
|
||||||
|
Kill the region if the mark is set.
|
||||||
|
.It C-y
|
||||||
|
Yank the killring.
|
||||||
|
.It ESC BACKSPACE
|
||||||
|
Delete the previous word.
|
||||||
|
.It ESC b
|
||||||
|
Move to the previous word.
|
||||||
|
.It ESC d
|
||||||
|
Delete the next word.
|
||||||
|
.It ESC f
|
||||||
|
Move to the next word.
|
||||||
|
.It ESC w
|
||||||
|
Save the region (if the mark is set) to the killring.
|
||||||
|
.It
|
||||||
|
.El
|
||||||
.Sh FIND
|
.Sh FIND
|
||||||
The find operation is an incremental search. The up or left arrow keys will
|
The find operation is an incremental search. The up or left arrow keys will
|
||||||
go to the previous result, while the down or right arrow keys will go to
|
go to the previous result, while the down or right arrow keys will go to
|
||||||
|
|||||||
Reference in New Issue
Block a user