mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

vimw (217B)


      1 #!/bin/bash
      2 
      3 WIDTH="$1"
      4 shift
      5 CURWIDTH=$(stty size | cut -d ' ' -f2)
      6 
      7 # vim with at most $WIDTH characters
      8 # https://vi.stackexchange.com/q/43726
      9 
     10 stty columns $WIDTH
     11 vim "$@"
     12 RET=$?
     13 stty columns $CURWIDTH
     14 exit $RET
     15