thimc / vifmimg

Image previews for Vifm (vi file manager) using Überzug
GNU General Public License v3.0
242 stars 26 forks source link

Clear image from screen when :shell command is run #14

Closed KodyVB closed 4 years ago

KodyVB commented 4 years ago

Would it be possible to clear the image preview from the screen when the user runs the :shell (or :sh) command? I have nnoremap cd :shell<CR> in my vifmrc so that I can easily change directories to whatever directory I happen to have open at the time in vifm. The problem comes from having an image preview open and running the command, as the image preview doesn't go away after going back to the shell prompt. The only ways to solve the problem are to either toggle the preview window visibility via :view before using :sh or going to something like a directory or text file which doesn't use Ueberzug.

Edit: I found a workaround to doing it. I just use the following remap:

nnoremap cd :!$XDG_CONFIG_HOME/vifm/scripts/vifmimg clear & $SHELL<CR>

Where XDG_CONFIG_HOME is ~/.config