Skip to content

Instantly share code, notes, and snippets.

@rgieseke
rgieseke / init.lua
Created November 11, 2010 11:20
Modification of Textadept's menu.lua
require 'textadept'
-- requires latest menu.lua from hg:
-- http://code.google.com/p/textadept/source/browse/modules/textadept/menu.lua
-- toggle menubar
local menubar_visible = true
keys['af10'] = {
function ()
if menubar_visible then
-- Base16 Theme: Brush Trees Dark
-- http://chriskempson.com/projects/base16/
-- Theme author: Abraham White <abelincoln.white@gmail.com>
-- Template Repository: https://github.com/rgieseke/ta-themes
local buffer = buffer
local property, property_int = buffer.property, buffer.property_int
-- Base16 colors
property['color.base00'] = 0x675848
@rgieseke
rgieseke / html.lua
Last active January 1, 2016 05:38
HTML lexer changes
-- Copyright 2006-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
-- HTML LPeg lexer.
local l = lexer
local token, word_match = l.token, l.word_match
local P, R, S, V = lpeg.P, lpeg.R, lpeg.S, lpeg.V
local M = {_NAME = 'html'}
case_insensitive_tags = true
<!doctype HTML>
<meta charset="utf-8">
<style>
body {
width: 400px;
}
</style>
<style type="text/css">
body {
width: 400px;
@rgieseke
rgieseke / python_syntax_check.lua
Created November 30, 2010 19:45
Textadept: Check Python syntax after saving.
events.connect('file_after_save',
function() -- show Python syntax errors as annotations
if buffer:get_lexer() == 'python' then
local lfs = require 'lfs'
local buffer = buffer
buffer:annotation_clear_all()
local filepath = buffer.filename:iconv(_CHARSET, 'UTF-8')
local filedir, filename = '', filepath
if filepath:find('[/\\]') then
filedir, filename = filepath:match('^(.+[/\\])([^/\\]+)$')
@rgieseke
rgieseke / highlight.lua
Last active October 10, 2015 16:17
Textadept: highlight active buffer
local line_number_back = buffer.style_back[33]
local current_line_back = buffer.caret_line_back
local function active()
local buffer = buffer
buffer.style_back[33] = current_line_back
buffer.set_fold_margin_colour(1, current_line_back)
buffer:set_fold_margin_hi_colour(1, current_line_back)
end
@rgieseke
rgieseke / ta
Created March 30, 2012 14:38
ta - Command line loader for Textadept
#!/bin/bash
# Put this script somewhere on your path to start or switch to Textadept from
# the command line.
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "ta - shell script to load Textadept.app"
echo "Example usage"
echo "ta : start or switch to Textadept"
echo "ta [file(s)] : open file(s) in Textadept"
@rgieseke
rgieseke / locale.de.conf
Created March 27, 2012 14:45
German translation for Textadept
% Copyright 2007-2012 Mitchell mitchell.att.foicica.com. See LICENSE.
%
% Localization file.
% The localized strings may contain UTF-8 characters, but not UTF-16 or UTF-32.
% The latter must be converted manually from the \U+xxxx format. Note that if
% you use the \ddd repesentation of characters, it must be in DECIMAL format,
% not Octal.
%
% Each line contains a "message = localized string" pair. The message should not
% be localized. Extra spaces around '=' are ignored.
@rgieseke
rgieseke / ta
Created August 27, 2011 17:38
Textadept loading shell script for OS X
#!/bin/bash
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "ta - shell script to load Textadept.app"
echo "Example usage"
echo "ta : start or switch to Textadept"
echo "ta [file(s)] : open file(s) in Textadept"
echo "ta -u [folder] : opens a new Textadept instance with the given user home"
echo "ta -n [session] : opens a new Textadept instance with the given session"
elif [ "${1:0:1}" == "-" ]; then
@rgieseke
rgieseke / testlatex.lua
Created June 18, 2011 11:12
Latex lexer with only l.* token names
-- Copyright 2006-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE.
-- Modified by Robert Gieseke.
-- LaTeX LPeg lexer.
local l = lexer
local token, style, color, word_match = l.token, l.style, l.color, l.word_match
local P, R, S = l.lpeg.P, l.lpeg.R, l.lpeg.S
local table = _G.table
module(...)