A very religious text editor

 --== Godit - a very religious text editor ==--

Screenshots:

 * https://nosmileface.dev/images/godit-linux1.png
 * https://nosmileface.dev/images/godit-linux2.png

I call it religious, because there is a strong faith in the "one true way"
of doing things. By that I mean things like: "the tab size is always an
equivalent to 8 spaces/characters" or "each line ends with '\n' symbol and
someone should end this '\r\n' madness" or "text files are always utf-8
encoded". Most editors provide customizable options for these things, but
godit takes a different approach in that area and has no settings at all. So,
that concludes the ideology behind godit.

If you're interested in what godit feels like, it would be fair to say that it
is an emacsish lightweight text editor. The godit uses many of the emacs key
bindings and operates using a notion of "micromodes". It's easier to explain
what a micromode is by a simple example. Let's take the keyboard macros feature
from both emacs and godit. You can start recording a macro using `C-x (` key
combination and then when you're ready to start repeating it, you do the
following: `C-x e (e...)`. Not only `C-x e` ends the recording of a macro, it
executes the macro once and enters a micromode, where typing `e` again, will
repeat that action. But as soon as some other key was pressed you quit this
micromode and everything is back to normal again. The idea of micromode is used
in godit a lot.


 --== List of keybindings ==--

Basic things:
  C-g              - Universal cancel button
  C-x C-c          - Quit from the godit
  C-x C-s          - Save file [prompt maybe]
  C-x S            - Save file (raw) [prompt maybe]
  C-x M-s          - Save file as [prompt]
  C-x M-S          - Save file as (raw) [prompt]
  C-x C-f          - Open file
  M-g              - Go to line [prompt]
  C-/              - Undo
  C-x C-/ (C-/...) - Redo

View/buffer operations:
  C-x C-w          - View operations mode
  C-x 0            - Kill active view
  C-x 1            - Kill all views but active
  C-x 2            - Split active view vertically
  C-x 3            - Split active view horizontally
  C-x o            - Make a sibling view active
  C-x b            - Switch buffer in the active view [prompt]
  C-x k            - Kill buffer in the active view

View operations mode:
  v                - Split active view vertically
  h                - Split active view horizontally
  k                - Kill active view
  C-f, <right>     - Expand/shrink active view to the right
  C-b, <left>      - Expand/shrink active view to the left
  C-n, <down>      - Expand/shrink active view to the bottom
  C-p, <up>        - Expand/shrink active view to the top
  1, 2, 3, 4, ...  - Select view

Cursor/view movement and text editing:
  C-f, <right>     - Move cursor one character forward
  M-f              - Move cursor one word forward
  C-b, <left>      - Move cursor one character backward
  M-b              - Move cursor one word backward
  C-n, <down>      - Move cursor to the next line
  C-p, <up>        - Move cursor to the previous line
  C-e, <end>       - Move cursor to the end of line
  C-a, <home>      - Move cursor to the beginning of the line
  C-v, <pgdn>      - Move view forward (half of the screen)
  M-v, <pgup>      - Move view backward (half of the screen)
  C-l              - Center view on line containing cursor
  C-s              - Search forward [interactive prompt]
  C-r              - Search backward [interactive prompt]
  C-j              - Insert a newline character and autoindent
  <enter>          - Insert a newline character
  <backspace>      - Delete one character backwards
  C-d, <delete>    - Delete one character in-place
  M-d              - Kill word
  M-<backspace>    - Kill word backwards
  C-k              - Kill line
  M-u              - Convert the following word to upper case
  M-l              - Convert the following word to lower case
  M-c              - Capitalize the following word
  <any other key>  - Insert character

Mark and region operations:
  C-<space>        - Set mark
  C-x C-x          - Swap cursor and mark locations
  C-x > (>...)     - Indent region (lines between the cursor and the mark)
  C-x < (<...)     - Deindent region (lines between the cursor and the mark)
  C-x C-r          - Search & replace (within region) [prompt]
  C-x C-u          - Convert the region to upper case
  C-x C-l          - Convert the region to lower case
  C-w              - Kill region (between the cursor and the mark)
  M-w              - Copy region (between the cursor and the mark)
  C-y              - Yank (aka Paste) previously killed/copied text
  M-q              - Fill region (lines between the cursor and the mark) [prompt]

Advanced:
  M-/              - Local words autocompletion
  C-x C-a          - Invoke buffer specific autocompletion menu [menu]
  C-x (            - Start keyboard macro recording
  C-x )            - Stop keyboard macro recording
  C-x e (e...)     - Stop keyboard macro recording and execute it
  C-x =            - Info about character under the cursor
  C-x !            - Filter region through an external command [prompt]


 --== Current development state==--

I'm still in process of designing some parts of it. Bits of functionality are
missing, but frankly I write godit in godit already and I use godit for
everything else on my system (EDITOR=godit). This README was written in godit
from scratch, I write commit messages in godit, I write code in godit, I write
configs and scripts in godit. The editor is definitely usable, but it is
certain that some corner cases are not covered. Just try it, perhaps you would
like it. Oh and I'm very picky about feature suggestions at the moment,
suggest, but don't expect too much.
Comments
  • Can't quit on Windows

    Can't quit on Windows

    Do you know why the sequence C-x C-c locks the command prompt on Win7? Its like the editor is quitting but the terminal isn't left in a good state and everything is locked.

  • render ASCII on windows

    render ASCII on windows

    As you know, on windows, there are some unicode points that doesn't render correctly. For example, east asian ambiguous width. It is not a problem of godit. Not a problem of termbox-go. it is a problem of ambiguous character widths. so i want to suggest to use ASCII characters for rendering borders on windows.

    Before

    After

    Currenly, this is ugly patch. if you want this change, I'll update.

  • Cannot compile and run godit.

    Cannot compile and run godit.

    Must be doing something wrong:

    $ go run /Users/johanlundberg/gocode/src/github.com/nsf/godit/godit.go

    src/github.com/nsf/godit/godit.go:53: undefined: view_tree src/github.com/nsf/godit/godit.go:54: undefined: view_tree src/github.com/nsf/godit/godit.go:55: undefined: buffer src/github.com/nsf/godit/godit.go:56: undefined: vcommand_class src/github.com/nsf/godit/godit.go:59: undefined: overlay_mode src/github.com/nsf/godit/godit.go:87: undefined: buffer src/github.com/nsf/godit/godit.go:131: undefined: buffer src/github.com/nsf/godit/godit.go:183: undefined: buffer src/github.com/nsf/godit/godit.go:336: undefined: view_tree src/github.com/nsf/godit/godit.go:365: undefined: view_tree src/github.com/nsf/godit/godit.go:365: too many errors

  • Fit to window

    Fit to window

    godit is so sweet. I tried this on windows.

    But I uses cmd.exe with 500 liens buffer, So scrollbar is always displayed. Then, I hope to fit window to visible rectangle. For example, vim.exe is doing that.

    Vim

    Godit

    SetConsoleWindowInfo can do it. Or CreateConsoleScreenBuffer create alternate window that fit the rectangle.

  • M-q should combine lines, not just split them

    M-q should combine lines, not just split them

    godit RET foo RET bar RET M-q RET RET

    Expected to see "foo bar" See two lines, "foo" and "bar"

    E.g. https://github.com/kr/text has the necessary logic.

  • Can't press any keys using AltGr

    Can't press any keys using AltGr

    I use the german keyboard layout and for example left brace is typed in with AltGr+7. But if I press this it runs the undo action. Right brace would be AltGr+9 but when I do this it doesn't do anything.

  • Correct rune width

    Correct rune width

    https://github.com/nsf/termbox-go/pull/21

    I know runWidth is in also termbox-go. So if you mind this, please move it into some where. And I'll working to add utf8.RuneWidth() into unicode/utf8 after the release of go1.1

  • Support suspend on all POSIX systems

    Support suspend on all POSIX systems

    Credit where credit is due: this change comes verbatim from Gomacs^0 which, in turn, adapted it from Micro.^1

    With this change applied, I tested suspend and resume of godit on Linux, FreeBSD, and macOS: it works.

  • Fix minor cursor position bug with no-op 'C-x <'

    Fix minor cursor position bug with no-op 'C-x <'

    C-x < has a very minor cursor position issue: it moves the cursor one byte to the left even if the current line had no indentation and the operation was a no-op for it.

    To reproduce, mark a region ending with a line that has no indentation, putting the cursor on a column greater than zero. Then invoke C-x <: it will move the cursor one byte to the left even though the line is unchanged, and repeating the operation with < will continue to move the cursor to the left each time.

    The idea with moving the cursor to the left is to adjust for the deleted tab, but if no tab was deleted, then the cursor should remain where it was.

  • files updated by gofmt

    files updated by gofmt

    I usually run go fmt after I edit a source file, just to make sure I didn't screw up the formatting too badly, and was a little surprised to see some changes in code I didn't touch. Making these updates probably minimizes the surprise others would have when updating the code.

  • How it works?

    How it works?

    Can you write a bit about how it works? I'm interested in how you store an open file and undo history. What happens when you open a new file, and what happens when you copypaste something from one part of file to another.

  • syntax coloring?

    syntax coloring?

    I know, you're happy with it, but anyway to link in go syntax coloring?

    (starting to use Go alot in vagrant/CoreOS/Docker stuff. When I install go in coreos and docker, I usually install godit too (which I rename to emacs) and then I am good-to-go...)

  • Question: Are you open to adding vim-like key-bindings?

    Question: Are you open to adding vim-like key-bindings?

    I'd like to use this editor because of its simplicity, responsiveness etc., but I'm used to vim-bindings in conjunction with some basic state-behavior (contrary to state-less as the current emacs-like one).

    I'm aware of the "very religious" statement, but why not being "very schizophrenic-religious"? :)

    Are there any plans to support it in the future?

Related tags
A graphical text editor
A graphical text editor

A A is a text editor inspired by the Sam and Acme text editors for the Plan 9 operating system. binary Latest Binaries https://github.com/as/a/release

Dec 13, 2022
A Programmer's Text Editor
A Programmer's Text Editor

The de Editor de is a programmer's editor. (Where that programmer happens to be driusan.) It's kind of like a bastard child of vim and Plan 9's acme e

Dec 8, 2022
A modern and intuitive terminal-based text editor
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals.

Dec 30, 2022
Source code editor written in Go using go-gtk bindings. It aims to handle navigation effectively among large number of files.
Source code editor written in Go using go-gtk bindings. It aims to handle navigation effectively among large number of files.

tabby Source code editor written in Go using go-gtk bindings. It aims to handle navigation effectively among large number of files. screenshot: depend

Nov 16, 2022
An Enhanced Go Experience For The Atom Editor
An Enhanced Go Experience For The Atom Editor

go-plus An Improved Go Experience For The Atom Editor Github: https://github.com/joefitzgerald/go-plus Atom: https://atom.io/packages/go-plus Overview

Dec 26, 2022
Go version of Plan9 Acme Editor

Overview Go port of Rob Pike's Acme editor. Derived from ProjectSerenity but now increasingly divergent. ProjectSerenity was itself a transliteration

Dec 24, 2022
Binary editor written in Go
Binary editor written in Go

bed Binary editor written in Go Screenshot Why? Why not? Programming is so fun! I learned so much while creating this editor; handling of file pointer

Jan 5, 2023
WYSIWYG theme editor for Fyne
WYSIWYG theme editor for Fyne

fyne-theme-generator WYSIWYG theme editor for Fyne Installation go get github.com/lusingander/fyne-theme-generator Usage You can change each parameter

Jan 5, 2023
MdEdit is a Vi-like markdown editor built using Gio

MdEdit MdEdit is a Vi-like markdown editor built using Gio. It is extremely early stage software. The Vi editor lacks most functionality and might be

Jun 29, 2022
Nuke-Net is a VERY VERY over powered and ridiculous web crawler that is well- very very noisy XD read more here
Nuke-Net is a VERY VERY over powered and ridiculous web crawler that is well- very very noisy XD read more here

Nuke-Net is a VERY VERY over powered and ridiculous web crawler that is well- very very noisy XD read more here

Dec 20, 2021
Mini is a small text editor, inspred by antirez's kilo editor.
Mini is a small text editor, inspred by antirez's kilo editor.

mini Mini is a small text editor, inspred by antirez's kilo editor. It aims to Keep it simple, stupid.

Dec 23, 2022
NERV Editor - A simple but peculiar text editor
NERV Editor - A simple but peculiar text editor

nerved a simple but peculiar text editor introduction nerved is a text editor bu

Oct 24, 2022
A very very simple CLI tool to know the next and previous SpaceX flights.

Rocket A very very simple CLI tool to know the next and previous SpaceX flights. Commands rocket Get the next flight. rocket latest Get the last fligh

Apr 19, 2021
A very simple and powerful package for making REST requests with very little effort

Welcome to KRest KRest stands for Keep it simple REST Package. It's a very simple and powerful package wrapper over the standard http package for maki

Dec 1, 2022
Go-Suit is a very very wacky version of a bash terminal but in go, however with a little twitst

Go-Suit Go-Suit is a very very wacky version of a bash terminal but in go, however with a little twitst languages -> Go-Lang packages Third Party -> g

May 19, 2022
A graphical text editor
A graphical text editor

A A is a text editor inspired by the Sam and Acme text editors for the Plan 9 operating system. binary Latest Binaries https://github.com/as/a/release

Dec 13, 2022
A Programmer's Text Editor
A Programmer's Text Editor

The de Editor de is a programmer's editor. (Where that programmer happens to be driusan.) It's kind of like a bastard child of vim and Plan 9's acme e

Dec 8, 2022
A modern and intuitive terminal-based text editor
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals.

Dec 30, 2022
A modern and intuitive terminal-based text editor
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals

Jan 7, 2023
A modern and intuitive terminal-based text editor
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals.

Jan 5, 2023