Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 128235283c | |||
| af3c0eddc4 | |||
| f8f01f7dd6 | |||
| 8206ab0a40 | |||
| af8dcb847e | |||
| 9434a34116 | |||
| 3b2b60466c | |||
| 52e1f2dd8b | |||
| 8bb9228339 | |||
| e937e3398c | |||
| f147c866ab | |||
| 1227d0abf4 | |||
| d3591331a5 | |||
| 5eafc1a34b | |||
| a0103dd5aa | |||
| 3782880062 | |||
| e345b55595 | |||
| d1978a3b98 | |||
| 5ee8234ab7 | |||
| f82d1f8831 | |||
| 2019ec10ce | |||
| 0110f82705 | |||
| a62a8e50fa | |||
| 33e19e7d76 | |||
| fd01e3593f | |||
| 47bbc5339c | |||
| 2962a6c92e | |||
| 7fa887273b | |||
| fb02f37512 | |||
| 1722dbee0b | |||
| 14199afeb5 | |||
| 9f3558c430 | |||
| ce64e4637d | |||
| 36013e42e4 | |||
| dd667c1ef5 | |||
| c9977b0fc0 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,4 @@
|
|||||||
*.log
|
*.log
|
||||||
build
|
build
|
||||||
|
ke
|
||||||
|
*.txt
|
||||||
@@ -2,20 +2,29 @@ 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.0.4")
|
set(KE_VERSION "1.3.0")
|
||||||
|
|
||||||
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")
|
||||||
|
|
||||||
|
# Optionally enable AddressSanitizer (ASan)
|
||||||
|
option(ENABLE_ASAN "Enable AddressSanitizer for builds" OFF)
|
||||||
|
|
||||||
|
if (ENABLE_ASAN)
|
||||||
|
message(STATUS "ASan enabled")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
|
||||||
|
# Ensure the sanitizer is linked too (especially important on some platforms)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# Add executable
|
# Add executable
|
||||||
add_executable(ke main.c)
|
add_executable(ke main.c)
|
||||||
|
|
||||||
# Define KE_VERSION for use in C code (e.g., #define KE_VERSION)
|
|
||||||
target_compile_definitions(ke PRIVATE KE_VERSION="ke version ${KE_VERSION}")
|
target_compile_definitions(ke PRIVATE KE_VERSION="ke version ${KE_VERSION}")
|
||||||
|
install(TARGETS ke RUNTIME DESTINATION bin)
|
||||||
|
install(FILES ke.1 TYPE MAN)
|
||||||
|
|
||||||
|
install(TARGETS ke RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
install(FILES ke.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||||
|
|
||||||
# Set output properties
|
|
||||||
set_target_properties(ke PROPERTIES
|
|
||||||
FOLDER bin
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY bin
|
|
||||||
)
|
|
||||||
27
Makefile
Normal file
27
Makefile
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
TARGET := ke
|
||||||
|
KE_VERSION := devel
|
||||||
|
DEST := $(HOME)/.local/bin/$(TARGET)
|
||||||
|
|
||||||
|
CFLAGS := -Wall -Wextra -pedantic -Wshadow -Werror -std=c99 -g
|
||||||
|
CFLAGS += -D_DEFAULT_SOURCE -D_XOPEN_SOURCE
|
||||||
|
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
||||||
|
|
||||||
|
LDFLAGS := -fsanitize=address
|
||||||
|
|
||||||
|
all: $(TARGET) test.txt
|
||||||
|
|
||||||
|
$(TARGET): main.c
|
||||||
|
$(CC) $(CFLAGS) -o $(TARGET) $(LDFLAGS) main.c
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
#install: $(TARGET)
|
||||||
|
install:
|
||||||
|
cp $(TARGET) $(DEST)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(TARGET)
|
||||||
|
rm -f asan.log*
|
||||||
|
|
||||||
|
.PHONY: test.txt
|
||||||
|
test.txt:
|
||||||
|
cp test.txt.bak $@
|
||||||
@@ -11,4 +11,8 @@ It should be available via homebrew, even:
|
|||||||
brew tap kisom/homebrew-tap
|
brew tap kisom/homebrew-tap
|
||||||
brew install ke
|
brew install ke
|
||||||
|
|
||||||
Released under an ISC license.
|
To get verbose ASAN messages:
|
||||||
|
|
||||||
|
export LSAN_OPTIONS=verbosity=1:log_threads=1
|
||||||
|
|
||||||
|
Released under an ISC license.
|
||||||
|
|||||||
6
ke.1
6
ke.1
@@ -26,6 +26,8 @@ saving a file can be done with either C-k s or C-k C-s.
|
|||||||
Delete from the cursor to the beginning of the line.
|
Delete from the cursor to the beginning of the line.
|
||||||
.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
|
||||||
|
Delete the entire link.
|
||||||
.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
|
||||||
@@ -40,7 +42,9 @@ 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 \
|
.It C-k y
|
||||||
|
Yank the killring.
|
||||||
|
.It C-k \[char92]
|
||||||
Dump core.
|
Dump core.
|
||||||
.El
|
.El
|
||||||
.Sh FIND
|
.Sh FIND
|
||||||
|
|||||||
15
test.txt.bak
Normal file
15
test.txt.bak
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
hello
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
world it is me
|
||||||
|
but I am not me
|
||||||
Reference in New Issue
Block a user