forked from zyedidia/micro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macro: renamed the project from micro
licensed under MIT renamed because I wanted a separated configuration so ~/.config/macro seemed reasonable this fork is just a custom baked micro editor and I just share its code please do not report bugs to upstream as those might be mine
- Loading branch information
1 parent
4d34a48
commit 6c65660
Showing
45 changed files
with
1,361 additions
and
4,343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,208 +1,76 @@ | ||
# Micro | ||
#  Macro [](https://go.dev) [](https://lua.org) | ||
|
||
 | ||
](https://github.com/zyedidia/micro/releases) | ||
> Modeless (simple) terminal text editor done right. | ||
**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. It comes as a single, batteries-included, static binary with no dependencies; you can download and use it right now! | ||
**macro** is a fork of the Micro editor providing a separate configuration path and additional features to suit my taste. | ||
|
||
As its name indicates, micro aims to be somewhat of a successor to the nano editor by being easy to install and use. | ||
It strives to be enjoyable as a full-time editor for people who prefer to work in a terminal, or those who regularly edit files over SSH. | ||
**micro** by [Zachary Yedidia](https://github.com/zyedidia) 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. | ||
|
||
Here is a picture of micro editing its source code. | ||
Head over [Micro-Editor's website](https://micro-editor.github.io) for more informations. | ||
|
||
 | ||
## Main features | ||
|
||
To see more screenshots of micro, showcasing some of the default color schemes, see [here](https://micro-editor.github.io). | ||
|
||
You can also check out the website for Micro at https://micro-editor.github.io. | ||
|
||
## Table of Contents | ||
|
||
- [Features](#features) | ||
- [Installation](#installation) | ||
- [Building from source](#building-from-source) | ||
- [Fully static binary](#fully-static-binary) | ||
- [macOS terminal](#macos-terminal) | ||
- [Linux clipboard support](#linux-clipboard-support) | ||
- [Colors and syntax highlighting](#colors-and-syntax-highlighting) | ||
- [Usage](#usage) | ||
- [Documentation and Help](#documentation-and-help) | ||
- [Upstream](#upstream) | ||
|
||
- - - | ||
|
||
## Features | ||
|
||
- Easy to use and install. | ||
- No dependencies or external files are needed — just the binary you can download further down the page. | ||
- Modeless editor: like what you're probably used to. | ||
- Written in go, easy and fast to compile: and most likely cross-platform (where Go runs on). | ||
- Sane defaults and keybindings (^S, ^C, ^V, ^Q…). | ||
- Easy configuration via JSON. | ||
- Easy plugins via Lua. | ||
- Multiple cursors. | ||
- Common keybindings (<kbd>Ctrl-s</kbd>, <kbd>Ctrl-c</kbd>, <kbd>Ctrl-v</kbd>, <kbd>Ctrl-z</kbd>, …). | ||
- Keybindings can be rebound to your liking. | ||
- Sane defaults. | ||
- You shouldn't have to configure much out of the box (and it is extremely easy to configure). | ||
- Splits and tabs. | ||
- nano-like menu to help you remember the keybindings. | ||
- Extremely good mouse support. | ||
- This means mouse dragging to create a selection, double click to select by word, and triple click to select by line. | ||
- Cross-platform (it should work on all the platforms Go runs on). | ||
- Note that while Windows is supported, Mingw/Cygwin is not (see below). | ||
- Plugin system (plugins are written in Lua). | ||
- micro has a built-in plugin manager to automatically install, remove, and update plugins. | ||
- Built-in diff gutter. | ||
- Wonderful mouse support (selection, drag, double-click, triple-click…). | ||
- Diff gutter and line numbers. | ||
- Simple autocompletion. | ||
- Persistent undo. | ||
- Automatic linting and error notifications. | ||
- Syntax highlighting for over [130 languages](runtime/syntax). | ||
- Color scheme support. | ||
- By default, micro comes with 16, 256, and true color themes. | ||
- True color support (set the `MICRO_TRUECOLOR` environment variable to 1 to enable it). | ||
- Copy and paste with the system clipboard. | ||
- Small and simple. | ||
- Easily configurable. | ||
- Syntax highlighting for 100+ languages. | ||
- Theming: color scheme support (16, 256 and true color support). | ||
- Macros. | ||
- Common editor features such as undo/redo, line numbers, Unicode support, soft wrapping, … | ||
|
||
## Installation | ||
|
||
To install micro, you can download a [prebuilt binary](https://github.com/zyedidia/micro/releases), or you can build it from source. | ||
- Common editor features such as (persistent) undo/redo, Unicode support, soft wrapping… | ||
|
||
If you want more information about ways to install micro, see this [wiki page](https://github.com/zyedidia/micro/wiki/Installing-Micro). | ||
|
||
Use `micro -version` to get the version information after installing. It is only guaranteed that you are installing the most recent | ||
stable version if you install from the prebuilt binaries, Homebrew, or Snap. | ||
|
||
A desktop entry file and man page can be found in the [assets/packaging](https://github.com/zyedidia/micro/tree/master/assets/packaging) directory. | ||
|
||
**Note for Linux desktop environments:** | ||
|
||
For interfacing with the local system clipboard, the following tools need to be installed: | ||
* For X11, `xclip` or `xsel` | ||
* For [Wayland](https://wayland.freedesktop.org/), `wl-clipboard` | ||
|
||
Without these tools installed, micro will use an internal clipboard for copy and paste, but it won't be accessible to external applications. | ||
|
||
### Building from source | ||
|
||
If your operating system does not have a binary release, but does run Go, you can build from source. | ||
## Building from source | ||
|
||
Make sure that you have Go version 1.16 or greater and Go modules are enabled. | ||
|
||
``` | ||
git clone https://github.com/zyedidia/micro | ||
git clone https://github.com/shkschneider/macro | ||
cd micro | ||
make build | ||
sudo mv micro /usr/local/bin # optional | ||
``` | ||
|
||
You could also need: | ||
|
||
``` | ||
go get github.com/zyedidia/clipboard | ||
go get github.com/zyedidia/tcell | ||
go get github.com/zyedidia/micro/cmd/micro/shellwords | ||
make build | ||
``` | ||
|
||
The binary will be placed in the current directory and can be moved to | ||
The binary (`./macro`) will be placed in the current directory and can be moved to | ||
anywhere you like (for example `/usr/local/bin`). | ||
|
||
The command `make install` will install the binary to `$GOPATH/bin` or `$GOBIN`. | ||
|
||
You can install directly with `go get` (`go get github.com/zyedidia/micro/cmd/micro`) but this isn't | ||
recommended because it doesn't build micro with version information (necessary for the plugin manager), | ||
and doesn't disable debug mode. | ||
|
||
### Fully static binary | ||
|
||
By default, the micro binary will dynamically link with core system libraries (this is generally | ||
recommended for security and portability). However, there is a fully static prebuilt binary that | ||
is provided for amd64 as `linux-static.tar.gz`, and to build a fully static binary from source, run | ||
|
||
``` | ||
CGO_ENABLED=0 make build | ||
``` | ||
|
||
### macOS terminal | ||
|
||
If you are using macOS, you should consider using [iTerm2](http://iterm2.com/) instead of the default terminal (Terminal.app). The iTerm2 terminal has much better mouse support as well as better handling of key events. For best keybinding behavior, choose `xterm defaults` under `Preferences->Profiles->Keys->Presets...`, and select `Esc+` for `Left Option Key` in the same menu. The newest versions also support true color. | ||
|
||
If you still insist on using the default Mac terminal, be sure to set `Use Option key as Meta key` under | ||
`Preferences->Profiles->Keyboard` to use <kbd>option</kbd> as <kbd>alt</kbd>. | ||
|
||
### WSL and Windows Console | ||
|
||
If you use micro within WSL, it is highly recommended that you use the [Windows | ||
Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-us&gl=us) | ||
instead of the default Windows Console. | ||
|
||
If you must use Windows Console for some reason, note that there is a bug in | ||
Windows Console WSL that causes a font change whenever micro tries to access | ||
the external clipboard via powershell. To fix this, use an internal clipboard | ||
with `set clipboard internal` (though your system clipboard will no longer be | ||
available in micro). | ||
|
||
### Colors and syntax highlighting | ||
|
||
If you open micro and it doesn't seem like syntax highlighting is working, this is probably because | ||
you are using a terminal which does not support 256 color mode. Try changing the color scheme to `simple` | ||
by pressing <kbd>Ctrl-e</kbd> in micro and typing `set colorscheme simple`. | ||
|
||
If you are using the default Ubuntu terminal, to enable 256 color mode make sure your `TERM` variable is set | ||
to `xterm-256color`. | ||
|
||
Many of the Windows terminals don't support more than 16 colors, which means | ||
that micro's default color scheme won't look very good. You can either set | ||
the color scheme to `simple`, or download and configure a better terminal emulator | ||
than the Windows default. | ||
|
||
### Cygwin, Mingw, Plan9 | ||
|
||
Cygwin, Mingw, and Plan9 are unfortunately not officially supported. In Cygwin and Mingw, micro will often work when run using | ||
the `winpty` utility: | ||
|
||
``` | ||
winpty micro.exe ... | ||
``` | ||
|
||
Micro uses the amazing [tcell library](https://github.com/gdamore/tcell), but this | ||
means that micro is restricted to the platforms tcell supports. As a result, micro does not support | ||
Plan9 or Cygwin (although this may change in the future). Micro also doesn't support NaCl (which is deprecated anyway). | ||
A desktop entry file can also be found in the `runtime` directory. | ||
|
||
## Usage | ||
|
||
Once you have built the editor, start it by running `micro path/to/file.txt` or `micro` to open an empty buffer. | ||
|
||
micro also supports creating buffers from `stdin`: | ||
|
||
```sh | ||
ip a | micro | ||
``` | ||
- Use `macro -version` to get the verson information after installing. | ||
- Use `macro <path/to/file>` to open a file. | ||
- Use `macro <path/to/directory>` to browse files in this directory | ||
(requires [fd](https://github.com/sharkdp/fd) and [fzf](https://github.com/junegunn/fzf)). | ||
- Macro also supports creating buffers from `stdin`. | ||
|
||
You can move the cursor around with the arrow keys and mouse. | ||
Save with Ctrl-S, quit with Ctrl-Q. | ||
Run (and explore) commands with Ctrl-Space. | ||
|
||
You can also use the mouse to manipulate the text. Simply clicking and dragging | ||
will select text. You can also double click to enable word selection, and triple | ||
click to enable line selection. | ||
|
||
## Documentation and Help | ||
|
||
micro has a built-in help system which you can access by pressing <kbd>Ctrl-e</kbd> and typing `help`. Additionally, you can | ||
view the help files here: | ||
|
||
- [main help](https://github.com/zyedidia/micro/tree/master/runtime/help/help.md) | ||
- [keybindings](https://github.com/zyedidia/micro/tree/master/runtime/help/keybindings.md) | ||
- [commands](https://github.com/zyedidia/micro/tree/master/runtime/help/commands.md) | ||
- [colors](https://github.com/zyedidia/micro/tree/master/runtime/help/colors.md) | ||
- [options](https://github.com/zyedidia/micro/tree/master/runtime/help/options.md) | ||
- [plugins](https://github.com/zyedidia/micro/tree/master/runtime/help/plugins.md) | ||
**Note for Linux desktop environments:** | ||
|
||
I also recommend reading the [tutorial](https://github.com/zyedidia/micro/tree/master/runtime/help/tutorial.md) for | ||
a brief introduction to the more powerful configuration features micro offers. | ||
For interfacing with the local system clipboard, the following tools need to be installed: | ||
* For X11, `xclip` or `xsel` | ||
* For [Wayland](https://wayland.freedesktop.org/), `wl-clipboard` | ||
Without these tools installed, macro will use an internal clipboard for copy and paste, but it won't be accessible to external applications. | ||
|
||
There is also an unofficial Discord, which you can join at https://discord.gg/nhWR6armnR. | ||
## Documentation (Upstream) | ||
|
||
## Upstream | ||
- This is a fork of Micro by Zachary Yedidia. | ||
- [Micro's documentation](https://github.com/zyedidia/micro/tree/master/runtime/help/help.md) | ||
|
||
Since this is a fork, you might also want to explore . | ||
As for exploring the code, use `grep` extensively and start with: | ||
[actions.go](internal/actions/actions.go) | ||
[bufpane.go](internal/actions/bufpane.go) | ||
[buffer.go](internal/buffer/buffer.go) | ||
|
||
Please do NOT report any bug there you had with this fork. | ||
Please do NOT report any bug upstream as those could be mine! |
Oops, something went wrong.