Skip to content

Brief Text Editor Emulator and Keymap for Intellij IDEA. This repository contains components common to all IntelliJ IDEA platform versions. These components are symbolically linked into each target platform build. See "rkdawenterprises/brief4ijidea" project for the rest.

License

Notifications You must be signed in to change notification settings

rkdawenterprises/brief4ijidea_common

Repository files navigation

icon

Brief Editor Emulator for IntelliJ IDEA


Version Downloads

Brief Text Editor Emulator and Keymap for Intellij IDEA

This IntelliJ IDEA extension adds key bindings and functionality that attempts to emulate many features of the original BRIEF MS-DOS application. Adds it's home-home-home and end-end-end functionality, line and column marking modes, single key cut, copy, and paste, clipboard swap, as well as most of the original keybindings.

Some history. BRIEF (Basic Re-configurable Interactive Editing Facility) was a popular programmer's text editor in the late 1980s and early 1990s. Developed by UnderWare Inc, it was quite powerful and feature rich for its time. For more information, see the Wikipedia page "Brief (text editor)" for more information.

Note! Plugin will not activate until indexing is finished!


Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "brief4ijidea" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk


Commands

The following are the key bindings and commands implemented by the plugin.

Some Brief functionality is currently the Intellij IDEA default, or close enough. No intentional changes to mouse functionality. The commands may not work unless the caret is in an active "Editor Text Document". This is done so hopefully the extension won't interfere with existing functionality.

You must enable

Settings -> Editor -> General -> Virtual Space -> After the end of line

for some commands (Column Marking Mode, and Right side of window) to work properly.

Help and Undo/Redo
Key BindingCommandDescription
Alt + HHelpShow the contextual help window.
Alt + U, Keypad MultiplyUndoUndo the last command.
Ctrl + URedoRedoes the commands that have been previously undone.
Saving and Exiting
Key BindingCommandDescription
Alt + OChange output file nameChange the file name of the current editor. This not only changes the output file name, but also commits the change to file storage.
Alt + XExitExits current the editor.
Alt + WWriteWrites the current editor's file to storage.
Ctrl + XWrite all and exitWrites all unsaved content to storage and exits the IDE.
Cursor Movement
Key BindingCommandDescription
HomeBeginning of line or window or fileMoves the cursor to the beginning of the line or the window or the file depending on whether it is already there. Pressing <Home> will move the cursor/caret to the beginning of the current line if it is not already there. If the cursor/caret is already at the beginning of the line, pressing <Home> will move the cursor/caret to the beginning of the window. If the cursor/caret is already at the beginning of the window, pressing <Home> will move the cursor/caret to the beginning of the buffer/file.
EndEnd of line or window or fileMoves the cursor to the end of the line or the window or the file depending on whether it is already there. Pressing <End> will move the cursor/caret to the end of the current line if it is not already there. If the cursor/caret is already at the end of the line, pressing <End> will move the cursor/caret to the end of the window. If the cursor/caret is already at the end of the window, pressing <End> will move the cursor/caret to the end of the buffer/file.
Ctrl + HomeTop of windowMoves the cursor to the top fully visible line of the window.
Ctrl + EndEnd of windowMoves the cursor to the bottom fully visible line of the window.
Ctrl + PgUpTop of buffer/fileMoves the cursor to the first character position of the editor. Hitting the <Home> key up to 3 times will also do this.
Ctrl + PgDnEnd of buffer/fileMoves the cursor to the last character position of the editor. Hitting the <End> key up to 3 times will also do this.
Ctrl + →Next wordMoves the cursor to the last character of the next word.
Ctrl + ←Previous wordMoves the cursor to the first character of the previous word.
Alt + GGo to lineOpens the "Goto Dialog" and moves the cursor to the requested line number.
Windows
Key BindingCommandDescription
Ctrl + TLine to top of windowMoves the line, that the cursor is currently on, to the top of the current window.
Ctrl + CCenter line in windowMoves the current line to the center of the current window.
Ctrl + BLine to bottom of windowMoves the current line to the bottom of the current window.
Editing Text
Key BindingCommandDescription
Alt + DDelete lineDeletes the current line.
Alt + BackspaceDelete next wordDeletes from the current cursor position to the end of the current word.
Ctrl + BackspaceDelete previous wordDeletes from the current cursor position the be beginning of the current word.
Ctrl + KDelete to beginning of lineDeletes from the current cursor position to the beginning of the line.
Alt + KDelete to end of lineDeletes from the current cursor position to the end of the line.
Alt + IInsert mode toggleToggles between the insert and overstrike modes.
Ctrl + EnterOpen lineInsert a blank line after the current line.
Blocks and Marks (aka selection)
Key BindingCommandDescription
Alt + MMark toggleToggle normal marking mode. Use cursor or single click mouse to move cursor and expand selection.
Alt + LLine Mark toggleToggle line marking mode. Use cursor or single click mouse to move cursor and expand selection.
Alt + CColumn Mark toggle*Toggle column marking mode. Use cursor or single click mouse to move cursor and expand selection.
Alt + [1-10]Drop bookmarkInserts a numbered (1-10) bookmark into the editor and the current cursor posiotion. Bookmark 10 is dropped using the 0 key. This uses the built-in "toggle bookmark" commands.
Alt + J, [1-10]Jump to bookmarkWaits for a bookmark number (waits only for the default 2 seconds), [1-10] then jumps to that number. Bookmark 10 is the 0 key.
Alt + BBookmark ListOpen bookmark list dialog. Scroll and select a bookmark to jump to. Can also delete bookmarks. This is a new command and the key assignment was taken from the "buffer list" command, which is not implemented.
Scrap (aka clipboard)
Key BindingCommandDescription
Keypad PlusCopy to scrapCopies the marked selection to the scrap buffer (the clipboard).
Keypad MinusCut to scrapCuts the marked selection to the scrap buffer.
InsPaste from scrapPastes the latest scrap buffer item into the current editor.
Shift + InsPaste from historyOpens the "Paste from clipboard History Dialog" and pastes the selected scrap item into the current editor. This is a new command.
Alt + InsSwap selection and scrapExchanges the current selection with the latest scrap buffer item, i.e. cuts the current selection, and in it's place, pastes the current scrap. New command. Comes in handy when you want to extract some existing code from a complex statement and make it a new variable. First create the new variable then copy it. Then select the code statement and swap <Alt+Ins>. Then paste the code after the new variable.
Search and Translate (replace)
Key BindingCommandDescription
Alt + SSearch forwardOpens Find/Replace dialog which facilitates both search/replace forward and backward.
Alt + TTranslate forwardAlso opens Find/Replace dialog.
Shift + F5Search againSearches forwards using previous search parameters.
Alt + F5Search backwardSearches backwards using previous search parameters.
Shift + F6Translate againTranslates (replaces) forwards using previous search/replace parameters. Only works if the search dialog is open.
Ctrl + RRepeat!!!Not functional (WIP)!!! Opens the "Repeat Dialog", then repeats the requested command, or inserts the requested char/string into the editor, the requested number of times. Not all commands are supported or work well. Actually accepts any "non-printable" key sequence, so not sure what works actually.

Notes*

  • The extension may not work as well with line/code folding (not well tested). So best to unfold the area of the file you are working on if you want the commands to work as expected.
  • I was only able to account for most Brief defined keystrokes affect in the marking modes. Turn off an active marking mode to use other commands. I couldn't find a way to generally monitor all keystrokes to affect/or disable an active marking mode as a result of a keystroke.
  • Does not support multiple carets (not tested).
  • Column marking mode is independent of, and does not work with IDEA Column Selection Mode. It creates a custom MIME type in the clipboard. Brief's column selection and paste is unique, and superior to most implementations, IMHO. The paste relocates the cursor such that using the single key INS allows you to paste from the top to the bottom of the document by holding down the key.

Contact/Bugs

Enter bugs at Brief Editor Emulator for IntelliJ IDEA Issues.

You can email me at rkdawenterprises@gmail.com.no!spam. I don't look at this very often so it may take a while to hear back.

I started using Brief in the early 1990s when I was at Compaq Computer Corporation working on printers. I thought at the time that it was way superior to any editor I had used to date. I used it for so long, the key bindings and particular functionality just stuck with me.

I created this project as an exercise for me to learn some Kotlin and Intellij IDEA plugin development; Just having fun. I don't believe there is a high demand for Brief emulation anywhere. Regardless, I have always really liked the Brief key assignments and feature set and I try and set it up in any editor I use. So if you are/were also into Brief, I hope you enjoy using this.

One of the goals of this project was to have minimal functional effect on the IntelliJ IDEA "Editor Text Document" editor. So this is by no means a perfect example of the Brief editor, and it's a little quirky at times, mainly because it is limited by the API and architecture of the existing editor. I try to note any deviations in the command descriptions, at least, deviations from the limited documentation and knowledge I have. I have also added some commands as documented above. You can, of course, disable any key bindings and/or set them back to default with

settings->keyboard shortcuts

in the menus.

BTW, I don't have a working example of Brief, just the old documentation. Feel free to let me know if I have implemented something improperly. Also, I did not try to emulate all of Brief's functionality. This is most certainly a subset.


License

Copyright 2019-2022 RKDAW Enterprises and Ralph Williamson

Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License.

You may obtain a copy of the License at Apache License Verson 2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Plugin based on the IntelliJ Platform Plugin Template.

About

Brief Text Editor Emulator and Keymap for Intellij IDEA. This repository contains components common to all IntelliJ IDEA platform versions. These components are symbolically linked into each target platform build. See "rkdawenterprises/brief4ijidea" project for the rest.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published