Skip Navigation

Fish

Members
0
Posts
10
Created
3 yr. ago

fin - fish extensible text editor written in fish

cross-posted from: https://lemmy.wtf/post/26550037 to fishshell@programming.dev just for the attention of more fish users. fin - fish extensible text editor written in fish It's really just a novel proof of concept. Just showing off how useful fish can be. And I really liked the idea of my text editor being extensible in the language I'm most familiar with, fish, using it every day on the command line. I burned out on it after the first month (and wrestling undo/redo to work how I wanted next month (or two)), so progress has stalled for a few months [~ so it's not yet up to the level of features [e.g. syntax highlighting] before I start bootstrapping its development, writing fin in fin, rather than in emacs]. :/ But it still does the job. :) (And, FYI, fish fans, see the fishsticks branch for the more fish-centric version (fewer unixy-tool dependencies (than main onix branch) and less awk(wardness) (than arctictern branch)) Feel free to contribute or fork, if you like the fun idea. :D PS, fin is tiny. Fewer lines of code than e.g. even just the git thing in the default fish prompt. And it's a whole text editor! :)

Started on a whim. Is actually useable.

[Edit: Update 20261111: • Now fin has its own website url! https://fintexteditor.com/ (Definitely taking this whim too far now.)] • Moved to codefloe.com after unsure policy change at codeberg.org [^edited links]. • Rearranged branches. (defaults to leading branch ~ while feature parity lags) • Mended wrap-hides-top-lines bug, visual rows and file lines no longer conflated. • Advanced the status bar (~ further changes, regressions, and a video are planned). • ... some other stuff too. PS, while fin is still tiny. It no longer has fewer lines of code than the git thing in the default fish prompt (unless it grew too, I've not checked). But it's still a whole text editor in under 1000 lines of fish! :) ]

codeberg.org

When typing multiple logical statements on the same line (connected through ; or &&): ¿how does one bring up autocomplete suggestions for subsequent statements?

I often write multiple statements on the same logical line. For instance short loops that converts one image format to another. Is there a way to bring up tab completions or history search for subsequent statements? After beginning a new command with ; && &or | I want to be able to make use of suggestions again.

How to remove terminal escape sequences from strings?

I'm writing a fish script to process the output of music tagging programs (like operon). I use this for instance to list the filenames of all music tracks in a collection that are missing certain tags like a date of release or which have a CD number tag but no tracknumber tag. Unfortunately the output I'm parsing may control control characters // escape sequences. This caused me quite a lot of headache during debugging. Take the following string for instance: it will display as tracknumber (including the leading whitespace` in my terminal. The word itself only has 11 characters so naturally I tried to call string trim on it, but that doesn't actually alter it because on closer inspection the character sequence looks like this:

 
string_value= tracknumber
string_length=16
0:
:[
2:0
3:m
4:
5:t
6:r
7:a
8:c
9:k
10:n
11:u
12:m
13:b
14:e
15:r

As you can see it starts with a terminal escape sequence which is rendered as a whitespace. Is there an easy way to strip any and all escape sequences from a variable? I used regular expression search and replace with some success, but that seems quite a brittle approach as I can't anticipate every single (edge) case and could also accidentally remove stuff I want to keep.