Add Android/Java snippets

This commit is contained in:
Eryn Wells 2013-12-12 22:50:19 -08:00
parent 4a8efde9cc
commit ebfbba44c8
2 changed files with 65 additions and 3 deletions

View file

@ -0,0 +1,61 @@
snippet imp android.app.Activity
import android.app.Activity;
snippet imp android.os.Bundle
import android.os.Bundle;
snippet imp android.view.Menu
import android.view.Menu;
snippet imp android.view.MenuInflater
import android.view.MenuInflater;
snippet imp java.util.ArrayList
import java.util.ArrayList;
snippet oncreate
@Override
public void
onCreate(Bundle savedInstanceState)
{
${0}
}
snippet oncreateoptionsmenu
@Override
public void
onCreateOptionsMenu(Menu menu,
MenuInflater inflater)
{
${0}
}
snippet oncreateview Fragment.onCreateView()
@Override
public View
onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState)
{
${0}
}
snippet acc
/**
* Getter for $3.
*
* @return ${5:A foo.}
*/
public ${2:int}
get${1:Foo}()
{
return ${3:mFoo};
}
/**
* Setter for $3.
*
* @param $4 ${6:$5}
*/
public void
set$1(final $2 ${4:foo})
{
$3 = $4;
}${0}

7
vimrc
View file

@ -142,9 +142,10 @@ endtry
" Empty snipmate options dictionary
let g:snipMate = {}
" tell SnipMate who I am
if has('loaded_snips')
let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
endif
let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
" Set up some snippet scope aliases
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases["java"] = "android"
" set the Gundo preview window on the bottom
if has('loaded_gundo')