From bcf302ab52c017a7a068af4294bd1ed8910d047f Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 1 Feb 2016 22:31:47 +0000 Subject: [PATCH] vim: add readline function to sh.snippets --- vim/ultisnips/sh.snippets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vim/ultisnips/sh.snippets b/vim/ultisnips/sh.snippets index 1ea5c21..f17a0b5 100644 --- a/vim/ultisnips/sh.snippets +++ b/vim/ultisnips/sh.snippets @@ -12,6 +12,12 @@ snippet ar "${array[@]}" w \${${1:array}[${2:@}]}$0 endsnippet +snippet readline "Read a file line by line" b +while ${1:IFS='' }read -r ${2:line} || [[ -n "$$2" ]]; do + ${0:echo "Text read from file: $$2"} +done < "\$${3:file}" +endsnippet + snippet getopt version="${1:0.1}" -- 2.48.1