From 53eb1a38a4fab237f5acb812907c37f225479297 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 7 Dec 2012 09:34:36 -0800 Subject: [PATCH 01/10] Fix C comments --- vim/after/ftplugin/c.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim index c8c679d..b2b3404 100644 --- a/vim/after/ftplugin/c.vim +++ b/vim/after/ftplugin/c.vim @@ -11,6 +11,6 @@ endif " Do comments that look like this: " /* stuff and things " more stuff with things */ -setlocal comments="sO:* -,mO: ,exO:*/,sl:/*,mb: ,ex:*/" +"setlocal comments="sO:* -,mO: ,exO:*/,sl:/*,mb: ,ex:*/" setlocal cinoptions+=(0,Ws From e9de60c438cb28d9f05f476191f4c5acc34bb3ab Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:51:06 -0800 Subject: [PATCH 02/10] Comments and stuff in tmux config --- tmux.conf | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/tmux.conf b/tmux.conf index 6b440ce..19922e9 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,19 +1,38 @@ -set-option -g prefix C-f -set-option -g exit-unattached off -set-option -g default-terminal "screen-256color" -set-option -g set-titles off -set-option -g visual-bell off -set-option -g history-limit 10000 +# tmux config +# Eryn Wells -set-option -g mode-keys vi +set -g default-terminal "screen-256color" +set -g prefix C-f +# Don't destroy sessions that have no clients attached. +set -g exit-unattached off +# Set terminal titles +set -g set-titles on +set -g set-titles-string "#T" +# Ring bells for actions on any window in the session +set -g bell-action any +# Use audible bells +set -g visual-bell off +# Keep 10k lines of history for each window +set -g history-limit 10000 +# Use vi keys for copy mode +set -g mode-keys vi +# Start window numbering at 1, not 0 +set -g base-index 1 +# Start pane numbering at 1, not 0 +set -g pane-base-index 1 +set -g repeat-time 0 -set-option -g base-index 1 -set-option -g pane-base-index 1 +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 -set-option -g status-bg green +setw -g window-status-format " #I:#W(#P) " +setw -g window-status-current-bg yellow +setw -g window-status-current-format " #I:#W(#P) " -set-window-option -g alternate-screen on - -set-window-option -g clock-mode-style 24 +setw -g alternate-screen on +setw -g clock-mode-style 24 bind-key C-a last-window From 7bb63895711001864e262cf142f9c35fa65b2b63 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:51:43 -0800 Subject: [PATCH 03/10] List tmux sessions when starting zsh login shells --- zprofile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 From e1ae600953cf826c7cb5f6e9b0f5ae7d8dd394d1 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:53:03 -0800 Subject: [PATCH 04/10] C and Python ftplugin tweaks --- vim/after/ftplugin/c.vim | 2 +- vim/after/ftplugin/python.vim | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim index b2b3404..c8c679d 100644 --- a/vim/after/ftplugin/c.vim +++ b/vim/after/ftplugin/c.vim @@ -11,6 +11,6 @@ endif " Do comments that look like this: " /* stuff and things " more stuff with things */ -"setlocal comments="sO:* -,mO: ,exO:*/,sl:/*,mb: ,ex:*/" +setlocal comments="sO:* -,mO: ,exO:*/,sl:/*,mb: ,ex:*/" setlocal cinoptions+=(0,Ws 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 From 1b261558281453d3807d3bd5200235649e157571 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:53:19 -0800 Subject: [PATCH 05/10] Add C++ to mkcodemod --- zsh/func/makers/mkcodemod | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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' From b69ed2a83f030c0971572d746267d52da438f750 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:53:52 -0800 Subject: [PATCH 06/10] Add some Markdown settings to vim/after/ftplugin --- vim/after/ftplugin/markdown.vim | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 vim/after/ftplugin/markdown.vim 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 From cd8896326e95fc8b6bb3ff0b61192d8aaf35f8ad Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:55:13 -0800 Subject: [PATCH 07/10] Tweak some Vim macros for sourcing and editing configuration files --- vimrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 0d6ef28..07a6fc1 100644 --- a/vimrc +++ b/vimrc @@ -173,7 +173,10 @@ nmap :nohlsearch " 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 :set invcursorline From 8fbbca85f448894d1f5d5fe2c577641485e58d63 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:55:57 -0800 Subject: [PATCH 08/10] Set filetypes with autocmds (I think these will be fixed by some syntax scripts) --- vimrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 07a6fc1..0040567 100644 --- a/vimrc +++ b/vimrc @@ -194,7 +194,10 @@ if has('autocmd') filetype plugin indent on " Markdown files can also have the .md extension - autocmd BufAdd,BufEnter,BufFilePost *.md :setlocal ft=markdown + autocmd BufAdd,BufEnter,BufFilePost *.md :setf markdown + " SConstruct and SConscript files are Python + autocmd BufAdd,BufEnter,BufFilePost SConstruct :setf python + autocmd BufAdd,BufEnter,BufFilePost SConscript :setf python " Jump to last known cursor position unless it's the first line, or past the " end of the file From 29c48d66a96b902753fe308516a85dd0f9064013 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 09:56:12 -0800 Subject: [PATCH 09/10] Reload snippets after writing a snippet configuration file --- vimrc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index 0040567..76c612f 100644 --- a/vimrc +++ b/vimrc @@ -206,9 +206,15 @@ if has('autocmd') \ exe "normal! g`\"" | \ endif - " Clean whitespace before saving: Python, C, HTML, and Objective-C - autocmd BufWritePre *.py,*.h,*.c,*.html,*.m + " Clean whitespace before saving code files. + autocmd BufWritePre *.py,*.h,*.c,*.html,*.m,*.cc,*.hh,*.mm \ :call StripTrailingWhitespace() + + " 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')) endif if has('unix') From f64bce25cf7401ceafb401a6aec46357902a87ae Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 10:22:08 -0800 Subject: [PATCH 10/10] Dark windows everywhere (again?) --- gvimrc | 1 - vimrc | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/gvimrc b/gvimrc index 20250c1..577574b 100644 --- a/gvimrc +++ b/gvimrc @@ -1,6 +1,5 @@ " List mode on here because the GUI has more color possibilities. set list -set bg=light if has('win32') || has('win64') || has('win32unix') set guifont=Inconsolata:h18 diff --git a/vimrc b/vimrc index 3e4048d..2259a8b 100644 --- a/vimrc +++ b/vimrc @@ -113,11 +113,7 @@ if &t_Co > 2 || has('gui_running') syntax on " turn on syntax highlighting endif -if has('gui_running') - set bg=light -else - set bg=dark -endif +set bg=dark " use solarized colorscheme if the terminal can support it (or we're in a GUI) let g:solarized_termtrans = 1