diff --git a/tmux.conf b/tmux.conf index ce63451..51ba709 100644 --- a/tmux.conf +++ b/tmux.conf @@ -3,6 +3,7 @@ set -g prefix C-f +# Don't destroy sessions that have no clients attached. set -g exit-unattached off set -g default-terminal "screen-256color" @@ -16,13 +17,25 @@ set -g visual-bell off set -g set-titles on set -g set-titles-string "#T" -set-option -g mode-keys vi +# Use vi keys for copy mode +set -g mode-keys vi +set -g repeat-time 0 + +# No left status; right status bar is session name +set -g status-bg green +set -g status-left "" +set -g status-left-attr none +set -g status-right "| #S " +set -g status-right-attr none # Start window and pane indexing from 1 instead of 0 set-option -g base-index 1 set-option -g pane-base-index 1 -set-option -g status-bg green +# Tabs like this: " :() " +setw -g window-status-format " #I:#W(#P) " +setw -g window-status-current-bg yellow +setw -g window-status-current-format " #I:#W(#P) " setw -g alternate-screen on diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim new file mode 100644 index 0000000..bd0bd1e --- /dev/null +++ b/vim/after/ftplugin/markdown.vim @@ -0,0 +1,7 @@ +setlocal tw=80 +setlocal cc=80 +setlocal fdm=marker +setlocal spell + +" Comment out the current selection +vmap co "xdi diff --git a/vim/after/ftplugin/python.vim b/vim/after/ftplugin/python.vim index bb2f799..c2da26f 100644 --- a/vim/after/ftplugin/python.vim +++ b/vim/after/ftplugin/python.vim @@ -1,8 +1,15 @@ setlocal shiftwidth=4 setlocal softtabstop=4 setlocal expandtab -setlocal textwidth=100 -setlocal colorcolumn=100 + +let s:buf_filename = expand('%:t') +if s:buf_filename != "SConscript" && s:buf_filename != "SConstruct" + setlocal textwidth=100 + setlocal colorcolumn=100 +else + setlocal textwidth=80 + setlocal colorcolumn=80 +endif "setlocal foldnestmax=3 "setlocal fdm=indent diff --git a/vimrc b/vimrc index c4e2fad..4fef1b7 100644 --- a/vimrc +++ b/vimrc @@ -207,7 +207,10 @@ nmap :setlocal invhlsearch " find all nmap fa :%s/\v -nmap sn :e ~/.vim/bundle/snipmate/snippets/=&filetype.snippets +" Open the snippet file for the current filetype +nmap esn :e ~/.vim/bundle/snipmate/snippets/=&filetype.snippets +" Open the ftplugin-after script for the current filetype +nmap eft :e ~/.vim/after/ftplugin/=&filetype.vim " Toggle position highlighting nmap cl :setlocal invcursorline @@ -244,6 +247,12 @@ if has('autocmd') autocmd VimEnter ~/Code/* \ call source_project_file() + " Reload snippets after editing the snippets file. Snippet files are + " .snippets. Get from the filename and reload the + " snippets for that type. + autocmd BufWritePost *.snippets + \ :call ReloadSnippets(expand('%:t:r')) + " Clean whitespace before saving: Python, C, HTML, and Objective-C autocmd BufWritePre *.py,*.h,*.c,*.html,*.m,*.mm,*.cc,*.hh \ call strip_trailing_whitespace() diff --git a/zprofile b/zprofile index f19a0d7..7b24140 100644 --- a/zprofile +++ b/zprofile @@ -9,7 +9,19 @@ print_heading -l 1 'Initializing login shell' [ -e $HOME/.profile ] && source $HOME/.profile -# Any ZSH stuff goes here. +list_tmux_sessions() +{ + tmux_out=`tmux list-sessions 2>/dev/null` + [[ -z "$tmux_out" ]] && return + + echo "You have the following active tmux sessions:" + for session in ${(f)tmux_out}; do + echo " $session" + done + echo +} + +list_tmux_sessions [ -e $HOME/.profile.$SYS ] && source $HOME/.profile.$SYS [ -e $HOME/.profile.local ] && source $HOME/.profile.local diff --git a/zsh/func/makers/mkcodemod b/zsh/func/makers/mkcodemod index 7c374c7..d2df6af 100644 --- a/zsh/func/makers/mkcodemod +++ b/zsh/func/makers/mkcodemod @@ -2,7 +2,7 @@ # Create a code module # Eryn Wells -local opts='cmph' +local opts='Ccmph' local funcname=$0 _usage() { @@ -24,6 +24,11 @@ local modtype='' while getopts $opts opt; do [[ $complete -eq 1 ]] && return 2 case $opt in + C) + modtype='C++' + srcext='cc' + headext='hh' + ;; c) modtype='C' srcext='c'