Skip to content

Instantly share code, notes, and snippets.

View felixjung's full-sized avatar

Felix Jung felixjung

View GitHub Profile
n u *@:call FdmSave()<CR>u:call FdmRestore()<CR>
Last set from ~/.vimviews/~=+Research Projects=+Forward Intensity=+Presentation=+frames.tex=
@felixjung
felixjung / gist:4130276
Created November 22, 2012 09:47
Print example for TM2. Selecting the second line _only_ and choosing "Run selection" from the menu will still run both lines.
print("Foo")
print("Bar")
@felixjung
felixjung / gist:4130245
Created November 22, 2012 09:37
R Bundle "Run" Code
if [ ! -z "$TM_INPUT_START_LINE" ]; then
if [ `echo -en "$TM_SELECTED_TEXT" | egrep -cv '^[ ]*#'` -gt 0 ]; then
echo -en "$TM_SELECTED_TEXT" | "$TM_BUNDLE_SUPPORT/tmR.rb" "$CRAN" 1
else
cat | "$TM_BUNDLE_SUPPORT/tmR.rb" "$CRAN" 0
fi
else
cat | "$TM_BUNDLE_SUPPORT/tmR.rb" "$CRAN" 0
fi
@felixjung
felixjung / gist:3842148
Created October 5, 2012 20:22
TM2 Gutter Keys
Further improvements to theming the gutter. There are now the following keys which can be set to change the color of gutter elements: Dennis Vennink
gutterDivider: Border between text view and gutter.
gutterForeground: Text color.
gutterBackground: Background color.
gutterIcons: Color of the images in the gutter.
gutterSelectionForeground: Text color for lines containing caret / part of a selection.
gutterSelectionBackground: Background color for lines containing caret / part of a selection.
gutterSelectionIcons: Color of images on lines containing caret / part of a selection.
gutterSelectionBorder: Border between selected and non-selected lines.
allan: I've almost fixed the LaTeX Watch
command in the latex.tmbundle. One issue
is left, after opening the document in the
viwer, the latex_watch.pl script fails to
kill the progress window opened using
CocoaDialog.
the progress bar dialog is created this
way:
https://gist.github.com/3361804
latex_watch.pl tries to kill it this way:
if (defined ($progressbar_pid)) {
kill(15, $progressbar_pid) or fail("Failed to close progress bar window: $!");
undef $progressbar_pid;
}
nice -n 20 CocoaDialog progressbar --indeterminate --title 'LaTeX Watch' --text 'LaTeX Watch: Compiling document' </dev/console &>/dev/null &
progressbar_pid=$(jobs -p %%)
disown %%
if(placeOnRight)
[layoutView addResizeInfo:(OakResizeInfo){ 11, 15, OakResizeInfo::kTopLeft, OakResizeInfo::kWidth } forView:fileBrowser.view];
else [layoutView addResizeInfo:(OakResizeInfo){ -11, 15, OakResizeInfo::kTopRight, OakResizeInfo::kWidth } forView:fileBrowser.view];
@felixjung
felixjung / gist:3352272
Created August 14, 2012 19:56
LaTeX Typeset & View Command (hide log window preference)
#
# Decide what to do with the Latex & View log window
#
if not tmPrefs['latexKeepLogWin']:
if numErrs == 0 and viewer != 'TextMate':
eCode = 200
else:
eCode = 0
else:
eCode = 0
@felixjung
felixjung / DataPlotting.R
Created July 24, 2012 10:10
Some R Code
# Import necessary packages
library(xts);
library(timeDate);
require(Hmisc);
library(ggplot2);
library(scales);
library(reshape2);
library(gridExtra);
library(grid);