自己编写vim规则
This commit is contained in:
parent
64bd0abb1b
commit
b8e3fc0167
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 设计 svim 编辑器的脚本,自动添加 shell 脚本的头部信息和文件权限,
|
||||||
|
# 并创建 /usr/bin/svim 的软链接
|
||||||
|
|
||||||
|
# 验证是否提供了文件路径 (文件名)
|
||||||
|
# 验证参数个数是否等于 1
|
||||||
|
if [ $# -eq 1 ]
|
||||||
|
then
|
||||||
|
if [ ! -e $1 ]; then
|
||||||
|
echo "#!/bin/bash">$1
|
||||||
|
echo "" >> $1
|
||||||
|
chmod +x $1
|
||||||
|
fi
|
||||||
|
vi +'set nonu' +'set fileencoding=utf-16' +2 $1
|
||||||
|
else
|
||||||
|
echo "Usage: svim filename"
|
||||||
|
fi
|
Loading…
Reference in New Issue