zyedidia / micro Goto Github PK
View Code? Open in Web Editor NEWA modern and intuitive terminal-based text editor
Home Page: https://micro-editor.github.io
License: MIT License
A modern and intuitive terminal-based text editor
Home Page: https://micro-editor.github.io
License: MIT License
I just downloaded the pre-built binary for 64-bit Linux on my Ubuntu 14.04. Ran the "install.sh" and copied the ./bin/micro binary to my path location. When I tried to run the binary it always exits out with an error message "Character set not supported" as shown in the screenshot below.
Is there any settings that I should do before running micro?
A handful of modern text editors, such as Atom and Visual Studio Code, support simply refactoring code by highlighting text and then pressing Ctrl + D to also select the next occurrence of that text. Each time Ctrl + D is pressed, another selection is added. Once you begin typing, the buffer will be edited in all selections simultaneously.
I am on Ubuntu 14.04.
When I run micro executable I get the message:
character set not supported
My current locale is en_IN .
Installed locales in my machine obtained by locale -a is:
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX
It would be better to use a buffer and view for the help screen instead of what I have now, which is sort of a half implementation of a view.
It would be nice if the full range of text editing shorcuts worked:
On Macs:
Movement
Cmd-UpArrow: Go to start of the file
Cmd-LeftArrow: Go to start of the line
Cmd-RightArrow: Go to end of the line
Cmd-DownArrow: Go to end of the file
Alt-LeftArrow: Go to start of previous word
Alt-RightArrow: Go to start of next word
Selection
Shift-Cmd-UpArrow: Select from current position to start of the file
Shift-Cmd-LeftArrow: Select from current position to start of the line
Shift-Cmd-RightArrow: Select from current position to end of the line
Shift-Cmd-DownArrow: Select from current position to end of the file
Shift-Alt-LeftArrow: Select from current position to start of previous word
Shift-Alt-RightArrow: Select from current position to start of next word
Deletion
Cmd-Backspace: Delete until the start of the line
Cmd-Delete: Delete until the end of the line
Alt-Backspace: delete until end of previous word
Alt-Delete: delete until end of next word
Jump to previous/next word: #12
Select to previous/next word: #13
Many text editors give an option to save the file when quitting, if its been modified. You already have most of the logic in CanClose()
and Save()
to accomplish this. I could write the code if this is a feature you'd be interested in. Just didn't want to change the functionality if you had a reason to keep it as-is.
It would be more convenient to install micro on servers if you could just run apt-get install micro
.
Should the end key show the end of the file or get the cursor to the end of the line?
I know from some other editors the second (and with ctrl+end cursor the the end of the file).
Maybe it's a feature, I don't know :)
(Same for the pos1 key)
OS: Ubuntu 15.10 64 bits
Used the pre-compiled binary: Linux 64 bits
Command Run: micro
Error: character set not supported
$ micro/micro
terminal entry not found
$ uname -a
Linux athena.barrera.io 4.5.1-1-ARCH #1 SMP PREEMPT Thu Apr 14 19:19:32 CEST 2016 x86_64 GNU/Linux
Not sure what else would be relevant here.
Hi!
I wanted to try out true color support on iTerm2 since I know it supports it.
$ micro ch4.go
Shows me a syntax highlighted Go file. However:
$ MICRO_TRUECOLOR=1 micro ch4.go
Doesn't. What am I doing wrong, and how can I debug it?
It's a common action. Should have a shortcut.
such as micro *
or micro .
or micro test1.go test2.go
up and down is too slow
On a clean/fresh install, starting micro without a ~/.micro
directory existing causes an error on startup.
Error writing settings.json file: open /Users/amrk/.micro/settings.json: no such file or directory
xfce4-terminal on Debian amd-64 (jessie)
fresh master branch
Seeing if HOME/END keys work yet, and...
Micro encountered an error: runtime error: slice bounds out of range
runtime.errorString runtime error: slice bounds out of range
/usr/local/go/src/runtime/panic.go:426 (0x45c149)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/local/go/src/runtime/panic.go:21 (0x45a679)
panicslice: panic(sliceError)
/home/aerth/go/src/github.com/zyedidia/micro/cmd/micro/highlighter.go:402 (0x40b4f6)
Match: lines := buf.lines[viewStart:viewEnd]
/home/aerth/go/src/github.com/zyedidia/micro/cmd/micro/view.go:615 (0x427470)
(*View).HandleEvent: v.matches = Match(v)
/home/aerth/go/src/github.com/zyedidia/micro/cmd/micro/micro.go:211 (0x40da18)
main: view.HandleEvent(event)
/usr/local/go/src/runtime/proc.go:188 (0x45dc60)
main: main_main()
/usr/local/go/src/runtime/asm_amd64.s:1998 (0x48c231)
goexit: BYTE $0x90 // NOP
Good sir,
At first run I visited help (with ctrl-h
), and it said it was possible to press ctrl-e
to execute commands. However, upon pressing ctrl-e
, nothing happened. Only after exiting the help screen by pressing esc
would ctrl-e
react. Preposterous!
All the best,
Alexander F Rødseth
When pasting something in an empty text document, the cursor is shown at the end of what you pasted. If you move up/down, the cursor goes to the correct line, but goes to the beginning.
Pasting
trl-p: Find previous
Ctrl-a: Select all
Ctrl-c: Copy
Ctrl-x: Cut
Results in the cursor (|
) being placed at the end of the content:
trl-p: Find previous
Ctrl-a: Select all
Ctrl-c: Copy
Ctrl-x: Cut|
But going up places the cursor at the beginning of the line:
trl-p: Find previous
Ctrl-a: Select all
|Ctrl-c: Copy
Ctrl-x: Cut
You shouldn't have to do anything to get this to work right after the install.
When I run micro
regardless of input, I get terminal entry not found
and the process exits. I'm using zsh
inside tmux
in iterm
without the tmux
/iterm
integration stuff, which may be confusing isatty
?
reproduce by entering help mode (ctrl+g) and editing the text. while the text is changed, press ctrl+q to quit and panic
Micro encountered an error: runtime error: index out of range
runtime.errorString runtime error: index out of range
/usr/local/go/src/runtime/panic.go:426 (0x45c8c9)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/local/go/src/runtime/panic.go:15 (0x45ad99)
panicindex: panic(indexError)
/tmp/test/micro/cmd/micro/cursor.go:295 (0x406e78)
(*Cursor).GetVisualX: runes := []rune(c.v.buf.lines[c.y])
/tmp/test/micro/cmd/micro/view.go:311 (0x427873)
(*View).Relocate: cx := v.cursor.GetVisualX()
/tmp/test/micro/cmd/micro/view.go:619 (0x427d0b)
(*View).HandleEvent: v.Relocate()
/tmp/test/micro/cmd/micro/micro.go:246 (0x40e65f)
main: view.HandleEvent(event)
/usr/local/go/src/runtime/proc.go:188 (0x45e3e0)
main: main_main()
/usr/local/go/src/runtime/asm_amd64.s:1998 (0x48c9b1)
goexit: BYTE $0x90 // NOP
I tried to download both the 32 and 64 bit builds, but both result in a 404.
It would be handy if there were binary releases for this repo. Since Go provides single binaries, this would allow for easy installs on servers in need a quick text editor (which isn't vi
).
This can be done manually, or you can use https://github.com/jpillora/cloud-gox to automatically do it on each tag push. Give http://gox.jpillora.com/ a try with github.com/zyedidia/micro/src
(will just hold binaries on disk).
Awesome project :) Feel free to close if not interested.
Looks like a neat project here and I'm interested in possibly contributing some expertise as a Windows programmer. What, in your estimation, is missing to get Micro running on Windows? (Note: I've not yet done the leg work to find out what's missing).
This issue is demonstrated by this .gifv: http://i.imgur.com/1zpieuP.gifv
It does not always happen, but scrolling (typically with Page Up/Page Down) will cause the text to become garbled (the effect is only visual). You can also notice the status bar acting up as well.
The end of the .gifv shows some editing with nano, which does not have this issue.
The server runs Ubuntu Server 14.04, host is Windows 10 with ConEmu terminal and Cygwin.
Using a Mac at work has conditioned me to use the "command" key instead of ctrl, and it would make micro more ergonomic if it used this idiom as well.
To reproduce, just hold down a letter or paste long line
xfce4-terminal
xterm
debian 8
en_US utf8
I'd be nice if Micro supported using SHIFT+arrows for text selection like GUI editors (Gedit, etc...) do.
In micro my delete key is not working. I'm on elementary os, xterm and using the latest version of micro now. Maybe something is buggy with elementary os, see issue #34
It'd be awesome to auto gofmt or goimports over the code just before saving, or on a key combo.
I guess this would manifest as a customisable pre- or post-save command option.
After using sublime and atom I can't go back to not having multiple cursor support. Any plans to introduce this into micro? Even just select all and select next would be amazing as that covers 90% of my usage.
Most (all?) editors support jumping to next/previous word using ctrl+arrows. Micro inserts [1;5D
or [1;5C
instead.
$ echo $SHELL
/bin/bash
$ echo $TERM
xterm-256color
$ uname -a
Linux bendem-fedora-acer 4.4.6-301.fc23.x86_64 #1 SMP Wed Mar 30 16:43:58 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Micro will crash whilst performing the find next (Cntrl+N) at the start of a file. This error thrown is a 'slice bounds out of range' at cursor.go:297.
Can we have some sort of plugin runtime? using LUA or another approach?
I think this can help collaborations without touching the core!
By using resource embedding you can remove the need to install the runtime data. Micro you should read config and runtime data from $XDG_CONFIG_HOME and if not found load the default embedded resources. This would simplify installation of micro.
List of tools for embedding resources in Go:
https://github.com/avelino/awesome-go#resource-embedding
I can't select how I would normally do with the mouse.
When I move my mouse cursor somewhere on the micro screen, it selects from the current text cursor (or sometimes from the top) to the mouse position, I don't have to click for beginning selection.
I think it should work like in every text editor.
Double click for a word and three clicks for a line are working how expected.
$TERM: xterm
$SHELL: /bin/bash
uname -a: Linux element 3.19.0-58-generic #64~14.04.1-Ubuntu SMP Fri Mar 18 19:05:43 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
It would be more convenient if you could brew install micro
on a Mac.
not sure what key presses were being made at the exact moment
[smini micro (master)] $ ./micro
Micro encountered an error: runtime error: index out of range
runtime.errorString runtime error: index out of range
/usr/local/go/src/runtime/panic.go:426 (0x3dbd9)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/local/go/src/runtime/panic.go:15 (0x3c0a9)
panicindex: panic(indexError)
/Users/shoenig/Documents/golang/src/github.com/zyedidia/micro/src/cursor.go:295 (0x74a8)
(*Cursor).GetVisualX: runes := []rune(c.v.buf.lines[c.y])
/Users/shoenig/Documents/golang/src/github.com/zyedidia/micro/src/view.go:308 (0x12693)
(*View).Relocate: cx := v.cursor.GetVisualX()
/Users/shoenig/Documents/golang/src/github.com/zyedidia/micro/src/view.go:596 (0x12b03)
(*View).HandleEvent: v.Relocate()
/Users/shoenig/Documents/golang/src/github.com/zyedidia/micro/src/micro.go:170 (0xdc8e)
main: view.HandleEvent(event)
/usr/local/go/src/runtime/proc.go:188 (0x3f6f0)
main: main_main()
/usr/local/go/src/runtime/asm_amd64.s:1998 (0x6d1b1)
goexit: BYTE $0x90 // NOP
In certain terminals, the a mouse click will put the mouse in the wrong position (off by 1 in both the x and y directions).
Most terminals report the mouse position incorrectly (off by 1) so I adjust for this, but other terminals actually report the coordinates correctly.
The terminals that I know of so far that report mouse coordinates properly are:
Holding down the shift key while moving the cursor using the arrow keys is a common shortcut to create and modify selections.
This can be combined with #12 to support selecting whole words using the keyboard.
Micro encountered an error: runtime error: index out of range
runtime.errorString runtime error: index out of range
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/panic.go:426 (0x43d099)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/panic.go:15 (0x43b569)
/Users/zachary/programming/micro/src/cursor.go:282 (0x4062d4)
/Users/zachary/programming/micro/src/view.go:334 (0x411793)
/Users/zachary/programming/micro/src/view.go:517 (0x411b81)
/Users/zachary/programming/micro/src/micro.go:170 (0x40cc4e)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/proc.go:188 (0x43ebb0)
/usr/local/Cellar/go/1.6.1/libexec/src/runtime/asm_amd64.s:1998 (0x46d601)
Also happens with my fork
Micro encountered an error: runtime error: index out of range
runtime.errorString runtime error: index out of range
/usr/local/go/src/runtime/panic.go:426 (0x43d0a9)
gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/local/go/src/runtime/panic.go:15 (0x43b579)
panicindex: panic(indexError)
/home/aerth/go/src/github.com/aerth/micro/cmd/micro/cursor.go:282 (0x4062d4)
(*Cursor).GetCharPosInLine: visualLine := strings.Replace(c.v.buf.lines[lineNum], "\t", "\t"+Spaces(tabSize-1), -1)
/home/aerth/go/src/github.com/aerth/micro/cmd/micro/view.go:334 (0x4117a3)
(*View).MoveToMouseClick: x = v.cursor.GetCharPosInLine(y, x)
/home/aerth/go/src/github.com/aerth/micro/cmd/micro/view.go:517 (0x411b91)
(*View).HandleEvent: v.MoveToMouseClick(x, y)
/home/aerth/go/src/github.com/aerth/micro/cmd/micro/micro.go:170 (0x40cc4e)
main: view.HandleEvent(event)
/usr/local/go/src/runtime/proc.go:188 (0x43ebc0)
main: main_main()
/usr/local/go/src/runtime/asm_amd64.s:1998 (0x46d611)
goexit: BYTE $0x90 // NOP
Any chance that a soft wrap feature would be made available?
Seems related to #60, only a small portion of the text is actually pasted. (11 characters)
This will help for bug filing and support requests
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.