Commit Graph

92 Commits

Author SHA1 Message Date
Jon Craton
cc9342df9d Added OutdentLine action 2016-10-15 12:47:15 -04:00
Saeed Rasooli
127ebc15b9 Improvement: improve Search behaviour, and Escape key behaviour 2016-10-13 00:49:43 +03:30
Saeed Rasooli
c1dd403ab9 Feature: add MoveLinesUp (Alt + Up) and MoveLinesDown (Alt + Down) actions 2016-10-12 08:15:46 +03:30
Zachary Yedidia
3733e7e223 Add 'Unsplit' action and VSplit and HSplit actions
This commit adds the 'Unsplit' action used to close all splits except
the current one.

It also adds the 'VSplit' and 'HSplit' actions which open empty
vertical/horizontal splits so you can bind them to keys.

Closes #228
2016-10-04 11:08:32 -04:00
Zachary Yedidia
7d16e97b95 Switch to my fork of json5
This should reduce go get download times for micro considerably
because the original json5 committed a bunch of binaries which
cause the repository to be very large and slow to download.

My fork fixes that.
2016-09-29 18:43:10 -04:00
Zachary Yedidia
c1d08a6dc0 Fix typo 2016-09-26 12:08:35 -04:00
Zachary Yedidia
5cc66cef42 Fix problems recognizing CtrlH
Fixes #368

The 'Backspace2' key has been renamed to 'Backspace'.
2016-09-26 09:34:55 -04:00
anatoly techtonik
a853164302 Usability integration with file managers 2016-09-08 00:11:51 +03:00
Zachary Yedidia
539495d2f7 Add support for macros
Closes #270

CtrlU to toggle recording and CtrlJ to playback.
You can also rebind using the "ToggleMacro" and "PlayMacro"
actions.

Note that recursive macros are not yet supported.
2016-09-06 10:44:15 -04:00
Zachary Yedidia
0a534767f0 Merge branch 'primary-clipboard' 2016-09-05 11:37:49 -04:00
Zachary Yedidia
b905400892 Add default bindings for CtrlHome and CtrlEnd
Fixes #280
2016-09-03 13:37:16 -04:00
Zachary Yedidia
b45fcf5bd7 Use json5 for config files 2016-09-02 11:12:16 -04:00
Zachary Yedidia
d9b8a04841 Add support for primary clipboard 2016-09-02 09:40:08 -04:00
Zachary Yedidia
b6f5db3692 Add QuitAll action to close all splits and tabs at once
See #239
2016-08-30 17:38:46 -04:00
Zachary Yedidia
dbdfef632e Add center action to center the view on the cursor 2016-08-24 15:48:11 -07:00
Zachary Yedidia
d17cc0f628 Add boolean option to actions to disable the lua callback 2016-08-17 14:16:27 -04:00
Zachary Yedidia
de9567322b Rebind Home and End to StartOfLine and EndOfLine
This commit changes the default keybindings for Home and End. It
also changes the InsertEnter action to InsertNewline (a better name)
although InsertEnter is still valid for backwards compatibility.

Closes #206
2016-08-16 10:55:04 -04:00
Zachary Yedidia
c409f1cc07 Bind OutdentSelection to ShiftTab (Backtab)
I was under the impression that tcell couldn't detect shift tab
key presses, but this was incorrect. It turns out that tcell just
calls it backtab. This commit makes backtab the default binding
for OutdentSelection.

See #203
2016-08-07 21:41:12 -04:00
Zachary Yedidia
586a66b3a4 Bindings for IndentSelection and OutdentSelection
Tab is now bound to both IndentSelection and InsertTab.

There is currently no binding for OutdentSelection (the user can
bind that to their liking). Hopefully in the future it can be bound
to shift-tab but tcell does currently support that.

Closes #203
2016-08-07 19:45:35 -04:00
Zachary Yedidia
f2ec82520a Separate bindings and actions into two files 2016-07-10 13:30:28 -04:00
Zachary Yedidia
3089967546 Add binding to move to next split (default binding: CtrlW) 2016-07-02 17:41:23 -04:00
Zachary Yedidia
4a15a1d3c8 Add the ability to close splits and change splits using the mouse
This commits adds split navigation with the mouse and the ability to
close splits. You can now also open a file directly with the hsplit
and vsplit commands.
2016-07-02 17:41:23 -04:00
Zachary Yedidia
cb238db307 Merge pull request #189 from onodera-punpun/sudosave
bindings:go: Only display saved message if actually saved
2016-06-30 11:08:12 -04:00
Camille Scholtz
151df0d2aa bindings:go: Only display saved message if actually saved 2016-06-30 16:49:32 +02:00
Zachary Yedidia
2002cb6579 Wrap around when using NextTab and PreviousTab
Fixes #188
2016-06-28 21:29:46 -04:00
Zachary Yedidia
aa8a329745 Fix JumpLine range
Fixes #187
2016-06-28 21:26:19 -04:00
Zachary Yedidia
c51c185be6 Add feedback to save with sudo
Fixes #183
2016-06-25 13:42:21 -04:00
Zachary Yedidia
e2079ac88e Add file completion to OpenFile (CtrlO) with tab 2016-06-09 10:03:50 -04:00
Zachary Yedidia
2c73e1c043 Add default bindings for PreviousTab and NextTab 2016-06-08 18:48:59 -04:00
Zachary Yedidia
a79e964cb6 Make tabs respond to mouse events 2016-06-08 17:47:48 -04:00
Zachary Yedidia
059a5c3b89 Resize the view correctly when there is only one tab left 2016-06-08 14:38:15 -04:00
Zachary Yedidia
40affa56c7 Create tab struct and reorganize tab bar 2016-06-08 13:26:50 -04:00
Zachary Yedidia
5f19f69681 Tab bar and support for opening multiple files 2016-06-08 12:19:36 -04:00
Zachary Yedidia
bd0fa7b6c2 Add DeleteLine binding
Ref #135
2016-06-07 21:47:34 -04:00
Zachary Yedidia
72f5808025 Replace rope with lineArray 2016-06-07 11:43:28 -04:00
Zachary Yedidia
e6c6c7f47d Merge 2016-06-02 13:04:11 -04:00
Zachary Yedidia
1d52ef6c54 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

Fixes #158
2016-06-02 13:01:13 -04:00
JT Olds
646cdd6a9f 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:

   "AltBackspace": "SelectWordLeft,Backspace",
2016-06-01 19:43:30 -06:00
Zachary Yedidia
cd6389c49e Make CursorPageUp and CursorPageDown default
This commit also fixes the documentation for PageUp and PageDown.

See #149
2016-05-31 19:45:19 -04:00
JT Olds
8bd23a575f Add CursorPageUp and CursorPageDown actions 2016-05-31 16:02:42 -06:00
Zachary Yedidia
7adcb13c08 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`.
2016-05-30 13:38:50 -04:00
Zachary Yedidia
68189fd406 Add ability to bind lua functions defined in plugins 2016-05-30 09:12:04 -04:00
Zachary Yedidia
e3e50dd6f6 Add DeleteWordRight and DeleteWordLeft bindings 2016-05-29 19:09:27 -04:00
Zachary Yedidia
1fe18eecb7 Add history navigation with up and down arrows
Fixes #145
2016-05-28 18:41:53 -04:00
Zachary Yedidia
a92a7dc4e6 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).

Fixes #107
2016-05-28 17:29:49 -04:00
Zachary Yedidia
96c7bc67c0 Make Quit() close help if its open and not the whole editor
Fixes #146
2016-05-28 14:53:48 -04:00
Zachary Yedidia
87d147cf92 Indicate correct help binding in status line 2016-05-28 13:58:42 -04:00
Zachary Yedidia
e8d8da1443 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

This fixes #109
2016-05-28 11:32:09 -04:00
Zachary Yedidia
ca58fc949e Make sure there is a selection before deleting it
Fixes #140
2016-05-24 17:46:46 -04:00
Zachary Yedidia
6ece5bc41a Fix tabstospaces problem 2016-05-22 15:47:28 -04:00