Skip to content

Commit

Permalink
more plugins and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
gawel committed Dec 11, 2011
1 parent e9b92e1 commit 9ac3854
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
15 changes: 6 additions & 9 deletions ohmyvim/scripts.py
@@ -1,15 +1,13 @@
from os.path import join
from os.path import isdir
from os.path import isfile
from os.path import abspath
from os.path import basename
from os.path import expanduser
from urllib import urlopen
from subprocess import Popen
from subprocess import PIPE
from glob import glob
import webbrowser
import subprocess
import shutil
import sys
import os
Expand All @@ -25,6 +23,7 @@
source %(ohmyvim)s
'''


class Manager(object):

runtime = expanduser('~/.vim/bundle')
Expand All @@ -37,7 +36,8 @@ class Manager(object):
}

def __init__(self):
for dirname in (self.runtime, self.autoload, self.ohmyvim):
for dirname in (self.runtime, self.autoload,
self.ohmyvim, expanduser('~/.vim/swp')):
if not isdir(dirname):
os.makedirs(dirname)
for name, url in self.dependencies.items():
Expand All @@ -53,7 +53,6 @@ def __init__(self):
'autoload', 'pathogen.vim'))
fd.write('call pathogen#runtime_append_all_bundles()\n')
fd.write('source %s\n' % join(self.ohmyvim, 'theme.vim'))
ohmyvim = join(self.ohmyvim, 'ohmyvim.vim')
binary = os.path.abspath(sys.argv[0])
if not isfile(expanduser('~/.vimrc')):
with open(expanduser('~/.vimrc'), 'w') as fd:
Expand Down Expand Up @@ -137,13 +136,14 @@ def install(self, args):
fd = urlopen(url)
dependencies = [d for d in fd.readlines()]
else:
for _, d in self.install_url(url):
_, deps = self.install_url(url)
for d in deps:
if d.strip():
dependencies.add(d)
if dependencies:
print 'Processing dependencies...'
for url in dependencies:
self.install_url(url)
self.install_url(url)

def upgrade(self, args):
if not args.bundle:
Expand All @@ -156,7 +156,6 @@ def upgrade(self, args):
elif args.raw:
print plugin


def remove(self, args):
for plugin, dirname, themes in self.get_plugins():
if not args.bundle:
Expand Down Expand Up @@ -264,5 +263,3 @@ def main(*args):
else:
args = parser.parse_args()
args.action(args)


2 changes: 2 additions & 0 deletions profiles/defaults.vim
Expand Up @@ -10,7 +10,9 @@ set expandtab
set tabstop=4
set noerrorbells
set shiftwidth=4
filetype plugin on
set visualbell t_vb=
set ignorecase smartcase
set statusline=%F%m%r%h%w\ format=%{&ff}\ type=%Y\ x=%l\ y=%v\ %p%%\ %{strftime(\"%d/%m/%y\ -\%H:%M\")}

set directory=~/.vim/swp/
5 changes: 5 additions & 0 deletions profiles/git.vim
@@ -0,0 +1,5 @@
" git helpers

au FileType gitcommit map <buffer> <C-D> :DiffGitCached<CR>
au FileType gitcommit imap <buffer> <C-D> <Esc>:DiffGitCached<CR>
3 changes: 2 additions & 1 deletion profiles/python.vim
@@ -1,11 +1,12 @@
" fix tabulation. enable long lines highlighting

augroup python
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl set filetype=python
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl setlocal fileformat=unix
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl setlocal tabstop=4
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl setlocal shiftwidth=4
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl setlocal shiftwidth=4
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl call PythonBinding
au BufNewFile,BufRead *.?py,*.py,*.py_tmpl call PythonBinding()
au BufWinEnter *.?py,*.py,*.py_tmpl let w:m1=matchadd('Search', '\%<81v.\%>77v', -1)
au BufWinEnter *.?py,*.py,*.py_tmpl let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
augroup END
Expand Down
8 changes: 6 additions & 2 deletions setup.py
@@ -1,8 +1,10 @@
from setuptools import setup, find_packages
import sys, os
import sys
import os

version = '0.2'


def read(*args):
path = os.path.join(*args)
try:
Expand Down Expand Up @@ -42,8 +44,10 @@ def read(*args):
""",
)


def upgrade():
sys.path.insert(0, os.path.dirname(__file__))

class Args(object):
def __init__(self, dependencies):
self.bundle = dependencies
Expand All @@ -52,7 +56,7 @@ def __init__(self, dependencies):
manager = Manager()
manager.upgrade(Args(manager.dependencies.keys()))
except Exception:
sys.stderr.write('Auto upgrade failed. Please run:\n')
sys.stderr.write('\nAuto upgrade failed. Please run:\n')
sys.stderr.write(' $ oh-my-vim upgrade\n')

if 'install' in sys.argv or 'bdist_egg' in sys.argv:
Expand Down

0 comments on commit 9ac3854

Please sign in to comment.