summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashrc2
-rw-r--r--.vimrc20
-rwxr-xr-xbin/vm5
3 files changed, 25 insertions, 2 deletions
diff --git a/.bashrc b/.bashrc
index fdf38af..d2073e2 100644
--- a/.bashrc
+++ b/.bashrc
@@ -33,7 +33,7 @@ fixab() { printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 "$1"; }
#export LESS_TERMCAP_ue=$'\E[0m' # end underline
# Less: use a 4-space tabulation
-export LESS=Rx4
+export LESS=XFRx4
# gnuplot display in terminal
export GNUTERM='sixelgd enhanced truecolor font "arial,9"'
diff --git a/.vimrc b/.vimrc
index b1900bd..9c74d98 100644
--- a/.vimrc
+++ b/.vimrc
@@ -8,6 +8,9 @@ filetype plugin on
filetype plugin indent on
let mapleader = ","
+" No bell
+set belloff=all
+
set guifont=6x13:h13
set rtp+=/opt/homebrew/opt/fzf
@@ -101,3 +104,20 @@ noremap <leader>e :cs find e <C-R>=expand("<cword>")<CR><CR><tab>
noremap <leader>i :cs find i <C-R>=expand("<cfile>")<CR><CR><tab>
" noremap <leader>f :cs find f <C-R>=expand("<cfile>")<CR><CR><tab>
noremap <leader>d :cs find d <C-R>=expand("<cword>")<CR><CR><tab>
+
+function! CloseOnLast()
+ let cnt = 0
+ for i in range(0, bufnr("$"))
+ if buflisted(i)
+ let cnt += 1
+ endif
+ endfor
+ if cnt <= 1
+ q
+ else
+ bd
+ endif
+ endfunction
+
+noremap <leader><leader> :call CloseOnLast()<cr>
+
diff --git a/bin/vm b/bin/vm
index c0d2e2a..a1c7ae6 100755
--- a/bin/vm
+++ b/bin/vm
@@ -88,7 +88,9 @@ getconf() { awk -F '=' -v k="$2" '$1 == k {print $2}' "$dir/$1/config"; }
help() {
usage 'help' 'Print this help text' && return
- printf '%s\n' "$vm_version\nManage virtual machines\nUsage: vm command [options] [args]"
+ echo "$vm_version - Manage virtual machines"
+ echo "Usage: vm command [options] [args]"
+ echo "Commands:"
Opth=1; for c in $Cmdlist; do $c; done
}
@@ -201,6 +203,7 @@ start_vm() (
-a "${arg-console=hvc0}" \
>>vftool.log 2>&1 & sleep 1
+ [ -f screenlog.0 ] && mv screenlog.0 screenlog.0.old
echo "$!" >vftool.pid
screen -L -S "${PWD##*/}" -d -m "$(vftool_tty)"
wait