javascript - Typing function definitions in Vim -


i'm newly excited using vim programming needs, haven't yet managed google myself neat way of writing function definitions.

when typing new function definition (i'm writing javascript) this:

  1. ifunction foo(x) {}esc leaves me in normal mode cursor between braces.

  2. now ireturnesc puts closing brace on new line.

  3. finally o opens new line above closing brace cursor on new line.

this seems inefficient. there neater way? (ideally not involving .vimrc hacks, because i'm trying learn 'vanilla' vim can)

ifunction foo(x) {cr
}ctrl-oo

is golfiest can goal (parentheses closed @ times) without editing .vimrc or installing plugins.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -