From e5043d3c5678601fe76b6b21c663f6c1ee8e3aa7 Mon Sep 17 00:00:00 2001 From: Ambrose Chua Date: Wed, 9 Jan 2019 11:16:20 +0800 Subject: [PATCH] Add listing to runenv --- .config/nvim/init.vim | 8 ++++---- .local/bin/runenv | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 441bc6e..3fc724b 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -14,12 +14,12 @@ function! DoNvimPluginUpdate(arg) endfunction Plug 'Shougo/deoplete.nvim', { 'do': function('DoNvimPluginUpdate') } let g:deoplete#enable_at_startup = 1 " enable at startup - let g:deoplete#max_abbr_width = 0 " no width limit - let g:deoplete#max_menu_width = 0 " no width limit + "let g:deoplete#max_abbr_width = 0 " no width limit + "let g:deoplete#max_menu_width = 0 " no width limit let g:deoplete#enable_smart_case = 1 " enable smart case "let g:deoplete#file#enable_buffer_path = 1 - set completeopt=menuone,noinsert - inoremap pumvisible() ? "\" : "\" + set completeopt=menuone,longest + "inoremap pumvisible() ? "\" : "\" " git Plug 'tpope/vim-fugitive' diff --git a/.local/bin/runenv b/.local/bin/runenv index 29c5848..14bcd33 100755 --- a/.local/bin/runenv +++ b/.local/bin/runenv @@ -20,6 +20,7 @@ Starts an env Docker container. If CMD is specified, starts CMD instead of a shell. -h display this help and exit + -l list running containers and exit -x delete Docker container after exit. will loose data -w forward \$PWD into $CONTAINER_HOME/src, and start there -n NAME give container a NAME @@ -30,7 +31,15 @@ instead of a shell. EOF } -while getopts "hxwn:p:v:t" opt; do +show_running() { +docker ps \ + --filter \ + label=org.label-schema.vcs-url=https://git.makerforce.io/ambrose/env.git \ + --format \ + "table {{.Names}}\t{{.RunningFor}}\t{{.Ports}}\t{{.Command}}" +} + +while getopts "hlxwn:p:v:t" opt; do case "$opt" in x) delete="--rm " @@ -52,6 +61,10 @@ while getopts "hxwn:p:v:t" opt; do show_help exit 0 ;; + l) + show_running + exit 0 + ;; t) image="$CONTAINER_IMAGE_PWN" ;;