ScalpiEditor

Top-level Files of tip
Login

Top-level Files of tip

Files in the top-level directory from the latest check-in


licenze:

This code and its derivatives can be used under the following conditions:
- Do not attack other countries.
- Jerk off on public at least 1 time per day.
- maintain hygiene.
- check my other projects https://chiselapp.com/user/sergey6661313

about:

#   ScalpiEditor - ansi-only text editor
    killer features: no. its just editor.
    writed from zig language for linux terminals.

    Initially I wrote the editor exclusively in zig, but then I wanted to rewrite it to just C in future.

        error system:
            zig: The error system in zig is good, but it does not help with segfaults. 
                 I still have to look for the error with binary search, stupidly placing debugging in the program.
            C:   no error system - less asm output code.

        unwraping:
            zig: I need stupid explicit casting or unwraping for "[*c]" and "?"
            c:  i can write "*ptr" or ptr[0] and its just work. 
                No matter to real pointer value - null or not.
                and i can write "if (ptr) {...}" for just check it. 
                Moreover, in some libraries "-1" is sometimes returned as an error value instead of a pointer, 
                which completely breaks the innovation of mandatory null checks. 

        tagged unions:
            zig: Types like Tagged union are generally confusing. zig hust hided tag.
            c:   It is much easier to use structures with a EXPLICIT tag and data.

## Editor Functionality:
    Handles input/output operations, including reading from and writing to the terminal.
    Supports text manipulation features such as inserting, deleting, and navigating through text.
    Includes clipboard operations, marking lines, and easy motion for quick navigation.
    Provides functionality to fold and unfold sections of the text based on indentation.
    Supports saving and loading files, including external copying using a temporary file.
    Implements a macro recording and playback system for repetitive tasks.
    Provides support for commentary highlighting and setting various font styles for text. (in src)

## Noteworthy Features
    Easy Motion:            A mode for quick navigation within the text using key shortcuts.
    Macro Recording:        Allows recording sequences of key presses to be replayed later.
    Text Folding:           Automatically folds sections of text based on indentation levels.
    Clipboard Integration:  Supports external clipboard operations via a temporary file.

##   videos (not tutorials. deprecated. many keys remaped. But idea of navigating is showed...):
    https://www.youtube.com/watch?v=8sJJOQeyOTE
    https://www.youtube.com/watch?v=8qQlMbE8Zmw
    https://www.youtube.com/watch?v=51ao2416ioE&t=60s

##  main dev page: 
    https://chiselapp.com/user/sergey6661313/repository/ScalpiEditor/

##   Download src:
    select version:
    https://chiselapp.com/user/sergey6661313/repository/ScalpiEditor/
    just open file main.c/main.zig in repo and press download.

FAQ:

* pasta from system clipboard makes the text move apart
    try change new_line mode:                     [alt] + [b]
    try paste multiline text only in folded mode: [ctrl] + [e] 

* copy to file not work
    copy to file copyid only cutted lines...
    first clear "cut" buffer with [Alt] + [z]
    then copy blocks with ctrl + c to "cut" buffer
    and then use [Alt]+[c]

* Why did I refuse to parse the colon in the file name? 
    In the linux operating system, files with a colon in the name are often created.

* Nothing work or crash on start
    try download earleer version by timeline in repo. i mark not work version as red.
    Use terminal only with monospaced fonts. crazy fonts giving crazy resaults.

* Does not offer to save the file on exit.
    Idiot protection does not work, if the fool is used to pressing "y" on every programm.

* Why i not support UTF? why  display only ansi symbols?
    just help me write this :)) 
    I search in network how to determine - terminal work with unicode or not. 
    And i not find how to check this.
    Some times terminal work with unicode partially - how to check this?

* no history
    partialy undo work - only for current line.
    the editor doesn't have to keep the whole history, it's a job for csv.
    like fossil, git or any you want (jj is simpliest for this).
    do not make many changes to the code at once. It's unhealthy.

* how to open and close multiple files?
    just use multiple tabs in your terminal. (if terminal can this)
    or use multiple terminals (if you use graphical mode)
    or use any terminal multiplexer.
    and use [Alt]+[c] and [Alt]+[v] for copy paste

* Mouse not work
    I use scroling for view terminal history.
    I don not ability to catch only buttons without catch scrolling.

to support me

with boosty: 
    https://boosty.to/cutloosedev

with monero:
    87T7 qGbA TrM3 a6Br
    DyeC jQQf NWtU u3iZ
    bHVB MC6W mEbN NE13
    Qrrt KhBb e4vF 58NR
    8PTF dYk2 Sozc HexX
    4Q69 jbdQ Asrs P7B

additional tips for linux:

i use "sakura" terminal. There no work "ctrl+shift+left" key-sequence but other thing work norm.
previously i try terminals: zutty, kitty, alacritty, Terminology - all good (not perfect) work.

## you may rename and copy binary to "~/bin/se" like this:
    cp ./main ~/bin/se

## and add this lines to config (".bashrc" file for bash) for easy use:
    export EDITOR="~/bin/se"
    export PATH="~/bin:$PATH"

additional tips for windows:

in windows i recommend use alacritty. 
    it does not overload the system. 
    but sometimes you have to use shift+ins instead of the usual ctrl+shift+v.
    it can just freeze if change keyboar layout many times. Or just disable keys like "{".

## you can try add folder with bin file to system path like this:

    ## temporaly:
        $env:path += ";$($pwd.Path)"

    ## temporally for your custom folder
        $env:path += ";C:\TopSecret\Bin"

    ## or
        $addPath = 'C:\TopSecret\Bin'

    ## or for not temporally:
        [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$($pwd.Path)", "User")

list of bindings:

warning! the operation of certain key combinations depends on the terminal and not on me. if key combination not work try alternative version of combination or use alternative terminal. (for reference: in some programs all key combinations work, not because their code is correct, but because they use dirty hacks. For example, they intercept the keyboard through root access. Such programs need to be installed into the system, instead of just copying. I don't like installers - that won't happen in my text editor.)

basic keys: help [F1] save [Ctrl] + [s] exit [Ctrl] + [q]

navigation: use arrows for navigation

enter block            [Tab]
leave block            [Esc] 
go to start of line    [Home] or  [Ctrl] + [Shift] + [Left]
go to end   of line    [End]  or  [Ctrl] + [Shift] + [Right]
go to line from number [Ctrl]  +  [g]
go to left   word      [Ctrl]  +  [Left]
go to right  word      [Ctrl]  +  [Right]
go to prev block       [Ctrl]  +  [up]
go to next block       [Ctrl]  +  [Down]

symbol interacting: insert as prev [any symbol] delete prev [BackSpace] delete next [Del]

lines/blocks interacting: split line [Enter] join lines [Ctrl] + [j] // also sometimes [Ctrl] + [enter] work. and you can try [num_enter] move up [Alt] + [Up] // not work on some terminals... move down [Alt] + [Down] clear line [Shift] + [Del] duplicate [Ctrl] + [d]

word interactig: delete current word: [ctrl] + [w] copy current word to find buffer: [Alt] + [1]

mark: mark [Alt] + [m] jump to mark [Alt] + [g] move out current block [Alt] + [8] move block outside mark [Alt] + 0 move block inside mark [Alt] + 9 move block before mark [Alt] + [0]

macroses: start record macro [F1] stop record macro [F2] play latest recorded macro [F3]

also there are many buffers: 1) buffer for blocks/lines: cut [Ctrl] + [x] copy [Ctrl] + [c] paste [Ctrl] + [v] discard cutted/coppied [Alt] + [z]

2) external buffer (file "clipboard.txt")
  copy                   [Alt]  +  [c]
  paste                  [Alt]  +  [v]

3) using buffer for finding text:
  copy current word      [Alt]   +  [1]
  find prev:             [Alt]   +  [2]
  find next:             [Alt]   +  [3]
  paste                  [Alt]   +  [4]
  replace finded:        [Alt]   +  [6] // for replace need cursor placed on start of finding text

change mode: fold/unfold [Ctrl] + [e] edit finding buffer [Ctrl] + [f] edit replace buffer: [Alt] + [5] auto space [alt] + [b]

  easy motion:
    horizontal:          [Alt]   +  [q]
    vertical:            [Alt]   +  [e]