pwd command

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-11-29 19:40:00 +00:00
parent f8a2248a28
commit abafebd389
1 changed files with 8 additions and 0 deletions

View File

@ -127,3 +127,11 @@ class ToggleTabs(Method):
w.set_error("Buffer will translate %d spaces to a tab" % b.indentlvl)
else:
w.set_error("Buffer will not write tabs")
class Pwd(Method):
'''Print the buffer's current working directory'''
def _execute(self, w, **vargs):
cwd = os.path.dirname(w.buffer.path) + '/'
if cwd.startswith(os.getenv('HOME')):
cwd = cwd.replace(os.getenv('HOME'), '~')
w.set_error("Directory %s" % cwd)