Skip to content

artnc/sublime-file-locking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sublime Text 2 File Locking

This is a quick plugin I wrote for a team project I'm working on that's contained entirely in a shared Dropbox folder.

Files are locked when opened and unlocked when closed. Due to the lack of a listener in the API for detecting operations that read files but don't actually open an editing buffer (e.g. file previews), this plugin works best when those features are avoided. Otherwise you'll run into issues with files that are locked even though nobody's editing them.

Use at your own risk and hack as needed. Released under the MIT license.

Getting started

  1. Have all team members go to "Tools > New Plugin..." and paste in the contents of FileLocking.py.
  2. In the "Settings" block, all members must set the 'project' and 'lockext' variables to the same string. The 'me' variable may optionally be given a custom value per member (the default value is the name of the currently logged in user).
  3. Have everyone save the plugin file to the default Packages/User directory, ideally in unison.
  4. Add viewlocks.py to the project's root directory.

Viewing locks

Display all currently existing locks, their owners, and their creation times:

python viewlocks.py

Display all locks set by the team member who has their 'me' variable set to 'john':

python viewlocks.py john

Manually remove all locks set by john:

python viewlocks.py john -r

About

File locking plugin for Sublime Text

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages