The monokai-tc colorscheme has been renamed to plain monokai and has
been made the default colorscheme. It is still a true color colorscheme,
but the automatic 256 color approximation is very good so it can be used
just fine in terminals which do not support true color.
If your terminal only supports 16 colors, used the 'default'
colorscheme.
Zachary Yedidia [Sat, 25 Jun 2016 23:20:13 +0000 (19:20 -0400)]
Add string group to syntax files
This commit adds the string group (constant.string) to valid strings
in all the syntax files that support colorschemes (see the readme in
the runtime/syntax directory).
Zachary Yedidia [Wed, 22 Jun 2016 22:51:36 +0000 (18:51 -0400)]
Colorscheme group inheritance
With this commit, the syntax files can define groups that are subsets of
other groups, for example constant.string. This is so that colorschemes
can be more accurate, possibly highlighting strings differently than
numbers for example.
See #176. This doesn't fully close that issue yet because the string
group still needs to be added to all strings in the syntax files.
Zachary Yedidia [Wed, 22 Jun 2016 17:54:42 +0000 (13:54 -0400)]
Add autoclose plugin to handle autoclose for brackets, quotes etc...
The plugin adds an option `autoclose` to configure whether or not you
would like quotes, brackets etc... to be automatically closed. The
option is enabled by default.
Zachary Yedidia [Tue, 21 Jun 2016 21:57:25 +0000 (17:57 -0400)]
Add onRune(r string) callback for plugins
Define this function in a plugin (which takes one argument) to be
notified whenever a character is typed, and the character will be passed
as the argument.
Zachary Yedidia [Tue, 21 Jun 2016 21:49:57 +0000 (17:49 -0400)]
Auto prefix for plugin functions
YOu no longer have to prefix all functions in a plugin with the plugin
name (linter_onSave). This will now be done automatically using lua's
setfenv. When passing a function as a callback to a editor function,
make sure to prefix the plugin name (linter.onExit, or go.goimports) so
that micro knows which plugin to call the function from.
Zachary Yedidia [Wed, 15 Jun 2016 15:19:00 +0000 (11:19 -0400)]
Add support for job control
This commit adds support for job control (running processes
asynchronously from plugins) with the JobStart, JobSend, and JobStop
functions (copying neovim's job control).
This commit also makes the linter plugin work asynchronously, so the
editor won't be frozen while the linter checks your code for errors.
Zachary Yedidia [Wed, 8 Jun 2016 22:49:08 +0000 (18:49 -0400)]
Add support for tabs
Merge branch 'tabbar'
This branch adds support for having multiple tabs open, each viewing one
file. Use CtrlT to open a new tab empty tab and then CtrlO to open a
file in that tab. Use can also just open multiple files from the command
line: `micro file1.txt file2.txt ...`. Use Ctrl-] and Ctrl-\ to move
between the tabs, or simply click them with the mouse.
Zachary Yedidia [Wed, 8 Jun 2016 14:21:27 +0000 (10:21 -0400)]
Fix multiline remove in lineArray
I forgot that when you remove lines[n] then lines[n+1] becomes lines[n]
so to remove the range lines[a:b] you need to remove lines[a] for a-b
times. In this case we should delete lines[start.Y + 1] over and over
instead of removing lines[i] because i is contantly increasing.
Zachary Yedidia [Thu, 2 Jun 2016 17:01:13 +0000 (13:01 -0400)]
Add simple way to save with sudo if you forgot to open micro with sudo
If you are editing a read-only file and forgot to open micro with sudo
so you could write to it, when saving the file, micro will now give you
the option to save with sudo.
This little hack is used by vim users to achieve the same behavior, but
micro makes it nicer to use. Here is an explanation for how it works:
http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work
JT Olds [Wed, 1 Jun 2016 22:06:37 +0000 (16:06 -0600)]
chainable actions and flexible modifiers
Doesn't work quite right yet, but the idea is to support
arbitrary modifiers without having to hardcode in all the permutations
of alt/shift/ctrl for every key, along with chainable actions,
so this can be configured:
Zachary Yedidia [Tue, 31 May 2016 21:23:08 +0000 (17:23 -0400)]
Screen redraw optimization
We don't have to clear the screen every time, we only have to make sure
that we erase the rest of the line that used to be on the current line.
We can still optimize a bit more by finding the longest line and drawing
to that length, but using the full width is fine for now.
Zachary Yedidia [Tue, 31 May 2016 01:01:40 +0000 (21:01 -0400)]
Allow changes from external programs to be undone
We use a diff to be able to transform the buffer into an arbitrary
string (usually when we reread the file after an external program such
as gofmt has changed it) and still preserve undo/redo.
Zachary Yedidia [Mon, 30 May 2016 17:38:50 +0000 (13:38 -0400)]
Add support for user-created commands
Plugins can now create their own commands using the `MakeCommand`
function. Plugins can also now create their own keybindings with the
`BindKey` function. See the go plugin for an example of `MakeCommand`.
Zachary Yedidia [Sat, 28 May 2016 21:29:49 +0000 (17:29 -0400)]
Add `savecursor` option
This adds the `savecursor` option which will remember where the cursor
was when the file was closed and put it back when the file is opened
again. The option is off by default so that people aren't confused as to
why the cursor isn't at the start of a file when they open it.
This commit also adds a more general ability to serialize a buffer so
various components can be saved (which could also be useful for persistent
undo).
Zachary Yedidia [Sat, 28 May 2016 15:32:09 +0000 (11:32 -0400)]
Refactor and clean up
This commit puts in place the ability for multiple views (splits).
This commit also removes the editor bindings so that all bindings can be
rebound by the user.
I also added some more comments