DVTM-EDITOR(1)

πŸ’– DVTM-EDITOR β€” the little filter-glam bestie from the dvtm manual, section 1 ✨

okay so real talk, this is the dvtm-editor page from the General Commands Manual, and she's tiny but she's doing the most. let's get into it πŸŽ€


🌸 NAME 🌸

dvtm-editor β€” make a text editor act as a filter

like, your editor but she's a pipeline girlie now πŸ’…


✨ SYNOPSIS ✨

dvtm-editor ARGS...

that's it. that's the whole vibe. args go in, magic comes out πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so dvtm-editor is a file buffering utility that the dvtm(1) terminal multiplexer uses to make its copy mode work. she reads standard input, saves it to a temporary file, and then opens an editor β€” and which editor she opens is decided by the "ENVIRONMENT VARIABLES" section below. iykyk 😌

now here's the important part, bestie, listen up:

  • if the editor you invoked exits with a non-zero exit status, dvtm-editor outputs nothing at all. silence. ghosted. πŸ‘»
  • if the file's modification time stays unchanged, same deal β€” nothing gets output.
  • but if neither of those things happened? she dumps the content of the modified temporary file straight to stdout. slay. πŸ”₯

and every single command line argument gets forwarded verbatim, no edits, no notes. dvtm(1) uses this to adjust the initial view port by passing +n, which means "the start of line n should be displayed." periodt. πŸ‘‘


🌈 ENVIRONMENT VARIABLES 🌈

she goes hunting for your user editor by checking these variables, in order:

  • DVTM_EDITOR β€” lets you invoke an editor that's specific to dvtm, or set particular flags. the VIP pass 🎟️
  • VISUAL, EDITOR β€” the fallback to global defaults. the reliable besties 🫢

and if literally no editor is found? vi(1) gets used. she's always there for you. iconic behaviour fr fr.


πŸŽ€ FILES πŸŽ€

the temporary files get created according to this template:

/tmp/dvtm-editor.XXXXXX

and /dev/tty gets opened to obtain a controlling tty, which is then used for the standard input/output streams of the invoked editor. so the editor has somewhere to actually be, you know? main character energy 🧚


πŸ’… NOTES πŸ’…

using vis(1) as your editor is particularly convenient because :wq! in visual mode will reduce the file down to the currently active selection(s). that's the trick, bestie. that's the whole hack. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

vi(1), dvtm(1), dvtm-pager(1) β€” go read the family, they're all lovely 🌸


πŸ¦‹ AUTHOR πŸ¦‹

dvtm is written by Marc AndrΓ© Tanner <mat at brain-dump.org> β€” thank you for your service, king πŸ’œ


okay and one last thing before you go: this is dvtm version 0.15+40.g311a8c0-1build1, dated December 27, 2016. so like, vintage but still eating. no cap. πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from