Skip to content

Instantly share code, notes, and snippets.

@alicanalbayrak
Last active March 27, 2018 06:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alicanalbayrak/9a750714be0a0e3c77f86c6a9499d6c4 to your computer and use it in GitHub Desktop.
Save alicanalbayrak/9a750714be0a0e3c77f86c6a9499d6c4 to your computer and use it in GitHub Desktop.
Source: https://www.tecmint.com/use-vim-as-bash-ide-using-bash-support-in-linux/
============================================================================================================
Important !!!
formatting script = gg=G
============================================================================================================
The following are key mappings for inserting statements (n – normal mode, i – insert mode):
\sc – case in … esac (n, I)
\sei – elif then (n, I)
\sf – for in do done (n, i, v)
\sfo – for ((…)) do done (n, i, v)
\si – if then fi (n, i, v)
\sie – if then else fi (n, i, v)
\ss – select in do done (n, i, v)
\su – until do done (n, i, v)
\sw – while do done (n, i, v)
\sfu – function (n, i, v)
\se – echo -e “…” (n, i, v)
\sp – printf “…” (n, i, v)
\sa – array element, ${.[.]} (n, i, v) and many more array features.
============================================================================================================
Insert a Function and Function Header
\sfu - to add a new empty function
============================================================================================================
create a header for the function above
\cfu
============================================================================================================
How To Use Run Operation in Vi Editor
\rr – update file, run script (n, I)
\ra – set script cmd line arguments (n, I)
\rc – update file, check syntax (n, I)
\rco – syntax check options (n, I)
\rd – start debugger (n, I)
\re – make script executable/not exec.(*) (in)
============================================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment