├── .gitignore ├── License ├── Makefile ├── README ├── vuim.1 └── vuim.c /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | vuim 3 | -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | VUIM LICENSE License 2 | 3 | Copyright (c) ETERNITY GENGHIUS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software with heavy restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall not be seen 13 | by anyone except for your organization because this license should only 14 | be seen in a proprietary setting. 15 | 16 | Following the above copyright notice, (the "Software") must be licensed 17 | under a proprietary license and all redistribution of the software 18 | must be in a binary form and must be licensed for a high cost per year. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | THIS LICENSE IS PROVIDED UNDER THE VUIM LICENSE License AND ALL REDISTRIBUTION 29 | OF THIS LICENSE MUST BE UNDER THE GIVEN TERMS. 30 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .POSIX: 2 | 3 | PREFIX = /usr/local 4 | 5 | MYLIBS = ${LIBS} -l curses 6 | MYCPPFLAGS = ${CPPFLAGS} -D _POSIX_C_SOURCE=200809L 7 | 8 | all: vuim 9 | 10 | vuim: vuim.c 11 | ${CC} -o $@ ${MYCPPFLAGS} ${CFLAGS} ${LDFLAGS} vuim.c ${MYLIBS} 12 | 13 | clean: 14 | rm -f vuim 15 | 16 | install: vuim 17 | mkdir -p ${DESTDIR}${PREFIX}/bin 18 | cp vuim ${DESTDIR}${PREFIX}/bin/vuim 19 | mkdir -p ${DESTDIR}${PREFIX}/share/man/man1 20 | cp vuim.1 ${DESTDIR}${PREFIX}/share/man/man1/vuim.1 21 | 22 | uninstall: 23 | rm -f ${DESTDIR}${PREFIX}/bin/vuim 24 | rm -f ${DESTDIR}${PREFIX}/share/man/man1/vuim.1 25 | 26 | .PHONY: all clean install uninstall 27 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | #VUIM—Vi Un-IMproved 2 | 3 | The ultimate piece of garbage code. 4 | 5 | ##Features 6 | 7 | Figure them out yourself. 8 | 9 | ##User bloat protection. 10 | 11 | With no way to save files, VUIM protects the user from bloating their 12 | system; as anything you cannot commit to memory is probably useless 13 | bloatware. For example: Vim, this program is so bloated that it would 14 | be near impossible for any user to remember its entire source code. 15 | However, VUIM is so efficient and lightweight that the user can easily 16 | recall all its 126 lines of code. 17 | 18 | ##More Intended Features 19 | 20 | -terminal text is messed up after use 21 | 22 | ##Installation: 23 | 24 | VUIM should run on any system conforming to the Single UNIX 25 | Specification. 26 | 27 | make install 28 | -------------------------------------------------------------------------------- /vuim.1: -------------------------------------------------------------------------------- 1 | .Dd December 29, 2020 2 | .Dt VUIM 1 3 | .Os 4 | . 5 | .Sh NAME 6 | .Nm vuim 7 | .Nd vi unimproved 8 | . 9 | .Sh SYNOPSIS 10 | .Nm 11 | . 12 | .Sh DESCRIPTION 13 | .Nm 14 | is a text editor with a minimalist set of capabilities. 15 | It uses vi-like keybindings. 16 | . 17 | .Sh SEE ALSO 18 | .Xr vi 1 , 19 | .Xr vim 1 20 | . 21 | .Sh BUGS 22 | Watchu talking about? 23 | -------------------------------------------------------------------------------- /vuim.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void commandM(void); 5 | void insertM(void); 6 | 7 | void insertM(void){ 8 | while(1){ 9 | int ch = getch(); 10 | int y, x; 11 | switch (ch){ 12 | case KEY_BACKSPACE: 13 | nocbreak(); 14 | getyx(stdscr, y, x); 15 | if(x != 0){ 16 | move(y, --x); 17 | delch(); 18 | } 19 | cbreak(); 20 | break; 21 | case KEY_DC: 22 | nocbreak(); 23 | delch(); 24 | cbreak(); 25 | break; 26 | case 27: // key 27 | commandM(); 28 | break; 29 | case KEY_DOWN: 30 | getyx(stdscr, y, x); 31 | move(++y, x); 32 | break; 33 | case KEY_UP: 34 | getyx(stdscr, y, x); 35 | move(--y, x); 36 | break; 37 | case KEY_LEFT: 38 | getyx(stdscr, y, x); 39 | move(y, --x); 40 | break; 41 | case KEY_RIGHT: 42 | getyx(stdscr, y, x); 43 | move(y, ++x); 44 | break; 45 | case KEY_END: 46 | exit(0); 47 | break; 48 | default: 49 | waddch(stdscr, ch); 50 | break; 51 | } 52 | } 53 | } 54 | 55 | void commandM(void){ 56 | int ch; 57 | int y; 58 | int x; 59 | char modifier = 'm'; // m for move, d for delete. 60 | while(true){ 61 | ch = getch(); 62 | getyx(stdscr, y, x); 63 | switch(ch){ 64 | case '0': 65 | move(y, 0); 66 | break; 67 | case '$': 68 | while(winch(stdscr) != '\n'){ 69 | move(y, ++x); 70 | } 71 | break; 72 | case 'i': 73 | insertM(); 74 | break; 75 | case 'k': 76 | move(--y, x); 77 | break; 78 | case 'j': 79 | move(++y, x); 80 | break; 81 | case 'h': 82 | move(y, --x); 83 | break; 84 | case 'l': 85 | move(y, ++x); 86 | break; 87 | case 'd': 88 | modifier = 'd'; 89 | break; 90 | case 'w': 91 | switch(modifier){ 92 | case 'm': 93 | if(winch(stdscr) == ' '){ 94 | do{ 95 | move(y, ++x); 96 | }while(winch(stdscr) == ' '); 97 | } 98 | do{ 99 | move(y, ++x); 100 | }while(winch(stdscr) != ' '); 101 | break; 102 | case 'd': 103 | if(winch(stdscr) == ' '){ 104 | do{ 105 | delch(); 106 | }while(winch(stdscr) == ' '); 107 | } 108 | do{ 109 | delch(); 110 | }while(winch(stdscr) != ' '); 111 | modifier = 'm'; 112 | break; 113 | } 114 | break; 115 | case 'q': 116 | exit(0); 117 | } 118 | } 119 | } 120 | 121 | int main(void){ 122 | initscr(); 123 | cbreak(); 124 | noecho(); 125 | keypad(stdscr, TRUE); 126 | commandM(); 127 | } 128 | --------------------------------------------------------------------------------