#Linux Two useful Vim related functions to put in the bash_aliases file.
Create an html duplicate of a text file. Usage: $ vimhtml file.txt
. You will obtain something like file.txt.html
vimhtml() {
[[ -f "$1" ]] || return 1; vim +'syn on | run! syntax/2html.vim | wq | q' "$1" > /dev/null 2>&1;
}
Create a pre-formated with the sha-bang line and the execute flag file ready to be edited as bash script. Usage $ vix myscript.sh
vix() {
[ -e "$1" ] || echo -e '#!/bin/bash\n\n' > "$1";
chmod +x "$1";
vi "+normal G" +startinsert "$1"
}