Tag Archives: sublime

Select a Ruby Block (scope) in Sublime Text

Coming from PHP to Ruby you may wonder if there is a way to select Ruby ( or Ruby on Rails ) block scope that starts with things like begin or def and finishes with end In PHP it was possible using the commands like Expand Selection to Scope or Expand Selection to Block and in PHP it works nicely: But in the Ruby syntax neither of these items work. So how can you select a ruby block scope in Sublime Text 2 / 3 ? Easier than you might imagine: just use “Expand Selection to Paragraph” instead

Posted in Tech Tips | Tagged , | Leave a comment

Sublime Text: Remember Position In File

When you close and re-open files in SublimeText there is a way you can get your cursor to go back to the same position. I really like this behavior in VI/VIM called autocmd / BufReadPost – which is done by editing / changing a configuration file, usually ~/.vimrc or /etc/vim/vimrc and enabling this part: ” Uncomment the following to have Vim jump to the last position when ” reopening a file “if has(“autocmd”) ” au BufReadPost * if line(“‘\””) > 1 && line(“‘\””) < = line(“$”) | exe “normal! g’\”” | endif “endif Sublime Text In Sublime Text this is done by a plugin called BufferScroll BufferScroll: Remember, restore and sync scroll, bookmarks, marks, folds and cursors. keys: multiple columns one buffer, follow mode, split, screen, pages, synchronize vertical scrolling There are two methods for installation: Installation with Package Manager If you’re not yet using Package Manager you may be missing out. At first I thought “ah, who needs that I can just drop in the files I need” but once I started using it I realized that I had been wasting my time by not using it. Installation is done by pasting some text into the console and then once it is installed… You can use Cmd+Shift+P (Windows Control+Shift+P) to bring up the “Command Palette” and then install lots of great addons in just a few strokes – like installing BufferScroll is as easy as choosing “Package Control: Install Package”: And then selecting “BufferSroll” from the list of packages … Continue reading

Posted in Tech Tips | Tagged | Leave a comment

ActivePerl Flags

Recently I had to setup Active Perl with Sublime Text 2 in Windows 8. After adding a new build system and setting up the path to perl.exe with the -w flag I wanted to figure out what other flags were available. You can pass perl several flags: bin/perl -w bin/perl -p bin/perl -d bin/perl -i bin/perl -t bin/perl -pe bin/perl -pi Here are what the perl flags do: -i: Modifies your input file in-place -w: Activates some warnings -d: Runs under the Perl debugger -t: Treats certain “tainted” code as warnings -p: Places a printing loop around your command so that it acts on each line of standard input. -e: Allows you to provide the program as an argument rather than in a file.

Posted in Tech Tips | Tagged , , , | Leave a comment

Sublime Text: Disable Auto Complete on Return / Enter key

Recently I’ve been trying to switch from TextMate to SublimeText. For the most part it is an easy transition, but there are a few things that cause me hangups. One of them is how the autocomplete works. In Text Mate, you can use enter / return to get a new line after typing something like a CSS or LESS rule. In SublimeText, if your CSS, LESS, SASS rule matches an auto complete snippet, pressing enter (or return) will cause that to be autocompleted. Fortunately you can edit your Preferences.sublime-settings file and add the following rule to keep autocomplete on but disable enter / return from autocompleting: “auto_complete_commit_on_tab” : false

Posted in Mac, Software, Tech Tips | Tagged , | 1 Comment