From fa3b0897e2215b6e80e751887bb48504c12488e1 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 25 Mar 2013 14:46:49 -0700 Subject: [PATCH 01/21] add ycm submodule --- .gitmodules | 3 +++ .vim/bundle/YouCompleteMe | 1 + 2 files changed, 4 insertions(+) create mode 160000 .vim/bundle/YouCompleteMe diff --git a/.gitmodules b/.gitmodules index c49de8c..af8ec02 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,6 @@ [submodule ".vim/bundle/vim-angry"] path = .vim/bundle/vim-angry url = https://github.com/b4winckler/vim-angry.git +[submodule ".vim/bundle/YouCompleteMe"] + path = .vim/bundle/YouCompleteMe + url = https://github.com/Valloric/YouCompleteMe.git diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe new file mode 160000 index 0000000..b4837c8 --- /dev/null +++ b/.vim/bundle/YouCompleteMe @@ -0,0 +1 @@ +Subproject commit b4837c81feb7ac8bacc87ff8c2920eabbecf6671 From 8529e1a0c16adf45adda9f760e27948dc3b682a7 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 25 Mar 2013 15:57:07 -0700 Subject: [PATCH 02/21] add ycm flags config --- .ycm_extra_conf.py | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 .ycm_extra_conf.py diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py new file mode 100644 index 0000000..33ac6f6 --- /dev/null +++ b/.ycm_extra_conf.py @@ -0,0 +1,120 @@ +import os +import ycm_core +from clang_helpers import PrepareClangFlags + +# These are the compilation flags that will be used in case there's no +# compilation database set (by default, one is not set). +# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. +flags = [ +'-Wall', +'-Wextra', +'-Werror', +'-Wc++98-compat', +'-Wno-long-long', +'-Wno-variadic-macros', +'-fexceptions', +'-DNDEBUG', +'-DUSE_CLANG_COMPLETER', +# THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which +# language to use when compiling headers. So it will guess. Badly. So C++ +# headers will be compiled as C headers. You don't want that so ALWAYS specify +# a "-std=". +# For a C project, you would set this to something like 'c99' instead of +# 'c++11'. +'-std=c++11', +# ...and the same thing goes for the magic -x option which specifies the +# language that the files to be compiled are written in. This is mostly +# relevant for c++ headers. +# For a C project, you would set this to 'c' instead of 'c++'. +'-x', +'c++', +'-isystem', +'../BoostParts', +'-isystem', +# This path will only work on OS X, but extra paths that don't exist are not +# harmful +'/System/Library/Frameworks/Python.framework/Headers', +'-isystem', +'../llvm/include', +'-isystem', +'../llvm/tools/clang/include', +'-I', +'.', +'-I', +'./ClangCompleter', +'-isystem', +'./tests/gmock/gtest', +'-isystem', +'./tests/gmock/gtest/include', +'-isystem', +'./tests/gmock', +'-isystem', +'./tests/gmock/include' +] + +# Set this to the absolute path to the folder (NOT the file!) containing the +# compile_commands.json file to use that instead of 'flags'. See here for +# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html +# +# Most projects will NOT need to set this to anything; you can just change the +# 'flags' list of compilation flags. Notice that YCM itself uses that approach. +compilation_database_folder = '' + +if compilation_database_folder: + database = ycm_core.CompilationDatabase( compilation_database_folder ) +else: + database = None + + +def DirectoryOfThisScript(): + return os.path.dirname( os.path.abspath( __file__ ) ) + + +def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): + if not working_directory: + return flags + new_flags = [] + make_next_absolute = False + path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] + for flag in flags: + new_flag = flag + + if make_next_absolute: + make_next_absolute = False + if not flag.startswith( '/' ): + new_flag = os.path.join( working_directory, flag ) + + for path_flag in path_flags: + if flag == path_flag: + make_next_absolute = True + break + + if flag.startswith( path_flag ): + path = flag[ len( path_flag ): ] + new_flag = path_flag + os.path.join( working_directory, path ) + break + + if new_flag: + new_flags.append( new_flag ) + return new_flags + + +def FlagsForFile( filename ): + if database: + # Bear in mind that compilation_info.compiler_flags_ does NOT return a + # python list, but a "list-like" StringVec object + compilation_info = database.GetCompilationInfoForFile( filename ) + final_flags = PrepareClangFlags( + MakeRelativePathsInFlagsAbsolute( + compilation_info.compiler_flags_, + compilation_info.compiler_working_dir_ ), + filename ) + + else: + relative_to = DirectoryOfThisScript() + final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + + return { + 'flags': final_flags, + 'do_cache': True + } From eae656f94983f71acdc10a9610bd59548368b9ff Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 25 Mar 2013 16:13:39 -0700 Subject: [PATCH 03/21] Add extra conf stuff to vimrc --- .vimrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vimrc b/.vimrc index d5827cf..19e9d5f 100644 --- a/.vimrc +++ b/.vimrc @@ -163,6 +163,13 @@ let g:ConqueTerm_InsertOnEnter = 0 let g:ConqueTerm_SendVisKey = 'ss' " * MiniBufExplorer +let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' +let g:ycm_confirm_extra_conf = 0 + +au! BufRead,BufWrite,BufWritePost,BufNewFile *.org +au BufEnter *.org call org#SetOrgFileType() + +"MiniBufExplore Options "let g:miniBufExplMapWindowNavVim = 1 "let g:miniBufExplMapWindowNavArrows = 1 "let g:miniBufExplMapCTabSwitchBufs = 1 From 16a782de423df23b642a5ba4813e7e00dae29199 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 25 Mar 2013 17:13:24 -0700 Subject: [PATCH 04/21] Add preview window --- .vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.vimrc b/.vimrc index 19e9d5f..a41c750 100644 --- a/.vimrc +++ b/.vimrc @@ -165,6 +165,7 @@ let g:ConqueTerm_SendVisKey = 'ss' " * MiniBufExplorer let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' let g:ycm_confirm_extra_conf = 0 +let g:ycm_add_preview_to_completeopt = 1 au! BufRead,BufWrite,BufWritePost,BufNewFile *.org au BufEnter *.org call org#SetOrgFileType() From 6bc262623f36156426ccde107641c12bf7f96955 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 25 Mar 2013 17:20:02 -0700 Subject: [PATCH 05/21] nope --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index a41c750..7f2e535 100644 --- a/.vimrc +++ b/.vimrc @@ -165,7 +165,7 @@ let g:ConqueTerm_SendVisKey = 'ss' " * MiniBufExplorer let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' let g:ycm_confirm_extra_conf = 0 -let g:ycm_add_preview_to_completeopt = 1 +"let g:ycm_add_preview_to_completeopt = 1 au! BufRead,BufWrite,BufWritePost,BufNewFile *.org au BufEnter *.org call org#SetOrgFileType() From 8fc73efa209b189cc85b6ba249069e706629d8f6 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 12 Apr 2013 17:33:59 -0400 Subject: [PATCH 06/21] merge fix --- .vimrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.vimrc b/.vimrc index 7f2e535..f1c84dc 100644 --- a/.vimrc +++ b/.vimrc @@ -190,7 +190,6 @@ let g:CommandTMaxDepth = 7 "let g:org_tag_setup='{@home(h) @work(w) @tennisclub(t)} \n {easy(e) hard(d)} \n {computer(c) phone(p)}' - " ** STATUSLINE ** " set laststatus=2 From 4a2c407d2530d0043bf2e79fc847618ecd745b35 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 12 Apr 2013 17:37:22 -0400 Subject: [PATCH 07/21] make sure we have YCM --- .vim/bundle/YouCompleteMe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index b4837c8..882c6b5 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit b4837c81feb7ac8bacc87ff8c2920eabbecf6671 +Subproject commit 882c6b5d18da50ad20bd3b8e02f13ceda20efaca From da3069a15206cfbda4b060a3f90d17d2ab33f0cc Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 18 Apr 2013 12:59:46 -0400 Subject: [PATCH 08/21] Convert old aliases and add fish config --- .bash_aliases | 50 ++++++++++++++++++++++++------------------------ .config/fish/config.fish | 1 + bin/tmux-pwn | 4 ++++ 3 files changed, 30 insertions(+), 25 deletions(-) create mode 100755 bin/tmux-pwn diff --git a/.bash_aliases b/.bash_aliases index 562c507..c102401 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -10,30 +10,30 @@ #alias dir='ls --color=auto --format=vertical' #alias vdir='ls --color=auto --format=long' -case `uname` in -Linux) - if [ "$TERM" != "dumb" ]; then - eval "`dircolors -b`" - fi - alias ls='ls -F --color=auto' - alias open='xdg-open' - ;; -Darwin) - alias ls='ls -FG' - ;; -FreeBSD) - alias ls='ls -FG' - ;; -SunOS) - alias ls='ls -F' - ;; -*) - if [ "$TERM" != "dumb" ]; then - eval "`dircolors -b`" - fi - alias ls='ls --color=auto' - ;; -esac +#case `uname` in +#Linux) + #if [ "$TERM" != "dumb" ]; then + #eval "`dircolors -b`" + #fi + #alias ls='ls -F --color=auto' + #alias open='xdg-open' + #;; +#Darwin) + #alias ls='ls -FG' + #;; +#FreeBSD) + #alias ls='ls -FG' + #;; +#SunOS) + #alias ls='ls -F' + #;; +#*) + #if [ "$TERM" != "dumb" ]; then + #eval "`dircolors -b`" + #fi + #alias ls='ls --color=auto' + #;; +#esac @@ -52,7 +52,7 @@ alias grep="grep --color=auto" alias dvtm="dvtm -m \"^w\"" alias tm="tmux -2 attach" alias ppjson="python -mjson.tool" -alias tmux-pwn='tmux list-clients | sed "s|^\(/dev/ttys[0-9]\+\).*\[\([0-9]\+x[0-9]\+\).*$|\2 \1|" | sort -r -n | tail -n +2 | cut -d " " -f 2 | xargs -n 1 tmux detach-client -t' +#alias tmux-pwn='tmux list-clients | sed "s|^\(/dev/ttys[0-9]\+\).*\[\([0-9]\+x[0-9]\+\).*$|\2 \1|" | sort -r -n | tail -n +2 | cut -d " " -f 2 | xargs -n 1 tmux detach-client -t' #Cosmetic/useful #alias naim="naim --noscreen" diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 5bfc59a..b07e1e8 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,4 +1,5 @@ set PATH ~/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH set fish_greeting "" + . ~/.bash_aliases diff --git a/bin/tmux-pwn b/bin/tmux-pwn new file mode 100755 index 0000000..4212643 --- /dev/null +++ b/bin/tmux-pwn @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + + +tmux list-clients | sed "s|^\(/dev/ttys[0-9]\+\).*\[\([0-9]\+x[0-9]\+\).*$|\2 \1|" | sort -r -n | tail -n +2 | cut -d " " -f 2 | xargs -n 1 tmux detach-client -t From 4c4ee123425505731909f122d8ce11924885cec5 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 20 Apr 2013 12:34:44 -0700 Subject: [PATCH 09/21] disable old go flags, add gui vim options --- .vim/bundle/VimOrganizer | 2 +- .vim/bundle/command-t | 2 +- .vim/bundle/nerdtree | 2 +- .vim/bundle/syntastic | 2 +- .vim/bundle/vim-fugitive | 2 +- .vim/bundle/vim-gitgutter | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.vim/bundle/VimOrganizer b/.vim/bundle/VimOrganizer index ce15d1a..77fe790 160000 --- a/.vim/bundle/VimOrganizer +++ b/.vim/bundle/VimOrganizer @@ -1 +1 @@ -Subproject commit ce15d1acdad51c3bdb9d7537f0fd36bcf9685e32 +Subproject commit 77fe79056f2c2aaf0e87bf3ccea8a73f51a096a7 diff --git a/.vim/bundle/command-t b/.vim/bundle/command-t index 8866bbc..d30099c 160000 --- a/.vim/bundle/command-t +++ b/.vim/bundle/command-t @@ -1 +1 @@ -Subproject commit 8866bbc0e18a981889b3431790caf47432f38cf4 +Subproject commit d30099cac79dfdbc4a16d8279c5a2304b1494b2c diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree index eaf1973..9a341ec 160000 --- a/.vim/bundle/nerdtree +++ b/.vim/bundle/nerdtree @@ -1 +1 @@ -Subproject commit eaf19734e73dbaa5b30f10591079043b0eba0aab +Subproject commit 9a341ec18f631e58398350cc9665b8ec4d50954d diff --git a/.vim/bundle/syntastic b/.vim/bundle/syntastic index 6f214cb..04778e2 160000 --- a/.vim/bundle/syntastic +++ b/.vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 6f214cbb6d42256031aaa9670cf9ea7358e18431 +Subproject commit 04778e2dda7a600fc6c6d5a8fbf705ba04c13d23 diff --git a/.vim/bundle/vim-fugitive b/.vim/bundle/vim-fugitive index 618d884..f6d93b8 160000 --- a/.vim/bundle/vim-fugitive +++ b/.vim/bundle/vim-fugitive @@ -1 +1 @@ -Subproject commit 618d884562f2b99fa62e3fb90e3531bf17396efa +Subproject commit f6d93b8788b57990a2669b2408004c0086d6a878 diff --git a/.vim/bundle/vim-gitgutter b/.vim/bundle/vim-gitgutter index 935184b..d4a1a60 160000 --- a/.vim/bundle/vim-gitgutter +++ b/.vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit 935184bd1806e37c1e3319c7f7f3ae94ef5a5313 +Subproject commit d4a1a60f399ee4c6a16263e559dbcca70ed0a84a From 0a10b15c96682a95cf7468cdc9c18411dd40c920 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sun, 21 Apr 2013 19:52:05 -0700 Subject: [PATCH 10/21] master merge --- .vim/bundle/VimOrganizer | 2 +- .vim/bundle/command-t | 2 +- .vim/bundle/nerdtree | 2 +- .vim/bundle/syntastic | 2 +- .vim/bundle/vim-fugitive | 2 +- .vim/bundle/vim-gitgutter | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.vim/bundle/VimOrganizer b/.vim/bundle/VimOrganizer index 77fe790..ce15d1a 160000 --- a/.vim/bundle/VimOrganizer +++ b/.vim/bundle/VimOrganizer @@ -1 +1 @@ -Subproject commit 77fe79056f2c2aaf0e87bf3ccea8a73f51a096a7 +Subproject commit ce15d1acdad51c3bdb9d7537f0fd36bcf9685e32 diff --git a/.vim/bundle/command-t b/.vim/bundle/command-t index d30099c..8866bbc 160000 --- a/.vim/bundle/command-t +++ b/.vim/bundle/command-t @@ -1 +1 @@ -Subproject commit d30099cac79dfdbc4a16d8279c5a2304b1494b2c +Subproject commit 8866bbc0e18a981889b3431790caf47432f38cf4 diff --git a/.vim/bundle/nerdtree b/.vim/bundle/nerdtree index 9a341ec..eaf1973 160000 --- a/.vim/bundle/nerdtree +++ b/.vim/bundle/nerdtree @@ -1 +1 @@ -Subproject commit 9a341ec18f631e58398350cc9665b8ec4d50954d +Subproject commit eaf19734e73dbaa5b30f10591079043b0eba0aab diff --git a/.vim/bundle/syntastic b/.vim/bundle/syntastic index 04778e2..6f214cb 160000 --- a/.vim/bundle/syntastic +++ b/.vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 04778e2dda7a600fc6c6d5a8fbf705ba04c13d23 +Subproject commit 6f214cbb6d42256031aaa9670cf9ea7358e18431 diff --git a/.vim/bundle/vim-fugitive b/.vim/bundle/vim-fugitive index f6d93b8..4c7e649 160000 --- a/.vim/bundle/vim-fugitive +++ b/.vim/bundle/vim-fugitive @@ -1 +1 @@ -Subproject commit f6d93b8788b57990a2669b2408004c0086d6a878 +Subproject commit 4c7e649efba289df0e7e8bb9abfa37f95b28f8ed diff --git a/.vim/bundle/vim-gitgutter b/.vim/bundle/vim-gitgutter index d4a1a60..935184b 160000 --- a/.vim/bundle/vim-gitgutter +++ b/.vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit d4a1a60f399ee4c6a16263e559dbcca70ed0a84a +Subproject commit 935184bd1806e37c1e3319c7f7f3ae94ef5a5313 From 272b3e511aff2816151433b357ba5a30ea483ccb Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 22 Apr 2013 15:44:51 -0400 Subject: [PATCH 11/21] doh --- .vim/bundle/vim-fugitive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vim/bundle/vim-fugitive b/.vim/bundle/vim-fugitive index 4c7e649..618d884 160000 --- a/.vim/bundle/vim-fugitive +++ b/.vim/bundle/vim-fugitive @@ -1 +1 @@ -Subproject commit 4c7e649efba289df0e7e8bb9abfa37f95b28f8ed +Subproject commit 618d884562f2b99fa62e3fb90e3531bf17396efa From 27b6f067621a579b194bde6505974979f18ab43e Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 22 Apr 2013 16:19:37 -0400 Subject: [PATCH 12/21] add detail bar --- .config/awesome/rc.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 1a939e4..82e265f 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -156,7 +156,6 @@ function (widget, args) return args[2] end , 120, "BAT0") - -- Register CPU widget vicious.register(cpuwidget, vicious.widgets.cpu, function (widget, args) From 6313a4fdd589bc6396f1277464106dab86e76470 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 23 Apr 2013 22:48:50 -0400 Subject: [PATCH 13/21] battery monitor, gvimrc, and puppet fixes --- .vim/bundle/YouCompleteMe | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index 882c6b5..a7203d9 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 882c6b5d18da50ad20bd3b8e02f13ceda20efaca +Subproject commit a7203d97c8aacf5e9da8872ff2b269e8af75bb41 From f4b8857fa41d891306deecc20867f2c4bcd2794a Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 25 Apr 2013 19:39:00 -0400 Subject: [PATCH 14/21] modify zsh --- .zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.zshrc b/.zshrc index f8fc2ee..5fa34d7 100644 --- a/.zshrc +++ b/.zshrc @@ -22,6 +22,7 @@ bindkey -e #ZLS_COLORS=$LS_COLORS +PATH=$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/games:/usr/X11R6/bin:/$HOME/.gem/ruby/1.9.1/bin:$HOME/.cabal/bin:/usr/lib/go/bin:$PATH; export PATH export DISTCC_HOSTS='hyades01 hyades02 hyades03 hyades04' #if [[ "$GOROOT" == "" ]]; then #export GOROOT=$HOME/local/go From 93310317fb05fe921fafc3621762b13e22eafd4f Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Thu, 25 Apr 2013 19:41:32 -0400 Subject: [PATCH 15/21] really want env --- .zshrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.zshrc b/.zshrc index 5fa34d7..f8fc2ee 100644 --- a/.zshrc +++ b/.zshrc @@ -22,7 +22,6 @@ bindkey -e #ZLS_COLORS=$LS_COLORS -PATH=$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/games:/usr/X11R6/bin:/$HOME/.gem/ruby/1.9.1/bin:$HOME/.cabal/bin:/usr/lib/go/bin:$PATH; export PATH export DISTCC_HOSTS='hyades01 hyades02 hyades03 hyades04' #if [[ "$GOROOT" == "" ]]; then #export GOROOT=$HOME/local/go From 84021f562ff2d579b93aab0dd3e4011d06ce87bd Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 3 May 2013 14:24:40 -0400 Subject: [PATCH 16/21] dammit --- .vim/bundle/YouCompleteMe | 2 +- .vim/bundle/syntastic | 2 +- .vim/bundle/vim-fugitive | 2 +- .vim/bundle/vim-gitgutter | 2 +- .vimrc | 9 ++++----- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index a7203d9..7cef111 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit a7203d97c8aacf5e9da8872ff2b269e8af75bb41 +Subproject commit 7cef111e01d05f21202098e48d2dde41b15e7ee2 diff --git a/.vim/bundle/syntastic b/.vim/bundle/syntastic index 6f214cb..f750870 160000 --- a/.vim/bundle/syntastic +++ b/.vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit 6f214cbb6d42256031aaa9670cf9ea7358e18431 +Subproject commit f7508703d640eebc959036005bcb912aa50161ec diff --git a/.vim/bundle/vim-fugitive b/.vim/bundle/vim-fugitive index 618d884..54ead5a 160000 --- a/.vim/bundle/vim-fugitive +++ b/.vim/bundle/vim-fugitive @@ -1 +1 @@ -Subproject commit 618d884562f2b99fa62e3fb90e3531bf17396efa +Subproject commit 54ead5abcbfdd776e1160b5510a129884c39f29c diff --git a/.vim/bundle/vim-gitgutter b/.vim/bundle/vim-gitgutter index 935184b..ff031d0 160000 --- a/.vim/bundle/vim-gitgutter +++ b/.vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit 935184bd1806e37c1e3319c7f7f3ae94ef5a5313 +Subproject commit ff031d022f2123353bc93a3aa97290287c10a287 diff --git a/.vimrc b/.vimrc index f1c84dc..70b4b89 100644 --- a/.vimrc +++ b/.vimrc @@ -162,15 +162,12 @@ let g:ConqueTerm_CWInsert = 1 let g:ConqueTerm_InsertOnEnter = 0 let g:ConqueTerm_SendVisKey = 'ss' -" * MiniBufExplorer +" * YouCompleteMe let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' let g:ycm_confirm_extra_conf = 0 "let g:ycm_add_preview_to_completeopt = 1 -au! BufRead,BufWrite,BufWritePost,BufNewFile *.org -au BufEnter *.org call org#SetOrgFileType() - -"MiniBufExplore Options +" * MinBufExplorer "let g:miniBufExplMapWindowNavVim = 1 "let g:miniBufExplMapWindowNavArrows = 1 "let g:miniBufExplMapCTabSwitchBufs = 1 @@ -188,6 +185,8 @@ let g:CommandTMaxDepth = 7 " let g:org_todo_setup='TODO | DONE' " while g:org_tag_setup is itself a string "let g:org_tag_setup='{@home(h) @work(w) @tennisclub(t)} \n {easy(e) hard(d)} \n {computer(c) phone(p)}' +au! BufRead,BufWrite,BufWritePost,BufNewFile *.org +au BufEnter *.org call org#SetOrgFileType() " ** STATUSLINE ** From f7c9c15fa16548327aa793b2d3832e577153b44f Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 3 May 2013 14:26:10 -0400 Subject: [PATCH 17/21] update push semantics --- .gitconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitconfig b/.gitconfig index f10c4f1..019de4e 100644 --- a/.gitconfig +++ b/.gitconfig @@ -29,3 +29,5 @@ autocrlf = input ;[push] ;default = simple +[push] + default = current From a570db8a4359fc575cddea7ede9de592f8f3edc4 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 3 May 2013 19:44:55 -0400 Subject: [PATCH 18/21] Select better layouts --- .config/awesome/rc.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 82e265f..91eaef0 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -70,11 +70,11 @@ layouts = awful.layout.suit.tile.bottom, awful.layout.suit.tile.top, awful.layout.suit.floating, - awful.layout.suit.fair, - awful.layout.suit.fair.horizontal, - --awful.layout.suit.spiral, + --awful.layout.suit.fair, + --awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral, --awful.layout.suit.spiral.dwindle, - awful.layout.suit.max, + --awful.layout.suit.max, awful.layout.suit.max.fullscreen, awful.layout.suit.magnifier } From 70661defc6f8706361b0688ea8ae046de161546b Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 7 May 2013 16:22:09 -0400 Subject: [PATCH 19/21] add fasd for bash --- .bashrc | 7 + .vim/bundle/YouCompleteMe | 2 +- .vim/bundle/syntastic | 2 +- .vim/bundle/vim-fugitive | 2 +- .vim/bundle/vim-gitgutter | 2 +- bin/fasd | 624 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 635 insertions(+), 4 deletions(-) create mode 100755 bin/fasd diff --git a/.bashrc b/.bashrc index 3bc9c26..e1cf881 100644 --- a/.bashrc +++ b/.bashrc @@ -99,6 +99,13 @@ if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi +fasd_cache="$HOME/.fasd-init-bash" +if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache" +fi +source "$fasd_cache" +unset fasd_cache + # enable color support of ls and also add handy aliases #if [ "$TERM" != "dumb" ]; then # eval "`dircolors -b`" diff --git a/.vim/bundle/YouCompleteMe b/.vim/bundle/YouCompleteMe index 7cef111..a7203d9 160000 --- a/.vim/bundle/YouCompleteMe +++ b/.vim/bundle/YouCompleteMe @@ -1 +1 @@ -Subproject commit 7cef111e01d05f21202098e48d2dde41b15e7ee2 +Subproject commit a7203d97c8aacf5e9da8872ff2b269e8af75bb41 diff --git a/.vim/bundle/syntastic b/.vim/bundle/syntastic index f750870..6f214cb 160000 --- a/.vim/bundle/syntastic +++ b/.vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit f7508703d640eebc959036005bcb912aa50161ec +Subproject commit 6f214cbb6d42256031aaa9670cf9ea7358e18431 diff --git a/.vim/bundle/vim-fugitive b/.vim/bundle/vim-fugitive index 54ead5a..618d884 160000 --- a/.vim/bundle/vim-fugitive +++ b/.vim/bundle/vim-fugitive @@ -1 +1 @@ -Subproject commit 54ead5abcbfdd776e1160b5510a129884c39f29c +Subproject commit 618d884562f2b99fa62e3fb90e3531bf17396efa diff --git a/.vim/bundle/vim-gitgutter b/.vim/bundle/vim-gitgutter index ff031d0..935184b 160000 --- a/.vim/bundle/vim-gitgutter +++ b/.vim/bundle/vim-gitgutter @@ -1 +1 @@ -Subproject commit ff031d022f2123353bc93a3aa97290287c10a287 +Subproject commit 935184bd1806e37c1e3319c7f7f3ae94ef5a5313 diff --git a/bin/fasd b/bin/fasd new file mode 100755 index 0000000..5ea0c73 --- /dev/null +++ b/bin/fasd @@ -0,0 +1,624 @@ +#!/usr/bin/env sh + +# Fasd (this file) can be sourced or executed by any POSIX compatible shell. + +# Fasd is originally written based on code from z (https://github.com/rupa/z) +# by rupa deadwyler under the WTFPL license. Most if not all of the code has +# been rewritten. + +# Copyright (C) 2011, 2012 by Wei Dai. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +fasd() { + + # make zsh do word splitting inside this function + [ "$ZSH_VERSION" ] && emulate sh && setopt localoptions + + case $1 in + --init) shift + while [ "$1" ]; do + case $1 in + env) + { # source rc files if present + [ -s "/etc/fasdrc" ] && . "/etc/fasdrc" + [ -s "$HOME/.fasdrc" ] && . "$HOME/.fasdrc" + + # set default options + [ -z "$_FASD_DATA" ] && _FASD_DATA="$HOME/.fasd" + [ -z "$_FASD_BLACKLIST" ] && _FASD_BLACKLIST="--help" + [ -z "$_FASD_SHIFT" ] && _FASD_SHIFT="sudo busybox" + [ -z "$_FASD_IGNORE" ] && _FASD_IGNORE="fasd ls echo" + [ -z "$_FASD_SINK" ] && _FASD_SINK=/dev/null + [ -z "$_FASD_TRACK_PWD" ] && _FASD_TRACK_PWD=1 + [ -z "$_FASD_MAX" ] && _FASD_MAX=2000 + [ -z "$_FASD_BACKENDS" ] && _FASD_BACKENDS=native + [ -z "$_FASD_FUZZY" ] && _FASD_FUZZY=2 + [ -z "$_FASD_VIMINFO" ] && _FASD_VIMINFO="$HOME/.viminfo" + [ -z "$_FASD_RECENTLY_USED_XBEL" ] && \ + _FASD_RECENTLY_USED_XBEL="$HOME/.local/share/recently-used.xbel" + + if [ -z "$_FASD_AWK" ]; then + # awk preferences + local awk; for awk in mawk gawk original-awk nawk awk; do + $awk "" && _FASD_AWK=$awk && break + done + fi + } >> "${_FASD_SINK:-/dev/null}" 2>&1 + ;; + + auto) cat <> "$_FASD_SINK" 2>&1 + +EOS + ;; + + posix-alias) cat <& /dev/null || fasd -d'; +EOS + ;; + + zsh-hook) cat <> "$_FASD_SINK" 2>&1 +} +autoload -Uz add-zsh-hook +add-zsh-hook preexec _fasd_preexec + +EOS + ;; + + bash-hook) cat <> "$_FASD_SINK" 2>&1 +} + +# add bash hook +case \$PROMPT_COMMAND in + *_fasd_prompt_func*) ;; + *) PROMPT_COMMAND="_fasd_prompt_func;\$PROMPT_COMMAND";; +esac + +EOS + ;; + + posix-hook) cat <> "$_FASD_SINK" 2>&1 +} +case \$PS1 in + *_fasd_ps1_func*) ;; + *) export PS1="\\\$(_fasd_ps1_func)\$PS1";; +esac + +EOS + ;; + + tcsh-hook) cat <& /dev/null'; +EOS + + ;; + + zsh-ccomp) cat <> "$_FASD_SINK" | \\ + sort -nr | sed 's/^[^ ]*[ ]*//' | while read -r line; do + compadd -U -V fasd "\$line" + done + compstate[insert]=menu # no expand + } + _fasd_zsh_word_complete_f() { _fasd_zsh_word_complete f ; } + _fasd_zsh_word_complete_d() { _fasd_zsh_word_complete d ; } + _fasd_zsh_word_complete_trigger() { + local _fasd_cur="\${words[CURRENT]}" + eval \$(fasd --word-complete-trigger _fasd_zsh_word_complete \$_fasd_cur) + } + # define zle widgets + zle -C fasd-complete complete-word _generic + zstyle ':completion:fasd-complete:*' completer _fasd_zsh_word_complete + zstyle ':completion:fasd-complete:*' menu-select + + zle -C fasd-complete-f complete-word _generic + zstyle ':completion:fasd-complete-f:*' completer _fasd_zsh_word_complete_f + zstyle ':completion:fasd-complete-f:*' menu-select + + zle -C fasd-complete-d complete-word _generic + zstyle ':completion:fasd-complete-d:*' completer _fasd_zsh_word_complete_d + zstyle ':completion:fasd-complete-d:*' menu-select +} + +EOS + ;; + + zsh-ccomp-install) cat <> "$_FASD_SINK" | sed -n "\\\$s/^.*'\\\\(.*\\\\)'/\\\\1/p") + \${COMP_LINE#* }" | while read -r line; do + quote_readline "\$line" 2>/dev/null || \\ + printf %q "\$line" 2>/dev/null && \\ + printf \\\\n + done) + local IFS=\$'\\n'; COMPREPLY=( \$RESULT ) +} +_fasd_bash_hook_cmd_complete() { + for cmd in \$*; do + complete -F _fasd_bash_cmd_complete \$cmd + done +} + +EOS + ;; + + bash-ccomp-install) cat <$`{}]\{1,\}/\1 /g' + ;; + + --proc) shift # process commands + # stop if we don't own $_FASD_DATA or $_FASD_RO is set + [ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return + + # blacklists + local each; for each in $_FASD_BLACKLIST; do + case " $* " in *\ $each\ *) return;; esac + done + + # shifts + while true; do + case " $_FASD_SHIFT " in + *\ $1\ *) shift;; + *) break;; + esac + done + + # ignores + case " $_FASD_IGNORE " in + *\ $1\ *) return;; + esac + + shift; fasd --add "$@" # add all arguments except command + ;; + + --add|-A) shift # add entries + # stop if we don't own $_FASD_DATA or $_FASD_RO is set + [ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return + + # find all valid path arguments, convert them to simplest absolute form + local paths="$(while [ "$1" ]; do + [ -e "$1" ] && printf %s\\n "$1"; shift + done | sed '/^[^/]/s@^@'"$PWD"'/@ + s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0 + s@[^/][^/]*//*\.\./@/@;t 0 + s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@;s@^$@/@' 2>> "$_FASD_SINK" \ + | tr '\n' '|')" + + # add current pwd if the option is set + [ "$_FASD_TRACK_PWD" = "1" -a "$PWD" != "$HOME" ] && paths="$paths|$PWD" + + [ -z "${paths##\|}" ] && return # stop if we have nothing to add + + # maintain the file + local tempfile + tempfile="$(mktemp "$_FASD_DATA".XXXXXX)" || return + $_FASD_AWK -v list="$paths" -v now="$(date +%s)" -v max="$_FASD_MAX" -F"|" ' + BEGIN { + split(list, files, "|") + for(i in files) { + path = files[i] + if(path == "") continue + paths[path] = path # array for checking + rank[path] = 1 + time[path] = now + } + } + $2 >= 1 { + if($1 in paths) { + rank[$1] = $2 + 1 / $2 + time[$1] = now + } else { + rank[$1] = $2 + time[$1] = $3 + } + count += $2 + } + END { + if(count > max) + for(i in rank) print i "|" 0.9*rank[i] "|" time[i] # aging + else + for(i in rank) print i "|" rank[i] "|" time[i] + }' "$_FASD_DATA" 2>> "$_FASD_SINK" >| "$tempfile" + if [ $? -ne 0 -a -f "$_FASD_DATA" ]; then + env rm -f "$tempfile" + else + env mv -f "$tempfile" "$_FASD_DATA" + fi + ;; + + --delete|-D) shift # delete entries + # stop if we don't own $_FASD_DATA or $_FASD_RO is set + [ -f "$_FASD_DATA" -a ! -O "$_FASD_DATA" ] || [ "$_FASD_RO" ] && return + + # turn valid arguments into entry-deleting sed commands + local sed_cmd="$(while [ "$1" ]; do printf %s\\n "$1"; shift; done | \ + sed '/^[^/]/s@^@'"$PWD"'/@;s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0 + s@[^/][^/]*//*\.\./@/@;t 0 + s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@ + s@^$@/@;s@\([.[\/*^$]\)@\\\1@g;s@^\(.*\)$@/^\1|/d@' 2>> "$_FASD_SINK")" + + # maintain the file + local tempfile + tempfile="$(mktemp "$_FASD_DATA".XXXXXX)" || return + + sed "$sed_cmd" "$_FASD_DATA" 2>> "$_FASD_SINK" >| "$tempfile" + + if [ $? -ne 0 -a -f "$_FASD_DATA" ]; then + env rm -f "$tempfile" + else + env mv -f "$tempfile" "$_FASD_DATA" + fi + ;; + + --query) shift # query the db, --query [$typ ["$fnd" [$mode]]] + [ -f "$_FASD_DATA" ] || return # no db yet + [ "$1" ] && local typ="$1" + [ "$2" ] && local fnd="$2" + [ "$3" ] && local mode="$3" + + # cat all backends + local each _fasd_data; for each in $_FASD_BACKENDS; do + _fasd_data="$_fasd_data +$(fasd --backend $each)" + done + [ "$_fasd_data" ] || _fasd_data="$(cat "$_FASD_DATA")" + + # set mode specific code for calculating the prior + case $mode in + rank) local prior='times[i]';; + recent) local prior='sqrt(100000/(1+t-la[i]))';; + *) local prior='times[i] * frecent(la[i])';; + esac + + if [ "$fnd" ]; then # dafault matching + local bre="$(printf %s\\n "$fnd" | sed 's/\([*\.\\\[]\)/\\\1/g + s@ @[^|]*@g;s/\$$/|/')" + bre='^[^|]*'"$bre"'[^|/]*|' + local _ret="$(printf %s\\n "$_fasd_data" | grep "$bre")" + [ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do + [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" + done)" + if [ "$_ret" ]; then + _fasd_data="$_ret" + else # no case mathcing + _ret="$(printf %s\\n "$_fasd_data" | grep -i "$bre")" + [ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do + [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" + done)" + if [ "$_ret" ]; then + _fasd_data="$_ret" + elif [ "${_FASD_FUZZY:-0}" -gt 0 ]; then # fuzzy matching + local fuzzy_bre="$(printf %s\\n "$fnd" | \ + sed 's/\([*\.\\\[]\)/\\\1/g;s/\$$/|/ + s@\(\\\{0,1\}[^ ]\)@\1[^|/]\\{0,'"$_FASD_FUZZY"'\\}@g + s@ @[^|]*@g')" + fuzzy_bre='^[^|]*'"$fuzzy_bre"'[^|/]*|' + _ret="$(printf %s\\n "$_fasd_data" | grep -i "$fuzzy_bre")" + [ "$_ret" ] && _ret="$(printf %s\\n "$_ret" | while read -r line; do + [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" + done)" + [ "$_ret" ] && _fasd_data="$_ret" || _fasd_data= + fi + fi + else # no query arugments + _fasd_data="$(printf %s\\n "$_fasd_data" | while read -r line; do + [ -${typ:-e} "${line%%\|*}" ] && printf %s\\n "$line" + done)" + fi + + # query the database + [ "$_fasd_data" ] && printf %s\\n "$_fasd_data" | \ + $_FASD_AWK -v t="$(date +%s)" -F"|" ' + function frecent(time) { + dx = t-time + if( dx < 3600 ) return 6 + if( dx < 86400 ) return 4 + if( dx < 604800 ) return 2 + return 1 + } + { + if(!paths[$1]) { + times[$1] = $2 + la[$1] = $3 + paths[$1] = 1 + } else { + times[$1] += $2 + if($3 > la[$1]) la[$1] = $3 + } + } + END { + for(i in paths) printf "%-10s %s\n", '"$prior"', i + }' - 2>> "$_FASD_SINK" + ;; + + --backend) + case $2 in + native) cat "$_FASD_DATA";; + viminfo) + < "$_FASD_VIMINFO" sed -n '/^>/{s@~@'"$HOME"'@ + s/^..// + p + }' | $_FASD_AWK -v t="$(date +%s)" '{ + t -= 60 + print $0 "|1|" t + }' + ;; + recently-used) + local nl="$(printf '\\\nX')"; nl="${nl%X}" # slash newline for sed + tr -d '\n' < "$_FASD_RECENTLY_USED_XBEL" | \ + sed 's@file:/@'"$nl"'@g;s@count="@'"$nl"'@g' | sed '1d;s/".*$//' | \ + tr '\n' '|' | sed 's@|/@'"$nl"'@g' | $_FASD_AWK -F'|' '{ + sum = 0 + for( i=2; i<=NF; i++ ) sum += $i + print $1 "|" sum + }' + ;; + *) eval "$2";; + esac + ;; + + *) # parsing logic and processing + local fnd= last= _FASD_BACKENDS="$_FASD_BACKENDS" _fasd_data= comp= exec= + while [ "$1" ]; do case $1 in + --complete) [ "$2" = "--" ] && shift; set -- $2; local lst=1 r=r comp=1;; + --query|--add|--delete|-A|-D) fasd "$@"; return $?;; + --version) [ -z "$comp" ] && echo "1.0.1" && return;; + --) while [ "$2" ]; do shift; fnd="$fnd $1"; last="$1"; done;; + -*) local o="${1#-}"; while [ "$o" ]; do case $o in + s*) local show=1;; + l*) local lst=1;; + i*) [ -z "$comp" ] && local interactive=1 show=1;; + r*) local mode=rank;; + t*) local mode=recent;; + e*) o="${o#?}"; if [ "$o" ]; then # there are characters after "-e" + local exec="$o" # anything after "-e" + else # use the next argument + local exec="${2:?"-e: Argument needed "}" + shift + fi; break;; + b*) o="${o#?}"; if [ "$o" ]; then + _FASD_BACKENDS="$o" + else + _FASD_BACKENDS="${2:?"-b: Argument needed"}" + shift + fi; break;; + B*) o="${o#?}"; if [ "$o" ]; then + _FASD_BACKENDS="$_FASD_BACKENDS $o" + else + _FASD_BACKENDS="$_FASD_BACKENDS ${2:?"-B: Argument needed"}" + shift + fi; break;; + a*) local typ=e;; + d*) local typ=d;; + f*) local typ=f;; + R*) local r=r;; + [0-9]*) local _fasd_i="$o"; break;; + h*) [ -z "$comp" ] && echo "fasd [options] [query ...] +[f|a|s|d|z] [opions] [query ...] + options: + -s list paths with scores + -l list paths without scores + -i interactive mode + -e set command to execute on the result file + -b only use backend + -B add additional backend + -a match files and directories + -d match directories only + -f match files only + -r match by rank only + -t match by recent access only + -R reverse listing order + -h show a brief help message + -[0-9] select the nth entry + +fasd [-A|-D] [paths ...] + -A add paths + -D delete paths" >&2 && return;; + esac; o="${o#?}"; done;; + *) fnd="$fnd $1"; last="$1";; + esac; shift; done + + # guess whether the last query is selected from tab completion + case $last in + /?*) if [ -z "$show$lst" -a -${typ:-e} "$last" -a "$exec" ]; then + $exec "$last" + return + fi;; + esac + + local R; [ -z "$r" ] && R=r || R= # let $R be the opposite of $r + fnd="${fnd# }" + + local res + res="$(fasd --query 2>> "$_FASD_SINK")" # query the database + [ $? -gt 0 ] && return + if [ 0 -lt ${_fasd_i:-0} ] 2>> "$_FASD_SINK"; then + res="$(printf %s\\n "$res" | sort -n${R} | \ + sed -n "$_fasd_i"'s/^[^ ]*[ ]*//p')" + elif [ "$interactive" ] || [ "$exec" -a -z "$fnd$lst$show" -a -t 1 ]; then + if [ "$(printf %s "$res" | sed -n '$=')" -gt 1 ]; then + res="$(printf %s\\n "$res" | sort -n${R})" + printf %s\\n "$res" | sed = | sed 'N;s/\n/ /' | sort -nr >&2 + printf "> " >&2 + local i; read i; [ 0 -lt "${i:-0}" ] 2>> "$_FASD_SINK" || return 1 + fi + res="$(printf %s\\n "$res" | sed -n "${i:-1}"'s/^[^ ]*[ ]*//p')" + elif [ "$lst" ]; then + [ "$res" ] && printf %s\\n "$res" | sort -n${r} | sed 's/^[^ ]*[ ]*//' + return + elif [ "$show" ]; then + [ "$res" ] && printf %s\\n "$res" | sort -n${r} + return + elif [ "$fnd" ] && [ "$exec" -o ! -t 1 ]; then # exec or subshell + res="$(printf %s\\n "$res" | sort -n | sed -n '$s/^[^ ]*[ ]*//p')" + else # no args, show + [ "$res" ] && printf %s\\n "$res" | sort -n${r} + return + fi + if [ "$res" ]; then + fasd --add "$res" + [ -z "$exec" ] && exec='printf %s\n' + $exec "$res" + fi + ;; + esac +} + +fasd --init env + +case $- in + *i*) ;; # assume being sourced, do nothing + *) # assume being executed as an executable + if [ -x "$_FASD_SHELL" -a -z "$_FASD_SET" ]; then + _FASD_SET=1 exec $_FASD_SHELL "$0" "$@" + else + fasd "$@" + fi;; +esac + From 3a02eaf46f0b0e48a4f24611ddea83db75206f28 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 7 May 2013 16:37:09 -0400 Subject: [PATCH 20/21] remove bad sparkup --- .gitmodules | 3 --- .vim/bundle/sparkup | 1 - 2 files changed, 4 deletions(-) delete mode 160000 .vim/bundle/sparkup diff --git a/.gitmodules b/.gitmodules index af8ec02..ebd6aa9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,9 +10,6 @@ [submodule ".vim/bundle/NrrwRgn"] path = .vim/bundle/NrrwRgn url = git://github.com/chrisbra/NrrwRgn.git -[submodule ".vim/bundle/sparkup"] - path = .vim/bundle/sparkup - url = git://github.com/rstacruz/sparkup.git [submodule ".vim/bundle/ack.vim"] path = .vim/bundle/ack.vim url = git://github.com/mileszs/ack.vim.git diff --git a/.vim/bundle/sparkup b/.vim/bundle/sparkup deleted file mode 160000 index 5041a10..0000000 --- a/.vim/bundle/sparkup +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5041a10515c98f69dd510b0486983eee1fa1697e From 9d71297561c7d14f52f726abdde2d12d99f452b6 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Tue, 7 May 2013 16:50:06 -0400 Subject: [PATCH 21/21] new sparkup --- .gitmodules | 3 +++ .vim/bundle/vim-sparkup | 1 + 2 files changed, 4 insertions(+) create mode 160000 .vim/bundle/vim-sparkup diff --git a/.gitmodules b/.gitmodules index ebd6aa9..d951888 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,6 @@ [submodule ".vim/bundle/YouCompleteMe"] path = .vim/bundle/YouCompleteMe url = https://github.com/Valloric/YouCompleteMe.git +[submodule ".vim/bundle/vim-sparkup"] + path = .vim/bundle/vim-sparkup + url = git://github.com/tristen/vim-sparkup.git diff --git a/.vim/bundle/vim-sparkup b/.vim/bundle/vim-sparkup new file mode 160000 index 0000000..b5e9269 --- /dev/null +++ b/.vim/bundle/vim-sparkup @@ -0,0 +1 @@ +Subproject commit b5e9269136ae8dc7d6fbd5ed8777cbcd8cc22fbf