pozemka / cheatsh-qtcreator

Plugin for Qt Creator to view cheat sheets from cheat.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CheatSh-QtCreator

Plugin for QtCreator to view cheat sheets from cheat.sh

Download here

Introduction

Cheat.sh is a community-driven cheat sheets repository for programming languages, databases, linux tools and commands. It also searches StackOverflow if nothing is found in cheat.sh repository.

This plugin provides integrated access to cheat.sh from Qt Creator.

For example, you want to know how to get random number in a range. Instead of switching to documentaion or to browser you can search with plugin for random in range and read cheat sheet right inside Qt Creator.

Search examples: tie, RAII, random in range, measure time, reverse a list. QML/js function, Qt/resources, SQL/select, tar

Usage

From editor

Right-click on a word or selection and choose Search cheat.sh from popup menu. Or hit Alt + ⇧ Shift + c

Context menu example animation

Context menu example animation

From Locator

  1. Hit Ctrl + k to focus Locator
  2. Type ch <search term> to search in default context or cs /<context>/<search term> to override context for this search
Locator menu example animation

Locator example animation

Pasting results

Hit Alt + ⇧ Shift + v to paste result in text cursor position. Or right-click in text editor and select Paste result from context menu. Please note that most of the comments will be stripped and only the code will be pasted (Result of ?TQ request to cheat.sh).

Paste example animation

Locator example animation

Next/Previous answer

You can switch between answers by pressing "Next item" (F6) and "Previous item" (⇧ Shift + F6) buttons on the cheat.sh panel.

Next/Previous buttons

Useful settings

Plugin setting allows you to:

  • change default search context to your favorite language (default value is C++ language)
  • set custom URL to self-hosted cheat.sh instance
  • turn on and off displaying comments in results
  • disable update checks

Installation

To install plugin, please download suitable version from releases page. Then extract archive to user plugin directory:

  • Windows Vista and newer: "%LOCALAPPDATA%\QtProject\qtcreator\plugins\x.y.z". For example: c:\Users\Username\AppData\Local\QtProject\QtCreator\plugins\4.10.0\cheatsh.dll
  • Linux: "~/.local/share/data/QtProject/qtcreator/plugins/x.y.z" or "$XDG_DATA_HOME/data/QtProject/qtcreator/plugins/x.y.z" . For example "/home/user/.local/share/data/QtProject/qtcreator/plugins/4.10.0/cheatsh.so"

Please note:

  • for Qt Creator prior 4.9.0 plugin must be put into subdirectory with exact match to Qt Creator version (For example …/QtProject/qtcreator/plugins/4.8.2). Starting from 4.9.0 you can put plugin into subdirectory with lowest patch version (e.g. 4.9.0 instead of 4.9.2).
  • Qt Creator 4.9.x for Windows has broken SSL support so you should install OpenSSL manually.

Compilation

See INSTALL for more info about compilation from sources.

Build plugin

About

Plugin for Qt Creator to view cheat sheets from cheat.sh

License:MIT License


Languages

Language:C++ 94.7%Language:CMake 4.9%Language:C 0.4%