Skip to content

Commit

Permalink
Remove nano like frontend for now
Browse files Browse the repository at this point in the history
If time permits I still want to experiment with different editing
paradigms and write a proper nano/sandy/sam frontend but at the
moment it is just bitrotting and not very useful.
  • Loading branch information
martanne committed Jan 14, 2015
1 parent 6f53d32 commit 6eef82c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 79 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ config.h:
vis: config.h config.mk
@echo ${CC} ${CFLAGS} ${LDFLAGS} *.c -o $@
@${CC} ${CFLAGS} ${LDFLAGS} *.c -o $@
@ln -sf $@ nano

debug: clean
@make CFLAGS='${DEBUG_CFLAGS}'

clean:
@echo cleaning
@rm -f vis nano vis-${VERSION}.tar.gz
@rm -f vis vis-${VERSION}.tar.gz

dist: clean
@echo creating dist tarball
Expand Down
9 changes: 3 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,10 @@ Editor Frontends

The editor core is written in a library like fashion which should make
it possible to write multiple frontends with possibly different user
interfaces/paradigms.
interfaces/paradigms. The frontend to run is selected based on the
executable name.

At the moment there exists a barely functional, non-modal nano/sandy
like interface which was used during early testing. The default interface
is a vim clone called vis.

The frontend to run is selected based on the executable name.
The default interface is a vim clone called vis.

Key binding modes
-----------------
Expand Down
71 changes: 0 additions & 71 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -775,71 +775,6 @@ static Mode vis_modes[] = {
},
};

/* incomplete list of useful but currently missing functionality from nano's help ^G:
^X (F2) Close the current file buffer / Exit from nano
^O (F3) Write the current file to disk
^J (F4) Justify the current paragraph
^R (F5) Insert another file into the current one
^W (F6) Search for a string or a regular expression
^K (F9) Cut the current line and store it in the cutbuffer
^U (F10) Uncut from the cutbuffer into the current line
^T (F12) Invoke the spell checker, if available
^_ (F13) (M-G) Go to line and column number
^\ (F14) (M-R) Replace a string or a regular expression
^^ (F15) (M-A) Mark text at the cursor position
M-W (F16) Repeat last search
M-^ (M-6) Copy the current line and store it in the cutbuffer
M-V Insert the next keystroke verbatim
XXX: CONTROL(' ') = 0, ^Space Go forward one word
*/

static KeyBinding nano_keys[] = {
{ { CONTROL('D') }, call, { .f = editor_delete_key } },
BACKSPACE( call, f, editor_backspace_key ),
{ { CONTROL('F') }, movement, { .i = MOVE_CHAR_NEXT } },
{ { CONTROL('P') }, movement, { .i = MOVE_SCREEN_LINE_UP } },
{ { CONTROL('N') }, movement, { .i = MOVE_SCREEN_LINE_DOWN } },
{ { CONTROL('Y') }, wscroll, { .i = -PAGE } },
{ { KEY(F(7)) }, wscroll, { .i = -PAGE } },
{ { CONTROL('V') }, wscroll, { .i = +PAGE } },
{ { KEY(F(8)) }, wscroll, { .i = +PAGE } },
#if 0
// CONTROL(' ') == 0 which signals the end of array
{ { CONTROL(' ') }, movement, { .i = MOVE_LONGWORD_START_NEXT } },
#endif
{ { META(' ') }, movement, { .i = MOVE_LONGWORD_START_PREV } },
{ { CONTROL('A') }, movement, { .i = MOVE_LINE_START } },
{ { CONTROL('E') }, movement, { .i = MOVE_LINE_END } },
{ { META(']') }, movement, { .i = MOVE_BRACKET_MATCH } },
{ { META(')') }, movement, { .i = MOVE_PARAGRAPH_PREV } },
{ { META('(') }, movement, { .i = MOVE_PARAGRAPH_NEXT } },
{ { META('\\') }, movement, { .i = MOVE_FILE_BEGIN } },
{ { META('|') }, movement, { .i = MOVE_FILE_BEGIN } },
{ { META('/') }, movement, { .i = MOVE_FILE_END } },
{ { META('?') }, movement, { .i = MOVE_FILE_END } },
{ { META('U') }, undo, { NULL } },
{ { META('E') }, redo, { NULL } },
#if 0
{ { CONTROL('I') }, insert, { .s = "\t" } },
/* TODO: handle this in vis to insert \n\r when appriopriate */
{ { CONTROL('M') }, insert, { .s = "\n" } },
#endif
{ { CONTROL('L') }, call, { .f = editor_draw } },
{ /* empty last element, array terminator */ },
};

static Mode nano[] = {
{ .parent = NULL, .bindings = basic_movement, },
{ .parent = &nano[0], .bindings = nano_keys, .input = vis_mode_insert_input },
};

/* list of vis configurations, first entry is default. name is matched with
* argv[0] i.e. program name upon execution
*/
Expand All @@ -850,12 +785,6 @@ static Config editors[] = {
.statusbar = statusbar,
.keypress = vis_keypress,
},
{
.name = "nano",
.mode = &nano[1],
.statusbar = statusbar,
.keypress = vis_keypress,
},
};

/* default editor configuration to use */
Expand Down

0 comments on commit 6eef82c

Please sign in to comment.