Skip to content

Instantly share code, notes, and snippets.

View felixSchl's full-sized avatar

Felix Schlitter felixSchl

View GitHub Profile
@felixSchl
felixSchl / gist:d38b455df8bf83a78d3d
Last active October 28, 2020 09:10
Recursive zip python
# Original:
# http://stackoverflow.com/a/6078528
#
# Call `zipit` with the path to either a directory or a file.
# All paths packed into the zip are relative to the directory
# or the directory of the file.
def zipit(path, archname):
archive = zipfile.ZipFile(archname, "w", zipfile.ZIP_DEFLATED)
if os.path.isdir(path):
@felixSchl
felixSchl / gist:8721943
Created January 30, 2014 23:00
Working directory per tab
" There is no way to set the cwd per tab by default.
" :cd changes the cwd for all of vim
" :lcd changes the cwd for the active window
" These two lines remedy this:
au TabEnter * if exists("t:wd") | exe "cd" . '"' t:wd . '"' | endif
au TabLeave * let t:wd=getcwd()