Skip to content

Instantly share code, notes, and snippets.

View yixizhang's full-sized avatar

Yixi Zhang yixizhang

  • bay area
View GitHub Profile
@yixizhang
yixizhang / _readme.md
Created May 30, 2017 02:03 — forked from mislav/_readme.md
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited --filter status=created -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs -r docker volume rm