• Stars
    star
    3
  • Rank 3,963,521 (Top 79 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Some useful TextMate2 snippets, commands etc...

Version Plaftorm

TextMate2 - Power Tools

This bundle includes most used commands (on a daily basis) of me!...

Installation

cd ~/Library/Application\ Support/TextMate/Bundles/
git clone https://github.com/vigo/textmate2-power-tools.git PowerTools.tmbundle

# Restart your TextMate2

You need to install extra tools for Golang helper. You need to enable default Go Bundle from TextMate first...

$ go install golang.org/x/tools/cmd/goimports@latest
$ go install mvdan.cc/gofumpt@latest
$ go install github.com/segmentio/golines@latest
$ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
$ go install honnef.co/go/tools/cmd/staticcheck@latest

$ brew install golangci-lint

Shellcheck feature requires shellcheck binary;

$ brew install shellcheck

You need to add your brew/bin path to PATH variable too:

$ command -v golangci-lint
/opt/homebrew/bin/golangci-lint     # my brew/bin is: /opt/homebrew/bin

# add to TextMate variable
PATH /opt/homebrew/bin:${PATH}

and you need to set:

  • TM_GOPATH and GOPATH get the value of $ go env GOPATH
  • TM_GO get the value of $ command -v go
  • GOMODCACHE get the value of $ go env GOMODCACHE
$ go env GOPATH           # (example) for TM_GOPATH and GOPATH => /Users/vigo/.local/go
$ go env GOMODCACHE       # (example) for GOMODCACHE  => /Users/vigo/.local/go/pkg/mod
$ command -v go           # (example) for TM_GO  => /opt/homebrew/opt/go/libexec/bin/go

$ defaults write com.macromates.TextMate environmentVariables \
    -array-add "{enabled = 1; value = \"$(command -v go)\"; name = \"TM_GO\"; }"
$ defaults write com.macromates.TextMate environmentVariables \
    -array-add "{enabled = 1; value = \"$(go env GOPATH)\"; name = \"TM_GOPATH\"; }"
$ defaults write com.macromates.TextMate environmentVariables \
    -array-add "{enabled = 1; value = \"$(go env GOPATH)\"; name = \"GOPATH\"; }"
$ defaults write com.macromates.TextMate environmentVariables \
    -array-add "{enabled = 1; value = \"$(go env GOMODCACHE)\"; name = \"GOMODCACHE\"; }"

Other bundle dependencies (not required but nice to have)


News

2023-06-27

  • Yeah, I’m still developing this bundle
  • Add - + create dynamic comment till your wrap column size!

2023-04-18

  • Add shellcheck disable comment via dis + TAB

2023-01-01

  • Add error tool tip max line length via TM_ERROR_TOOLTIP_MAX_LINE

2022-07-14

  • golangci-lint runner checks for TM_GOLANGCI_LINT_LOG_LEVEL environment variable. Due to go 1.18, golangci-lint produces some warnings. You can bypass those warnings via setting TM_GOLANGCI_LINT_LOG_LEVEL. Default is set to error (no more warnings).

2022-07-13

  • add fprf + , golang fmt.Fprintf snippet.

2022-06-03

  • golint removed, now using golangci-lint’s revive. (golint has been archived by the owner)

Available Items

  1. TextMate
  2. Django
  3. Python
  4. Ruby
  5. Rake
  6. Bash
  7. Markdown
  8. jQuery
  9. HTML
  10. Javascript
  11. Go
  12. Swift
  13. Lisp
  14. Elixir
  15. Git
  16. General
  17. Templates

TextMate Helpers

Scopes:

  • text.xml.plist

  • source.tm-properties

  • folder + : Add folder for info.plist

  • - + : Add delimeter for info.plist

  • prop + : Add properties for .tm_properties

    • excludes: excludeInFolderSearch / excludeInFileChooser
    • includes: include
    • spelling: spellingLanguage
  • "Show Environment Variables" for better, sorted and grouped env-var list


Django

Update

  • Improve Django snippets/helpers
  • Add Django REST generics and viewsets

Django Snippets

TAB completion Description
admin + Screenshot of: admin
admin + Screenshot of: admin
model + Screenshot of: model
meta + (Model meta options) Screenshot of: opt
fld + (For fields...) Screenshot of: fld
opt + (For field options...) Screenshot of: opt
hlp + (Helpers) Screenshot of: hlp
str + Injects def __str__(self):
save + Injects model save def save(self, *args, **kwargs):
does + Model.DoesNotExist
wr + (Management commands) self.stdout.write
ws + (Management commands) self.style
= + (Template) {{ variable }}
== + (Template) {% tag %}
ase + (Test) self.assertQuerysetEqual

Django Scope

You have a scope called: Python Django (Extended). Press + + + P for selecting this scope.


Python

You can prettify any kind of Python list or dict via + + P in any scope!

Python Snippets

TAB completion Description
ase + Screenshot of: ase
utf + # -*- coding: utf-8 -*-
p + Print with format: print(CURSOR.format())
pp + pp = pprint.PrettyPrinter(indent=4)
pr + Pretty Print with format: pp.pprint(CURSOR.format())
tern + Ternary expression helper
pdbg + Injects Python Debuffer
ipdbg + Injects IPython Debuffer
logger + Injects logger snippet
loggerbc + Injects logger snippet with basic config
+ ' Docstring
init + (Class) Injects def __init__ ...
@sm + (Class) Injects @staticmethod
@cm + (Class) Injects @classmethod
@pr + (Class) Injects @property
__ + (Class) Injects __str__ or __repr__
imp + (import) Injects import with some predefined package names
inject + (apped) Injects TM_PYTHON_FMT_VIRTUAL_ENV related appends to sys.path
= + (python) Injects python placeholder {}
. + (doctest) Injects >>>
+ + i Create __init__.py

hlp +

from __future__ import unicode_literals
                       print_function
                       division
                       absolute_imports

Ruby

You need to add Ruby on Rails bundle from Preferences/Bundles.

Ruby Snippets for ERB

Scope: text.html.erb

TAB completion Description
= + <%= CURSOR %>
if + ERB compatible if
each + ERB compatible each and each_with_index

Rake

Rake Snippets

tas +

  • Task with args

  • Task with args and dependecies

  • Task w/o description

  • tasr + : Creates remote-task skel

  • tasd + : Creates default task code

  • inv + : Creates Rake::Task...invoke + params

  • des + : desc "...." only

  • args + : args.with_defaults(...)


Bash

Added shellcheck linter/checker support. Use TM_SHELLCHECK_DISABLE to disable it! You need to install shellcheck via;

brew install shellcheck

If you already have shellcheck, set binary path to TM_SHELLCHECK:

# custom shellcheck path
defaults write com.macromates.textmate environmentVariables -array-add \
    '{ name = "TM_SHELLCHECK"; enabled = 1; value = "/path/to/shellcheck"; }'

# disable shellcheck
defaults write com.macromates.textmate environmentVariables -array-add \
    '{ name = "TM_SHELLCHECK_DISABLE"; enabled = 1; value = "1"; }'

You can disable shellcheck feature on your scripts via dis + TAB, this adds:

# shellcheck disable=all

comment.

You need to restart TextMate after these settings...

Bash Snippets

  • if + : if / else / elif template.
  • for + : Array iteration template
  • for + : Range iteration template
  • envi + : Inject some environment variables.

Markdown

Markdown Snippets

  • badge + : Adds img.shields.io badge!
  • + (: Fixes Parenthesis behavior.

jQuery

jQuery Snippets

  • each + : jQuery each code template
  • ready + : jQuery $(document).ready() code template
  • plug + : jQuery plugin skel.

HTML

HTML Snippets

  • more + : &rsquo;
  • + + S: Wrap selection with smart quotes.
  • + C: Wrap/unwrap code Inline
  • p + : <p>carret<p>
  • li + : <li>carret<li>

Javascript

Javascript Snippets

  • con + : Generates console.log, console.dir, console.warn, console.error, console.group, console.groupEnd skel
  • if + : if related code.
  • fun + : function related code.
  • for + : for related code.
  • swi + : switch related code.
  • load + : Injects window.addEventListener(...)

Javascript Commands

You need to install node locally and must define TM_NODE variable and set the executable path for node:

# example
defaults write com.macromates.textmate environmentVariables -array-add \
    '{enabled = 1; value = "/path/to/node"; name = "TM_NODE"; }'
  • + R: Runs javascript.

Go

When you hit + S, TextMate runs unless disabler environment variable(s) is/are set:

  • gofumpt
  • gofmt
  • goimports
  • golines
  • go vet + shadow
  • golangci-lint
  • staticcheck

You can disable format/lint feature (all of them) via setting TM_DISABLE_GO_LINTER environment variable.

You can disable linters piece by piece;

  • TM_DISABLE_GOFUMPT

  • TM_DISABLE_GOFMT

  • TM_DISABLE_GOIMPORTS

  • TM_DISABLE_GOLINES

  • TM_DISABLE_GOVET

  • TM_DISABLE_GOVET_SHADOW

  • TM_DISABLE_GOLANGCI_LINT

  • TM_DISABLE_STATIC_CHECK

Also you can configure golines via;

  • TM_GOLINES_MAX_LEN: Default value is 100
  • TM_GOLINES_TAB_LEN: Default value is 4

environment variables.

Use TM_GOLANGCI_LINT_LOG_LEVEL to by-pass linter warnings (go 1.18 issue):

  • TM_GOLANGCI_LINT_LOG_LEVEL to error shows only errors
  • TM_GOLANGCI_LINT_LOG_LEVEL to warning shows warnings too
  • TM_GOLANGCI_LINT_LOG_LEVEL to info show info level logs

Error tool tip had some issues, due to TextMate’s limit, lines > 150 chars was broken. Now it’s fixed. Use TM_ERROR_TOOLTIP_MAX_LINE environment variable to set your desired amount. Maximum is 150.

Go Commands

  • + R : Runs gofmt + goimports without save!

Go Snippets

  • fmt + : fmt.METHOD
  • spr + : fmt.Sprintf
  • prl + : fmt.Println
  • prf + : fmt.Printf
  • errf + : fmt.Errorf
  • tof + : reflect.TypeOf
  • log + : log.METHOD
  • if + : if conditions or obj, ok condition
  • for + : for conditions
  • str + : Define struct
  • fld + : Define struct field
  • ctp + : Inserts compile time proof fill place holders of var _ interface = (*struct)(nil)
  • seed + : Inserts random seeder
  • gcil + : Creates .golangci.yml under current working directory.
  • fprf + : fmt.Fprintf

.golangci.yml default config:

run:
  concurrency: 4
  timeout: 1m

linters-settings:
  revive:
    ignore-generated-header: true
    severity: warning
    rules:
      - name: exported
        severity: warning
        arguments:
            - "checkPrivateReceivers"
            - "sayRepetitiveInsteadOfStutters"
      - name: error-return
        severity: warning
      - name: error-naming
        severity: warning
      - name: if-return
        severity: warning
      - name: var-naming
        severity: warning
      - name: var-declaration
        severity: warning
      - name: receiver-naming
        severity: warning
      - name: errorf
        severity: warning
      - name: empty-block
        severity: warning
      - name: unused-parameter
        severity: warning
      - name: unreachable-code
        severity: warning
      - name: redefines-builtin-id
        severity: warning
      - name: superfluous-else
        severity: warning
      - name: unexported-return
        severity: warning
      - name: indent-error-flow
        severity: warning
      - name: blank-imports
        severity: warning
      - name: range
        severity: warning
      - name: time-naming
        severity: warning
      - name: context-as-argument
        severity: warning
      - name: context-keys-type
        severity: warning
      - name: indent-error-flow
        severity: warning
      - name: waitgroup-by-value
        severity: warning
      - name: useless-break
        severity: warning
      - name: struct-tag
        severity: warning

linters:
  disable-all: true
  enable:
    - asciicheck 
    - durationcheck 
    - errcheck 
    - errorlint 
    - exhaustive 
    - gosec 
    - govet 
    - makezero 
    - nilerr 
    - rowserrcheck 
    - exportloopref 
    - sqlclosecheck 
    - staticcheck 
    - typecheck 
    - bodyclose 
    - noctx 
    - prealloc
    - gosimple
  presets:
    - comment 
    - error 
    - format 
    - metalinter 
    - unused

issues:
  exclude-use-default: false

You can configure golangci via setting TM_GOLANGCI_LINT_MANUAL environment variable manually w/o config file. Example variable and value:

TM_GOLANGCI_LINT_MANUAL    -p comment -p error -p format -p metalinter -p unused -E gosimple -E asciicheck -E durationcheck -E errcheck -E errorlint -E exhaustive -E gosec -E govet -E makezero -E nilerr -E rowserrcheck -E exportloopref -E sqlclosecheck -E staticcheck -E typecheck -E bodyclose -E noctx -E prealloc

This works only if any of these file(s) is/are unset/not-exists in the project root:

  • .golangci.yml
  • .golangci.yaml
  • .golangci.toml
  • .golangci.json

Swift

You need to install/activate Swift Bundle from: TextMate > Preferences > Bundles.

Swift Snippets

  • p + : Print statement
  • typ + : Type of object
  • = + : Variable safe print
  • des + : Describe object

Lisp

You need to install/activate Lisp Bundle from: TextMate > Preferences > Bundles. Please set TM_CLISP variable for executer. You can install from brew: brew install clisp

# example
defaults write com.macromates.textmate environmentVariables -array-add \
    '{enabled = 1; value = "/usr/local/bin/clisp"; name = "TM_CLISP"; }'

Lisp Snippets

  • p + : Print

Lisp Commands

  • + R: Run.

Elixir

You need to install/activate Elixir Bundle:

cd ~/Library/Application\ Support/TextMate/Bundles/
git clone https://github.com/elixir-lang/elixir-tmbundle.git Elixir.tmbundle

Elixir Snippets

  • p + : Print or Inspect
  • #: Select text in quotes then press # (Ruby’s string interpolation-ish)

Git

Press + + B for;

  1. Git blame current line
  2. Git blame current line for last N commit

General

TAB completion Description
dateT + Screenshot of: dateT
lorem + Screenshot of: lorem
+ ' Single smart apostrophe. (Works in html, text, markdown, yaml)
applek + Generate apple symbols like: ⌘ ⎋ more...
applek + Generate apple symbols inside of <kbd> tags.
- + Dynamic comment. Fills remaning line with -
-- + Line delimeter, 80 charts comment # ---- ...
--- + Dynamic tilda. Fills remaning line with ~
+ + B Shows git blame for current line

Templates

Language Scope TAB Completion
BASH source.shell temp +
Python source.python temp +
Python source.python temp + with Doctests
Python source.python temp + with Logging
Golang source.go temp +
HTML -no scope required- html5 +
HTML with Bulma -no scope required- html5 + with Bulma.io CSS
Vue Component text.html.vue temp +

Contributor(s)

License

This project is licensed under MIT.

More Repositories

1

git-puf-noktalari

Günlük hayatta kullandığımız revizyon kontrol sistemi GIT ile ilgili küçük ipuçlarını anlatan yeni mini kitabım.
Ruby
425
star
2

kommit

Build your commit message without touching or editing your code!
Shell
204
star
3

ruby101-kitap

Türkçe Ruby kitabı
Ruby
197
star
4

dinozorus

1990'lı yıllara damgasını vuran efsane televizyon oyunu Dinozorus. Amiga 1200 - AGA
Assembly
134
star
5

turk-scene-tarihi

80'lerin ortasında başlayan, günümüz bilgisayar kültürünün neredeyse başlangıç noktası olan Türk SCENE/DEMOSCENE tarihçesi
85
star
6

lyk-2017

Linux Yaz Kampı 2017'de anlattığım konular.
41
star
7

django2-project-template

Django project/application starter for lazybones :)
Python
39
star
8

statoo

`statoo` is a super simple http GET tool for checking site health
Go
33
star
9

textmate-twitterbootstrap.tmbundle

TextMate bundle for Twitter's Bootstrap
HTML
33
star
10

awesome-c64

Commodore 64 related links such as C64 tools for Mac/Linux/PC, demoscene related stuff, coding tools, C64 utilities etc...
31
star
11

textmate-octopress.tmbundle

TextMate bundle for Octopress blog engine. http://octopress.org/
29
star
12

django-admin-list-filter

Dead simple autocompletion for Django admin `list_filter`.
Python
22
star
13

gh_issues

Manage GitHub issues from command-line (read only!)
Ruby
22
star
14

dotfiles-light

Just another but `lighter` version of BASH environment
Shell
20
star
15

dotfiles-universal

My old BASH dot-files... Try new one!
Shell
13
star
16

textmate2-python-fmt

Python FMT is a python linter/formatter/checker for TextMate.
Ruby
13
star
17

textmate2-gfm-preview

GitHub Flavored Markdown Preview for TextMate 2
CSS
13
star
18

django-project-template

Project starter for Django 1.11.4 ... Batteries included :)
Python
9
star
19

textmate-hosts.tmbundle

TextMate bundle for /etc/hosts file
9
star
20

dotfiles-fever

Elegant BASH environment for macOS, Ubuntu and Gentoo
Shell
8
star
21

textmate-window-manager

Window manager/arranger for oldskool TextMate (1.5)
Shell
7
star
22

apm-bash-completion

Bash completion for Atom Package Manager (apm)
Shell
6
star
23

stormssh-completion

Bash competion for `sshstorm` (https://github.com/emre/storm)
Shell
6
star
24

devpod

Official website of devPod
HTML
6
star
25

textmate2-ruff-linter

Ruff linter for TextMate2. Linter and auto fixer for python!
Perl
5
star
26

ugur.ozyilmazel.com-v5

Kişisel websitem V4.0
HTML
5
star
27

lsvirtualenvs

Small commandline tool for `virtualenvwrapper`
Go
4
star
28

ghstars

Show GitHub stars count for user!
Go
4
star
29

git-init-githubrepo

Create git repository for GitHub style
Go
4
star
30

textmate2-tailwind-css

Tailwind CSS support for TextMate 2
Ruby
4
star
31

golang-notlarim

Golang geliştirme ile ilgili aldığım notlar
Ruby
4
star
32

git-tips

Git versiyon kontrol sistemi ile ilgili Türkçe dökümantasyon ve ipuçları
JavaScript
4
star
33

dox2008

2007-2008 yıllarında İstanbul Bilgi Üniversitesi, web departmanı için hazırladığım javascript ve html/css eğitimleri
JavaScript
4
star
34

inspect-go

Ruby-ish Object#inspect tryouts for Golang!
Go
3
star
35

putio

Command-Line client for put.io platform (unofficial)
Go
3
star
36

textmate2-64tass-bundle

64tass Bundle for TextMate 2
2
star
37

sayisal_captcha

Çok basit şekilde iki basamaklı sayılardan random toplama ya da çarpma üreten bir sistem
Ruby
2
star
38

learning-stimulus-02

I'm learning stimulus, this is example 02
JavaScript
2
star
39

vigo

I'm a hustler baby!
2
star
40

textmate2-gomodifytags

TextMate2 implementation of Fatih’s gomodifytags
Shell
2
star
41

els

Unix `ls` command alternative via Ruby :)
Ruby
2
star
42

ruby101-kitap-kod

Ruby101 kitabında geçen kod örnekleri
2
star
43

vigo.io

Personal website
HTML
2
star
44

pg16_django

3. Programlama Günleri / Karabük - Django ile tanışma
Python
2
star
45

learning-stimulus-01

I'm learning stimulus, this is example 01
JavaScript
1
star
46

homebrew-statoo

brew tap repo for `statoo`
Ruby
1
star
47

textmate2-bootstrap3

Bootstrap 3's helpers for TextMate2
1
star
48

uptimerobot_cmd

Command-line client for Uptimerobot service
Ruby
1
star
49

stringutils-demo

A basic golang package for demo purpose only...
Go
1
star
50

textmate1-twitter-bs3.tmbundle

Twitter Bootstrap 3 bundle for TextMate1 (yes the oldest TextMate)
1
star
51

try_git

1
star
52

homebrew-lsvirtualenvs

brew tap for lsvirtualenvs
Ruby
1
star
53

dji18njs

Modified and hardcore changed version of Django's i18n-javascript function. Can be usable as JavasScript Template engine. If you familiar with python's "format text" you will love this!
JavaScript
1
star
54

homebrew-git-init-githubrepo

brew tap for `git-init-githubrepo`
Ruby
1
star
55

amiga-ascii.tmbundle

Oldskool Amiga ascii/azki/nfo/diz support for TextMate with real Amiga fonts
1
star
56

vigo.github.com

My developer home page...
HTML
1
star
57

ugur.ozyilmazel.com

Kişisel web sitem
HTML
1
star
58

my-custom-textmate1-bundle

Many snippets and my custom scratch-pad for TextMate1.
CSS
1
star
59

textmate-nanorc.tmbundle

.nanorc bundle for TextMate
Ruby
1
star
60

homebrew-ghstars

Brew tap for ghstars cli
Ruby
1
star