From 2f23452e9d50e79400bdecb851983acac3d4801c Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 29 Dec 2015 23:06:00 -0500 Subject: [PATCH 01/17] Remap alt as win, default to show bar (ideal for one hand) --- i3/Xmodmap | 8 ++++++++ i3/config | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/i3/Xmodmap b/i3/Xmodmap index b275bf8..c896533 100644 --- a/i3/Xmodmap +++ b/i3/Xmodmap @@ -1,5 +1,13 @@ clear Lock keysym Caps_Lock = Escape +remove mod1 = Alt_R +clear mod4 +keycode 108 = Super_L +add mod4 = Super_L +remove mod1 = Alt_L +clear mod4 +keycode 64 = Super_L +add mod4 = Super_L keysym Escape = Caps_Lock add Lock = Caps_Lock keycode 248 = diff --git a/i3/config b/i3/config index 0eb2d78..0cbfa8b 100644 --- a/i3/config +++ b/i3/config @@ -4,6 +4,8 @@ assign [class=Firefox] 2 assign [class=midori4] 2 assign [class=Chromium-browser] 2 exec --no-startup-id "zsh -c 'xrandr --output LVDS1 --primary || xrandr --output HDMI3 --primary'" +bindsym $mod+apostrophe bar mode hide +bindsym $mod+shift+apostrophe bar mode dock bindsym $mod+shift+d exec i3-input -F 'rename workspace to "%s"' -P 'Rename to: ' bindsym $mod+semicolon exec quickswitch.py -d 'rofi -dmenu' #bindsym $mod+semicolon exec rofi -term urxvt -show window $() @@ -43,7 +45,7 @@ client.urgent $rd $rd $tx bar { status_command i3status --config ~/.i3/i3status.conf font -*-*-*-*-*-*-8-*-*-*-*-*-*-* - mode hide + mode dock #position top modifier Mod4 tray_output primary From 8a08e483f5e5f52752936c61d042b5bf04bc3abe Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 29 Dec 2015 23:51:16 -0500 Subject: [PATCH 02/17] Add pub-git-init --- shells/zshrc | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index c56c020..fbe7881 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -235,25 +235,32 @@ function rc(){ *) echo "Opts:\nz v i\nuse make unmask mask accept_keywords" esac } -function ncsu-git-init(){ - branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1 | sha512sum | cut -d\ -f1) - echo Branch will be: $branch - remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$branch" - echo -n "Add $remote? " - read a - git remote add ncsu $remote +function pub-git-init(){ + # Get the project name + branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1) + # Get the hashed project name + enc_branch=$("$branch" | sha512sum | cut -d\ -f1) + git remote add local "git@localhost:$branch" + git remote add ncsu "gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#$enc_branch" + git remote add gitlab "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$enc_branch" git config remote.ncsu.gcrypt-participants "CCDFE3F1" - echo -n "Push? " - read a - git push ncsu --all - git push ncsu --tags + git config remote.gitlab.gcrypt-participants "CCDFE3F1" } -function ncsu-git-clone(){ +function pub-git-clone(){ + case $1 in + ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;; + gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;; + #TODO: Fix enc_branch + local) remote="git@localhost:" ;; + *) echo "Opts: ncsu gitlab local" ; return 1 + esac + shift + if [ -z "$1" ] ; then + echo "No arg2" + return 2 + fi branch=$(echo $1 | sha512sum | cut -d\ -f1) - echo Branch will be: $branch - echo -n "Continue?" - read a - git clone "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$branch" $1 + git clone "$remote$branch" $1 } function k(){ #More than 1 arguement From f3af0da923d96375bbc584cdd1c438edb01153d9 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 31 Dec 2015 12:55:30 -0500 Subject: [PATCH 03/17] Added more pub-git commands --- shells/zshrc | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index fbe7881..55fce10 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -237,22 +237,44 @@ function rc(){ } function pub-git-init(){ # Get the project name - branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -e 's/^.\+\///' -e 's/\.git$//' | head -n1) + branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -r -e 's/^.+\///' -e 's/#.+$//' -e 's/\.git$//' | head -n1) + echo "Branch: $branch" # Get the hashed project name - enc_branch=$("$branch" | sha512sum | cut -d\ -f1) - git remote add local "git@localhost:$branch" + enc_branch=$(echo "$branch" | sha512sum | cut -d\ -f1) + git remote add local "gcrypt::git@localhost:stonewareslord/79a79b1a6e37813d9226872c6428aca29eec9f6111558109861cb0dcd2f0ffc8198deea4e361f84e170989212452fdfb21e0ef690da2ad399c03ce308d79dcfe#$enc_branch" git remote add ncsu "gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#$enc_branch" git remote add gitlab "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$enc_branch" git config remote.ncsu.gcrypt-participants "CCDFE3F1" git config remote.gitlab.gcrypt-participants "CCDFE3F1" } +function pub-git-rm(){ + if (( $# = 0 )) ; then + git remote rm local + git remote rm ncsu + git remote rm gitlab + fi + while (( $# > 0 )) ; do + git remote rm "$1" + shift + done +} +function pub-git-push(){ + if (( $# = 0 )) ; then + git push local --all && git push local --tags + git push ncsu --all && git push ncsu --tags + git push gitlab --all && git push gitlab --tags + fi + while (( $# > 0 )) ; do + git push "$1" --all && git push "$1" --tags + shift + done +} function pub-git-clone(){ case $1 in ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;; gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;; - #TODO: Fix enc_branch - local) remote="git@localhost:" ;; - *) echo "Opts: ncsu gitlab local" ; return 1 + local) remote="gcrypt::git@localhost:stonewareslord/79a79b1a6e37813d9226872c6428aca29eec9f6111558109861cb0dcd2f0ffc8198deea4e361f84e170989212452fdfb21e0ef690da2ad399c03ce308d79dcfe#" ;; + *) echo "Opts: local ncsu gitlab" ; return 1 esac shift if [ -z "$1" ] ; then @@ -332,3 +354,6 @@ echo -ne '[##### ]\r' antigen apply echo -ne '[######]\r' echo + +# OPAM configuration +. /home/stonewareslord/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true From 1943637373ab54bf99d3fe67eea430d7cd8511e8 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 31 Dec 2015 13:02:45 -0500 Subject: [PATCH 04/17] Small fix --- shells/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shells/zshrc b/shells/zshrc index 55fce10..b5c9225 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -259,7 +259,7 @@ function pub-git-rm(){ done } function pub-git-push(){ - if (( $# = 0 )) ; then + if (( $# == 0 )) ; then git push local --all && git push local --tags git push ncsu --all && git push ncsu --tags git push gitlab --all && git push gitlab --tags From 1e1998211c3dfb5e4416f693913551ee83c7cfda Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 3 Jan 2016 19:17:50 -0500 Subject: [PATCH 05/17] Minor fix, added pg --- shells/zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shells/zshrc b/shells/zshrc index b5c9225..0e3e090 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -23,6 +23,7 @@ function asroot(){ xauth extract $TEMPFILE $DISPLAY sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';" } +alias pg="pcregrep -M" alias mouse1="xmodmap <(echo pointer = 1 2 3)" alias mouse2="xmodmap <(echo pointer = 3 2 1)" alias where="readlink -e" @@ -248,7 +249,7 @@ function pub-git-init(){ git config remote.gitlab.gcrypt-participants "CCDFE3F1" } function pub-git-rm(){ - if (( $# = 0 )) ; then + if (( $# == 0 )) ; then git remote rm local git remote rm ncsu git remote rm gitlab From 33a75d4052ada9fa8c1e0601c7d225992b671519 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 6 Jan 2016 08:33:57 -0500 Subject: [PATCH 06/17] Alias eix to eix -F --- shells/zshrc | 1 + 1 file changed, 1 insertion(+) diff --git a/shells/zshrc b/shells/zshrc index 0e3e090..fd23902 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -24,6 +24,7 @@ function asroot(){ sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';" } alias pg="pcregrep -M" +alias eix="eix -F" alias mouse1="xmodmap <(echo pointer = 1 2 3)" alias mouse2="xmodmap <(echo pointer = 3 2 1)" alias where="readlink -e" From f88247207e8a02da9923b64f4a93a10e6c72f7fe Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 10 Jan 2016 03:25:01 -0500 Subject: [PATCH 07/17] Added touch .nobackup --- scripts/youcompleteme.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/youcompleteme.sh b/scripts/youcompleteme.sh index d2c7c7d..afe6682 100755 --- a/scripts/youcompleteme.sh +++ b/scripts/youcompleteme.sh @@ -5,6 +5,7 @@ echo -n "Press enter to continue..." read a mkdir ~/ycm_build cd ~/ycm_build +touch .nobackup cmake -G "Unix Makefiles" . ~/.vim/plugged/YouCompleteMe/third_party/ycmd/cpp make ycm_support_libs cd - From 062ef572572c866bfbd9984d3772bb1104e1574d Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 10 Jan 2016 03:47:41 -0500 Subject: [PATCH 08/17] Added borg.sh --- scripts/borg.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/borg.sh diff --git a/scripts/borg.sh b/scripts/borg.sh new file mode 100755 index 0000000..436a383 --- /dev/null +++ b/scripts/borg.sh @@ -0,0 +1,11 @@ +#!/bin/zsh +set -e +mkdir -p ~/applications +\cd ~/applications +virtualenv --python=python3 borg-env +pip install 'llfuse<0.41' +source borg-env/bin/activate +pip install borgbackup +mkdir -p ~/bin +ln -s $(readlink -e borg-env/bin/borg ~/bin/borg) +\cd - From 989b6b0aefd7db6acd5d5e2de667c4a46473246f Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 10 Jan 2016 03:55:04 -0500 Subject: [PATCH 09/17] Fixed small borg bug --- scripts/borg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/borg.sh b/scripts/borg.sh index 436a383..c61438b 100755 --- a/scripts/borg.sh +++ b/scripts/borg.sh @@ -7,5 +7,5 @@ pip install 'llfuse<0.41' source borg-env/bin/activate pip install borgbackup mkdir -p ~/bin -ln -s $(readlink -e borg-env/bin/borg ~/bin/borg) +ln -s $(readlink -e borg-env/bin/borg) ~/bin/borg \cd - From f120043821200372c146b68eeb59cd95fe4d33bd Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 10 Jan 2016 16:41:13 -0500 Subject: [PATCH 10/17] Changes --- shells/zshrc | 7 +++++++ vim/vimrc | 56 ++++++++++++++++++---------------------------------- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index fd23902..7f339b6 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -23,6 +23,13 @@ function asroot(){ xauth extract $TEMPFILE $DISPLAY sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';" } +function dedir(){ + mv "$1"/{.,}* . + rmdir "$1" +} +alias cpatch='diff -crB' +alias capatch='patch --dry-run -p1 -i' +alias apatch='patch -p1 -i' alias pg="pcregrep -M" alias eix="eix -F" alias mouse1="xmodmap <(echo pointer = 1 2 3)" diff --git a/vim/vimrc b/vim/vimrc index b48aeb5..0e50eb3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -19,13 +19,10 @@ filetype plugin on set grepprg=grep\ -nH\ $* let g:tex_flavor='latex' - "match Error /\s\+$/ "nnoremap s xa "nnoremap :UndotreeToggle "inoremap pumvisible() ? "\" : "\" -imap \ neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : pumvisible() ? "\" : "\" -smap \ neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : "\" nnoremap :CtrlPTag nnoremap \| vl nnoremap - sj @@ -197,7 +194,6 @@ let g:formatter_php = ['formatdef_my_custom_php'] "let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j" " These flags don't work for some reason " -xn -xc -xl -S -"let g:airline#extensions#tabline#enabled=1 let g:Powerline_symbols='fancy' let g:indent_guides_start_level=1 let g:indent_guides_guide_size=1 @@ -216,25 +212,24 @@ let g:neocomplete#enable_smart_case = 1 let g:neocomplete#sources#syntax#min_keyword_length = 2 let g:php_refactor_command='php /usr/local/bin/refactor.phar' let g:ctrlp_extensions=['funky'] -"inoremap neocomplcache#smart_close_popup()."\" -"function! g:UltiSnips_Complete() -" call UltiSnips#ExpandSnippet() -" if g:ulti_expand_res == 0 -" if pumvisible() -" return "\" -" else -" call UltiSnips#JumpForwards() -" if g:ulti_jump_forwards_res == 0 -" return "\" -" endif -" endif -" endif -" return "" -"endfunction -"au BufEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" -"let g:UltiSnipsJumpForwardTrigger="" -"let g:UltiSnipsListSnippets="" -"let g:UltiSnipsEditSplit="vertical" +function! g:UltiSnips_Complete() + call UltiSnips#ExpandSnippet() + if g:ulti_expand_res == 0 + if pumvisible() + return "\" + else + call UltiSnips#JumpForwards() + if g:ulti_jump_forwards_res == 0 + return "\" + endif + endif + endif + return "" +endfunction +au BufEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsListSnippets="" +let g:UltiSnipsEditSplit="vertical" inoremap pumvisible() ? "\" : "\u\" let loaded_matchit=1 filetype off @@ -243,10 +238,7 @@ if has("win32") else call plug#begin('~/.vim/plugged') endif -"Plug 'Floobits/floobits-vim' "Plug 'tsaleh/vim-matchit' -"Plug 'Shougo/neosnippet' -"Plug 'msanders/snipmate.vim' "Plug 'vim-scripts/YankRing.vim' Plug 'Chiel92/vim-autoformat' "Adds autoformat command | https://github.com/Chiel92/vim-autoformat @@ -274,8 +266,6 @@ Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " "Theme | https://github.com/altercation/vim-colors-solarized Plug 'stonewareslord/vim-colors' "Theme pack | https://github.com/spf13/vim-colors -"Plug 'spf13/PIV' -" "PHP tools | https://github.com/spf13/PIV "Plug 'vim-scripts/AutoTag' " "Generates taglist with ctags | https://github.com/vim-scripts/AutoTag Plug 'Lokaltog/vim-easymotion' @@ -292,22 +282,16 @@ Plug 'kien/ctrlp.vim' "Fuzzy file search | https://github.com/kien/ctrlp.vim Plug 'godlygeek/tabular' "Quickly make tables in vim | https://github.com/godlygeek/tabular -"Plug 'tpope/vim-abolish' -" "Better abbrivation | https://github.com/tpope/vim-abolish Plug 'godlygeek/csapprox' "256 color vim in terminal | https://github.com/godlygeek/csapprox -"Plug 'sirver/UltiSnips' +Plug 'sirver/UltiSnips' " "Adds snippets | https://github.com/sirver/UltiSnips Plug 'honza/vim-snippets' "More snippets | https://github.com/honza/vim-snippets Plug 'othree/eregex.vim' "Real regexes in vim | https://github.com/othree/eregex.vim -"Plug 'vim-scripts/sessionman.vim' -" "Session manager | https://github.com/vim-scripts/sessionman.vim Plug 'mattn/flappyvird-vim' "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim -"Plug 'morhetz/gruvbox' -" "Colorscheme | https://github.com/morhetz/gruvbox Plug 'superbrothers/vim-vimperator' "Vimperator for vim | https://github.com/superbrothers/vim-vimperator Plug 'Rykka/colorv.vim' @@ -344,8 +328,6 @@ Plug 'https://github.com/xolox/vim-easytags' "Vim tags | https://github.com/xolox/vim-easytags Plug 'https://github.com/xolox/vim-misc' "Misc (required for easytags) | https://github.com/xolox/vim-misc -Plug 'https://github.com/lervag/vimtex' - " | https://github.com/lervag/vimtex Plug 'https://github.com/habamax/vim-skipit' " | https://github.com/habamax/vim-skipit call plug#end() From 43fb5a4c75b25675e69acd2a618f2155acedddcd Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 14 Jan 2016 15:26:37 -0500 Subject: [PATCH 11/17] Added vim lines --- vim/vimrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 0e50eb3..ef6d6d4 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -3,16 +3,13 @@ if has('conceal') set conceallevel=2 concealcursor=i endif nnoremap autoformat! :%s/, /,:%s/ \/ /\/:%s/ {/{:%s/} /}:%s/ = /= +let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s3 -xG -S -K -N -xn -xl -n -p -H"' +let g:formatters_java = ['my_custom_java'] command! WW %!sudo tee > /dev/null % "TODO: Fix this "let g:rbpt_loadcmd_toggle = 1 -"autocmd BufRead,BufNewFile * RainbowParenthesesActivate -""autocmd BufRead,BufNewFile * RainbowParenthesesToggle -""autocmd BufRead,BufNewFile * RainbowParenthesesLoadBraces -"autocmd BufRead,BufNewFile * RainbowParenthesesLoadRound -"autocmd BufRead,BufNewFile * RainbowParenthesesLoadSquare -"autocmd BufRead,BufNewFile * RainbowParenthesesLoadChevrons let g:indent_guides_auto_colors = 0 +autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey filetype plugin on @@ -314,6 +311,7 @@ Plug 'https://github.com/fatih/vim-go' "go syntax | https://github.com/fatih/vim-go "Plug 'https://github.com/kien/rainbow_parentheses.vim' " "Colored parenthesis | https://github.com/kien/rainbow_parentheses.vim +" " Removed because they did not function when changing buffers Plug 'https://github.com/jiangmiao/auto-pairs' "Automatic pairs | https://github.com/jiangmiao/auto-pairs Plug 'https://github.com/Valloric/YouCompleteMe' @@ -330,6 +328,8 @@ Plug 'https://github.com/xolox/vim-misc' "Misc (required for easytags) | https://github.com/xolox/vim-misc Plug 'https://github.com/habamax/vim-skipit' " | https://github.com/habamax/vim-skipit +Plug 'gaw:stonewareslord/vim-java-getset.git' + " | gogs@austenwares.com:stonewareslord/vim-java-getset.git call plug#end() filetype plugin indent on if exists("+undofile") From 1195218f1d229b4c4edb6268f0d305fbdf615e8d Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 21 Jan 2016 12:19:51 -0500 Subject: [PATCH 12/17] Major vimrc changes --- vim/vimrc | 525 +++++++++++++++++++++++++++--------------------------- 1 file changed, 261 insertions(+), 264 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index ef6d6d4..2b35e0e 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,9 +2,9 @@ if has('conceal') set conceallevel=2 concealcursor=i endif -nnoremap autoformat! :%s/, /,:%s/ \/ /\/:%s/ {/{:%s/} /}:%s/ = /= let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s3 -xG -S -K -N -xn -xl -n -p -H"' let g:formatters_java = ['my_custom_java'] +let g:UltiSnipsUsePythonVersion=3 command! WW %!sudo tee > /dev/null % "TODO: Fix this "let g:rbpt_loadcmd_toggle = 1 @@ -17,158 +17,166 @@ set grepprg=grep\ -nH\ $* let g:tex_flavor='latex' "match Error /\s\+$/ -"nnoremap s xa -"nnoremap :UndotreeToggle -"inoremap pumvisible() ? "\" : "\" -nnoremap :CtrlPTag -nnoremap \| vl -nnoremap - sj -nnoremap q -nnoremap G G$ -vnoremap G G$ -nnoremap :GundoToggle -nnoremap + -nnoremap - -nnoremap Q -nnoremap -nnoremap a :!git st:!ls:!git a -nnoremap up :!git pull origin -nnoremap st :!git st -nnoremap ci :!git st:!git ci "" -nnoremap log :!git hist -nnoremap br :!git br -nnoremap gb :ls:b -nnoremap d :bd -nnoremap q :q -nnoremap W :%s/\s\+$//:let @/='' -nnoremap o m`o`` -nnoremap O m`O`` -nnoremap go %m`%x`` -nnoremap if m"Oif(){jo}`"v>k^wa -nnoremap else m"kAelse{jo}`"v> -nnoremap for m"Ofor(){jo}`"v>k^wa -nnoremap while m"Owhile(){jo}`"v>k^wa -nnoremap rm m"kddjddkv<`" -nnoremap # O#{{{jo#}}}kk^a -vnoremap # ``>o#}}}`{ O//{{{jo//}}}kk^la -vnoremap { ``>o//}}}`if ``>o}gv>`else ``>o}gv> -vnoremap for ``>o}gv>`while ``>o}gv>`rm `<kdd`>jddgv< -vnoremap * :call VisualSelection('f') -vnoremap # :call VisualSelection('b') -"nnoremap zo:set hlsearch! hlsearch? -"nnoremap :nohlsearchgzo -nnoremap :nohlsearchgzo -nnoremap U -nnoremap K ik$ -nnoremap :up:silent! call sy#start() -vnoremap gj j -vnoremap gk k -vnoremap j gj -vnoremap k gk -vnoremap H ^ -vnoremap L $h -vnoremap ; : -nnoremap gj j -nnoremap gk k -nnoremap j gj -nnoremap k gk -nnoremap H ^ -nnoremap L $ -nnoremap h -nnoremap j -nnoremap k -nnoremap l -map , (easymotion-prefix) -nnoremap ! :! -"nnoremap ; m"A;`" -vnoremap < >gv -nnoremap -inoremap -vnoremap -nnoremap ** yyPv$r*jyypv$r* -nnoremap = yypv$r= -nnoremap - yypv$r- -nnoremap ^ yypv$r^ -nnoremap " yypv$r" -"inoremap ;; m`A;``a -"inoremap ;; A;o -"nnoremap ;; m"A;`" -"nnoremap ;; A;o -nnoremap Y y$ -nnoremap w -nnoremap W -nnoremap :bp -nnoremap :bn -nnoremap z _\| -"nnoremap bun G?Plug yyjp$hdi'"+gP0Wl3d/\/xjyyP$"+gp:nohlsearch:up:PluginInstall -nnoremap bun G?Plug yyjp$hdi'"+gPo " \| "+gp:nohlsearch:up:PlugInstall -nnoremap :CtrlPFunky -nnoremap :set invpaste -"nnoremap [e -"nnoremap ]e -"vnoremap [egv -"vnoremap ]egv -nnoremap / /\v -vnoremap / /\v -inoremap jk A -inoremap kj A -set tags=./tags;/ -set wildmode=longest,list,full -set gfn=Monospace\ 8 -set guioptions= -set guicursor+=n-v-c:blinkon0 -set ttimeout -set ttimeoutlen=0 -set notimeout -set formatoptions-=r -set formatoptions-=o -set diffopt+=iwhite -set noesckeys -set mouse-=a -set shiftwidth=2 -set tabstop=2 -set modeline -set softtabstop=2 -set expandtab -set history=1000 -set hidden -set cursorline -set incsearch -set showmatch -set hlsearch -set scrolloff=3 -set scrolljump=5 -set autoindent -set backup -set backupdir=~/.vim/backup -set directory=~/.vim/tmp -set undolevels=1000 -set history=500 -set ttyfast -set fileformat=unix -set encoding=utf-8 -set laststatus=2 -set foldmethod=indent -set foldnestmax=10 -set foldlevel=2 -set relativenumber -set number -set ts=2 sw=2 et -set background=dark -set t_Co=256 -set gdefault -set nocompatible -"set rtp+=~/.vim/bundle/vundle/ -set ignorecase -set textwidth=0 -syntax on -"let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '<':'>', '%':'%'} +" Basic, very important mappings { + " Movement { + "Vertical + nnoremap gj j + nnoremap gk k + nnoremap j gj + nnoremap k gk + vnoremap gj j + vnoremap gk k + vnoremap j gj + vnoremap k gk + "Horizontal + nnoremap Y y$ + nnoremap H ^ + nnoremap L $ + vnoremap L $h + vnoremap H ^ + "Move to end of line + inoremap jk A + inoremap kj A + "Move to last character of last line + nnoremap G G$ + vnoremap G G$ + " } + " Buffers { + "Control-key movement + nnoremap h + nnoremap j + nnoremap k + nnoremap l + "Arrow keys + nnoremap w + nnoremap W + nnoremap :bp + nnoremap :bn + "Vertical and horizontal split + nnoremap \| vl + nnoremap - sj + "Close buffer + nnoremap q + "Fullscreen buffer + nnoremap z _\| + "Go to last buffer + nnoremap + " } + " Misc { + vnoremap * :call VisualSelection('f') + vnoremap # :call VisualSelection('b') + vnoremap ; : + nnoremap ! :! + vnoremap < >gv + "Disable F1 + nnoremap + inoremap + vnoremap + "F2 toggle paste + nnoremap :set invpaste + "Better searching + nnoremap / /\v + vnoremap / /\v + "Addition and subtraction + nnoremap + + nnoremap - + "Backspace remove highlights + nnoremap :nohlsearchgzo + "Better save + nnoremap :up:silent! call sy#start() + "Unmap Q + nnoremap Q + " } +" } +" Plugin mappings { + "Easymotion + map , (easymotion-prefix) + "Ctrl-p + nnoremap :CtrlPFunky + "Gundo + nnoremap :GundoToggle + "Easytags + "nnoremap :CtrlPTag + "Tagbar + nnoremap :Tagbar + "Add a bundle from clipboard + nnoremap bun G?Plug yyjp$hdi'"+gPo " \| "+gp:nohlsearch:up:PlugInstall + "Automatic if/else/for/while wrappers + nnoremap if m"Oif(){jo}`"v>k^wa + nnoremap else m"kAelse{jo}`"v> + nnoremap for m"Ofor(){jo}`"v>k^wa + nnoremap while m"Owhile(){jo}`"v>k^wa + nnoremap rm m"kddjddkv<`" + vnoremap if ``>o}gv>`else ``>o}gv> + vnoremap for ``>o}gv>`while ``>o}gv>`rm `<kdd`>jddgv< +" } +" Trial mappings { + nnoremap o m`o`` + nnoremap O m`O`` +" } + + +" Gui options { + set gfn=Monospace\ 8 + set guioptions= + set guicursor+=n-v-c:blinkon0 + set mouse-=a +" } +" Annoyance fixes { + "Annoying escape timeouts + set ttimeout + set ttimeoutlen=0 + set notimeout +" } +" Misc { + set tabstop=2 shiftwidth=2 expandtab + set tags=./tags;/ + set wildmode=longest,list,full + set formatoptions-=r + set formatoptions-=o + set diffopt+=iwhite + set noesckeys + set shiftwidth=2 + set tabstop=2 + set modeline + set softtabstop=2 + set expandtab + set history=1000 + set hidden + set cursorline + set incsearch + set showmatch + set hlsearch + set scrolloff=3 + set scrolljump=5 + set autoindent + set backup + set backupdir=~/.vim/backup + set directory=~/.vim/tmp + set undolevels=1000 + set history=500 + set ttyfast + set fileformat=unix + set encoding=utf-8 + set laststatus=2 + set foldmethod=indent + set foldnestmax=10 + set foldlevel=2 + set relativenumber + set number + set background=dark + set t_Co=256 + set gdefault + set nocompatible + set ignorecase + set textwidth=0 + syntax on +" } + let g:signify_vcs_list = [ 'git', 'svn' ] let g:signify_difftool = 'diff' let g:ctrlp_root_markers = ['.cproot'] @@ -195,22 +203,11 @@ let g:Powerline_symbols='fancy' let g:indent_guides_start_level=1 let g:indent_guides_guide_size=1 let g:indent_guides_enable_on_vim_startup=1 -"let g:neocomplcache_enable_at_startup=1 -"let g:neocomplcache_enable_camel_case_completion=1 -"let g:neocomplcache_enable_smart_case=1 -"let g:neocomplcache_enable_underbar_completion=1 -"let g:neocomplcache_enable_auto_delimiter=1 -"let g:neocomplcache_max_list=20 -"let g:neocomplcache_force_overwrite_completefunc=1 -"let g:neocomplcache_min_syntax_length=2 -"let g:neocomplcache_enable_auto_select=1 -let g:neocomplete#enable_at_startup = 1 -let g:neocomplete#enable_smart_case = 1 -let g:neocomplete#sources#syntax#min_keyword_length = 2 let g:php_refactor_command='php /usr/local/bin/refactor.phar' let g:ctrlp_extensions=['funky'] function! g:UltiSnips_Complete() call UltiSnips#ExpandSnippet() + echo "Test" if g:ulti_expand_res == 0 if pumvisible() return "\" @@ -223,10 +220,13 @@ function! g:UltiSnips_Complete() endif return "" endfunction -au BufEnter * exec "inoremap " . g:UltiSnipsExpandTrigger . " =g:UltiSnips_Complete()" -let g:UltiSnipsJumpForwardTrigger="" -let g:UltiSnipsListSnippets="" +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsListSnippets="" let g:UltiSnipsEditSplit="vertical" +let g:ycm_key_list_select_completion = [] inoremap pumvisible() ? "\" : "\u\" let loaded_matchit=1 filetype off @@ -235,101 +235,98 @@ if has("win32") else call plug#begin('~/.vim/plugged') endif -"Plug 'tsaleh/vim-matchit' -"Plug 'vim-scripts/YankRing.vim' -Plug 'Chiel92/vim-autoformat' - "Adds autoformat command | https://github.com/Chiel92/vim-autoformat -Plug 'tpope/vim-surround' - "Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround -Plug 'scrooloose/syntastic' - "Syntax checker | https://github.com/scrooloose/syntastic -Plug 'nathanaelkane/vim-indent-guides' - "Indentation guides | https://github.com/nathanaelkane/vim-indent-guides -Plug 'elzr/vim-json' - "JSON highlighting | https://github.com/elzr/vim-json -Plug 'groenewege/vim-less' - "LESS highlighting | https://github.com/groenewege/vim-less -Plug 'pangloss/vim-javascript' - "JS syntax and indentation | https://github.com/pangloss/vim-javascript -"Plug 'Lokaltog/powerline-fonts' -" "Better powerline fonts | https://github.com/Lokaltog/powerline-fonts -Plug 'bling/vim-airline' - "Bottom status bar | https://github.com/bling/vim-airline -Plug 'terryma/vim-multiple-cursors' - "Multicursor functionality like Coda | https://github.com/terryma/vim-multiple-cursors -Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } - "File browser | https://github.com/scrooloose/nerdtree -"Plug 'altercation/vim-colors-solarized' -" "Theme | https://github.com/altercation/vim-colors-solarized -Plug 'stonewareslord/vim-colors' - "Theme pack | https://github.com/spf13/vim-colors -"Plug 'vim-scripts/AutoTag' -" "Generates taglist with ctags | https://github.com/vim-scripts/AutoTag -Plug 'Lokaltog/vim-easymotion' - "Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion -Plug 'sjl/gundo.vim' - "Visual undo | https://github.com/sjl/gundo.vim -Plug 'tommcdo/vim-exchange' - "Exchange two selections of text | https://github.com/tommcdo/vim-exchange -Plug 'tpope/vim-repeat' - "Repeat last tpope command with . | https://github.com/tpope/vim-repeat -Plug 'tpope/vim-fugitive' - "Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive -Plug 'kien/ctrlp.vim' - "Fuzzy file search | https://github.com/kien/ctrlp.vim -Plug 'godlygeek/tabular' - "Quickly make tables in vim | https://github.com/godlygeek/tabular -Plug 'godlygeek/csapprox' - "256 color vim in terminal | https://github.com/godlygeek/csapprox -Plug 'sirver/UltiSnips' -" "Adds snippets | https://github.com/sirver/UltiSnips -Plug 'honza/vim-snippets' - "More snippets | https://github.com/honza/vim-snippets -Plug 'othree/eregex.vim' - "Real regexes in vim | https://github.com/othree/eregex.vim -Plug 'mattn/flappyvird-vim' - "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim -Plug 'superbrothers/vim-vimperator' - "Vimperator for vim | https://github.com/superbrothers/vim-vimperator -Plug 'Rykka/colorv.vim' - "Color selection in vim | https://github.com/Rykka/colorv.vim -Plug 'mhinz/vim-signify' - "Git information inline | https://github.com/mhinz/vim-signify -Plug 'jamessan/vim-gnupg' - "GPG support | https://github.com/jamessan/vim-gnupg -Plug 'stonewareslord/zeavim.vim' - "Zeal support | https://github.com/stonewareslord/zeavim.vim -Plug 'vim-scripts/DirDiff.vim' - "Directory diff | https://github.com/vim-scripts/DirDiff.vim -Plug 'vim-scripts/DoxygenToolkit.vim' - "Doxygen | https://github.com/vim-scripts/DoxygenToolkit.vim -Plug 'vim-scripts/SyntaxRange' - "Range of syntaxes | https://github.com/vim-scripts/SyntaxRange -Plug 'PotatoesMaster/i3-vim-syntax' - "i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax -Plug 'https://github.com/fatih/vim-go' - "go syntax | https://github.com/fatih/vim-go -"Plug 'https://github.com/kien/rainbow_parentheses.vim' -" "Colored parenthesis | https://github.com/kien/rainbow_parentheses.vim -" " Removed because they did not function when changing buffers -Plug 'https://github.com/jiangmiao/auto-pairs' - "Automatic pairs | https://github.com/jiangmiao/auto-pairs -Plug 'https://github.com/Valloric/YouCompleteMe' -" "Autocompletion | https://github.com/Valloric/YouCompleteMe -Plug 'https://github.com/evidens/vim-twig' - "Twig highlighting | https://github.com/evidens/vim-twig -Plug 'https://github.com/joonty/vdebug' - "Php debugging | https://github.com/joonty/vdebug -Plug 'https://github.com/zenbro/mirror.vim' - "Edit files remotely | https://github.com/zenbro/mirror.vim -Plug 'https://github.com/xolox/vim-easytags' - "Vim tags | https://github.com/xolox/vim-easytags -Plug 'https://github.com/xolox/vim-misc' - "Misc (required for easytags) | https://github.com/xolox/vim-misc -Plug 'https://github.com/habamax/vim-skipit' - " | https://github.com/habamax/vim-skipit -Plug 'gaw:stonewareslord/vim-java-getset.git' - " | gogs@austenwares.com:stonewareslord/vim-java-getset.git +" Code writing { + Plug 'Chiel92/vim-autoformat' + "Adds autoformat command | https://github.com/Chiel92/vim-autoformat + Plug 'tpope/vim-surround' + "Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround + Plug 'scrooloose/syntastic' + "Syntax checker | https://github.com/scrooloose/syntastic + Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } + "File browser | https://github.com/scrooloose/nerdtree + Plug 'Lokaltog/vim-easymotion' + "Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion + Plug 'sjl/gundo.vim', { 'on': 'GundoToggle' } + "Visual undo | https://github.com/sjl/gundo.vim + Plug 'tommcdo/vim-exchange' + "Exchange two selections of text | https://github.com/tommcdo/vim-exchange + Plug 'tpope/vim-repeat' + "Repeat last tpope command with . | https://github.com/tpope/vim-repeat + Plug 'tpope/vim-fugitive' + "Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive + Plug 'kien/ctrlp.vim' + "Fuzzy file search | https://github.com/kien/ctrlp.vim + Plug 'godlygeek/tabular' + "Quickly make tables in vim | https://github.com/godlygeek/tabular + Plug 'sirver/UltiSnips' + " "Adds snippets | https://github.com/sirver/UltiSnips + Plug 'honza/vim-snippets' + "More snippets | https://github.com/honza/vim-snippets + Plug 'othree/eregex.vim' + "Real regexes in vim | https://github.com/othree/eregex.vim + Plug 'Rykka/colorv.vim' + "Color selection in vim | https://github.com/Rykka/colorv.vim + Plug 'vim-scripts/DoxygenToolkit.vim' + "Doxygen | https://github.com/vim-scripts/DoxygenToolkit.vim + Plug 'mhinz/vim-signify' + "Git information inline | https://github.com/mhinz/vim-signify + Plug 'https://github.com/jiangmiao/auto-pairs' + "Automatic pairs | https://github.com/jiangmiao/auto-pairs + Plug 'https://github.com/Valloric/YouCompleteMe' + " "Autocompletion | https://github.com/Valloric/YouCompleteMe + Plug 'https://github.com/joonty/vdebug' + "Php debugging | https://github.com/joonty/vdebug + Plug 'https://github.com/zenbro/mirror.vim' + "Edit files remotely | https://github.com/zenbro/mirror.vim + Plug 'https://github.com/xolox/vim-easytags' + "Vim tags | https://github.com/xolox/vim-easytags + Plug 'https://github.com/xolox/vim-misc' + "Misc (required for easytags) | https://github.com/xolox/vim-misc + Plug 'gaw:stonewareslord/vim-java-getset.git' + "Java getters and setters| gogs@austenwares.com:stonewareslord/vim-java-getset.git + Plug 'https://github.com/majutsushi/tagbar' + " | https://github.com/majutsushi/tagbar + " } +" Style { + Plug 'nathanaelkane/vim-indent-guides' + "Indentation guides | https://github.com/nathanaelkane/vim-indent-guides + Plug 'bling/vim-airline' + "Bottom status bar | https://github.com/bling/vim-airline + Plug 'stonewareslord/vim-colors' + "Theme pack | https://github.com/spf13/vim-colors + Plug 'godlygeek/csapprox' + "256 color vim in terminal | https://github.com/godlygeek/csapprox + " } +" Syntax { + Plug 'elzr/vim-json' + "JSON highlighting | https://github.com/elzr/vim-json + Plug 'groenewege/vim-less' + "LESS highlighting | https://github.com/groenewege/vim-less + Plug 'pangloss/vim-javascript' + "JS syntax and indentation | https://github.com/pangloss/vim-javascript + Plug 'superbrothers/vim-vimperator' + "Vimperator for vim | https://github.com/superbrothers/vim-vimperator + Plug 'PotatoesMaster/i3-vim-syntax' + "i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax + Plug 'https://github.com/fatih/vim-go' + "go syntax | https://github.com/fatih/vim-go + Plug 'https://github.com/evidens/vim-twig' + "Twig highlighting | https://github.com/evidens/vim-twig + " } +" Misc { + Plug 'mattn/flappyvird-vim' + "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim + Plug 'jamessan/vim-gnupg' + "GPG support | https://github.com/jamessan/vim-gnupg +" } +" Unused { + "Plug 'vim-scripts/DirDiff.vim' + "Directory diff | https://github.com/vim-scripts/DirDiff.vim + "Plug 'https://github.com/kien/rainbow_parentheses.vim' + " "Colored parenthesis | https://github.com/kien/rainbow_parentheses.vim + "Plug 'vim-scripts/SyntaxRange' + "Range of syntaxes | https://github.com/vim-scripts/SyntaxRange +" } call plug#end() filetype plugin indent on if exists("+undofile") @@ -362,7 +359,6 @@ else "colorscheme torte endif silent! colorscheme fruity -nnoremap W :%s/\s\+$//:let @/='' function! Initialize() if has("win32") if empty(glob("~/_vim/autoload/plug.vim")) @@ -401,3 +397,4 @@ endfunction \ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*' \ ] set guifont=Fixed\ Medium\ Semi-Condensed\ 10 +inoremap =g:UltiSnips_Complete() From 8014583743e2fca44dff932d84f5a1c55cefdb21 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 21 Jan 2016 12:20:18 -0500 Subject: [PATCH 13/17] offline update --- shells/zshrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index 7f339b6..1674c3d 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -159,8 +159,11 @@ function ctar(){ #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest } function offline(){ - echo unshare -n -- sh -c "sudo -u stonewareslord zsh -c '$@'" - sudo unshare -n -- sh -c "sudo -u stonewareslord zsh -c '$@'" + if [ ! -z "$@" ] ; then + sudo unshare -n -- sudo -u stonewareslord zsh -c "$@" + else + sudo unshare -n -- sudo -u stonewareslord zsh + fi } function smon(){ timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 "$@" From e2b86551f648120a088ed517ba95dc28c047f0a7 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 22 Jan 2016 02:47:34 -0500 Subject: [PATCH 14/17] Changes --- shells/zshrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/shells/zshrc b/shells/zshrc index 1674c3d..e7a4e0d 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -23,8 +23,18 @@ function asroot(){ xauth extract $TEMPFILE $DISPLAY sudo zsh -c "xauth merge $TEMPFILE;(srm $TEMPFILE||rm $TEMPFILE)&'$@';" } +dsl() { + while (( $# > 0 )); do + readlink $1 2>&1 >/dev/null && mv $(readlink $1) $1 + shift + done +} function dedir(){ - mv "$1"/{.,}* . + mv "$1"/* . + rmdir "$1" + if (( !? != 0 )); then + mv "$1"/.* . + fi rmdir "$1" } alias cpatch='diff -crB' From 077280138468d75fb3575429bca189ca0e682de1 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 22 Jan 2016 13:47:57 -0500 Subject: [PATCH 15/17] Better offline --- shells/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shells/zshrc b/shells/zshrc index e7a4e0d..3575d29 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -172,7 +172,7 @@ function offline(){ if [ ! -z "$@" ] ; then sudo unshare -n -- sudo -u stonewareslord zsh -c "$@" else - sudo unshare -n -- sudo -u stonewareslord zsh + sudo unshare -n -- sudo -u stonewareslord LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh fi } function smon(){ From 547bd1ca9e6094de77a79be09fc7ab3acf72d8f9 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Tue, 26 Jan 2016 13:47:55 -0500 Subject: [PATCH 16/17] Made changes --- shells/zshrc | 46 +++++++++++++++++++++++++--------------------- vim/vimrc | 5 +++++ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index 3575d29..f0240be 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -17,7 +17,11 @@ fi export DISABLE_AUTO_TITLE=true export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$(readlink -e ~/bin)" export EDITOR='vim' -function asroot(){ +# For pasting in commands that start with $ +$ () { + $* +} +asroot(){ # Use temporary file for added security TEMPFILE=$(tempfile) xauth extract $TEMPFILE $DISPLAY @@ -29,7 +33,7 @@ dsl() { shift done } -function dedir(){ +dedir(){ mv "$1"/* . rmdir "$1" if (( !? != 0 )); then @@ -56,7 +60,7 @@ alias ll='ls -AlhF' alias la='ls -A' alias l='ls -CF' alias logout='sudo pkill -u $USER' -function rsh(){ +rsh(){ if [ -z $1 ] ; then echo "Valid hostnames:" cat /home/stonewareslord/syncthing/shared/ips @@ -71,7 +75,7 @@ function rsh(){ echo "SSH to $ADDR..." tsh $ADDR $* } -function fixsh(){ +fixsh(){ sed -i -e $1"d" ~/.ssh/known_hosts } alias tmux='tmux -2' @@ -79,8 +83,8 @@ alias less='less -R' alias tree='tree -C' alias skim="(head -5; tail -5) <" alias cp='rsync --partial -ha --info=progress2 "$@"' -function mv() { /bin/mv -v "$@" } -function m() { mv "$@" } +mv() { /bin/mv -v "$@" } +m() { mv "$@" } compdef _cp c m mv cp copy alias dt='date "+%F %T"' alias awake='disphost; while true; do xdotool mousemove 0 0; sleep 60; done' @@ -104,7 +108,7 @@ if test -f /etc/gentoo-release; then echo "args: $*" sudo zsh -c "emerge --autounmask-write -av $*" } - function update(){ + update(){ # If this is a server computer if [ "$(hostname|cut -b1)" = "S" ] ; then echo "You're a server. Exiting" @@ -163,22 +167,22 @@ alias -g L="2>&1|less" #alias -g L="2>&1|vimpager" alias -g G='|& ag' export FZF_COMPLETION_OPTS='--no-mouse -m -1 -x' -function ctar(){ +ctar(){ tar -cf - $@|pv -WcN tar|gzip|pv -WcN gzip #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest #tar -cf - $@|pv -WcN tar -s $(echo $(du -sb $@|awk '{print $1}'|tr '\n' '+')0|bc)|gzip|pv -WcN dest } -function offline(){ +offline(){ if [ ! -z "$@" ] ; then sudo unshare -n -- sudo -u stonewareslord zsh -c "$@" else sudo unshare -n -- sudo -u stonewareslord LP_MARK_PREFIX=" $(tput setaf 1)(offline)$(tput sgr0) " zsh fi } -function smon(){ +smon(){ timeout 1s pdsh -R ssh -w 10.0.1.196,10.0.1.207 "$@" } -function dnstest(){ +dnstest(){ echo "resolv.conf:" cat /etc/resolv.conf echo "Testing DNS:" @@ -191,7 +195,7 @@ function dnstest(){ echo "Testing DNS" curl ifconfig.me } -function cinitify(){ +cinitify(){ mkdir $2 cd $2 git init @@ -216,7 +220,7 @@ function cinitify(){ git checkout master fi } -function initify(){ +initify(){ git init git remote add origin git@austenwares.com:$1/$2.git git remote add https https://austenwares.com/gitlab/$1/$2.git @@ -232,7 +236,7 @@ function initify(){ git checkout master fi } -function tsh(){ +tsh(){ ssh $* -X if which ponysay >/dev/null; then ponysay "Connection closed!" @@ -240,11 +244,11 @@ function tsh(){ echo "\n\n\n\n\n\n\n\n\n\nSESSION CLOSED\n\n\n\n\n\n\n\n\n\n" fi } -function mcl(){ +mcl(){ mkdir -p $1 cd $1 } -function rc(){ +rc(){ case $1 in z) vim ~/.zshrc;; v) vim ~/.vimrc;; @@ -257,7 +261,7 @@ function rc(){ *) echo "Opts:\nz v i\nuse make unmask mask accept_keywords" esac } -function pub-git-init(){ +pub-git-init(){ # Get the project name branch=$(git remote -v | ag '^origin\s+' | sed -e 's/^origin\s*//' | cut -d\ -f1 | sed -r -e 's/^.+\///' -e 's/#.+$//' -e 's/\.git$//' | head -n1) echo "Branch: $branch" @@ -269,7 +273,7 @@ function pub-git-init(){ git config remote.ncsu.gcrypt-participants "CCDFE3F1" git config remote.gitlab.gcrypt-participants "CCDFE3F1" } -function pub-git-rm(){ +pub-git-rm(){ if (( $# == 0 )) ; then git remote rm local git remote rm ncsu @@ -280,7 +284,7 @@ function pub-git-rm(){ shift done } -function pub-git-push(){ +pub-git-push(){ if (( $# == 0 )) ; then git push local --all && git push local --tags git push ncsu --all && git push ncsu --tags @@ -291,7 +295,7 @@ function pub-git-push(){ shift done } -function pub-git-clone(){ +pub-git-clone(){ case $1 in ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;; gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;; @@ -306,7 +310,7 @@ function pub-git-clone(){ branch=$(echo $1 | sha512sum | cut -d\ -f1) git clone "$remote$branch" $1 } -function k(){ +k(){ #More than 1 arguement if [[ $# > 1 ]] ; then vim $@ diff --git a/vim/vimrc b/vim/vimrc index 2b35e0e..1947eb1 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,6 +2,8 @@ if has('conceal') set conceallevel=2 concealcursor=i endif +let g:formatdef_my_custom_cpp = '"astyle --mode=cpp -xc --style=google -j -s2 -xG -S -K -N -xn -xl -n -p -H"' +let g:formatters_cpp = ['my_custom_cpp'] let g:formatdef_my_custom_java = '"astyle --mode=java -xc --style=google -j -s3 -xG -S -K -N -xn -xl -n -p -H"' let g:formatters_java = ['my_custom_java'] let g:UltiSnipsUsePythonVersion=3 @@ -188,6 +190,9 @@ let g:ctrlp_custom_ignore = { let g:airline_left_sep='▶' let g:airline_right_sep='◀' let g:airline#extensions#syntastic#enabled=0 +let g:ycm_show_diagnostics_ui=0 +let g:syntastic_cpp_compiler = 'clang++' +let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' let g:airline#extensions#whitespace#enabled=0 let g:airline#extensions#whitespace#show_message=0 let g:airline#extensions#tmuxline#enabled=1 From 0a942264c7e56f19a304e22e00b41cb67c4c0e8b Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 28 Jan 2016 16:44:03 -0500 Subject: [PATCH 17/17] x --- shells/zshrc | 5 +++++ vim/vimrc | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index f0240be..8e2d61c 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -270,6 +270,7 @@ pub-git-init(){ git remote add local "gcrypt::git@localhost:stonewareslord/79a79b1a6e37813d9226872c6428aca29eec9f6111558109861cb0dcd2f0ffc8198deea4e361f84e170989212452fdfb21e0ef690da2ad399c03ce308d79dcfe#$enc_branch" git remote add ncsu "gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#$enc_branch" git remote add gitlab "gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#$enc_branch" + git remote add aws "gcrypt::git@aws:stonewareslord/5e0701d5b5b2118127d378c084be9a1dfb33d185d3e2c5da30a3984f5118e3d5136f3f3b038462bccd538e93f9e32cb06136.git#$enc_branch" git config remote.ncsu.gcrypt-participants "CCDFE3F1" git config remote.gitlab.gcrypt-participants "CCDFE3F1" } @@ -278,6 +279,7 @@ pub-git-rm(){ git remote rm local git remote rm ncsu git remote rm gitlab + git remote rm aws fi while (( $# > 0 )) ; do git remote rm "$1" @@ -289,6 +291,7 @@ pub-git-push(){ git push local --all && git push local --tags git push ncsu --all && git push ncsu --tags git push gitlab --all && git push gitlab --tags + git push aws --all && git push aws --tags fi while (( $# > 0 )) ; do git push "$1" --all && git push "$1" --tags @@ -300,6 +303,7 @@ pub-git-clone(){ ncsu) remote="gcrypt::git@github.ncsu.edu:agadler/a86a0f8757772be2ec617b395a0716679bfce51c1bfdeb8da6127feebd84facde645e9e30188318344eb458f5834e3d86800.git#" ;; gitlab) remote="gcrypt::git@gitlab.com:stonewareslord/e6e03ea006d55de0970a28bcb7fcf65f4c66f98f50830bd69b50c5dc502bdf1a4e4172187cfb5fcef8c32bd7fb316bdc67d7d86713ebfe232f97eb303ac316ae.git#" ;; local) remote="gcrypt::git@localhost:stonewareslord/79a79b1a6e37813d9226872c6428aca29eec9f6111558109861cb0dcd2f0ffc8198deea4e361f84e170989212452fdfb21e0ef690da2ad399c03ce308d79dcfe#" ;; + aws) remote="gcrypt::git@aws:stonewareslord/5e0701d5b5b2118127d378c084be9a1dfb33d185d3e2c5da30a3984f5118e3d5136f3f3b038462bccd538e93f9e32cb06136.git#" ;; *) echo "Opts: local ncsu gitlab" ; return 1 esac shift @@ -383,3 +387,4 @@ echo # OPAM configuration . /home/stonewareslord/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true +(( $+TMUX )) && unset zle_bracketed_paste diff --git a/vim/vimrc b/vim/vimrc index 1947eb1..56d25eb 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -99,9 +99,9 @@ let g:tex_flavor='latex' "Gundo nnoremap :GundoToggle "Easytags - "nnoremap :CtrlPTag + nnoremap :CtrlPTag "Tagbar - nnoremap :Tagbar + "nnoremap :Tagbar "Add a bundle from clipboard nnoremap bun G?Plug yyjp$hdi'"+gPo " \| "+gp:nohlsearch:up:PlugInstall "Automatic if/else/for/while wrappers @@ -179,14 +179,18 @@ let g:tex_flavor='latex' syntax on " } +"Signify let g:signify_vcs_list = [ 'git', 'svn' ] let g:signify_difftool = 'diff' +"CtrlP let g:ctrlp_root_markers = ['.cproot'] let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$', - \ 'file': '\v\.(exe|so|dll)$', + \ 'file': '\v\.(exe|so|dll|class)$', \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', \ } +let g:ctrlp_extensions=['funky'] +"Airline let g:airline_left_sep='▶' let g:airline_right_sep='◀' let g:airline#extensions#syntastic#enabled=0 @@ -196,6 +200,7 @@ let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' let g:airline#extensions#whitespace#enabled=0 let g:airline#extensions#whitespace#show_message=0 let g:airline#extensions#tmuxline#enabled=1 +"Autoformat let g:formatdef_my_custom_php = '"astyle --mode=php -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"' let g:formatdef_my_custom_cpp = '"astyle --mode=c -xc -A10 -j -s2 -xG -S -K -N -xn -xl -n"' let g:formatter_cpp = ['formatdef_my_custom_cpp'] @@ -204,15 +209,15 @@ let g:formatter_php = ['formatdef_my_custom_php'] "let g:formatprg_args_expr_cpp=" --mode=c --style=1tbs -xe -k1 -j" " These flags don't work for some reason " -xn -xc -xl -S -let g:Powerline_symbols='fancy' +"Syntastic +let g:syntastic_java_javac_classpath = "/home/stonewareslord/workspace/FullCourseManager/src:/home/stonewareslord/applications/java/junit-4.12.jar:/home/stonewareslord/applications/java/hamcrest-core-1.3.jar" +"IndentGuides let g:indent_guides_start_level=1 let g:indent_guides_guide_size=1 let g:indent_guides_enable_on_vim_startup=1 let g:php_refactor_command='php /usr/local/bin/refactor.phar' -let g:ctrlp_extensions=['funky'] function! g:UltiSnips_Complete() call UltiSnips#ExpandSnippet() - echo "Test" if g:ulti_expand_res == 0 if pumvisible() return "\" @@ -227,7 +232,7 @@ function! g:UltiSnips_Complete() endfunction "inoremap pumvisible() ? "\" : "\" "inoremap pumvisible() ? "\" : "\" -let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsExpandTrigger="" let g:UltiSnipsListSnippets="" let g:UltiSnipsEditSplit="vertical" @@ -287,7 +292,7 @@ endif "Vim tags | https://github.com/xolox/vim-easytags Plug 'https://github.com/xolox/vim-misc' "Misc (required for easytags) | https://github.com/xolox/vim-misc - Plug 'gaw:stonewareslord/vim-java-getset.git' + Plug 'https://austenwares.com/gogs/stonewareslord/vim-java-getset.git' "Java getters and setters| gogs@austenwares.com:stonewareslord/vim-java-getset.git Plug 'https://github.com/majutsushi/tagbar' " | https://github.com/majutsushi/tagbar @@ -403,3 +408,5 @@ endfunction \ ] set guifont=Fixed\ Medium\ Semi-Condensed\ 10 inoremap =g:UltiSnips_Complete() +map b JavagetsetInsertBothGetterSetter +map a m":Autoformat:%S/\n\n+/\r/`"