4b5f07def50817cf28fa8fe2f3c62f609cb055cb

Author
Pavle Portic <pavle.portic@tilda.center>
Committer
Pavle Portic <pavle.portic@tilda.center>
Date

Message

Add getline function to zsh

Diff

 1diff --git a/dot_config/zsh/functions/getline b/dot_config/zsh/functions/getline
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..e131dc9db3d33c8aee422d6b2a86fdab0b225eb3
 4--- /dev/null
 5+++ b/dot_config/zsh/functions/getline
 6@@ -0,0 +1,9 @@
 7+# vim: ft=zsh
 8+# Get nth line in a file
 9+
10+if [ -z ${2+x} ]; then
11+	sed -n ${1}p
12+else
13+	sed -n ${1}p ${2}
14+fi
15+