Skip to content

khoinv/intellij-snippets

Repository files navigation

IntelliJ-snippets

This repository contains snippets files for various programing languages.

In the first step, all of snippets was converted from vim-snippets and bootstrap-snippets - that using snipMate format. I am very happy if someone contribute with me to improve it better!

Screencasts

bootstrap.gif

How to use

  • Clone this repository to your local environment
    git clone https://github.com/khoinv/intellij-snippets.git
    cd IntelliJ-snippets && git submodule update --init --recursive
  • Copy all of file in intellij-snippets/resources/templates/* to your templates folder depend on your OS
    • Live templates are stored in the following location:
    • Windows: <your_user_home_directory>.IntelliJ IDEA<version_number>\config\templates
    • Linux: ~IntelliJ IDEA\config\templates
    • OS X: ~/Library/Preferences/IntelliJ IDEA/templates
  • Restart IntelliJ Editor if it is running
  • Type snippet name fllowed by pressing Tab or Enter to get template code. If snippets list do not show up press <CMD>J.
  • To move between variable locations in tamplate code you can use <Tab> or <Enter>. But if emmet mode is enabled, when you type abc<Tab> it will be converted to a html tag like <abc></abc>, so you shoud you <Enter> instead of <Tab> to swich between variable locations.

This template may be works for the following JetBrains products

  • IntelliJ IDEA(EC and Ultimate)(tested)
  • WebStorm and PhpStorm(not tested)
  • PyCharm(not tested)
  • RubyMine(not tested)

Snippets list

How to customize my snippets style

  • In vim-snippets repository has various snippets language, and you can convert it to intelliJ snippet if you need.
  • Using convert(inFile, outFile, prefix, language, [supportLanguages]) in convert.py
  • SupportLanguages OPTIONS
    • HTML
    • XML
    • JSON
    • JAVA_CODE
    • CSS
    • CUCUMBER_FEATURE_FILE
    • JAVA_SCRIPT
    • TypeScript
    • SQL
    • ColdFusion
    • PHP
    • GROOVY
    • MAVEN
    • ASPECTJ
    • ACTION_SCRIPT
    • MXML
    • CoffeeScript
    • JSP
    • OGNL
    • GSP
    • SCALA
    • SBT
    • SSP
    • KOTLIN
    • HAML
    • Python
    • Django
    • RUBY
    • RHTML
    • GO
  • Note: If you want make a snippet that support all languages, let supportLanguages value is 'OTHER'
  • Change prefix to what you want, prefix option can be empty

TODO

  • Make it become a Plugin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages