Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mac binding for beg/end of line #1296

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions src/lib/Guiguts/KeyBindings.pm
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,26 @@ sub keybindings {

# Extra bindings for Mac
if ($::OS_MAC) {
keybind( '<Meta-q>', sub { ::_exit(); } );
keybind( '<Meta-s>', sub { ::savefile(); } );
keybind( '<Meta-a>', sub { $textwindow->selectAll; } );
keybind( '<Meta-c>', sub { ::textcopy(); } );
keybind( '<Meta-x>', sub { ::cut(); } );
keybind( '<Meta-v>', sub { ::paste(); } );
keybind( '<Meta-f>', sub { ::searchpopup(); } );
keybind( '<Meta-Shift-f>', sub { ::quicksearchpopup(); } );
keybind( '<Meta-g>', undef, '<<FindNext>>' );
keybind( '<Meta-Shift-g>', undef, '<<FindNextReverse>>' );
keybind( '<Meta-z>', undef, '<<Undo>>' );
keybind( '<Meta-y>', undef, '<<Redo>>' );
keybind( '<Meta-Up>', [ 'SetCursor', '1.0' ] );
keybind( '<Meta-Shift-Up>', [ 'KeySelect', '1.0' ] );
keybind( '<Meta-Down>', [ 'SetCursor', 'end-1c' ] );
keybind( '<Meta-Shift-Down>', [ 'KeySelect', '1.0' ] );
keybind( '<Meta-q>', sub { ::_exit(); } );
keybind( '<Meta-s>', sub { ::savefile(); } );
keybind( '<Meta-a>', sub { $textwindow->selectAll; } );
keybind( '<Meta-c>', sub { ::textcopy(); } );
keybind( '<Meta-x>', sub { ::cut(); } );
keybind( '<Meta-v>', sub { ::paste(); } );
keybind( '<Meta-f>', sub { ::searchpopup(); } );
keybind( '<Meta-Shift-f>', sub { ::quicksearchpopup(); } );
keybind( '<Meta-g>', undef, '<<FindNext>>' );
keybind( '<Meta-Shift-g>', undef, '<<FindNextReverse>>' );
keybind( '<Meta-z>', undef, '<<Undo>>' );
keybind( '<Meta-y>', undef, '<<Redo>>' );
keybind( '<Meta-Up>', [ 'SetCursor', '1.0' ] );
keybind( '<Meta-Shift-Up>', [ 'KeySelect', '1.0' ] );
keybind( '<Meta-Down>', [ 'SetCursor', 'end-1c' ] );
keybind( '<Meta-Shift-Down>', [ 'KeySelect', 'end-1c' ] );
keybind( '<Meta-Left>', [ 'SetCursor', 'insert linestart' ] );
keybind( '<Meta-Shift-Left>', [ 'KeySelect', 'insert linestart' ] );
keybind( '<Meta-Right>', [ 'SetCursor', 'insert lineend' ] );
keybind( '<Meta-Shift-Right>', [ 'KeySelect', 'insert lineend' ] );
}

# Bookmarks - multiple key-combinations to allow for keyboard differences
Expand Down
Loading