Permalink
Browse files

Added tmux.conf. Prepare for reinstall.

  • Loading branch information...
ludo committed Apr 20, 2012
1 parent 7925244 commit b005bf844b5820f444392a59ece0c99fbe81dcb5
View
@@ -7,3 +7,6 @@ alias gtl='git log --graph --all --oneline --decorate=short'
# PGN proxy switch
alias noproxy='unset http_proxy && unset https_proxy && unset all_proxy'
alias proxy='export http_proxy=http://nl141-cips2.piap.philips.net:8080 && export https_proxy=$http_proxy && export all_proxy=$http_proxy'
+
+# tmux
+alias tmux="TERM=screen-256color-bce tmux"
View
@@ -4,22 +4,28 @@ export EDITOR=vim
export LANG=C
export LC_ALL=C
-# DirectLife development
-export CATALINA_HOME=/usr/local/tomcat
-export CATALINA_BASE=/Volumes/Philips/ActivityDataService/config/appserver
-export ACTIVITY_DATA_ROOT_PATH=/Volumes/Philips/ActivityDataService/appserver/var/nws
-
# Node.js
export NODE_PATH=$HOME/local/lib/node_modules
-# Maven2
-export MAVEN_HOME=/usr/share/java/maven-3.0.3
-export M2_HOME=$MAVEN_HOME
-export M2=$M2_HOME/bin
-export JAVA_HOME=/Library/Java/Home
-export PATH=$M2:$PATH
-
-# export TIMESHIFT_URL=http://localhost:3000/timeshift
-
# RT
export PERLLIB=/opt/local/lib/perl5/vendor_perl/5.12.3/darwin-multi-2level
+
+# Colors! I want colors! 256 of them.
+case "$TERM" in
+*-256color)
+ alias ssh='TERM=${TERM%-256color} ssh'
+ ;;
+*)
+ POTENTIAL_TERM=${TERM}-256color
+ POTENTIAL_TERMINFO=${TERM:0:1}/$POTENTIAL_TERM
+
+ # better to check $(toe -a | awk '{print $1}') maybe?
+ BOX_TERMINFO_DIR=/usr/share/terminfo
+ [[ -f $BOX_TERMINFO_DIR/$POTENTIAL_TERMINFO ]] && \
+ export TERM=$POTENTIAL_TERM
+
+ HOME_TERMINFO_DIR=$HOME/.terminfo
+ [[ -f $HOME_TERMINFO_DIR/$POTENTIAL_TERMINFO ]] && \
+ export TERM=$POTENTIAL_TERM
+ ;;
+esac
View
@@ -11,3 +11,5 @@ then
fi
source ~/.bash/prompt
+
+PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
View
@@ -8,3 +8,5 @@
status = auto
[http]
postBuffer = 100M
+[core]
+ excludesfile = /Users/ludo/.gitignore_global
View
@@ -0,0 +1,44 @@
+# Gimme colors!
+set -g default-terminal "screen-256color"
+
+# Gimme mouse!
+# set -g mode-mouse on
+
+# Use vi keybindings
+set-window-option -g mode-keys vi
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+#### Solarized colors!
+
+# default statusbar colors
+set-option -g status-bg colour235 #base02
+set-option -g status-fg colour136 #yellow
+set-option -g status-attr default
+
+# default window title colors
+set-window-option -g window-status-fg colour244
+set-window-option -g window-status-bg default
+#set-window-option -g window-status-attr dim
+
+# active window title colors
+set-window-option -g window-status-current-fg colour166 #orange
+set-window-option -g window-status-current-bg default
+#set-window-option -g window-status-current-attr bright
+
+# pane border
+set-option -g pane-border-fg colour235 #base02
+set-option -g pane-active-border-fg colour240 #base01
+
+# message text
+set-option -g message-bg colour235 #base02
+set-option -g message-fg colour166 #orange
+
+# pane number display
+set-option -g display-panes-active-colour colour33 #blue
+set-option -g display-panes-colour colour166 #orange
+
+# clock
+set-window-option -g clock-mode-colour colour64 #green
@@ -0,0 +1,262 @@
+" Increment the number below for a dynamic #include guard
+let s:autotag_vim_version=1
+
+if exists("g:autotag_vim_version_sourced")
+ if s:autotag_vim_version == g:autotag_vim_version_sourced
+ finish
+ endif
+endif
+
+let g:autotag_vim_version_sourced=s:autotag_vim_version
+
+" This file supplies automatic tag regeneration when saving files
+" There's a problem with ctags when run with -a (append)
+" ctags doesn't remove entries for the supplied source file that no longer exist
+" so this script (implemented in python) finds a tags file for the file vim has
+" just saved, removes all entries for that source file and *then* runs ctags -a
+
+if has("python")
+python << EEOOFF
+import os
+import string
+import os.path
+import fileinput
+import sys
+import vim
+import time
+import logging
+from collections import defaultdict
+
+# global vim config variables used (all are g:autotag<name>):
+# name purpose
+# maxTagsFileSize a cap on what size tag file to strip etc
+# ExcludeSuffixes suffixes to not ctags on
+# VerbosityLevel logging verbosity (as in Python logging module)
+# CtagsCmd name of ctags command
+# TagsFile name of tags file to look for
+# Disabled Disable autotag (enable by setting to any non-blank value)
+# StopAt stop looking for a tags file (and make one) at this directory (defaults to $HOME)
+vim_global_defaults = dict(maxTagsFileSize = 1024*1024*7,
+ ExcludeSuffixes = "tml.xml.text.txt",
+ VerbosityLevel = logging.WARNING,
+ CtagsCmd = "ctags",
+ TagsFile = "tags",
+ Disabled = 0,
+ StopAt = 0)
+
+# Just in case the ViM build you're using doesn't have subprocess
+if sys.version < '2.4':
+ def do_cmd(cmd, cwd):
+ old_cwd=os.getcwd()
+ os.chdir(cwd)
+ (ch_in, ch_out) = os.popen2(cmd)
+ for line in ch_out:
+ pass
+ os.chdir(old_cwd)
+
+ import traceback
+ def format_exc():
+ return ''.join(traceback.format_exception(*list(sys.exc_info())))
+
+else:
+ import subprocess
+ def do_cmd(cmd, cwd):
+ p = subprocess.Popen(cmd, shell=True, stdout=None, stderr=None, cwd=cwd)
+
+ from traceback import format_exc
+
+def vim_global(name, kind = string):
+ ret = vim_global_defaults.get(name, None)
+ try:
+ v = "g:autotag%s" % name
+ exists = (vim.eval("exists('%s')" % v) == "1")
+ if exists:
+ ret = vim.eval(v)
+ else:
+ if isinstance(ret, int):
+ vim.command("let %s=%s" % (v, ret))
+ else:
+ vim.command("let %s=\"%s\"" % (v, ret))
+ finally:
+ if kind == bool:
+ ret = (ret not in [0, "0"])
+ elif kind == int:
+ ret = int(ret)
+ elif kind == string:
+ pass
+ return ret
+
+class VimAppendHandler(logging.Handler):
+ def __init__(self, name):
+ logging.Handler.__init__(self)
+ self.__name = name
+ self.__formatter = logging.Formatter()
+
+ def __findBuffer(self):
+ for b in vim.buffers:
+ if b and b.name and b.name.endswith(self.__name):
+ return b
+
+ def emit(self, record):
+ b = self.__findBuffer()
+ if b:
+ b.append(self.__formatter.format(record))
+
+def makeAndAddHandler(logger, name):
+ ret = VimAppendHandler(name)
+ logger.addHandler(ret)
+ return ret
+
+
+class AutoTag:
+ MAXTAGSFILESIZE = long(vim_global("maxTagsFileSize"))
+ DEBUG_NAME = "autotag_debug"
+ LOGGER = logging.getLogger(DEBUG_NAME)
+ HANDLER = makeAndAddHandler(LOGGER, DEBUG_NAME)
+
+ @staticmethod
+ def setVerbosity():
+ try:
+ level = int(vim_global("VerbosityLevel"))
+ except:
+ level = vim_global_defaults["VerbosityLevel"]
+ AutoTag.LOGGER.setLevel(level)
+
+ def __init__(self):
+ self.tags = defaultdict(list)
+ self.excludesuffix = [ "." + s for s in vim_global("ExcludeSuffixes").split(".") ]
+ AutoTag.setVerbosity()
+ self.sep_used_by_ctags = '/'
+ self.ctags_cmd = vim_global("CtagsCmd")
+ self.tags_file = str(vim_global("TagsFile"))
+ self.count = 0
+ self.stop_at = vim_global("StopAt")
+
+ def findTagFile(self, source):
+ AutoTag.LOGGER.info('source = "%s"', source)
+ ( drive, file ) = os.path.splitdrive(source)
+ ret = None
+ while file:
+ file = os.path.dirname(file)
+ AutoTag.LOGGER.info('drive = "%s", file = "%s"', drive, file)
+ tagsDir = os.path.join(drive, file)
+ tagsFile = os.path.join(tagsDir, self.tags_file)
+ AutoTag.LOGGER.info('tagsFile "%s"', tagsFile)
+ if os.path.isfile(tagsFile):
+ st = os.stat(tagsFile)
+ if st:
+ size = getattr(st, 'st_size', None)
+ if size is None:
+ AutoTag.LOGGER.warn("Could not stat tags file %s", tagsFile)
+ break
+ if size > AutoTag.MAXTAGSFILESIZE:
+ AutoTag.LOGGER.info("Ignoring too big tags file %s", tagsFile)
+ break
+ ret = (file, tagsFile)
+ break
+ elif tagsDir and tagsDir == self.stop_at:
+ AutoTag.LOGGER.info("Reached %s. Making one %s" % (self.stop_at, tagsFile))
+ open(tagsFile, 'wb').close()
+ ret = (file, tagsFile)
+ break
+ elif not file or file == os.sep or file == "//" or file == "\\\\":
+ AutoTag.LOGGER.info('bail (file = "%s")' % (file, ))
+ break
+ return ret
+
+ def addSource(self, source):
+ if not source:
+ AutoTag.LOGGER.warn('No source')
+ return
+ if os.path.basename(source) == self.tags_file:
+ AutoTag.LOGGER.info("Ignoring tags file %s", self.tags_file)
+ return
+ (base, suff) = os.path.splitext(source)
+ if suff in self.excludesuffix:
+ AutoTag.LOGGER.info("Ignoring excluded suffix %s for file %s", source, suff)
+ return
+ found = self.findTagFile(source)
+ if found:
+ tagsDir, tagsFile = found
+ relativeSource = source[len(tagsDir):]
+ if relativeSource[0] == os.sep:
+ relativeSource = relativeSource[1:]
+ if os.sep != self.sep_used_by_ctags:
+ relativeSource = string.replace(relativeSource, os.sep, self.sep_used_by_ctags)
+ self.tags[(tagsDir, tagsFile)].append(relativeSource)
+
+ def goodTag(self, line, excluded):
+ if line[0] == '!':
+ return True
+ else:
+ f = string.split(line, '\t')
+ AutoTag.LOGGER.log(1, "read tags line:%s", str(f))
+ if len(f) > 3 and f[1] not in excluded:
+ return True
+ return False
+
+ def stripTags(self, tagsFile, sources):
+ AutoTag.LOGGER.info("Stripping tags for %s from tags file %s", ",".join(sources), tagsFile)
+ backup = ".SAFE"
+ input = fileinput.FileInput(files=tagsFile, inplace=True, backup=backup)
+ try:
+ for l in input:
+ l = l.strip()
+ if self.goodTag(l, sources):
+ print l
+ finally:
+ input.close()
+ try:
+ os.unlink(tagsFile + backup)
+ except StandardError:
+ pass
+
+ def updateTagsFile(self, tagsDir, tagsFile, sources):
+ self.stripTags(tagsFile, sources)
+ if self.tags_file:
+ cmd = "%s -f %s -a " % (self.ctags_cmd, self.tags_file)
+ else:
+ cmd = "%s -a " % (self.ctags_cmd,)
+ for source in sources:
+ if os.path.isfile(os.path.join(tagsDir, source)):
+ cmd += " '%s'" % source
+ AutoTag.LOGGER.log(1, "%s: %s", tagsDir, cmd)
+ do_cmd(cmd, tagsDir)
+
+ def rebuildTagFiles(self):
+ for ((tagsDir, tagsFile), sources) in self.tags.items():
+ self.updateTagsFile(tagsDir, tagsFile, sources)
+EEOOFF
+
+function! AutoTag()
+python << EEOOFF
+try:
+ if not vim_global("Disabled", bool):
+ at = AutoTag()
+ at.addSource(vim.eval("expand(\"%:p\")"))
+ at.rebuildTagFiles()
+except:
+ logging.warning(format_exc())
+EEOOFF
+ if exists(":TlistUpdate")
+ TlistUpdate
+ endif
+endfunction
+
+function! AutoTagDebug()
+ new
+ file autotag_debug
+ setlocal buftype=nowrite
+ setlocal bufhidden=delete
+ setlocal noswapfile
+ normal 
+endfunction
+
+augroup autotag
+ au!
+ autocmd BufWritePost,FileWritePost * call AutoTag ()
+augroup END
+
+endif " has("python")
+
+" vim:shiftwidth=3:ts=3
Submodule tslime added at 46340c
Submodule turbux-vim added at bb49e5
View
@@ -6,7 +6,7 @@ call pathogen#helptags()
syntax enable
-set background=light
+set background=dark
set number
set ruler
@@ -73,6 +73,14 @@ map <Leader>n :NERDTreeToggle<CR>
" Command-T configuration
let g:CommandTMaxHeight=20
+" CTags
+set tags+=gems.tags
+
+" Ruby
+if !empty($MY_RUBY_HOME)
+ let g:ruby_path = join(split(glob($MY_RUBY_HOME.'/lib/ruby/*.*')."\n".glob($MY_RUBY_HOME.'/lib/ruby/site_ruby/*'),"\n"),',')
+endif
+
" Functions *******************************************************************
" Remove trailing whitespaces in files

0 comments on commit b005bf8

Please sign in to comment.