From 5b3c75a6b418b2611ce60409c837cdded7226494 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 26 Aug 2013 16:55:00 -0400 Subject: [PATCH 1/6] minor changes --- .taskrc | 4 ++-- .vim/bundle/NrrwRgn | 2 +- .vim/bundle/YouCompleteMe | 2 +- .vim/bundle/calendar-vim | 2 +- .vim/bundle/fish-syntax | 2 +- .vim/bundle/nerdtree | 2 +- .vim/bundle/syntastic | 2 +- .vim/bundle/vim-fugitive | 2 +- .vim/bundle/vim-multiple-cursors | 2 +- .vim/bundle/vim-puppet | 2 +- .vim/bundle/vim-unimpaired | 2 +- .vimrc | 1 + 12 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.taskrc b/.taskrc index 64b58cf..afc243b 100644 --- a/.taskrc +++ b/.taskrc @@ -12,8 +12,8 @@ # Files data.location=~/.task -pull.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task -push.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task +pull.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task/ +push.default.uri=barak@miranda.barakmich.com:/fs/home/barak/.task/ # Color theme (uncomment one to use) #include /usr/share/doc/task/rc/light-16.theme diff --git a/.vim/bundle/NrrwRgn b/.vim/bundle/NrrwRgn index b73f97b..680f60f 160000 --- a/.vim/bundle/NrrwRgn +++ b/.vim/bundle/NrrwRgn @@ -1 +1 @@ -Subproject commit b73f97b7653818ed9a010dffb8fea98181b8bab9 +Subproject commit 680f60fb237370d6eda2bfb28cd660916991733e diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index 0c19ee4..972b0a9 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 0c19ee4fa78f69b4591fe107c104b07174cd661c +Subproject commit 972b0a92cbc9a56dd5deac2c7f2b57094374e3ff diff --git a/.vim/bundle/calendar-vim b/.vim/bundle/calendar-vim index 7b0a2c7..c6c607a 160000 --- a/.vim/bundle/calendar-vim +++ b/.vim/bundle/calendar-vim @@ -1 +1 @@ -Subproject commit 7b0a2c727086d39f658225bb00cd117770bf9245 +Subproject commit c6c607a43e1b4a328cec10ef8d139fdd243af60f diff --git a/.vim/bundle/fish-syntax b/.vim/bundle/fish-syntax index 195fbd1..4f21d02 160000 --- a/.vim/bundle/fish-syntax +++ b/.vim/bundle/fish-syntax @@ -1 +1 @@ -Subproject commit 195fbd1d31d0bab944b0b92fb7ffa83fb50c4524 +Subproject commit 4f21d024f91016aae2014cc99e6279e39b2fbbcc diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree index 448ad6f..b0bb781 160000 --- a/.vim/bundle/nerdtree +++ b/.vim/bundle/nerdtree @@ -1 +1 @@ -Subproject commit 448ad6f1bce0308329ccb020b51710227108b578 +Subproject commit b0bb781fc73ef40365e4c996a16f04368d64fc9d diff --git a/.vim/bundle/syntastic b/.vim/bundle/syntastic index 7f0412e..6239284 160000 --- a/.vim/bundle/syntastic +++ b/.vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 7f0412e91dd6e2b48cbe8ae54bddcfeca0c127c1 +Subproject commit 6239284d168931c40ac8681e9a950e962016ba51 diff --git a/.vim/bundle/vim-fugitive b/.vim/bundle/vim-fugitive index 54ead5a..00b0916 160000 --- a/.vim/bundle/vim-fugitive +++ b/.vim/bundle/vim-fugitive @@ -1 +1 @@ -Subproject commit 54ead5abcbfdd776e1160b5510a129884c39f29c +Subproject commit 00b0916ae2fc4e329f519686348de13d7477d770 diff --git a/.vim/bundle/vim-multiple-cursors b/.vim/bundle/vim-multiple-cursors index 679469e..8c9bced 160000 --- a/.vim/bundle/vim-multiple-cursors +++ b/.vim/bundle/vim-multiple-cursors @@ -1 +1 @@ -Subproject commit 679469ed357e141b8b028e1a0c0a12752704fd7a +Subproject commit 8c9bcedc6c534d3f308fa3ade6a459977ee4a58a diff --git a/.vim/bundle/vim-puppet b/.vim/bundle/vim-puppet index 82a88e7..6162f50 160000 --- a/.vim/bundle/vim-puppet +++ b/.vim/bundle/vim-puppet @@ -1 +1 @@ -Subproject commit 82a88e75e1d2ea392176debb5e3b63dadc6a8339 +Subproject commit 6162f501f41477e9f0d75e32cc4159863f4222a2 diff --git a/.vim/bundle/vim-unimpaired b/.vim/bundle/vim-unimpaired index cabf4b7..48d1cb6 160000 --- a/.vim/bundle/vim-unimpaired +++ b/.vim/bundle/vim-unimpaired @@ -1 +1 @@ -Subproject commit cabf4b79b1c0cd9c9a8beec303c2e6172c82d19f +Subproject commit 48d1cb6bf0000159291014226d8d8d3330ad875e diff --git a/.vimrc b/.vimrc index 70b4b89..3cd47ca 100644 --- a/.vimrc +++ b/.vimrc @@ -420,6 +420,7 @@ nnoremap hh :A nnoremap o :CommandTBuffer nnoremap j nnoremap p :PTW +nnoremap lp :LustyJugglePrevious " ** EXTRA INCLUDES ** " From 0d1975d879fc1516f6702d87c344ed1faf0cba0b Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 26 Aug 2013 17:34:58 -0400 Subject: [PATCH 2/6] airline theme --- .vim/autoload/airline/themes/barak.vim | 58 ++++++++++++++++++++++++++++++++++ .vim/bundle/YouCompleteMe | 2 +- .vim/bundle/vim-airline | 2 +- .vim/bundle/vim-coffee-script | 2 +- .vimrc | 7 +++- 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 .vim/autoload/airline/themes/barak.vim diff --git a/.vim/autoload/airline/themes/barak.vim b/.vim/autoload/airline/themes/barak.vim new file mode 100644 index 0000000..ed5b873 --- /dev/null +++ b/.vim/autoload/airline/themes/barak.vim @@ -0,0 +1,58 @@ +" vim-airline companion theme of Ubaryd +" (https://github.com/Donearm/Ubaryd) + +" Normal mode +let s:N1 = [ '#141413' , '#c7b386' , 232 , 252 ] " blackestgravel & bleaksand +let s:N2 = [ '#c7b386' , '#45413b' , 252, 238 ] " bleaksand & deepgravel +let s:N3 = [ '#b88853' , '#363946' , 137, 237 ] " toffee & darkgravel +let s:N4 = [ '#363946' , 237 ] " gravel + +" Insert mode +let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn +let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel +let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel + +" Visual mode +let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe +let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino +let s:V3 = [ '#88633f' , '#c7b386' , 95 , 252 ] " cappuccino & bleaksand +let s:V4 = [ '#c14c3d' , 160 ] " tannedumbrella + +" Replace mode +let s:RE = [ '#c7915b' , 173 ] " nut + +" Paste mode +let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon + +let s:file = [ '#ff7400' , '' , 196 , '' , '' ] +let s:IA = [ '#767986', '#363946', 244, 237, '' ] + +let g:airline#themes#barak#palette = {} +let g:airline#themes#barak#palette.inactive = { + \ 'airline_a' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] } + + +let g:airline#themes#barak#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) +let g:airline#themes#barak#palette.normal_modified = { + \ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , + \ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } + + +let g:airline#themes#barak#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) +let g:airline#themes#barak#palette.insert_modified = { + \ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] } +let g:airline#themes#barak#palette.insert_paste = { + \ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] } + + +let g:airline#themes#barak#palette.replace = copy(airline#themes#barak#palette.insert) +let g:airline#themes#barak#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] +let g:airline#themes#barak#palette.replace_modified = g:airline#themes#barak#palette.insert_modified + + +let g:airline#themes#barak#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) +let g:airline#themes#barak#palette.visual_modified = { + \ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } + +let g:airline#themes#barak#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) + diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index 527d980..7cc399a 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 527d98028bb00167acf9acd89f7129c229c26025 +Subproject commit 7cc399a017a0f20c230a50a4f05d58ab7ef9dca4 diff --git a/.vim/bundle/vim-airline b/.vim/bundle/vim-airline index c985499..ccb00be 160000 --- a/.vim/bundle/vim-airline +++ b/.vim/bundle/vim-airline @@ -1 +1 @@ -Subproject commit c98549913c19b9db632bc214bc4266a17fa103ae +Subproject commit ccb00be717d36276514ed660f6f6b6d3413b1fad diff --git a/.vim/bundle/vim-coffee-script b/.vim/bundle/vim-coffee-script index 0e38ef9..83c06f7 160000 --- a/.vim/bundle/vim-coffee-script +++ b/.vim/bundle/vim-coffee-script @@ -1 +1 @@ -Subproject commit 0e38ef90446a0f1f2294b6225c9c97dbc2810b45 +Subproject commit 83c06f7a351b9140988bfe6d3e651a63d3c504c0 diff --git a/.vimrc b/.vimrc index 2a28b44..0e4a708 100644 --- a/.vimrc +++ b/.vimrc @@ -194,7 +194,12 @@ set noshowmode let g:airline_enable_branch = 1 let g:airline_enable_syntastic = 1 let g:airline_enable_tagbar = 1 -let g:airline_theme="ubaryd" +let g:airline_theme="barak" +let g:airline_left_sep = '' +let g:airline_right_sep = '' +let g:airline#extensions#syntastic#enabled = 1 +let g:airline#extensions#hunks#non_zero_only = 1 +let g:airline#extensions#whitespace#enabled = 0 " * CtrlP let g:ctrlp_map = ',t' From 0ce7a2f33a4b269144e1f39058e3998e223cc7c5 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 26 Aug 2013 17:43:17 -0400 Subject: [PATCH 3/6] bring in bufferline, deprecate buftabs --- .gitmodules | 3 + .vim/buftabs.vim | 309 +++++++++++++++++++++++++++++++++++++++++++++ .vim/bundle/vim-bufferline | 1 + .vim/plugin/buftabs.vim | 309 --------------------------------------------- .vimrc | 7 +- 5 files changed, 319 insertions(+), 310 deletions(-) create mode 100644 .vim/buftabs.vim create mode 160000 .vim/bundle/vim-bufferline delete mode 100644 .vim/plugin/buftabs.vim diff --git a/.gitmodules b/.gitmodules index 91af43d..563cc7c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -73,3 +73,6 @@ [submodule ".vim/bundle/ctrlp"] path = .vim/bundle/ctrlp url = https://github.com/kien/ctrlp.vim.git +[submodule ".vim/bundle/vim-bufferline"] + path = .vim/bundle/vim-bufferline + url = https://github.com/bling/vim-bufferline diff --git a/.vim/buftabs.vim b/.vim/buftabs.vim new file mode 100644 index 0000000..30edea9 --- /dev/null +++ b/.vim/buftabs.vim @@ -0,0 +1,309 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" buftabs (C) 2006 Ico Doornekamp +" +" This program is free software; you can redistribute it and/or modify it +" under the terms of the GNU General Public License as published by the Free +" Software Foundation; either version 2 of the License, or (at your option) +" any later version. +" +" This program is distributed in the hope that it will be useful, but WITHOUT +" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +" more details. +" +" Introduction +" ------------ +" +" This is a simple script that shows a tabs-like list of buffers in the bottom +" of the window. The biggest advantage of this script over various others is +" that it does not take any lines away from your terminal, leaving more space +" for the document you're editing. The tabs are only visible when you need +" them - when you are switchin between buffers. +" +" Usage +" ----- +" +" This script draws buffer tabs on vim startup, when a new buffer is created +" and when switching between buffers. +" +" It might be handy to create a few maps for easy switching of buffers in your +" .vimrc file. For example, using F1 and F2 keys: +" +" noremap :bprev +" noremap :bnext +" +" or using control-left and control-right keys: +" +" :noremap :bprev +" :noremap :bnext +" +" +" The following extra configuration variables are availabe: +" +" * g:buftabs_only_basename +" +" Define this variable to make buftabs only print the filename of each buffer, +" omitting the preceding directory name. Add to your .vimrc: +" +" :let g:buftabs_only_basename=1 +" +" +" * g:buftabs_in_statusline +" +" Define this variable to make the plugin show the buftabs in the statusline +" instead of the command line. It is a good idea to configure vim to show +" the statusline as well when only one window is open. Add to your .vimrc: +" +" set laststatus=2 +" :let g:buftabs_in_statusline=1 +" +" +" * g:buftabs_active_highlight_group +" * g:buftabs_inactive_highlight_group +" +" The name of a highlight group (:help highligh-groups) which is used to +" show the name of the current active buffer and of all other inactive +" buffers. If these variables are not defined, no highlighting is used. +" (Highlighting is only functional when g:buftabs_in_statusline is enabled) +" +" :let g:buftabs_active_highlight_group="Visual" +" +" +" * g:buftabs_marker_start [ +" * g:buftabs_marker_end ] +" * g:buftabs_separator - +" +" These strings are drawn around each tab as separators. +" +" :let g:buftabs_separator = "." +" :let g:buftabs_marker_start = "(" +" :let g:buftabs_marker_end = ")" +" +" +" Changelog +" --------- +" +" 0.1 2006-09-22 Initial version +" +" 0.2 2006-09-22 Better handling when the list of buffers is longer then the +" window width. +" +" 0.3 2006-09-27 Some cleanups, set 'hidden' mode by default +" +" 0.4 2007-02-26 Don't draw buftabs until VimEnter event to avoid clutter at +" startup in some circumstances +" +" 0.5 2007-02-26 Added option for showing only filenames without directories +" in tabs +" +" 0.6 2007-03-04 'only_basename' changed to a global variable. Removed +" functions and add event handlers instead. 'hidden' mode +" broke some things, so is disabled now. Fixed documentation +" +" 0.7 2007-03-07 Added configuration option to show tabs in statusline +" instead of cmdline +" +" 0.8 2007-04-02 Update buftabs when leaving insertmode +" +" 0.9 2007-08-22 Now compatible with older Vim versions < 7.0 +" +" 0.10 2008-01-26 Added GPL license +" +" 0.11 2008-02-29 Added optional syntax highlighting to active buffer name +" +" 0.12 2009-03-18 Fixed support for split windows +" +" 0.13 2009-05-07 Store and reuse right-aligned part of original statusline +" +" 0.14 2010-01-28 Fixed bug that caused buftabs in command line being +" overwritten when 'hidden' mode is enabled. +" +" 0.15 2010-02-16 Fixed window width handling bug which caused strange +" behaviour in combination with the bufferlist plugin. +" Fixed wrong buffer display when deleting last window. +" Added extra options for tabs style and highlighting. +" +" 0.16 2010-02-28 Fixed bug causing errors when using buftabs in vim +" diff mode. +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +let w:buftabs_enabled = 0 +let w:original_statusline = matchstr(&statusline, "%=.*") + +" +" Don't bother when in diff mode +" + +if &diff + finish +endif + + +" +" Called on VimEnter event +" + +function! Buftabs_enable() + let w:buftabs_enabled = 1 +endfunction + + +" +" Persistent echo to avoid overwriting of status line when 'hidden' is enabled +" + +function! Pecho(msg) + let s:hold_ut=&ut|let &ut=1 + let s:Pecho=a:msg + aug Pecho + au CursorHold * ec s:Pecho + \|let &ut=s:hold_ut + \|aug Pecho|exe 'au!'|aug END|aug! Pecho + aug END +endf + + +" +" Draw the buftabs +" + +function! Buftabs_show(deleted_buf) + + let l:i = 1 + let l:list = '' + let l:start = 0 + let l:end = 0 + if ! exists("w:from") + let w:from = 0 + endif + + if ! exists("w:buftabs_enabled") + return + endif + + " Walk the list of buffers + + while(l:i <= bufnr('$')) + + " Only show buffers in the list, and omit help screens + + if buflisted(l:i) && getbufvar(l:i, "&modifiable") && a:deleted_buf != l:i + + " Get the name of the current buffer, and escape characters that might + " mess up the statusline + + if exists("g:buftabs_only_basename") + let l:name = fnamemodify(bufname(l:i), ":t") + else + let l:name = bufname(l:i) + endif + let l:name = substitute(l:name, "%", "%%", "g") + + " Append the current buffer number and name to the list. If the buffer + " is the active buffer, enclose it in some magick characters which will + " be replaced by markers later. If it is modified, it is appended with + " an exclaimation mark + + if winbufnr(winnr()) == l:i + let l:start = strlen(l:list) + let l:list = l:list . "\x01" + else + let l:list = l:list . ' ' + endif + + let l:buftabs_separator = "-" + if exists("g:buftabs_separator") + let l:buftabs_separator = g:buftabs_separator + endif + + let l:list = l:list . l:i . l:buftabs_separator + let l:list = l:list . l:name + + if getbufvar(l:i, "&modified") == 1 + let l:list = l:list . "!" + endif + + if winbufnr(winnr()) == l:i + let l:list = l:list . "\x02" + let l:end = strlen(l:list) + else + let l:list = l:list . ' ' + endif + end + + let l:i = l:i + 1 + endwhile + + " If the resulting list is too long to fit on the screen, chop + " out the appropriate part + + let l:width = winwidth(0) - 12 + + if(l:start < w:from) + let w:from = l:start - 1 + endif + if l:end > w:from + l:width + let w:from = l:end - l:width + endif + + let l:list = strpart(l:list, w:from, l:width) + + " Replace the magic characters by visible markers for highlighting the + " current buffer. The markers can be simple characters like square brackets, + " but can also be special codes with highlight groups + + let l:buftabs_marker_start = "[" + if exists("g:buftabs_marker_start") + let l:buftabs_marker_start = g:buftabs_marker_start + endif + + let l:buftabs_marker_end = "]" + if exists("g:buftabs_marker_end") + let l:buftabs_marker_end = g:buftabs_marker_end + endif + + if exists("g:buftabs_active_highlight_group") + if exists("g:buftabs_in_statusline") + let l:buftabs_marker_start = "%#" . g:buftabs_active_highlight_group . "#" . l:buftabs_marker_start + let l:buftabs_marker_end = l:buftabs_marker_end . "%##" + end + end + + if exists("g:buftabs_inactive_highlight_group") + if exists("g:buftabs_in_statusline") + let l:list = '%#' . g:buftabs_inactive_highlight_group . '#' . l:list + let l:list .= '%##' + let l:buftabs_marker_end = l:buftabs_marker_end . '%#' . g:buftabs_inactive_highlight_group . '#' + end + end + + let l:list = substitute(l:list, "\x01", l:buftabs_marker_start, 'g') + let l:list = substitute(l:list, "\x02", l:buftabs_marker_end, 'g') + + " Show the list. The buftabs_in_statusline variable determines of the list + " is displayed in the command line (volatile) or in the statusline + " (persistent) + + if exists("g:buftabs_in_statusline") + let &l:statusline = l:list . w:original_statusline + else + redraw + call Pecho(l:list) + end + +endfunction + + +" Hook to events to show buftabs at startup, when creating and when switching +" buffers + +autocmd VimEnter * call Buftabs_enable() +autocmd VimEnter,BufNew,BufEnter,BufWritePost * call Buftabs_show(-1) +autocmd BufDelete * call Buftabs_show(expand('')) +if version >= 700 + autocmd InsertLeave,VimResized * call Buftabs_show(-1) +end + +" vi: ts=2 sw=2 + diff --git a/.vim/bundle/vim-bufferline b/.vim/bundle/vim-bufferline new file mode 160000 index 0000000..f501353 --- /dev/null +++ b/.vim/bundle/vim-bufferline @@ -0,0 +1 @@ +Subproject commit f501353aeafdfd9137b5f7847d598b86065be133 diff --git a/.vim/plugin/buftabs.vim b/.vim/plugin/buftabs.vim deleted file mode 100644 index 30edea9..0000000 --- a/.vim/plugin/buftabs.vim +++ /dev/null @@ -1,309 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" buftabs (C) 2006 Ico Doornekamp -" -" This program is free software; you can redistribute it and/or modify it -" under the terms of the GNU General Public License as published by the Free -" Software Foundation; either version 2 of the License, or (at your option) -" any later version. -" -" This program is distributed in the hope that it will be useful, but WITHOUT -" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -" more details. -" -" Introduction -" ------------ -" -" This is a simple script that shows a tabs-like list of buffers in the bottom -" of the window. The biggest advantage of this script over various others is -" that it does not take any lines away from your terminal, leaving more space -" for the document you're editing. The tabs are only visible when you need -" them - when you are switchin between buffers. -" -" Usage -" ----- -" -" This script draws buffer tabs on vim startup, when a new buffer is created -" and when switching between buffers. -" -" It might be handy to create a few maps for easy switching of buffers in your -" .vimrc file. For example, using F1 and F2 keys: -" -" noremap :bprev -" noremap :bnext -" -" or using control-left and control-right keys: -" -" :noremap :bprev -" :noremap :bnext -" -" -" The following extra configuration variables are availabe: -" -" * g:buftabs_only_basename -" -" Define this variable to make buftabs only print the filename of each buffer, -" omitting the preceding directory name. Add to your .vimrc: -" -" :let g:buftabs_only_basename=1 -" -" -" * g:buftabs_in_statusline -" -" Define this variable to make the plugin show the buftabs in the statusline -" instead of the command line. It is a good idea to configure vim to show -" the statusline as well when only one window is open. Add to your .vimrc: -" -" set laststatus=2 -" :let g:buftabs_in_statusline=1 -" -" -" * g:buftabs_active_highlight_group -" * g:buftabs_inactive_highlight_group -" -" The name of a highlight group (:help highligh-groups) which is used to -" show the name of the current active buffer and of all other inactive -" buffers. If these variables are not defined, no highlighting is used. -" (Highlighting is only functional when g:buftabs_in_statusline is enabled) -" -" :let g:buftabs_active_highlight_group="Visual" -" -" -" * g:buftabs_marker_start [ -" * g:buftabs_marker_end ] -" * g:buftabs_separator - -" -" These strings are drawn around each tab as separators. -" -" :let g:buftabs_separator = "." -" :let g:buftabs_marker_start = "(" -" :let g:buftabs_marker_end = ")" -" -" -" Changelog -" --------- -" -" 0.1 2006-09-22 Initial version -" -" 0.2 2006-09-22 Better handling when the list of buffers is longer then the -" window width. -" -" 0.3 2006-09-27 Some cleanups, set 'hidden' mode by default -" -" 0.4 2007-02-26 Don't draw buftabs until VimEnter event to avoid clutter at -" startup in some circumstances -" -" 0.5 2007-02-26 Added option for showing only filenames without directories -" in tabs -" -" 0.6 2007-03-04 'only_basename' changed to a global variable. Removed -" functions and add event handlers instead. 'hidden' mode -" broke some things, so is disabled now. Fixed documentation -" -" 0.7 2007-03-07 Added configuration option to show tabs in statusline -" instead of cmdline -" -" 0.8 2007-04-02 Update buftabs when leaving insertmode -" -" 0.9 2007-08-22 Now compatible with older Vim versions < 7.0 -" -" 0.10 2008-01-26 Added GPL license -" -" 0.11 2008-02-29 Added optional syntax highlighting to active buffer name -" -" 0.12 2009-03-18 Fixed support for split windows -" -" 0.13 2009-05-07 Store and reuse right-aligned part of original statusline -" -" 0.14 2010-01-28 Fixed bug that caused buftabs in command line being -" overwritten when 'hidden' mode is enabled. -" -" 0.15 2010-02-16 Fixed window width handling bug which caused strange -" behaviour in combination with the bufferlist plugin. -" Fixed wrong buffer display when deleting last window. -" Added extra options for tabs style and highlighting. -" -" 0.16 2010-02-28 Fixed bug causing errors when using buftabs in vim -" diff mode. -" -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -let w:buftabs_enabled = 0 -let w:original_statusline = matchstr(&statusline, "%=.*") - -" -" Don't bother when in diff mode -" - -if &diff - finish -endif - - -" -" Called on VimEnter event -" - -function! Buftabs_enable() - let w:buftabs_enabled = 1 -endfunction - - -" -" Persistent echo to avoid overwriting of status line when 'hidden' is enabled -" - -function! Pecho(msg) - let s:hold_ut=&ut|let &ut=1 - let s:Pecho=a:msg - aug Pecho - au CursorHold * ec s:Pecho - \|let &ut=s:hold_ut - \|aug Pecho|exe 'au!'|aug END|aug! Pecho - aug END -endf - - -" -" Draw the buftabs -" - -function! Buftabs_show(deleted_buf) - - let l:i = 1 - let l:list = '' - let l:start = 0 - let l:end = 0 - if ! exists("w:from") - let w:from = 0 - endif - - if ! exists("w:buftabs_enabled") - return - endif - - " Walk the list of buffers - - while(l:i <= bufnr('$')) - - " Only show buffers in the list, and omit help screens - - if buflisted(l:i) && getbufvar(l:i, "&modifiable") && a:deleted_buf != l:i - - " Get the name of the current buffer, and escape characters that might - " mess up the statusline - - if exists("g:buftabs_only_basename") - let l:name = fnamemodify(bufname(l:i), ":t") - else - let l:name = bufname(l:i) - endif - let l:name = substitute(l:name, "%", "%%", "g") - - " Append the current buffer number and name to the list. If the buffer - " is the active buffer, enclose it in some magick characters which will - " be replaced by markers later. If it is modified, it is appended with - " an exclaimation mark - - if winbufnr(winnr()) == l:i - let l:start = strlen(l:list) - let l:list = l:list . "\x01" - else - let l:list = l:list . ' ' - endif - - let l:buftabs_separator = "-" - if exists("g:buftabs_separator") - let l:buftabs_separator = g:buftabs_separator - endif - - let l:list = l:list . l:i . l:buftabs_separator - let l:list = l:list . l:name - - if getbufvar(l:i, "&modified") == 1 - let l:list = l:list . "!" - endif - - if winbufnr(winnr()) == l:i - let l:list = l:list . "\x02" - let l:end = strlen(l:list) - else - let l:list = l:list . ' ' - endif - end - - let l:i = l:i + 1 - endwhile - - " If the resulting list is too long to fit on the screen, chop - " out the appropriate part - - let l:width = winwidth(0) - 12 - - if(l:start < w:from) - let w:from = l:start - 1 - endif - if l:end > w:from + l:width - let w:from = l:end - l:width - endif - - let l:list = strpart(l:list, w:from, l:width) - - " Replace the magic characters by visible markers for highlighting the - " current buffer. The markers can be simple characters like square brackets, - " but can also be special codes with highlight groups - - let l:buftabs_marker_start = "[" - if exists("g:buftabs_marker_start") - let l:buftabs_marker_start = g:buftabs_marker_start - endif - - let l:buftabs_marker_end = "]" - if exists("g:buftabs_marker_end") - let l:buftabs_marker_end = g:buftabs_marker_end - endif - - if exists("g:buftabs_active_highlight_group") - if exists("g:buftabs_in_statusline") - let l:buftabs_marker_start = "%#" . g:buftabs_active_highlight_group . "#" . l:buftabs_marker_start - let l:buftabs_marker_end = l:buftabs_marker_end . "%##" - end - end - - if exists("g:buftabs_inactive_highlight_group") - if exists("g:buftabs_in_statusline") - let l:list = '%#' . g:buftabs_inactive_highlight_group . '#' . l:list - let l:list .= '%##' - let l:buftabs_marker_end = l:buftabs_marker_end . '%#' . g:buftabs_inactive_highlight_group . '#' - end - end - - let l:list = substitute(l:list, "\x01", l:buftabs_marker_start, 'g') - let l:list = substitute(l:list, "\x02", l:buftabs_marker_end, 'g') - - " Show the list. The buftabs_in_statusline variable determines of the list - " is displayed in the command line (volatile) or in the statusline - " (persistent) - - if exists("g:buftabs_in_statusline") - let &l:statusline = l:list . w:original_statusline - else - redraw - call Pecho(l:list) - end - -endfunction - - -" Hook to events to show buftabs at startup, when creating and when switching -" buffers - -autocmd VimEnter * call Buftabs_enable() -autocmd VimEnter,BufNew,BufEnter,BufWritePost * call Buftabs_show(-1) -autocmd BufDelete * call Buftabs_show(expand('')) -if version >= 700 - autocmd InsertLeave,VimResized * call Buftabs_show(-1) -end - -" vi: ts=2 sw=2 - diff --git a/.vimrc b/.vimrc index 0e4a708..aa57ab8 100644 --- a/.vimrc +++ b/.vimrc @@ -137,7 +137,12 @@ let g:LustyJugglerShowKeys = 'a' " * Buftabs let g:buftabs_only_basename = 1 "let g:buftabs_in_statusline=1 -" + +" Bufferline +let g:bufferline_echo = 0 +let g:bufferline_modified = '+' +let g:bufferline_show_bufnr = 1 + " * NERDTree let g:NERDChristmasTree = 1 let g:NERDChristmasTree = 1 From a134cbdc2a4fc46d21346497b5356004482e9ea6 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 26 Aug 2013 18:55:03 -0400 Subject: [PATCH 4/6] emacs and rotate --- .config/awesome/rc.lua | 2 +- .emacs.d/init.el | 12 ++++++++++++ .vimrc | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 53b5df2..1909754 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -340,7 +340,7 @@ globalkeys = awful.util.table.join( -- Prompt awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), - awful.key({ modkey }, "x", + awful.key({ modkey, "Shift" }, "x", function () awful.prompt.run({ prompt = "Run Lua code: " }, mypromptbox[mouse.screen].widget, diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b287f98..3ad808c 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -8,6 +8,13 @@ (add-to-list 'load-path "~/.emacs.d/tabbar") (add-to-list 'load-path "~/.emacs.d/evil") +(require 'package) +(when (< emacs-major-version 24) + (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) +(add-to-list 'package-archives + '("melpa" . "http://melpa.milkbox.net/packages/") t) +(package-initialize) + (fset 'yes-or-no-p 'y-or-n-p) @@ -22,7 +29,9 @@ (require 'tabbar) ;(require 'highlight-symbol) (require 'auto-complete-config) +(require 'cl) (evil-mode 1) +(eval-after-load 'flymake '(require 'flymake-cursor)) ;; Hack to get *Messages* in viper-mode. @@ -86,6 +95,9 @@ ;(vimpulse-map "gK" 'kill-buffer-and-window) ;(vimpulse-map "gc" 'kill-buffer-and-window) ;(define-key viper-insert-global-user-map "\C-d" 'delete-char)) +(define-key evil-normal-state-map "gn" 'tabbar-forward-tab) +(define-key evil-normal-state-map "gp" 'tabbar-backward-tab) +(define-key evil-normal-state-map "gc" 'kill-buffer-and-window) (add-hook 'window-setup-hook 'delete-other-windows) diff --git a/.vimrc b/.vimrc index aa57ab8..86a0769 100644 --- a/.vimrc +++ b/.vimrc @@ -142,6 +142,7 @@ let g:buftabs_only_basename = 1 let g:bufferline_echo = 0 let g:bufferline_modified = '+' let g:bufferline_show_bufnr = 1 +let g:bufferline_rotate = 1 " * NERDTree let g:NERDChristmasTree = 1 From 76ee55c177275262e31c04b27b20e801cd38dd1d Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 29 Aug 2013 17:35:43 -0400 Subject: [PATCH 5/6] remove the outdated (and whiny) showfunc.vim --- .vim/plugin/ShowFunc.vim | 566 ----------------------------------------------- 1 file changed, 566 deletions(-) delete mode 100644 .vim/plugin/ShowFunc.vim diff --git a/.vim/plugin/ShowFunc.vim b/.vim/plugin/ShowFunc.vim deleted file mode 100644 index 2bc6dc8..0000000 --- a/.vim/plugin/ShowFunc.vim +++ /dev/null @@ -1,566 +0,0 @@ -" ------------------------------------------------------------------------------ -" Filename: ShowFunc.vim {{{ -" VimScript: #397 -" -" Maintainer: Dave Vehrs -" Last Modified: 28 Mar 2006 03:58:12 PM by Dave V -" -" Copyright: (C) 2002,2003,2004,2005,2006 Dave Vehrs -" -" This program is free software; you can redistribute it and/or -" modify it under the terms of the GNU General Public License as -" published by the Free Software Foundation; either version 2 of -" the License, or (at your option) any later version. -" -" This program is distributed in the hope that it will be useful, -" but WITHOUT ANY WARRANTY; without even the implied warranty of -" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -" GNU General Public License for more details. -" -" You should have received a copy of the GNU General Public -" License along with this program; if not, write to the Free -" Software Foundation, Inc., 59 Temple Place, Suite 330, -" Boston, MA 02111-1307 USA _OR_ download at copy at -" http://www.gnu.org/licenses/licenses.html#TOCGPL -" -" Description: This script creates a hyper link list of all the functions, -" subroutines, classes, macros or procedures in a single file or -" all currently open windows and displays them in a dynamically -" sized cwindow. -" History: This script inspired by an idea posted by Flemming Madsen, in -" vimtip#79. -" -" WARNING: It may write the file as a side effect. -" Requires: Vim 6.0 or newer. -" Exuberant ctags (http://ctags.sourceforge.net/). -" Install: Put this file in the vim plugins directory (~/.vim/plugin) -" to load it automatically, or load it manually with -" :so ShowFunc.vim. -" -" Additional notes at end of file...}}} -" ------------------------------------------------------------------------------ -" Configuration: {{{ - -" Test for and if necessary configure all default settings. If you would like -" to change any setting, just add let g:variablename = "new-value" to your -" .vimrc. -" For Example, to change the location of the ctags binary, add this: -" let g:showfuncctagsbin = "/bin/ctags" -" OR -" let g:showfuncctagsbin = "c:\\gnu\\ctags\\ctags.exe" - -" Default ScanType Options: buffers | Scan all open buffers. -" current | Scan only the current buffer. -" windows | Scan all open windows. -if !exists("g:ShowFuncScanType") - let g:ShowFuncScanType = "buffers" -endif - -" Default SortType Options: yes | Display output sorted alphabetically. -" no | Display output in file order. -" foldcase | Display output sorted alphabetically, -" | disregarding case. -if !exists("g:ShowFuncSortType") - let g:ShowFuncSortType = "foldcase" -endif - -" You can limited the filetypes that are supported by listing them seperated -" by "^@". -" let g:CtagsSupportedFileTypes = "c^@python^@perl^@" - -" ----- -" Sometimes you'll get more results than you want and you can filter the -" output. - -" To find out what languages ctags supports: -" ctags --list-languages -" To find out what tags are supported for each language, execute: -" ctags --list-kinds= -" For example: -" ctags --list-kinds=vim -" a autocommand groups -" f function definitions -" v variable definitions - -" Now, we can set ctags to just search for functions like so: -" let g:ShowFunc_vim_Kinds = "f" -" To search for functions and autocommand groups: -" let g:ShowFunc_vim_Kinds = "af" -" let g:ShowFunc_vim_Kinds = "-a+f-v" -" To search for everything but variables: -" let g:ShowFunc_vim_Kinds = "-v" -let g:ShowFunc_vim_Kinds = "-v" -let g:ShowFunc_php_Kinds = "-v" - -" To set filters for other languages, simply set a global variable for them -" by replacing the _vim_ with the vim filetype (same as ctags for all -" languages but c++, then use cpp). -" let g:ShowFunc_cpp_Kinds = "-v" - -" }}} -" ------------------------------------------------------------------------------ -" Exit if already loaded. {{{ - -if ( exists("loaded_showfunc") || &cp ) | finish | endif -let g:loaded_showfunc=1 - -" Enable filetype detection -filetype on - -" }}} -" ------------------------------------------------------------------------------ -" AutoCommands: {{{ - -augroup showfunc_autocmd - autocmd! - autocmd BufEnter * call LastWindow() -augroup end - -" }}} -" ------------------------------------------------------------------------------ -" Functions: {{{ - -" Rotate through available scan types. -function! ChangeScanType() - if g:ShowFuncScanType == "buffers" | let g:ShowFuncScanType = "windows" - elseif g:ShowFuncScanType == "windows" | let g:ShowFuncScanType = "current" - elseif g:ShowFuncScanType == "current" | let g:ShowFuncScanType = "buffers" - endif - call ShowFuncOpen() -endfunction - -" Rotate through available sort types. -function! ChangeSortType() - if g:ShowFuncSortType == "no" | let g:ShowFuncSortType = "yes" - elseif g:ShowFuncSortType == "yes" | let g:ShowFuncSortType = "foldcase" - elseif g:ShowFuncSortType == "foldcase" | let g:ShowFuncSortType = "no" - endif - call ShowFuncOpen() -endfunction - -" Ctags binary tests -function! s:CtagsTest(path) - " if the location of the ctags executable is not already configured, then - " attempt to find it.... - if a:path == "unk" - let l:test_paths = "/usr/local/bin/ctags /opt/local/bin/ctags /usr/bin/ctags" . - \ " C:\\gnu\\ctags\\ctags.exe " - let l:rpath = "fail" - while l:test_paths != '' - let l:pathcut = strpart(l:test_paths,0,stridx(l:test_paths,' ')) - if executable(l:pathcut) - let l:rpath = s:CtagsVersionTest(l:pathcut) - if l:rpath != "fail" - break - endif - endif - let l:test_paths = strpart(l:test_paths,stridx(l:test_paths,' ') + 1) - endwhile - if l:rpath == "fail" - if !has("gui_running") || has("win32") - echo "ShowFunc Error: Ctags binary not found.\n". - \ "Please set g:showfuncctagsbin in your .vimrc.\n" - endif - endif - else - " Else test the variable to see that it is actually an executable. - if executable(a:path) - let l:rpath = s:CtagsVersionTest(a:path) - else - if ( !has("gui_running") || has("win32") ) - echo "ShowFunc Error: Ctags binary not found.\n". - \ "Your g:showfuncctagsbin may be set incorrectly.\n" - endif - let g:loaded_showfunc = 0 - let l:rpath = "fail" - endif - endif - return l:rpath -endfunction - -" Test to be sure we have Exuberant Ctags. -function! s:CtagsVersionTest(path) - " Test Ctags for correct ctags project.. - let l:test_str = strtrans(system(a:path . " -x --version")) - let ctagsvertest = strpart(l:test_str,0,15) - if ctagsvertest != "Exuberant Ctags" - if ( !has("gui_running") || has("win32") ) - echo "ShowFunc Error: Incorrect Version of Ctags.\n". - \ "Download the correct version from http://ctags.sourceforge.net" - endif - let g:loaded_showfunc = 0 - let l:rpath = "fail" - else - let l:rpath = a:path - " Set Ctags version variables. - let g:CtagsMajorVersion = strpart(l:test_str,(stridx(l:test_str,"s ")+2), - \ (stridx(l:test_str,".")-(stridx(l:test_str,"s ")+2)) ) - let l:test_str2 = strpart(l:test_str,(stridx(l:test_str,".")+1)) - if ((stridx(l:test_str2,".") < stridx(l:test_str2,",")) && (stridx(l:test_str2,".") >= 0)) - let g:CtagsSubVersion = strpart(l:test_str2, - \ (stridx(l:test_str2,".")+1),(stridx(l:test_str2,",")-(stridx(l:test_str2,".")+1))) - - let g:CtagsMinorVersion = strpart(l:test_str2,0, - \ (stridx(l:test_str2,"."))) - else - let g:CtagsMinorVersion = strpart(l:test_str2,0, - \ (stridx(l:test_str2,","))) - let g:CtagsSubVersion = "0" - endif - " Test for correct versions. - if g:CtagsMajorVersion < 5 - echo "Exuberant Ctags needs to be upgraded for ShowFunc to work." - echo "Please visit http://ctags.sourceforge,net." - let l:rpath = "fail" - elseif g:CtagsMinorVersion <= 4 - echo "Exuberant Ctags should be upgraded, some features of the" - echo "ShowFunc script may not work." - echo "Please visit http://ctags.sourceforge,net." - endif - " Define default supported file types list for Ctags versions 5.5 and newer. - if (!exists("g:CtagsSupportedFileTypes") && g:CtagsMajorVersion == 5 && - \ g:CtagsMinorVersion >= 5) - let g:CtagsSupportedFileTypes = strtrans(system(l:rpath . - \ " -x --list-languages")) - endif - endif - return l:rpath -endfunction - - " Display a simple help window. -function! DisplayHelp() - echo "ShowFunc Help: \n". - \ " c Close \n". - \ " r Refresh \n". - \ " s Change Scan Sort \n". - \ " t Change Scan Type \n" -endfunction - -" Watch for last window and if its a CWindow, then close (vimtip#536). -function! LastWindow() - if ( &buftype == "quickfix" ) - if winbufnr(2) == -1 - quit! - endif - endif -endfunction - -" Determine the best window height for the new cwindow and open it. -function! s:OpenCWin() - let l:mod_total = 0 - let l:win_count = 1 - " Determine correct window height - windo let l:win_count = l:win_count + 1 - if l:win_count <= 2 | let l:win_count = 4 | endif - windo let l:mod_total = l:mod_total + winheight(0)/l:win_count | - \ execute 'resize +'.l:mod_total - " Open cwindow - execute 'belowright copen '.l:mod_total - let l:cwin_filelen = line("$") - " Test for short output lists. - if l:cwin_filelen < winheight(0) - cclose - " And adjust cwindow height accordingly. - execute 'belowright copen '.l:cwin_filelen - endif - if v:version >= 700 - setlocal statusline=ShowFunc.vim\ Tag\ List - endif - " Set cwindow specific key mappings. - nnoremap c :cclose - nnoremap h :call DisplayHelp() - nnoremap r :call ShowFuncOpen() - nnoremap s :call ChangeSortType() - nnoremap t :call ChangeScanType() - set nobuflisted - return -endfunction - -" Set Folds by filename. -function! s:ShowFuncFolds() - let l:test_line = getline(v:lnum) - let l:test_filename = strpart(l:test_line,0,stridx(l:test_line,'|')) - if g:FoldFileName == '' - let g:FoldFileName = l:test_filename - return ">1" - elseif g:FoldFileName == l:test_filename - return "=" - else - let g:FoldFileName = l:test_filename - return ">1" - endif -endfunction - -" Set FoldText to filename and tag count. -function! ShowFuncFoldText() - let l:line = "" - let l:textwidth = &textwidth - 20 - let l:line = getline(v:foldstart) - let l:line = strpart(l:line,0,stridx(l:line,'|')) - if strlen(l:line) < l:textwidth - let l:count = 59 - strlen(l:subline) - while strlen(l:line) < l:textwidth - let l:line = l:line." " - endwhile - endif - let l:tag_count = v:foldend - v:foldstart + 1 - if l:tag_count <= 9 - return v:folddashes."+ File: ".l:line." Tags: ". l:tag_count." " - elseif l:tag_count <= 99 - return v:folddashes."+ File: ".l:line." Tags: ". l:tag_count." " - elseif l:tag_count <= 999 - return v:folddashes."+ File: ".l:line." Tags: ". l:tag_count." " - else - return v:folddashes."+ File: ".l:line." Tags: ". l:tag_count." " - endif -endfunction - -" Set ctags options to call. -function! s:SetGrepPrg(sort) - if g:CtagsMinorVersion < 5 - if ( &filetype == "asm" || &filetype == "asp" || &filetype == "awk" || - \ &filetype == "beta" || &filetype == "c" || &filetype == "cobol" || - \ &filetype == "eiffel" || &filetype == "fortran" || &filetype == "java" || - \ &filetype == "lisp" || &filetype == "lua" || &filetype == "make" || - \ &filetype == "pascal" || &filetype == "perl" || &filetype == "php" || - \ &filetype == "python" || &filetype == "rexx" || &filetype == "ruby" || - \ &filetype == "scheme" || &filetype == "sh" || &filetype == "slang" || - \ &filetype == "sql" || &filetype == "tcl" || &filetype == "vera" || - \ &filetype == "verilog" || &filetype == "vim" || &filetype == "yacc" ) - let l:grep_return = g:showfuncctagsbin .' -x --language-force=' . &filetype . - \ ' --sort=' . a:sort - elseif &filetype == "cpp" - let l:grep_return = g:showfuncctagsbin .' -x --language-force=c++ --sort=' . - \ a:sort - else - return "fail" - endif - else - if &filetype == "cpp" | let l:cfiletype = "c++" - else | let l:cfiletype = &filetype | endif - let l:filetest = s:TestFileType(l:cfiletype) - if l:filetest != "false" - if exists("g:ShowFunc_{&filetype}_Kinds") - let l:grep_return = g:showfuncctagsbin . ' -x --language-force=' . - \ l:cfiletype . ' --' . l:cfiletype . '-kinds=' . - \ g:ShowFunc_{&filetype}_Kinds . ' --sort=' . a:sort - else - let l:grep_return = g:showfuncctagsbin . ' -x --language-force=' . - \ l:cfiletype . ' --sort=' . a:sort - endif - else | let l:grep_return = "fail" | endif - endif - return l:grep_return -endfunction - -function! ShowFuncOpen() - set lazyredraw - " Close any existing cwindows. - cclose - if &lines >= 8 - let l:count = 0 - let l:gf_s = &grepformat - let l:gp_s = &grepprg - set grepformat&vim - set grepprg&vim - let &grepformat = '%*\k%*\s%t%*\k%*\s%l%*\s%f\ %m' - if ( g:ShowFuncScanType == "buffers" ) - " Scan all open buffers. - let l:currbuf = bufnr("%") - bufdo! let &grepprg = s:SetGrepPrg(g:ShowFuncSortType) | - \ if &grepprg != "fail" | if &readonly == 0 | update | endif | - \ if l:count == 0 | silent! grep! % | let l:count = l:count + 1 | - \ else | silent! grepadd! % | endif | endif - execute 'buffer '.l:currbuf - elseif g:ShowFuncScanType == "windows" - " Scan all open windows. - windo let &grepprg = s:SetGrepPrg(g:ShowFuncSortType) | - \ if &grepprg != "fail" | if &readonly == 0 | update | endif | - \ if l:count == 0 | silent! grep! %| let l:count = l:count + 1 | - \ else | silent! grepadd! % | endif | endif - elseif g:ShowFuncScanType == "current" - " Scan current buffer only. - let &grepprg = s:SetGrepPrg(g:ShowFuncSortType) - if &grepprg != "fail" - if &readonly == 0 | update | endif - silent! grep! % - else - echohl WarningMsg - echo "ShowFunc Error: Unknown FileType" - echohl none - endif - endif - let &grepformat = l:gf_s - let &grepprg = l:gp_s - execute s:OpenCWin() - if ( g:ShowFuncScanType == "buffers" || g:ShowFuncScanType == "windows" ) - " Do folding. - let g:FoldFileName = '' - setlocal foldexpr=s:ShowFuncFolds() - setlocal foldmethod=expr - setlocal foldtext=ShowFuncFoldText() - endif - else - echohl WarningMsg - echo "ShowFunc Error: Window too small.\n" - echohl none - endif - set nolazyredraw - redraw! -endfunction - -" Test for supported filetype. -function! s:TestFileType(type) - let l:supportedfiles = g:CtagsSupportedFileTypes - while l:supportedfiles != "^@" && l:supportedfiles != "" - let l:sfcut = strpart(l:supportedfiles,0,stridx(l:supportedfiles,"^@")) - if l:sfcut ==? a:type - return "true" - endif - let l:supportedfiles = strpart(l:supportedfiles, - \ stridx(l:supportedfiles,'^@')+2) - endwhile - return "false" -endfunction -" }}} -" ------------------------------------------------------------------------------ -" Test Environment: {{{ -" Test Ctags Binary to be sure its the correct version. -if exists("g:showfuncctagsbin") - let g:showfuncctagsbin = s:CtagsTest(g:showfuncctagsbin) -endif -if (!exists("g:showfuncctagsbin") || g:showfuncctagsbin == "fail") - let g:showfuncctagsbin = s:CtagsTest("unk") -endif - -" If a suitable ctags binary cannot be found, remove autocommands, clear -" functions and exit script. -if g:showfuncctagsbin == "fail" - echo "ShowFunc exting. (Cleaning up functions)" - let g:loaded_showfunc = 0 - augroup! showfunc_autocmd - delfunction ChangeScanType - delfunction ChangeSortType - delfunction s:CtagsTest - delfunction s:CtagsVersionTest - delfunction DisplayHelp - delfunction LastWindow - delfunction s:OpenCWin - delfunction s:ShowFuncFolds - delfunction s:ShowFuncFoldText - delfunction s:SetGrepPrg - delfunction ShowFuncOpen - delfunction s:TestFileType - finish -endif - -" }}} -" ------------------------------------------------------------------------------ -" Key Mappings: {{{ -" To change the main key mapping, add this to your .vimrc file: -" map ShowFunc - -if ( !hasmapto('ShowFunc') && (maparg('') == '') ) - map ShowFunc - map! ShowFunc -elseif !hasmapto('ShowFunc') - if ( !has("gui_running") || has("win32") ) - echo "ShowFunc Error: No Key mapped.\n". - \ " is taken and a replacement was not assigned." - endif - let g:loaded_showfunc = 0 - finish -endif -noremap ShowFunc :call ShowFuncOpen() -noremap! ShowFunc :call ShowFuncOpen() - -" Note: Cwindow specific key mappings can be found in the OpenCWin function. }}} -" ------------------------------------------------------------------------------ -" Known Issues: {{{ -" 1. Error messages that occur as gvim is loading (on Linux) do not display in -" GUI windows. When called from a menu or icon, it appears that gvim is hung -" (it appears in the ps listings but no window appears). To avoid this I -" have disabled the display of errors during gvim loading and the ShowFunc -" script simply exits. -" }}} -" ------------------------------------------------------------------------------ -" Feature Wishlist: {{{ -" 1. If scan is set to "current", make cwindow update on buffer change (except -" to the cwindow) -" 2. Window size ratios should remain the same as ShowFunc opens and closes. -" 3. Patch vim to allow for setlocal statusline. -" 4. Expand error format format so that the tag type is grabbed by grep. -" }}} -" ------------------------------------------------------------------------------ -" Notes: {{{ -" 1. Best veiwed with AutoFold.vim (vimscript#925) and ShowFunc.vim -" (vimscript#397). -" }}} -" ------------------------------------------------------------------------------ -" Version History: {{{ -" 1.0 08-24-2002 Initial Release. -" 1.1 08-26-2002 Patches to Fortran (thanks to Ajit Thakkar), Pascal, -" and Python support. -" 1.1.1 08-26-2002 Fixed copy&paste errors. ooops. -" 1.1.2 08-27-2002 Removed the Python patch. -" 1.1.3 08-31-2002 Fixed Fortran and Pascal patches, Thanks to Ajit Thakkar, -" and Engelbert Gruber. -" 1.2 09-22-2002 Fixed redraw bug so that it works with the Winmanager -" (vimscript#95) and Bufexplorer (vimscript#42) scripts. -" 1.2.1 10-17-2002 Added unknown filetype handling. Added status messages -" ('ShowFunc:'). Fixed key-mappings. -" 1.3Beta 11-16-2002 Beta: Multiple file handling. Restructured script. -" 1.3Beta2 11-20-2002 Beta: Fixed Multiple file cwindow refresh issue (grep -" vs. grepadd). -" 1.3Beta3 11-29-2002 Beta: Split SetFileType into two ( SetGrepFormat, and -" SetGrepPrg ). Set &...&vim to insure proper '\ multiline -" translation. Added keymapping testing to protect against -" conflicting with existing user configurations and to make -" it easy to remap when necessary. Thanks to Luc Hermitte -" 1.3 12-01-2002 Fixed buffer display issue (Thanks to vimtip#133). Fixed -" window height test for TestWinH and OpenCWin. Changed -" MultiWin (scans all open windows) to MultiBuf (scans all -" open buffers). Basic multiple file handling is complete. -" 1.4 12-21-2002 Changed user interface. Eliminated multiple key-mappings. -" Pressing F1 runs the default scan, and opens the cwindow. -" Scan sort and type can be changed by pressing the s and t -" keys respectively. Unifed scan types into one function -" (ShowFuncOpen) and bought back the all open windows scan. -" 1.4.1 01-19-2003 Fixed multi-window scan display issue. Improved dynamic -" cwindow sizing. Added basic help dialog. -" 1.4.2 03-13-2003 Rewrote the SetGrepFormat and SetGrepPrg functions. Added -" support for all tags for all languages that Exburent -" Ctags (ver. 5.4) supports. -" 1.4.3 03-15-2003 Automatically fold output on filename for multiple file -" scans (all buffers or windows). -" 1.4.4 03-17-2003 Improved error handling. Improved SetFoldText(). -" 1.4.5 03-22-2003 More error handling improvements, including tests for the -" correct version of ctags, and keymap assignment. I want -" to thank Mark Thomas for his assistance in finding and -" fixing a bug in the ctags executable detection on Windows. -" 1.5 09-21-2003 Created a more generic grep format so that explicit type -" definitions are no longer necessary (eliminating the -" SetGrepFormat function). Modified the SetGrepPrg function -" to detect Ctags versions earlier than 5.5. Supportted -" filetypes for Ctags versions 5.4 are statically -" assigned. -" With Ctags versions 5.5 (and later) supported filetypes -" are detected dynamically (including those defined by -" regular expressions (--regex-). -" 1.5.1 09-25-2003 Bug Fixes. -" 1.5.2 10-06-2003 Improved Exuberant Ctags version checking. -" 1.5.3 10-15-2004 Fixed ShowFuncFoldText. -" 1.5.4 01-13-2005 Script cleanup. Added MyLastWindow function (when -" closing windows, tests last window to see if its a -" Cwindow, if it is then close vim session). -" 1.5.5 07-20-2005 Patches from two Windows users (David Rennalls and Bill -" McCarthy). Fixes in cleanup, documentaion, and autocmds. -" 1.5.6 02-28-2006 First Vim 7 patches. Added setlocal statusline support -" to update the cwindow name. -" 1.5.7 03-27-2006 Per request by Diederik Van der Boor, added ability to -" filter the variables kinds that ctags outputs (ver 5.5 -" or newer). -" -" }}} -" ------------------------------------------------------------------------------ -" vim:tw=80:ts=2:sw=2: From a5b1e00ac53e077a13d4d068ec836939d1baf114 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 30 Aug 2013 18:38:49 -0400 Subject: [PATCH 6/6] updates, totally remove command-t --- .vim/bundle/YouCompleteMe | 2 +- .vim/bundle/vim-airline | 2 +- .vim/bundle/vim-bufferline | 2 +- .vim/bundle/vim-coffee-script | 2 +- .vim/bundle/vim-gocode | 2 +- .vimrc | 7 ++++--- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index 7cc399a..d2fe03f 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 7cc399a017a0f20c230a50a4f05d58ab7ef9dca4 +Subproject commit d2fe03f0724d36ed75867e66150074930e2f3f2e diff --git a/.vim/bundle/vim-airline b/.vim/bundle/vim-airline index ccb00be..1f6b936 160000 --- a/.vim/bundle/vim-airline +++ b/.vim/bundle/vim-airline @@ -1 +1 @@ -Subproject commit ccb00be717d36276514ed660f6f6b6d3413b1fad +Subproject commit 1f6b936dd8454262cfd4effe42210f049891cff6 diff --git a/.vim/bundle/vim-bufferline b/.vim/bundle/vim-bufferline index f501353..526e4e2 160000 --- a/.vim/bundle/vim-bufferline +++ b/.vim/bundle/vim-bufferline @@ -1 +1 @@ -Subproject commit f501353aeafdfd9137b5f7847d598b86065be133 +Subproject commit 526e4e2c58d317f88ae84298922c2915bd0b1ecb diff --git a/.vim/bundle/vim-coffee-script b/.vim/bundle/vim-coffee-script index 83c06f7..d944c79 160000 --- a/.vim/bundle/vim-coffee-script +++ b/.vim/bundle/vim-coffee-script @@ -1 +1 @@ -Subproject commit 83c06f7a351b9140988bfe6d3e651a63d3c504c0 +Subproject commit d944c79848a29ac58cc1e435e81a795bb6d16c18 diff --git a/.vim/bundle/vim-gocode b/.vim/bundle/vim-gocode index 7b07ccd..1d6e948 160000 --- a/.vim/bundle/vim-gocode +++ b/.vim/bundle/vim-gocode @@ -1 +1 @@ -Subproject commit 7b07ccdc64afb8a4eced064901b63dbfca1e4a64 +Subproject commit 1d6e94805679eeb7c27391e6eebc8067ff1d543a diff --git a/.vimrc b/.vimrc index 86a0769..090cc29 100644 --- a/.vimrc +++ b/.vimrc @@ -211,6 +211,7 @@ let g:airline#extensions#whitespace#enabled = 0 let g:ctrlp_map = ',t' let g:ctrlp_cmd = 'CtrlP' let g:ctrlp_working_path_mode = 'ra' +let g:ctrlp_match_window = 'bottom,order:ttb,min:1,max:15' " ** STATUSLINE ** @@ -445,10 +446,10 @@ nnoremap ac :Ack nnoremap hh :A " CommandT is useful, but if I'm juggling lots of buffers, limit it to another " one I have open (instead of standard t). -nnoremap o :CommandTBuffer +nnoremap o :CtrlPBuffer nnoremap j -nnoremap p :PTW -nnoremap lp :LustyJugglePrevious +"nnoremap p :PTW +nnoremap p :LustyJugglePrevious " ** EXTRA INCLUDES ** "