From 2b4b48732bedc65ee058036e8325b201db13d783 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 10:12:43 -0800 Subject: [PATCH 1/6] Dark backgrounds everywhere --- vimrc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vimrc b/vimrc index 4bcb751..dca5e42 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 From dbd6a3c36729627573adbf4a7259f35b49a3db26 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 10:12:58 -0800 Subject: [PATCH 2/6] Dark backgrounds for Vim GUI windows --- gvimrc | 1 - 1 file changed, 1 deletion(-) 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 From b98cfe1c292b77cf196c58074cb2baa455acfcdc Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 10:13:30 -0800 Subject: [PATCH 3/6] For command-t: return to default behavior -- buffers, instead of tabs --- vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vimrc b/vimrc index dca5e42..a024862 100644 --- a/vimrc +++ b/vimrc @@ -126,8 +126,8 @@ let g:snips_author = 'Eryn Wells ' " set the Gundo preview window on the bottom let g:gundo_preview_bottom = 1 -map :GundoToggle map :NERDTreeToggle +map :GundoToggle map :setlocal invlist inoremap jj @@ -196,8 +196,8 @@ nmap gV `[v`] " Command-T should open files in tabs when I hit ; move opening files in " buffers to -let g:CommandTAcceptSelectionMap='' -let g:CommandTAcceptSelectionTabMap='' +"let g:CommandTAcceptSelectionMap='' +"let g:CommandTAcceptSelectionTabMap='' if has('autocmd') filetype plugin indent on From 7f1900d484823d33bdefd918d16b61250f0aac2b Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 7 Jan 2013 10:13:45 -0800 Subject: [PATCH 4/6] Add a GDB config file (yess!) --- gdbinit | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 gdbinit diff --git a/gdbinit b/gdbinit new file mode 100644 index 0000000..2b78bcb --- /dev/null +++ b/gdbinit @@ -0,0 +1,7 @@ +echo \nReading ~/.gdbinit\n +set history save on +set history size 100000 + +set print pretty on +set print array on +set print object on From 67339be8b9dd420eaf4c2896b8d20b575a99aede Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 13 Jan 2013 10:12:34 -0800 Subject: [PATCH 5/6] Vim: add {find,source}_project_file() functions - On VimEnter, look for and source (if found) a project.vim file containing settings specific to this project. Files are found by looking in the current working directory and searching up the tree until the root. --- vimrc | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/vimrc b/vimrc index a024862..c4e2fad 100644 --- a/vimrc +++ b/vimrc @@ -153,7 +153,8 @@ nnoremap l nnoremap :bn nnoremap :bp -function! StripTrailingWhitespace() + +function! strip_trailing_whitespace() " save last search let _s=@/ " save cursor position @@ -166,12 +167,41 @@ function! StripTrailingWhitespace() call cursor(l, c) endfunction + +function! find_project_file() + let l:dir = getcwd() + " Search up the path, starting at the current working directory, for a + " project.vim file and return the path to it, if it exists. + while l:dir != '/' + let l:project_file = l:dir . '/project.vim' + if filereadable(l:project_file) + return l:project_file + endif + let l:dir = fnamemodify(l:dir, ':h') + endwhile + return '' +endfunction + + +function! source_project_file() + let l:project_file = find_project_file() + if l:project_file != '' + exec 'source ' . l:project_file + endif +endfunction + + let mapleader=',' " strip all trailing whitespace in the current file -nnoremap W :call StripTrailingWhitespace() -" edit and source my .vimrc +nnoremap W :call strip_trailing_whitespace() +" (Re)load a project.vim file +nnoremap P :exec 'edit ' . source_project_file() + +" edit and source .vimrc and project.vim files nmap ev :e $MYVIMRC nmap sv :source $MYVIMRC +nmap eP :e find_project_file() + " hide search terms nmap :setlocal invhlsearch " find all @@ -209,9 +239,14 @@ if has('autocmd') \ exe "normal! g`\"" | \ endif + " All my projects are in the ~/Code directory. Look for and source a + " project.vim file if one exists. + autocmd VimEnter ~/Code/* + \ call source_project_file() + " Clean whitespace before saving: Python, C, HTML, and Objective-C autocmd BufWritePre *.py,*.h,*.c,*.html,*.m,*.mm,*.cc,*.hh - \ call StripTrailingWhitespace() + \ call strip_trailing_whitespace() endif if has('unix') From 2cbe3d7b00393dd19c4f27a59f5a8884b3c5c392 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 13 Jan 2013 10:14:22 -0800 Subject: [PATCH 6/6] Fix set_xterm_title function in prompt for iTerm2 --- zsh/func/prompt_loquacious_setup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh/func/prompt_loquacious_setup b/zsh/func/prompt_loquacious_setup index 6a21b02..aff7569 100644 --- a/zsh/func/prompt_loquacious_setup +++ b/zsh/func/prompt_loquacious_setup @@ -95,7 +95,9 @@ function set_prompt_info function set_xterm_title { # Set xterm and screen titles - [[ -n "$DISPLAY" ]] && print -Pn "\e]2;%n@%m\a" + if [[ -n "$DISPLAY" || -n "$TERM_PROGRAM" ]]; then + print -Pn "\e]2;%n@%m\a" + fi }