[dev] dvtm status update

From: Marc André Tanner <mat_AT_brain-dump.org>
Date: Sat, 1 Nov 2014 11:21:49 +0100


In the last couple of days/weeks two major changes landed in dvtm
and I would like to get some further testing exposure.

The copy mode, allowing you to move around in the scroll back buffer
history, selecting text and then later pasting it into different
windows was rewritten. It now works by piping the whole history to
your $EDITOR and whatever the editor writes to stdout is kept in a
dvtm "register" for later pasting.

Unfortunately common editors work pretty badly as a filter i.e.

  echo Hello World | $EDITOR - | cat

doesn't end up with the last saved content on stdout when exiting
the editor. And no temporary files are not a solution. I don't
want possibly sensitive data laying around on the file system.
Furthermore the implementation would be more complex.

Therefore dvtm currently uses a whitelist approach if the editor
is not known to work as a filter the communication is one way.
You will be able to navigate the whole history but nothing will
be stored by dvtm and hence pasting won't work. The white listing
also prevents stuff like DVTM_EDITOR=sort to work. Maybe a black
listing approach would be preferable?

Editors which I have tested and work as expected include sandy and
vis. The editor to use can be overridden by the $DVTM_EDITOR environment
variable. The following section describes the intended usage with vis.

 1) start dvtm with vis as editor

    DVTM_EDITOR=vis dvtm

 2) generate some output

 3) enter copy mode via MOD+e (where MOD defaults to CTRL-g)

 4) within vis navigate to the area your interested in. If you want to
    start with a search MOD+/ from dvtm is a shortcut.

 5) go into visual mode with: 'v' and extend your selection using
    your preferred method

 7) write the selected part back to dvtm

    If you now want to copy the selection for later pasting, go to
    the ':'-command mode. Notice that it starts with '<,'> meaning a
    command will only affect the current selection. If you now type
    'wq' you will write the selection to stdout and quit the editor.

    If you instead want to modify the selected text, then yank it
    into a vis register 'y', undo the last editing operation 'u'
    (which is reading from stdin therefore you should now have an
    empty file), paste the previously selected text 'p'. Edit it
    as you wish, once you are happy write the content to stdout and
    quit the editor ':wq'.

 8) Back in dvtm you should be able to paste the text with MOD+p.

Hope this illustrates the usage, feel free to ask if something is unclear.

The second big change is that due to popular requests for "workspaces"
the tagging branch has been merged into master. That is dvtm now supports
the same tagging concept as dwm. The current key bindings are:

       Mod-0 View all windows with any tag.

              Toggles to the previously selected tags.

              View all windows with nth tag.

              Add/remove all windows with nth tag to/from the view.

              Apply nth tag to focused window.

              Add/remove nth tag to/from focused window.

Still not quite sure whether this is the best choice. Other suggestions
are welcome!

To conclude this is essentially a kind of release candidate. It would be
nice if you could fetch the current git version[0] and report back on
whether everything works as expected.


PS: for those of you interested in SLOC, the copy mode change removed
    ~500 lines of code whereas the tagging stuff added around ~300.

[0] git clone git://repo.or.cz/dvtm.git

 Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
Received on Sat Nov 01 2014 - 11:21:49 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 01 2014 - 11:24:07 CET