Skip to content

Instantly share code, notes, and snippets.

@carousel
Last active October 14, 2020 18:33
Show Gist options
  • Save carousel/696be58014ba1f8a3ed9757d3ff82ea0 to your computer and use it in GitHub Desktop.
Save carousel/696be58014ba1f8a3ed9757d3ff82ea0 to your computer and use it in GitHub Desktop.
Use vim to search Java docs API
#read the comment below first
#paster this line into your .vimrc file
#<leader> is mapped to ,
map ,g gx u
@carousel
Copy link
Author

carousel commented Oct 14, 2020

l install snipMate vim plugin and paste this inside java.snippets file:

snippet lang
	https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/${1}.html
snippet util
	https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/${1}.html
snippet func
	https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/function/${1}.h
```tml 
 
 Usage

-  first expand snippet e.g. 
-  lang will expand to	https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/${1}.html
-  then type search term (like String)
-  then use vim mapped key ,g and you will be redirected to Java API term that you entered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment