Skip to content

Latest commit

 

History

History
1030 lines (628 loc) · 23.4 KB

File metadata and controls

1030 lines (628 loc) · 23.4 KB

Documentation for Hackerman Text

Configuration

This section keeps an up-to-date version of the default config-file.

License

[license]

path_to_license_file                -- path to license file (e.g. /Users/michael/Desktop/personal.txt, or leave empty for non-commercial version)

Editor

[editor]

font                                SF Mono -- use any installed font or place in /Application Support/Hackerman Text/fonts
font_weight                         light -- light, normal, medium, bold
font_size                           15

line_extra_height                   2
tab_width                           4

theme                               hackerman -- hackerman, borland, light, focus, focus-dark, nostromo, writer, github-dark, kujukuju, dark, ayu
adaptive_theme                      light, hackerman -- set theme to "adaptive" to use

auto_indent                         true
auto_complete                       true

file_explorer_root                  -- absolute path to folder to set as root on startup, default is Desktop
file_types_to_exclude               .dmg, .app, .git, .ttf, .dylib, .so, .venv, .pyc, .zip, .egg, .DS_Store

files_to_open_on_startup            quickstart.org, -- list of absolute paths to files to open on startup, e.g. todo.org, notes.txt, work.py

inline_command_in_files             txt, md, org,
inline_shell_start_symbol           %

scripts_enabled                     false
allow_unsafe_scripts                false -- allow imports

click_on_links                      false -- if false, use inline_command to activate

-- ui

show_line_numbers                   true
show_scrollbar                      true
show_minimap                        false
show_indent_guides                  true
show_annotations                    true
show_ui_borders                     true

-- cursor

cursor_width                        2
cursor_extra_height                 8

cursor_as_block                     false
cursor_line_highlight               false

cursor_blink                        false
cursor_blink_period                 530 -- 530 is default

cursor_neon_effect                  false -- experimental

-- statusbar

show_line_info                      true
show_model_metrics                  true
show_active_lexer                   true

-- misc

ui_font                             SF Mono
ui_font_weight                      -- leave empty for default, normal
ui_font_size                        -- leave empty for default, 12pt

scrollbar_width                     8
minimap_width                       64

open_on_largest_screen              true
 
eol_mode                            lf -- crlf, cr, lf
eol_symbols_visible                 false

terminal_to_use                     "Terminal" -- for open in terminal shortcuts
path_to_shell                       /bin/zsh -- for inline shell commands

window_opacity                      1
selection_opacity                   0.2
indent_guides_opacity               0.1
whitespace_opacity                  0.1

unsaved_symbol                      *
whitespace_symbol                   ▪

vertical_rulers                     -- list of columns

-- experimental

wrap_word                           txt, md,
-- highlight_line_on_jump              false
tabs_over_spaces                    false
font_ligatures                      false -- requires restart
path_to_scripts_file                -- path to external scripts file, requires restart

Keybinds

[keybinds]

-- Important: Use Comma, Period, Plus, Minus instead of symbols ,.+-

new_file                            Cmd + N
new_window                          Cmd + Shift + N
open_file                           Cmd + O
save_file                           Cmd + S
save_file_as                        Cmd + Shift + S
close_file                          Cmd + W
close_other_files                   Cmd + Shift + W
reopen_last_closed_file             Cmd + Shift + T

fold_line                           Cmd + L
fold_all                            Cmd + Shift + L
code_completion                     Cmd + K
line_comment                        Cmd + /
zoom_in                             Cmd + =,                Cmd + Plus
zoom_out                            Cmd + _,                Cmd + Minus
toggle_split_editor                 Cmd + \
show_file_explorer                  Cmd + P
-- show_outline_panel                  Cmd + Shift + E
show_buffer_explorer                Control + Tab
show_function_explorer              Cmd + Shift + P
open_terminal_at_file               Cmd + T
open_config_file
open_scripts_file
reveal_in_finder

select_all                          Cmd + A
undo                                Cmd + Z,                Control + /
redo                                Cmd + Shift + Z,        Control + Shift + /
lowercase                           Option + L
uppercase                           Option + U
cancel                              Escape,                 Control + G
newline                             Return,                 Cmd + Return,           Control + J
newline_at_end_of_line              Shift + Return
tab                                 Tab
backtab                             Shift + Tab
center_on_cursor                    Control + L
line_indent                         Cmd + ]
line_unindent                       Cmd + [
selection_duplicate
move_line_up
move_line_down
select_next_match                   Cmd + E
unselect_last_match                 Cmd + Shift + E

open_file_in_new_window
copy_path_to_file                   Cmd + Shift + C
reset_window_position
toggle_read_only
toggle_newspaper_scroll
select_matches
show_license_info
open_diff_in_new_buffer
go_to_line
tear_off_buffer
reset_zoom                          Cmd + 0
replace_all_eol
replace_tabs_with_spaces
toggle_indent_guides

plain_text_lexer
auto_detect_lexer

tab_width_2_spaces
tab_width_4_spaces

indent_with_spaces
indent_with_tabs

find_in_file                        Cmd + F
show_search_explorer                Cmd + Shift + F

accept_autocomplete
python_eval_line                    Cmd + Option + E

-- this is used to execute org-mode code, run shell commands, and evaluate expressions
inline_command                      Cmd + Shift + Return

-- Native MacOS keys bindings for document are rebound to para by default due to misclick prone
document_start                      Option + Comma
document_start_extend               Option + Shift + Comma
document_end                        Option + Period
document_end_extend                 Option + Shift + Period

home
home_extend

char_left                           Left,                   Control + B
char_left_extend                    Shift + Left,           Control + Shift + B
char_right                          Right,                  Control + F
char_right_extend                   Shift + Right,          Control + Shift + F

line_up                             Up,                     Control + P
line_up_extend                      Shift + Up,             Control + Shift + P
line_down                           Down,                   Control + N
line_down_extend                    Shift + Down,           Control + Shift + N

line_up_start                       Option + Up
line_up_start_extend                Option + Shift + Up

line_down_end                       Option + Down
line_down_end_extend                Option + Shift + Down

line_start                          Cmd + Left,             Control + A
line_start_extend                   Cmd + Shift + Left,     Control + Shift + A
line_end                            Cmd + Right,            Control + E
line_end_extend                     Cmd + Shift + Right,    Control + Shift + E

line_scroll_up                      Control + Up
line_scroll_down                    Control + Down
line_add_caret_up                   Control + Shift + Up
line_add_caret_down                 Control + Shift + Down

duplicate_line                      Cmd + Shift + D
transpose_line
reverse_line

copy                                Cmd + C
cut                                 Cmd + X
paste                               Cmd + V

paragraph_up                        Cmd + Up,               Option + A              -- MacOS default is Option+Up
paragraph_up_extend                 Cmd + Shift + Up,       Option + Shift + A      -- MacOS default is Option+Shift+Up
paragraph_down                      Cmd + Down,             Option + E              -- MacOS default is Option+Down
paragraph_down_extend               Cmd + Shift + Down,     Option + Shift + E      -- MacOS default is Option+Shift+Down

word_left                           Option + Left,          Option + B
word_left_extend                    Option + Shift + Left,  Option + Shift + B
word_right
word_right_extend

word_left_end
word_left_end_extend
word_right_end                      Option + Right,         Option + F
word_right_end_extend               Option + Shift + Right, Option + Shift + F

word_part_left                      Control + Left
word_part_left_extend               Control + Shift + Left
word_part_right                     Control + Right
word_part_right_extend              Control + Shift + Right

page_up                             Option + V
page_up_extend                      Option + Shift + V
page_down                           Control + V
page_down_extend                    Control + Shift + V

stuttered_page_up
stuttered_page_down
stuttered_page_up_extend
stuttered_page_down_extend

delete                              Backspace
delete_not_newline                  Shift + Backspace
delete_right                        Cmd + D,                Control + D             -- delete selection if selection is not empty
delete_word_left                    Option + Backspace,     Control + Backspace
delete_word_right                   Option + D
delete_line                         Cmd + Shift + K
delete_line_left                    Cmd + Backspace,        Control + Shift + Backspace
delete_line_right                   Control + K
delete_paragraph_left               Option + Shift + K
delete_paragraph_right              Option + K

-- pane navigation

focus_main_editor                   Cmd + Comma
focus_split_editor                  Cmd + Period
previous_tab                        Cmd + Shift + Comma
next_tab                            Cmd + Shift + Period

-- quick switch buffer
switch_to_buffer_1                  Cmd + 1
switch_to_buffer_2                  Cmd + 2
switch_to_buffer_3                  Cmd + 3
switch_to_buffer_4                  Cmd + 4
switch_to_buffer_5                  Cmd + 5
switch_to_buffer_6                  Cmd + 6
switch_to_buffer_7                  Cmd + 7
switch_to_buffer_8                  Cmd + 8
switch_to_buffer_9                  Cmd + 9

Place key bindings for custom editor commands in the [user] section.

[user]

-- Place key bindings to your own functions here
-- function_name                    Modifier + Key

toggle_system_appearance
build_and_run

Themes

This is the default hackerman theme. Define a new theme by giving it a name, such as [my-custom-theme], and adding colors to the below keys. Many keys are optional.

[hackerman]

background                          #102329 -- #16181C
foreground                          #87919D
text_color                          #FFFFFF
cursor                              #69EBFA

default                             #FFFFFF
keyword                             #E67D74
class                               #D0C5A9
name                                #D0C5A9
lambda                              #D699B5
string                              #D4BC7D
number                              #D699B5
operator                            #E0AD82
comment                             #87919D
special                             #69EBFA
type                                #9ECEF5
boolean                             #D699B5
builtin                             #E0AD82

_highlight                          #D4BC7D
_link                               #9ECEF5, #9ECEF5

-- error                               #FC4646, #FC4646 -- traffic light red
-- warning                             #FCAF24, #FCAF24 -- traffic light yellow
-- success                             #28C032, #28C032 -- traffic light green

-- _selection
-- _bold
-- _italic
-- _underline
-- _verbatim
-- _strike
-- _code
-- _link
-- _todo
-- _annotation

-- _title_bar
-- _status_bar

github-dark

[github-dark]                 

background                         #0F1217
foreground                         #868D97
text_color                         #E3E9EF
cursor                             #59C2FF

default                            #E3E9EF
keyword                            #FB6E65
class                              #EE9B52
name                               #D2A8FF
lambda                             #D2A8FF
string                             #A5D6FF
number                             #77BDFB
operator                           #77BDFB
comment                            #9198A1
special                            #79C0FF
type                               #79C0FF
boolean                            #79C0FF
builtin                            #77BDFB

_error                             #FC4646, #FC4646

Editor commands

This section keeps a list of available built-in editor commands.

accept_autocomplete

Accept the first item in the autocomplete popup.

auto_detect_lexer

Auto detect lexer based on file extension.

backtab

Perform reverse tab.

cancel

Cancel the current operation.

center_on_cursor

Center the view on the cursor.

char_left

Move caret left one character.

char_left_extend

Move caret left one character, extending selection.

char_right

Move caret right one character.

char_right_extend

Move caret right one character, extending selection.

close_file

Close the current file.

close_other_files

Close all files except the current one.

code_completion

Code completion using LLM.

copy

Copy the selected text to the clipboard.

copy_path_to_file

Copy the path to the file to the clipboard.

cut

Cut the selected text to the clipboard.

delete

Delete the character at the caret.

delete_line

Delete the current line.

delete_line_left

Delete the line to the left of the caret.

delete_line_right

Delete the line to the right of the caret.

delete_not_newline

Delete the character at the caret if it is not a newline.

delete_paragraph_left

Delete the paragraph to the left of the caret.

delete_paragraph_right

Delete the paragraph to the right of the caret.

delete_right

Delete the character to the right of the caret.

delete_word_left

Delete the word to the left of the caret.

delete_word_right

Delete the word to the right of the caret.

document_end

Move the cursor to the end of the document.

document_end_extend

Move the cursor to the end of the document and extend the selection.

document_start

Move the cursor to the start of the document.

document_start_extend

Move the cursor to the start of the document and extend the selection.

duplicate_line

Duplicate the current line.

find_in_file

Find a string in the current file.

focus_main_editor

Focus the main editor.

focus_split_editor

Focus the split editor.

fold_all

Fold all foldable lines at current line’s fold level.

fold_line

Fold the current line.

go_to_line

Go to a specific line in the file.

home

Move the cursor to the start of the line.

home_extend

Move the cursor to the start of the line and extend the selection.

indent_with_spaces

Set the indentation to use spaces. This is for current buffer only and not persistent on close.

indent_with_tabs

Set the indentation to use tabs. This is for current buffer only and not persistent on close.

inline_command

Execute inline command.

line_add_caret_down

Add a cursor below the current cursor.

line_add_caret_up

Add a cursor above the current cursor.

line_comment

Toggle line comment for the current line or selection.

line_down

Move the cursor down one line.

line_down_end

Move the cursor down one line and to the end of the line.

line_down_end_extend

Move the cursor down one line and to the end of the line and extend the selection.

line_down_extend

Move the cursor down one line and extend the selection.

line_end

Move the cursor to the end of the line.

line_end_extend

Move the cursor to the end of the line and extend the selection.

line_indent

Indent selected lines.

line_scroll_down

Scroll the view down one line.

line_scroll_up

Scroll the view up one line.

line_start

Move caret to the start of the line.

line_start_extend

Move caret to the start of the line, extending selection.

line_unindent

Unindent selected lines.

line_up

Move the cursor up one line.

line_up_extend

Move the cursor up one line and extend the selection.

line_up_start

Move the cursor up one line and to the start of the line.

line_up_start_extend

Move the cursor up one line and to the start of the line and extend the selection.

lowercase

Convert the selected text to lowercase.

move_down_to_next_empty_line

Move the cursor to the next empty line below the current line.

move_line_down

Move the current line down.

move_line_up

Move the current line up.

move_up_to_next_empty_line

Move the cursor to the next empty line above the current line.

new_file

Open a new file.

new_window

Open a new window.

newline

Insert a newline character.

newline_at_end_of_line

Insert a newline at the end of the current line.

next_tab

Switch to the next tab.

open_config_file

Open the config file in the current window.

open_diff_in_new_buffer

Open the diff for the current file in a new buffer.

open_file

Open a file in the current window.

open_file_in_new_window

Open the current file in a new window.

open_scripts_file

Open the scripts file in the current window.

open_terminal_at_file

Open the terminal at the file.

page_down

Move caret down one page.

page_down_extend

Move caret down one page, extending selection.

page_up

Move caret up one page.

page_up_extend

Move caret up one page, extending selection.

paragraph_down

Move the cursor to the end of the paragraph.

paragraph_down_extend

Move the cursor to the end of the paragraph and extend the selection.

paragraph_up

Move the cursor to the beginning of the paragraph.

paragraph_up_extend

Move the cursor to the beginning of the paragraph and extend the selection.

paste

Paste the text from the clipboard.

previous_tab

Switch to the previous tab.

python_eval_line

Evaluate the current line as Python code.

read_file

Read file into editor.

redo

Redo the last action.

reopen_last_closed_file

Reopen the last closed file.

replace_all_eol

Replace all EOLs with the current EOL mode.

replace_tabs_with_spaces

Replace all tabs with spaces in the document.

reset_window_position

Reset the window position.

reset_zoom

Reset the zoom level to 0.

reveal_in_finder

Reveal the file in the finder.

reverse_line

Reverse the current line.

save_file

Save the current file.

save_file_as

Save the current file as a new file.

select_all

Selects all text in the editor.

select_matches

Select all matches of the current word.

select_next_match

Selects the next match of the current selection.

selection_duplicate

Duplicate the selection.

show_about

Show the about dialog.

show_buffer_explorer

Show the buffer explorer.

show_file_explorer

Show the file explorer.

show_function_explorer

Show the function explorer.

show_license_info

Show the license information.

show_search_explorer

Show the search explorer.

stuttered_page_down

Move caret down one page, stuttered.

stuttered_page_down_extend

Move caret down one page, stuttered, extending selection.

stuttered_page_up

Move caret up one page, stuttered.

stuttered_page_up_extend

Move caret up one page, stuttered, extending selection.

switch_to_buffer_1

Switch to the first buffer.

switch_to_buffer_2

Switch to the second buffer.

switch_to_buffer_3

Switch to the third buffer.

switch_to_buffer_4

Switch to the fourth buffer.

switch_to_buffer_5

Switch to the fifth buffer.

switch_to_buffer_6

Switch to the sixth buffer.

switch_to_buffer_7

Switch to the seventh buffer.

switch_to_buffer_8

Switch to the eighth buffer.

switch_to_buffer_9

Switch to the ninth buffer.

tab

Insert a tab character.

tab_width_2_spaces

Set the tab width to 2 spaces. This is for current buffer only and not persistent on close.

tab_width_4_spaces

Set the tab width to 4 spaces. This is for current buffer only and not persistent on close.

toggle_indent_guides

Toggle the indentation guides. This is for current buffer only and not persistent on close.

toggle_split_editor

Toggle the split editor mode.

transpose_line

Transpose the current line.

undo

Undo the last action.

unselect_last_match

Unselect the last match.

uppercase

Convert the selected text to uppercase.

word_left

Move caret left one word.

word_left_end

Move caret left one word.

word_left_end_extend

Move caret left one word, extending selection.

word_left_extend

Move caret left one word, extending selection.

word_part_left

Move caret left one word part.

word_part_left_extend

Move caret left one word part, extending selection.

word_part_right

Move caret right one word part.

word_part_right_extend

Move caret right one word part, extending selection.

word_right

Move caret right one word.

word_right_end

Move caret right one word.

word_right_end_extend

Move caret right one word, extending selection.

word_right_extend

Move caret right one word, extending selection.

zoom_in

Zoom in by 1 point.

zoom_out

Zoom out by 1 point.

Custom editor commands

This section keeps an up-to-date version of the default scripts-file. Use this as an example or base to build your own custom editor commands. See how to add key bindings to custom functions in Keybinds.

# default scripts-file for Hackerman Text


def toggle_system_appearance(self):
    # run appscript on macos
    
    script = """
    tell application "System Events"
        tell appearance preferences
            set dark mode to not dark mode
        end tell
    end tell
    """
    osascript(script)


def build_and_run(self):
    # example build commands based on file_type
    
    BUILD_MAP = {
        "py": f"python { self.file_name }",
        "tex": f"pdflatex { self.file_name } -o { self.file_name.split('.')[0] }.pdf",
        "org": f"pandoc -f org -t pdf { self.file_name } -o { self.file_name.split('.')[0] }.pdf --pdf-engine=pdflatex",
        "md": f"pandoc -f md -t pdf { self.file_name } -o { self.file_name.split('.')[0] }.pdf --pdf-engine=pdflatex",
    }

    if self.file_type not in BUILD_MAP:
        show_message(f"No build command for { self.file_name } files.")
        return
    
    run_in_terminal(BUILD_MAP[self.file_type])