From 6da0278175debd86ed6b339c4b0233c2074027c4 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 21 Apr 2016 00:15:58 +0200 Subject: bashrc: updated the td function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- bashrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bashrc') diff --git a/bashrc b/bashrc index b9e7b9c..b80372e 100644 --- a/bashrc +++ b/bashrc @@ -95,7 +95,14 @@ source_maybe $HOME/.gcompletion.sh # The td utility. See: https://github.com/mssola/td td() { - # TODO: use a proper certificate on the server... + # If we are editing, pick the default layout. Otherwise, just execute the + # given arguments. + if [ -z "$1" ]; then + args="--file /root/.td/auto.txt" + else + args="$@" + fi + docker run -it \ -v $HOME/.td:/root/.td \ -v $HOME/.vimrc:/root/.vimrc:ro \ @@ -104,7 +111,7 @@ td() { -e EDITOR=vim \ --rm \ --detach-keys "ctrl-a,a" \ - mssola/td:latest "$@" + mssola/td:latest "$args" } source_maybe $HOME/.tdcompletion.sh -- cgit v1.2.3