feat(SublimeText2.EditorPackages): cache packages

This commit is contained in:
Iristyle
2013-04-04 08:55:15 -04:00
parent d65666cdfc
commit c3efdad2c2
274 changed files with 26863 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
*.pyc
*.cache
*.sublime-project
.DS_store
.c9revisions

View File

@@ -0,0 +1,48 @@
# BlockCursorEverywhere #
![Screenshot](http://f.cl.ly/items/42131K2X1h0j0P2m1O2B/Screen%20Shot%202011-12-02%20at%202.36.54%20AM.png)
It can become very difficult to keep track of your cursor location. This is solved by having a "block" cursor, which is very easy to spot no matter where it is on screen. Unfortunately, Sublime Text 2 does not (yet) support this feature natively. This Plugin mimics this functionality by highlighting the area behind the cursor whenever it moves (similar to how you might highlight syntax errors, or color a comment).
## Installation ##
### With Package Control ###
If you have the [Package Control][package_control] installed, you can install BlockCursorEverywhere from inside Sublime Text itself. Open the Command Palette and select "Package Control: Install Package", then search for BlockCursorEverywhere and youre done!
### Without Package Control ###
Go to your Sublime Text 2 Packages directory:
Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 2\Packages\
Mac: ~/Library/Application Support/Sublime Text 2/Packages/
and clone the repository there
git clone git://github.com/ingshtrom/BlockCursorEverywhere
## Configuration ##
These are the settings that I prefer. You can change the style of the block cursor by adding a section to your theme file like so:
```xml
<dict>
<key>name</key>
<string>Block Cursor</string>
<key>scope</key>
<string>block_cursor</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#000000</string>
<key>background</key>
<string>#FF1111</string>
</dict>
</dict>
```
---------
[sublime]: http://www.sublimetext.com/2
[package_control]: http://wbond.net/sublime_packages/package_control

View File

@@ -0,0 +1,38 @@
import sublime
import sublime_plugin
class BlockCursorEverywhere(sublime_plugin.EventListener):
def view_is_widget(self, view):
settings = view.settings()
return bool(settings.get('is_widget'))
def show_block_cursor(self, view):
validRegions = []
for s in view.sel():
if s.a != s.b:
continue
validRegions.append(sublime.Region(s.a, s.a + 1))
if validRegions.__len__:
view.add_regions('BlockCursorListener', validRegions, 'block_cursor')
else:
view.erase_regions('BlockCursorListener')
def on_selection_modified(self, view):
if view.settings().get('is_widget') or not("Vintage" in view.settings().get('ignored_packages') or view.settings().get('command_mode')):
view.erase_regions('BlockCursorListener')
return
self.show_block_cursor(view)
def on_deactivated(self, view):
view.erase_regions('BlockCursorListener')
view.settings().clear_on_change('command_mode')
self.current_view = None
def on_activated(self, view):
self.on_selection_modified(view)
view.settings().add_on_change('command_mode', self.on_command_mode_change)
self.current_view = view
def on_command_mode_change(self):
self.on_selection_modified(self.current_view)

View File

@@ -0,0 +1 @@
{"url": "https://github.com/ingshtrom/BlockCursorEverywhere", "version": "2013.01.20.10.51.30", "description": "Sublime Text 2 plugin to mimic a block cursor in Vintage command mode."}