Add Android/Java snippets
This commit is contained in:
parent
4a8efde9cc
commit
ebfbba44c8
2 changed files with 65 additions and 3 deletions
61
vim/snippets/android/java.snippets
Normal file
61
vim/snippets/android/java.snippets
Normal 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
7
vimrc
|
@ -142,9 +142,10 @@ endtry
|
||||||
" Empty snipmate options dictionary
|
" Empty snipmate options dictionary
|
||||||
let g:snipMate = {}
|
let g:snipMate = {}
|
||||||
" tell SnipMate who I am
|
" tell SnipMate who I am
|
||||||
if has('loaded_snips')
|
let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
|
||||||
let g:snips_author = 'Eryn Wells <eryn@erynwells.me>'
|
" Set up some snippet scope aliases
|
||||||
endif
|
let g:snipMate.scope_aliases = {}
|
||||||
|
let g:snipMate.scope_aliases["java"] = "android"
|
||||||
|
|
||||||
" set the Gundo preview window on the bottom
|
" set the Gundo preview window on the bottom
|
||||||
if has('loaded_gundo')
|
if has('loaded_gundo')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue