mirror of
https://github.com/zyedidia/micro.git
synced 2026-04-03 16:39:51 +09:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd8776cdd0 | ||
|
|
ac362bf1db | ||
|
|
462f73f695 | ||
|
|
cf92f91e1e | ||
|
|
52d6ac6cda | ||
|
|
eeb2aaf9ae | ||
|
|
f84c9f3b5d | ||
|
|
be56918174 | ||
|
|
08daaf95e4 | ||
|
|
51d73c6618 | ||
|
|
4644a2b5cc | ||
|
|
89863660ba | ||
|
|
641d188997 | ||
|
|
226932e631 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ tmp.sh
|
||||
test/
|
||||
.idea/
|
||||
packages/
|
||||
cmd/micro/vendor
|
||||
|
||||
@@ -99,6 +99,8 @@ cd $GOPATH/src/github.com/zyedidia/micro
|
||||
make install
|
||||
```
|
||||
|
||||
Please make sure that when you are working with micro's code, you are working on your `GOPATH`.
|
||||
|
||||
The binary will then be installed to `$GOPATH/bin` (or your `$GOBIN`).
|
||||
|
||||
You can install directly with `go get` (`go get -u github.com/zyedidia/micro/cmd/micro`) but this isn't recommended because it doesn't build micro with version information which is useful for the plugin manager.
|
||||
|
||||
123
cmd/micro/Gopkg.lock
generated
Normal file
123
cmd/micro/Gopkg.lock
generated
Normal file
@@ -0,0 +1,123 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/blang/semver"
|
||||
packages = ["."]
|
||||
revision = "4a1e882c79dcf4ec00d2e29fac74b9c8938d5052"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/dustin/go-humanize"
|
||||
packages = ["."]
|
||||
revision = "259d2a102b871d17f30e3cd9881a642961a1e486"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/gdamore/encoding"
|
||||
packages = ["."]
|
||||
revision = "b23993cbb6353f0e6aa98d0ee318a34728f628b9"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/go-errors/errors"
|
||||
packages = ["."]
|
||||
revision = "8fa88b06e5974e97fbf9899a7f86a344bfd1f105"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/lucasb-eyer/go-colorful"
|
||||
packages = ["."]
|
||||
revision = "9c2852a141bf4711e4276f8f119c90d0f20a556c"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/mattn/go-isatty"
|
||||
packages = ["."]
|
||||
revision = "fc9e8d8ef48496124e79ae0df75490096eccf6fe"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/mattn/go-runewidth"
|
||||
packages = ["."]
|
||||
revision = "97311d9f7767e3d6f422ea06661bc2c7a19e8a5d"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/mitchellh/go-homedir"
|
||||
packages = ["."]
|
||||
revision = "b8bc1bf767474819792c23f32d8286a45736f1c6"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/sergi/go-diff"
|
||||
packages = ["diffmatchpatch"]
|
||||
revision = "feef008d51ad2b3778f85d387ccf91735543008d"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/yuin/gopher-lua"
|
||||
packages = [".","ast","parse","pm"]
|
||||
revision = "b402f3114ec730d8bddb074a6c137309f561aa78"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/clipboard"
|
||||
packages = ["."]
|
||||
revision = "adacf416cec40266b051e7bc096c52951f2725e9"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/glob"
|
||||
packages = ["."]
|
||||
revision = "72567a468b2481490f359cdfb015231389e0bf9d"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/json5"
|
||||
packages = ["encoding/json5"]
|
||||
revision = "2518f8beebde6814f2d30d566260480d2ded2f76"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/tcell"
|
||||
packages = [".","encoding"]
|
||||
revision = "7095cc1c7f4173ae48314d80878e9985a0658889"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/net"
|
||||
packages = ["context"]
|
||||
revision = "007e530097ad7f954752df63046b4036f98ba6a6"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/sys"
|
||||
packages = ["unix"]
|
||||
revision = "d4feaf1a7e61e1d9e79e6c4e76c6349e9cab0a03"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "golang.org/x/text"
|
||||
packages = ["encoding","encoding/charmap","encoding/internal","encoding/internal/identifier","encoding/japanese","encoding/korean","encoding/simplifiedchinese","encoding/traditionalchinese","internal/gen","transform","unicode/cldr"]
|
||||
revision = "506f9d5c962f284575e88337e7d9296d27e729d3"
|
||||
|
||||
[[projects]]
|
||||
branch = "v2"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
packages = ["."]
|
||||
revision = "a83829b6f1293c91addabc89d0571c246397bbf4"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "layeh.com/gopher-luar"
|
||||
packages = ["."]
|
||||
revision = "80196fe2abc5682963fc7a5261f5a5d77509938b"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "aebc6aa50d78830f86e8964c1ebc1804c1f9603477ddba606717a972ca70d261"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
123
cmd/micro/Gopkg.toml
Normal file
123
cmd/micro/Gopkg.toml
Normal file
@@ -0,0 +1,123 @@
|
||||
|
||||
## Gopkg.toml example (these lines may be deleted)
|
||||
|
||||
## "metadata" defines metadata about the project that could be used by other independent
|
||||
## systems. The metadata defined here will be ignored by dep.
|
||||
# [metadata]
|
||||
# key1 = "value that convey data to other systems"
|
||||
# system1-data = "value that is used by a system"
|
||||
# system2-data = "value that is used by another system"
|
||||
|
||||
## "required" lists a set of packages (not projects) that must be included in
|
||||
## Gopkg.lock. This list is merged with the set of packages imported by the current
|
||||
## project. Use it when your project needs a package it doesn't explicitly import -
|
||||
## including "main" packages.
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
|
||||
## "ignored" lists a set of packages (not projects) that are ignored when
|
||||
## dep statically analyzes source code. Ignored packages can be in this project,
|
||||
## or in a dependency.
|
||||
# ignored = ["github.com/user/project/badpkg"]
|
||||
|
||||
## Constraints are rules for how directly imported projects
|
||||
## may be incorporated into the depgraph. They are respected by
|
||||
## dep whether coming from the Gopkg.toml of the current project or a dependency.
|
||||
# [[constraint]]
|
||||
## Required: the root import path of the project being constrained.
|
||||
# name = "github.com/user/project"
|
||||
#
|
||||
## Recommended: the version constraint to enforce for the project.
|
||||
## Only one of "branch", "version" or "revision" can be specified.
|
||||
# version = "1.0.0"
|
||||
# branch = "master"
|
||||
# revision = "abc123"
|
||||
#
|
||||
## Optional: an alternate location (URL or import path) for the project's source.
|
||||
# source = "https://github.com/myfork/package.git"
|
||||
#
|
||||
## "metadata" defines metadata about the dependency or override that could be used
|
||||
## by other independent systems. The metadata defined here will be ignored by dep.
|
||||
# [metadata]
|
||||
# key1 = "value that convey data to other systems"
|
||||
# system1-data = "value that is used by a system"
|
||||
# system2-data = "value that is used by another system"
|
||||
|
||||
## Overrides have the same structure as [[constraint]], but supersede all
|
||||
## [[constraint]] declarations from all projects. Only [[override]] from
|
||||
## the current project's are applied.
|
||||
##
|
||||
## Overrides are a sledgehammer. Use them only as a last resort.
|
||||
# [[override]]
|
||||
## Required: the root import path of the project being constrained.
|
||||
# name = "github.com/user/project"
|
||||
#
|
||||
## Optional: specifying a version constraint override will cause all other
|
||||
## constraints on this project to be ignored; only the overridden constraint
|
||||
## need be satisfied.
|
||||
## Again, only one of "branch", "version" or "revision" can be specified.
|
||||
# version = "1.0.0"
|
||||
# branch = "master"
|
||||
# revision = "abc123"
|
||||
#
|
||||
## Optional: specifying an alternate source location as an override will
|
||||
## enforce that the alternate location is used for that project, regardless of
|
||||
## what source location any dependent projects specify.
|
||||
# source = "https://github.com/myfork/package.git"
|
||||
|
||||
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/blang/semver"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/dustin/go-humanize"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/go-errors/errors"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/mattn/go-isatty"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/mattn/go-runewidth"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/mitchellh/go-homedir"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/sergi/go-diff"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/yuin/gopher-lua"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/clipboard"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/glob"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/json5"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "github.com/zyedidia/tcell"
|
||||
|
||||
[[constraint]]
|
||||
branch = "v2"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
|
||||
[[constraint]]
|
||||
branch = "master"
|
||||
name = "layeh.com/gopher-luar"
|
||||
@@ -11,11 +11,11 @@ import (
|
||||
const (
|
||||
// Opposite and undoing events must have opposite values
|
||||
|
||||
// TextEventInsert repreasents an insertion event
|
||||
// TextEventInsert represents an insertion event
|
||||
TextEventInsert = 1
|
||||
// TextEventRemove represents a deletion event
|
||||
TextEventRemove = -1
|
||||
|
||||
// TextEventReplace represents a replace event
|
||||
TextEventReplace = 0
|
||||
)
|
||||
|
||||
@@ -117,7 +117,7 @@ func (eh *EventHandler) Remove(start, end Loc) {
|
||||
eh.Execute(e)
|
||||
}
|
||||
|
||||
// Multiple creates an multiple insertions executes them
|
||||
// MultipleReplace creates an multiple insertions executes them
|
||||
func (eh *EventHandler) MultipleReplace(deltas []Delta) {
|
||||
e := &TextEvent{
|
||||
C: eh.buf.Cursor,
|
||||
|
||||
@@ -183,6 +183,10 @@ func InitScreen() {
|
||||
screen, err = tcell.NewScreen()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
if err == tcell.ErrTermNotFound {
|
||||
fmt.Println("Micro does not recognize your terminal:", oldTerm)
|
||||
fmt.Println("Please go to https://github.com/zyedidia/mkinfo to read about how to fix this problem (it should be easy to fix).")
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
if err = screen.Init(); err != nil {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -267,11 +267,16 @@ func Abs(n int) int {
|
||||
return n
|
||||
}
|
||||
|
||||
// FuncName returns the name of a given function object
|
||||
// FuncName returns the full name of a given function object
|
||||
func FuncName(i interface{}) string {
|
||||
return runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name()
|
||||
}
|
||||
|
||||
// ShortFuncName returns the name only of a given function object
|
||||
func ShortFuncName(i interface{}) string {
|
||||
return strings.TrimPrefix(runtime.FuncForPC(reflect.ValueOf(i).Pointer()).Name(), "main.(*View).")
|
||||
}
|
||||
|
||||
// SplitCommandArgs separates multiple command arguments which may be quoted.
|
||||
// The returned slice contains at least one string
|
||||
func SplitCommandArgs(input string) []string {
|
||||
|
||||
@@ -462,6 +462,7 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||
case *tcell.EventKey:
|
||||
// Check first if input is a key binding, if it is we 'eat' the input and don't insert a rune
|
||||
isBinding := false
|
||||
readonlyBindingsList := []string{"Delete", "Insert", "Backspace", "Cut", "Play", "Paste", "Move", "Add", "DuplicateLine", "Macro"}
|
||||
if e.Key() != tcell.KeyRune || e.Modifiers() != 0 {
|
||||
for key, actions := range bindings {
|
||||
if e.Key() == key.keyCode {
|
||||
@@ -474,11 +475,24 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||
relocate = false
|
||||
isBinding = true
|
||||
for _, action := range actions {
|
||||
relocate = action(v, true) || relocate
|
||||
funcName := FuncName(action)
|
||||
if funcName != "main.(*View).ToggleMacro" && funcName != "main.(*View).PlayMacro" {
|
||||
if recordingMacro {
|
||||
curMacro = append(curMacro, action)
|
||||
readonlyBindingsResult := false
|
||||
funcName := ShortFuncName(action)
|
||||
if v.Type.readonly == true {
|
||||
// check for readonly and if true only let key bindings get called if they do not change the contents.
|
||||
for _, readonlyBindings := range readonlyBindingsList {
|
||||
if strings.Contains(funcName, readonlyBindings) {
|
||||
readonlyBindingsResult = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if !readonlyBindingsResult {
|
||||
// call the key binding
|
||||
relocate = action(v, true) || relocate
|
||||
// Macro
|
||||
if funcName != "ToggleMacro" && funcName != "PlayMacro" {
|
||||
if recordingMacro {
|
||||
curMacro = append(curMacro, action)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -488,33 +502,39 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||
}
|
||||
}
|
||||
if !isBinding && e.Key() == tcell.KeyRune {
|
||||
// Insert a character
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.DeleteSelection()
|
||||
v.Cursor.ResetSelection()
|
||||
}
|
||||
v.Buf.Insert(v.Cursor.Loc, string(e.Rune()))
|
||||
v.Cursor.Right()
|
||||
|
||||
for pl := range loadedPlugins {
|
||||
_, err := Call(pl+".onRune", string(e.Rune()), v)
|
||||
if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
|
||||
TermMessage(err)
|
||||
// Check viewtype if readonly don't insert a rune (readonly help and log view etc.)
|
||||
if v.Type.readonly == false {
|
||||
// Insert a character
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.DeleteSelection()
|
||||
v.Cursor.ResetSelection()
|
||||
}
|
||||
}
|
||||
v.Buf.Insert(v.Cursor.Loc, string(e.Rune()))
|
||||
v.Cursor.Right()
|
||||
|
||||
if recordingMacro {
|
||||
curMacro = append(curMacro, e.Rune())
|
||||
for pl := range loadedPlugins {
|
||||
_, err := Call(pl+".onRune", string(e.Rune()), v)
|
||||
if err != nil && !strings.HasPrefix(err.Error(), "function does not exist") {
|
||||
TermMessage(err)
|
||||
}
|
||||
}
|
||||
|
||||
if recordingMacro {
|
||||
curMacro = append(curMacro, e.Rune())
|
||||
}
|
||||
}
|
||||
}
|
||||
case *tcell.EventPaste:
|
||||
if !PreActionCall("Paste", v) {
|
||||
break
|
||||
// Check viewtype if readonly don't paste (readonly help and log view etc.)
|
||||
if v.Type.readonly == false {
|
||||
if !PreActionCall("Paste", v) {
|
||||
break
|
||||
}
|
||||
|
||||
v.paste(e.Text())
|
||||
|
||||
PostActionCall("Paste", v)
|
||||
}
|
||||
|
||||
v.paste(e.Text())
|
||||
|
||||
PostActionCall("Paste", v)
|
||||
case *tcell.EventMouse:
|
||||
x, y := e.Position()
|
||||
x -= v.lineNumOffset - v.leftCol + v.x
|
||||
@@ -571,9 +591,12 @@ func (v *View) HandleEvent(event tcell.Event) {
|
||||
}
|
||||
}
|
||||
case tcell.Button2:
|
||||
// Middle mouse button was clicked,
|
||||
// We should paste primary
|
||||
v.PastePrimary(true)
|
||||
// Check viewtype if readonly don't paste (readonly help and log view etc.)
|
||||
if v.Type.readonly == false {
|
||||
// Middle mouse button was clicked,
|
||||
// We should paste primary
|
||||
v.PastePrimary(true)
|
||||
}
|
||||
case tcell.ButtonNone:
|
||||
// Mouse event with no click
|
||||
if !v.mouseReleased {
|
||||
@@ -937,7 +960,7 @@ func (v *View) Display() {
|
||||
}
|
||||
v.DisplayView()
|
||||
// Don't draw the cursor if it is out of the viewport or if it has a selection
|
||||
if (v.Cursor.Y-v.Topline < 0 || v.Cursor.Y-v.Topline > v.Height-1) || (v.Cursor.HasSelection() && v.Num == tabs[curTab].CurView) {
|
||||
if v.Num == tabs[curTab].CurView && (v.Cursor.Y-v.Topline < 0 || v.Cursor.Y-v.Topline > v.Height-1 || v.Cursor.HasSelection()) {
|
||||
screen.HideCursor()
|
||||
}
|
||||
_, screenH := screen.Size()
|
||||
|
||||
27
data/com.github.zyedidia.micro.metainfo.xml
Normal file
27
data/com.github.zyedidia.micro.metainfo.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component>
|
||||
<id>com.github.zyedidia.micro</id>
|
||||
<name>Micro Text Editor</name>
|
||||
<summary>A modern and intuitive terminal-based text editor</summary>
|
||||
<url type="homepage">https://micro-editor.github.io</url>
|
||||
<url type="bugtracker">https://github.com/zyedidia/micro</url>
|
||||
<metadata_license>MIT</metadata_license>
|
||||
<categories>
|
||||
<category>Development</category>
|
||||
<category>TextEditor</category>
|
||||
</categories>
|
||||
|
||||
<provides>
|
||||
<binary>micro</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="1.2.0" date="2017-05-28" />
|
||||
</releases>
|
||||
<developer_name>Zachary Yedidia</developer_name>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<caption>Micro Text Editor editing its source code.</caption>
|
||||
<image type="source">https://raw.githubusercontent.com/zyedidia/micro/master/assets/micro-solarized.png</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
</component>
|
||||
@@ -2,22 +2,23 @@ color-link default "#839496,#002833"
|
||||
color-link comment "#586E75,#002833"
|
||||
color-link identifier "#268BD2,#002833"
|
||||
color-link constant "#2AA198,#002833"
|
||||
color-link constant.specialChar "#DC322F,#002833"
|
||||
color-link statement "#859900,#002833"
|
||||
color-link symbol "#859900,#002833"
|
||||
color-link preproc "#CB4B16,#002833"
|
||||
color-link type "#B58900,#002833"
|
||||
color-link special "#DC322F,#002833"
|
||||
color-link special "#268BD2,#002833"
|
||||
color-link underlined "#D33682,#002833"
|
||||
color-link error "bold #CB4B16,#002833"
|
||||
color-link todo "bold #D33682,#002833"
|
||||
color-link statusline "#003541,#839496"
|
||||
color-link tabbar "#003541,#839496"
|
||||
color-link indent-char "#586E75,#002833"
|
||||
color-link indent-char "#003541,#002833"
|
||||
color-link line-number "#586E75,#003541"
|
||||
color-link current-line-number "#586E75,#002833"
|
||||
color-link gutter-error "#003541,#CB4B16"
|
||||
color-link gutter-warning "#CB4B16,#002833"
|
||||
color-link cursor-line "#003541"
|
||||
color-link color-column "#003541"
|
||||
color-link type.extended "default"
|
||||
color-link symbol.brackets "default"
|
||||
color-link type.extended "#839496,#002833"
|
||||
color-link symbol.brackets "#839496,#002833"
|
||||
|
||||
@@ -12,16 +12,17 @@ If you don't like it, you can change it!
|
||||
|
||||
#Power user
|
||||
+--------+---------------------------------------------------------+
|
||||
| Key | Description of function |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+E | Switch to the micro command prompt to run a command. |
|
||||
| | (See `>help commands` for a list of commands. ) |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Tab | In command prompt it will auto complete if possible. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+B | Run shell commands in micro's current working directory.|
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Navigation
|
||||
|
||||
+--------+---------------------------------------------------------+
|
||||
| Key | Description of function |
|
||||
|--------+---------------------------------------------------------+
|
||||
| Arrows | Move the cursor around your current document. |
|
||||
| | (Yes this is rebindable to the vim keys if you want.) |
|
||||
@@ -29,19 +30,52 @@ If you don't like it, you can change it!
|
||||
| Shift+ | Move and select text. |
|
||||
| Arrows | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Home | Move to the beginning of the current line. (Naturally.) |
|
||||
| Home | |
|
||||
| or | |
|
||||
| Ctrl+ | Move to the beginning of the current line. (Naturally.) |
|
||||
| Left | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| End | Move to the end of the current line. |
|
||||
| End | |
|
||||
| or | |
|
||||
| Ctrl+ | Move to the end of the current line. |
|
||||
| Right | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Left | Move cursor one complete word left. |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Right | Move cursor one complete word right. |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| PageUp | Move cursor up lines quickly. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| PageDn | Move cursor down lines quickly. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+ | |
|
||||
| Home | |
|
||||
| or | Move cursor to start of the document |
|
||||
| Ctrl+ | |
|
||||
| Up | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+ | |
|
||||
| End | |
|
||||
| or | Move cursor to end of the document |
|
||||
| Ctrl+ | |
|
||||
| Down | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+L | Jump to line in current file. ( Prompts for line # ) |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+W | Move between splits open in current tab. |
|
||||
| | (See vsplit and hsplit in `>help commands`) |
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Tabs
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+T | Open a new tab. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+, | Move to the previous tab in the tablist. |
|
||||
@@ -51,7 +85,6 @@ If you don't like it, you can change it!
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Find Operations
|
||||
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+F | Find text in current file. ( Prompts for text to find.) |
|
||||
+--------+---------------------------------------------------------+
|
||||
@@ -61,7 +94,6 @@ If you don't like it, you can change it!
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#File Operations
|
||||
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+Q | Close current file. ( Quits micro if last file open. ) |
|
||||
+--------+---------------------------------------------------------+
|
||||
@@ -71,10 +103,45 @@ If you don't like it, you can change it!
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Text operations
|
||||
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+A | Select all text in current file. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Shift+ | Select complete word right. |
|
||||
| Right | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Shift+ | Select complete word left. |
|
||||
| Left | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Shift+ | |
|
||||
| Home | |
|
||||
| or | Select from the current cursor position to the |
|
||||
| Ctrl+ | start of the current line. |
|
||||
| Shift+ | |
|
||||
| Left | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Shift+ | |
|
||||
| End | |
|
||||
| or | Select from the current cursor position to the |
|
||||
| Ctrl+ | end of the current line. |
|
||||
| Shift+ | |
|
||||
| Right | |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+ | |
|
||||
| Shift+ | Select from the current cursor position to the |
|
||||
| Up | start of the document. |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+ | |
|
||||
| Shift+ | Select from the current cursor position to the |
|
||||
| Down | end of the document. |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+X | Cut selected text. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+C | Copy selected text. |
|
||||
@@ -89,6 +156,30 @@ If you don't like it, you can change it!
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+Y | Redo actions. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Up | Move current line or selected lines up. |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Down | Move current line or selected lines down. |
|
||||
| Arrow | |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+ | |
|
||||
| Ctrl+H | |
|
||||
| or | Delete complete word left. |
|
||||
| Alt+ | |
|
||||
| Back- | |
|
||||
| space | |
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Macros
|
||||
+--------+---------------------------------------------------------+
|
||||
| | Toggle ON/OFF macro recording. |
|
||||
| Ctrl+U | Simply press Ctrl+U to begin recording a macro and |
|
||||
| | press Ctrl+U to stop recording macro. |
|
||||
+--------+---------------------------------------------------------+
|
||||
| Ctrl+J | Run your recorded macro. |
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Other
|
||||
+--------+---------------------------------------------------------+
|
||||
@@ -101,7 +192,6 @@ If you don't like it, you can change it!
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Emacs style actions
|
||||
|
||||
+--------+---------------------------------------------------------+
|
||||
| Alt+F | Move to the end of the next word. (To the next space.) |
|
||||
+--------+---------------------------------------------------------+
|
||||
@@ -117,7 +207,6 @@ If you don't like it, you can change it!
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Function keys.
|
||||
|
||||
Warning! The function keys may not work in all terminals!
|
||||
+--------+---------------------------------------------------------+
|
||||
| F1 | Open help. |
|
||||
@@ -133,9 +222,3 @@ Warning! The function keys may not work in all terminals!
|
||||
| F10 | Close current file. |
|
||||
+--------+---------------------------------------------------------+
|
||||
|
||||
#Macros
|
||||
|
||||
Micro supports the use of keyboard macros. Simply press Ctrl+U to
|
||||
begin recording a macro and press Ctrl+U to stop recording.
|
||||
|
||||
Press Ctrl+J to run your recorded macro.
|
||||
@@ -9,6 +9,6 @@ rules:
|
||||
- constant.number: "\\b[0-9]+\\b"
|
||||
- symbol.operator: "[*:=]"
|
||||
- constant.bool: "\\b(true|false)\\b"
|
||||
- comment: "(^|[[:space:]])#([^{].*)?$"
|
||||
- comment: "(^|[[:space:]])!([^{].*)?$"
|
||||
- indent-char.whitespace: "[[:space:]]+$"
|
||||
- indent-char: " + +| + +"
|
||||
|
||||
Reference in New Issue
Block a user