From 2421524bfb3f28a4baf3afbc33c101ce2237b91f Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Mon, 2 Jul 2018 15:42:22 -0400 Subject: [PATCH] Changes before moving to skel --- i3/run.sh | 6 +- shells/bashrc | 1 - shells/zshrc | 22 ++--- tmux/tmux.conf | 1 - vim/vimrc | 249 +++++++++++++++++++------------------------------ 5 files changed, 110 insertions(+), 169 deletions(-) diff --git a/i3/run.sh b/i3/run.sh index bd5c25d..728d394 100755 --- a/i3/run.sh +++ b/i3/run.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env zsh +#!/usr/bin/env bash if [ "$1" = "lock" ];then #!/bin/bash @@ -89,7 +89,7 @@ if [ "$1" = "ping" ]; then fi if [ "$1" = "ip" ]; then shift - local RET=0 + RET=0 if [ "$(hostname)" = "MMLin" ]; then if grep -q "$1" < <(ifconfig enp2s0f0); then RET=1 @@ -109,7 +109,7 @@ if [ "$1" = "copy" ]; then (printf '-chegg ';xsel | perl -pe 's/[^a-zA-Z ]//g;chomp()') | xsel && notify-send "Copied" || notify-send "Error" fi if [ "$1" = "screenshot" ]; then - \rm -f ~/last-photo/*(N) + \rm -f ~/last-photo/* sleep .2 #DISPLAY=:0.0 xfce4-screenshooter -r -s ~/last-photo DISPLAY=:0.0 import "$HOME/last-photo/$(date +'%Y-%m-%d_%T').png" diff --git a/shells/bashrc b/shells/bashrc index 18621b8..4bf68ec 100644 --- a/shells/bashrc +++ b/shells/bashrc @@ -1,2 +1 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games -PS1="$ " diff --git a/shells/zshrc b/shells/zshrc index 27a1c19..5606c87 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -50,7 +50,7 @@ sv () { while (( $# > 1 )); do if [[ "$command" == "i" ]]; then echo "Status of $1" - service "$1" status + rc-service "$1" status shift continue fi @@ -61,15 +61,15 @@ sv () { fi if [[ "$command" == "r" ]]; then echo "Restarting $1" - sudo service "$1" restart + sudo rc-service "$1" restart elif [[ "$command" == "s" ]]; then echo "Starting $1" - sudo service "$1" start + sudo rc-service "$1" start elif [[ "$command" == "x" ]]; then echo "Stopping $1" - sudo service "$1" stop + sudo rc-service "$1" stop else - sudo service "$1" "$command" + sudo rc-service "$1" "$command" fi shift done @@ -301,12 +301,12 @@ if test -f /etc/gentoo-release; then } elif test -f /etc/lsb-release; then # Ubuntu - alias install='sudo apt-get --show-progress install' - alias remove='sudo apt-get --show-progress remove' - alias update='sudo apt-get update' - alias upgrade='sudo apt-get --show-progress upgrade' - alias autoremove='sudo apt-get --show-progress autoremove' - alias updateall='sudo sh -c "apt-get update;apt-get upgrade -y;apt-get dist-upgrade -y;apt-get autoremove -y"' + alias install='sudo apt install' + alias remove='sudo apt remove' + alias update='sudo apt update' + alias upgrade='sudo apt upgrade' + alias autoremove='sudo apt autoremove' + alias updateall='sudo sh -c "apt update;apt full-upgrade -y"' alias search='apt-cache search' fi alias ..='k ..' diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 6475e8d..a6e7e37 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -1,4 +1,3 @@ -set-option -g default-shell /bin/zsh #set -g mouse on set -g status-bg black set -g status-fg white diff --git a/vim/vimrc b/vim/vimrc index 1d3b2b1..e4c7b85 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,112 +2,103 @@ 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 -s2 -xG -S -K -N -xn -xl -n -p -H"' -let g:formatters_java = ['my_custom_java'] -let g:UltiSnipsUsePythonVersion=3 +"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 -s2 -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 -let g:indent_guides_auto_colors = 0 -"Required for CSC216, not needed for current classes -"autocmd FileType java set shiftwidth=3 tabstop=3 softtabstop=3 expandtab -"au FileType twig let b:AutoPairs['%']='%' +"let g:indent_guides_auto_colors = 0 autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=darkgrey ctermbg=darkgrey autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=grey ctermbg=grey filetype plugin on set grepprg=grep\ -nH\ $* -let g:tex_flavor='latex' +"let g:tex_flavor='latex' "match Error /\s\+$/ " 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 + noremap gj j + noremap gk k + noremap j gj + noremap k gk "Horizontal - nnoremap Y y$ - nnoremap H ^ + noremap H ^ nnoremap L $ vnoremap L $h - vnoremap H ^ + + nnoremap Y y$ "Move to end of line inoremap jk inoremap kj "Move to last character of last line - nnoremap G G$ - vnoremap G G$ + noremap G G$ + noremap G G$ " } " Buffers { "Control-key movement - nnoremap h - nnoremap j - nnoremap k - nnoremap l + noremap h + noremap j + noremap k + noremap l "Arrow keys - nnoremap w - nnoremap W - nnoremap :bp - nnoremap :bn + noremap w + noremap W + noremap :bp + noremap :bn "Vertical and horizontal split - nnoremap \| vl - nnoremap - sj + noremap \| vl + noremap - sj "Close buffer - nnoremap q + "noremap q "Fullscreen buffer - nnoremap z _\| + noremap z _\| "Go to last buffer - nnoremap + noremap " } " Misc { vnoremap * :call VisualSelection('f') vnoremap # :call VisualSelection('b') vnoremap ; : - nnoremap ! :! vnoremap < >gv + noremap ! :! "Disable F1 - nnoremap - inoremap - vnoremap + noremap + noremap! "F2 toggle paste - nnoremap :set invpaste + noremap :set invpaste "Better searching - nnoremap / /\v - vnoremap / /\v + noremap / /\v "Addition and subtraction - nnoremap + - nnoremap - + "nnoremap + + "nnoremap - "Backspace remove highlights - nnoremap :nohlsearchgzo + noremap :nohlsearchg "Better save - nnoremap :up:silent! call sy#start() + nnoremap :up "Unmap Q - nnoremap Q + noremap Q " } " } " Plugin mappings { "Easymotion map , (easymotion-prefix) "Ctrl-p - nnoremap :CtrlPFunky + "nnoremap :CtrlPFunky "Gundo - nnoremap :GundoToggle + "nnoremap :GundoToggle "Easytags "nnoremap :CtrlPTag "Replacing easytags with ctrl p buffer - nnoremap :CtrlPBuffer + "nnoremap :CtrlPBuffer "Tagbar "nnoremap :Tagbar "Add a bundle from clipboard - nnoremap bun G?Plug yyjp$hdi'"+gPo " \| "+gp:nohlsearch:up:PlugInstall + "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> @@ -121,8 +112,8 @@ let g:tex_flavor='latex' vnoremap rm `<kdd`>jddgv< " } " Trial mappings { - nnoremap o m`o`` - nnoremap O m`O`` + "nnoremap o m`o`` + "nnoremap O m`O`` " } @@ -141,19 +132,15 @@ let g:tex_flavor='latex' set conceallevel=0 " } " Misc { - set tabstop=2 shiftwidth=2 expandtab + set tabstop=2 softtabstop=2 shiftwidth=2 expandtab set tags=./tags;/ set wildmode=longest,list,full - set formatoptions-=r - set formatoptions-=o + set formatoptions-=rot set diffopt+=iwhite set noesckeys - set shiftwidth=2 - set tabstop=2 set modeline - set softtabstop=2 set expandtab - set history=1000 + set history=2048 set hidden "set cursorline set incsearch @@ -165,8 +152,7 @@ let g:tex_flavor='latex' set backup set backupdir=~/.vim/backup set directory=~/.vim/tmp - set undolevels=1000 - set history=500 + set undolevels=2048 set ttyfast set fileformat=unix set encoding=utf-8 @@ -174,7 +160,6 @@ let g:tex_flavor='latex' set foldmethod=indent set foldnestmax=10 set foldlevel=2 - set relativenumber set number set background=dark set t_Co=256 @@ -182,76 +167,45 @@ let g:tex_flavor='latex' set nocompatible set ignorecase set textwidth=0 + set path+=** syntax on " } "Polyglot conflicts with another latex editor let g:polyglot_disabled = ['latex'] -"Symfony -let g:symfony_app_console_caller="php" -let g:symfony_app_console_path="bin/console" "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|class)$', - \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', - \ } -let g:ctrlp_extensions=['funky'] +"let g:ctrlp_root_markers = ['.cproot'] +"let g:ctrlp_custom_ignore = { +" \ 'dir': '\v[\/](\.git|\.hg|\.svn|vendor)$', +" \ 'file': '\v\.(exe|so|dll|class)$', +" \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', +" \ } "Airline -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:ycm_path_to_python_interpreter='/usr/bin/python2.7' +"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:ycm_path_to_python_interpreter='/usr/bin/python2.7' "let g:syntastic_cpp_compiler = 'clang++' "let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' -let g:syntastic_cpp_compiler_options = ' -std=c++11' -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'] -let g:formatter_php = ['formatdef_my_custom_php'] +"let g:syntastic_cpp_compiler_options = ' -std=c++11' +"let g:airline#extensions#whitespace#enabled=0 +"let g:airline#extensions#whitespace#show_message=0 +"let g:airline#extensions#tmuxline#enabled=1 "let g:formatprg_cpp="astyle" "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 -"Syntastic -let g:syntastic_java_javac_classpath = "~/applications/java/junit-4.12.jar:~/applications/java/hamcrest-core-1.3.jar:~/wpilib/java/current/lib/WPILib.jar:~/wpilib/java/current/lib/NetworkTables.jar:~/git/ford-java/src" -"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' -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 "inoremap pumvisible() ? "\" : "\" "inoremap pumvisible() ? "\" : "\" -let g:UltiSnipsJumpForwardTrigger="" -let g:UltiSnipsExpandTrigger="" -let g:UltiSnipsListSnippets="" -let g:UltiSnipsEditSplit="vertical" -let g:ycm_key_list_select_completion = [] +"let g:UltiSnipsJumpForwardTrigger="" +"let g:UltiSnipsExpandTrigger="" +"let g:UltiSnipsListSnippets="" +"let g:UltiSnipsEditSplit="vertical" inoremap pumvisible() ? "\" : "\u\" -let loaded_matchit=1 filetype off if has("win32") call plug#begin('~/vimfiles/plugged') @@ -259,31 +213,31 @@ else call plug#begin('~/.vim/plugged') endif " Code writing { - Plug 'https://austenwares.com/gitea/vim/vim-autoformat', { 'on': 'Autoformat'} + "Plug 'https://austenwares.com/gitea/vim/vim-autoformat', { 'on': 'Autoformat'} "Adds autoformat command | https://github.com/Chiel92/vim-autoformat Plug 'https://austenwares.com/gitea/vim/vim-surround' "Surround selection in ({\"' or HTML tags | https://github.com/tpope/vim-surround - Plug 'https://austenwares.com/gitea/vim/syntastic' + "Plug 'https://austenwares.com/gitea/vim/syntastic' "Syntax checker | https://github.com/scrooloose/syntastic - Plug 'https://austenwares.com/gitea/vim/nerdtree', { 'on': 'NERDTreeToggle' } + "Plug 'https://austenwares.com/gitea/vim/nerdtree', { 'on': 'NERDTreeToggle' } "File browser | https://github.com/scrooloose/nerdtree Plug 'https://austenwares.com/gitea/vim/vim-easymotion' "Move around quickly in a document | https://github.com/Lokaltog/vim-easymotion "Plug 'https://austenwares.com/gitea/vim/gundo.vim', { 'on': 'GundoToggle' } "Visual undo | https://github.com/sjl/gundo.vim - Plug 'https://austenwares.com/gitea/vim/vim-exchange' + "Plug 'https://austenwares.com/gitea/vim/vim-exchange' "Exchange two selections of text | https://github.com/tommcdo/vim-exchange - Plug 'https://austenwares.com/gitea/vim/vim-repeat' + "Plug 'https://austenwares.com/gitea/vim/vim-repeat' "Repeat last tpope command with . | https://github.com/tpope/vim-repeat - Plug 'https://austenwares.com/gitea/vim/vim-fugitive' + "Plug 'https://austenwares.com/gitea/vim/vim-fugitive' "Great Vim-Git compatibility | https://github.com/tpope/vim-fugitive - Plug 'https://austenwares.com/gitea/vim/ctrlp.vim' + "Plug 'https://austenwares.com/gitea/vim/ctrlp.vim' "Fuzzy file search | https://github.com/kien/ctrlp.vim Plug 'https://austenwares.com/gitea/vim/tabular', { 'on': 'Tab' } "Quickly make tables in vim | https://github.com/godlygeek/tabular - Plug 'https://austenwares.com/gitea/vim/UltiSnips' + "Plug 'https://austenwares.com/gitea/vim/UltiSnips' "Adds snippet support | https://github.com/sirver/UltiSnips - Plug 'https://austenwares.com/gitea/vim/vim-snippets' + "Plug 'https://austenwares.com/gitea/vim/vim-snippets' "Add snippets | https://github.com/honza/vim-snippets Plug 'https://austenwares.com/gitea/vim/eregex.vim' "Real regexes in vim | https://github.com/othree/eregex.vim @@ -291,11 +245,11 @@ endif "Git information inline | https://github.com/mhinz/vim-signify Plug 'https://austenwares.com/gitea/vim/auto-pairs' "Automatic pairs | https://github.com/jiangmiao/auto-pairs - Plug 'https://austenwares.com/gitea/vim/YouCompleteMe' + "Plug 'https://austenwares.com/gitea/vim/YouCompleteMe' "Autocompletion | https://github.com/Valloric/YouCompleteMe "Plug 'https://austenwares.com/gitea/vim/vim-java-getset.git' "Java getters and setters| https://austenwares.com/gitea/vim/vim-java-getset.git - Plug 'https://austenwares.com/gitea/vim/double-tap.git' + "Plug 'https://austenwares.com/gitea/vim/double-tap.git' "Double tap for comments " } " Style { @@ -309,23 +263,23 @@ endif "256 color vim in terminal | https://github.com/godlygeek/csapprox " } " Syntax { - Plug 'https://austenwares.com/gitea/vim/vimtex' + "Plug 'https://austenwares.com/gitea/vim/vimtex' "Latex | https://github.com/lervag/vimtex Plug 'https://austenwares.com/gitea/vim/vim-polyglot' "Many languages | https://github.com/sheerun/vim-polyglot - Plug 'https://austenwares.com/gitea/vim/vim-vimperator' + "Plug 'https://austenwares.com/gitea/vim/vim-vimperator' "Vimperator for vim | https://github.com/superbrothers/vim-vimperator - Plug 'https://austenwares.com/gitea/vim/i3-vim-syntax' + "Plug 'https://austenwares.com/gitea/vim/i3-vim-syntax' "i3 syntax | https://github.com/PotatoesMaster/i3-vim-syntax " } " Misc { - Plug 'https://austenwares.com/gitea/vim/flappyvird-vim', { 'on': [] } + "Plug 'https://austenwares.com/gitea/vim/flappyvird-vim', { 'on': [] } "The amazing Flappy Bird game | https://github.com/mattn/flappyvird-vim - Plug 'https://austenwares.com/gitea/vim/vim-gnupg' + "Plug 'https://austenwares.com/gitea/vim/vim-gnupg' "GPG support | https://github.com/jamessan/vim-gnupg Plug 'https://austenwares.com/gitea/vim/vim-bracketed-paste' "Automatic :set paste funcationality | https://github.com/ConradIrwin/vim-bracketed-paste - Plug 'https://austenwares.com/gitea/vim/HiCursorWords' + "Plug 'https://austenwares.com/gitea/vim/HiCursorWords' "Highlight word under cursor automatically | http://www.vim.org/scripts/script.php?script_id=4306 " } " Unused { @@ -345,8 +299,7 @@ if exists("+undofile") if isdirectory($HOME . '/.vim/undo')==0 :silent !mkdir -p ~/.vim/undo > /dev/null 2>&1 endif - set undodir=./.vim-undo// - set undodir+=~/.vim/undo// + set undodir=~/.vim/undo/ set undofile endif augroup autosave @@ -362,15 +315,11 @@ augroup vimrcEx \ exe "normal g`\"" | \ endif augroup END -if has('gui_running') - set guioptions-=T -else - set t_Co=256 - if &term=='xterm' || &term=='screen' - set t_Co=256 - endif - "colorscheme torte -endif +"if has('gui_running') +" set guioptions-=T +"else +" set t_Co=256 +"endif silent! colorscheme fruity function! Initialize() if has("win32") @@ -399,14 +348,8 @@ function! Initialize() silent! PlugInstall q endfunction - if !exists('g:ycm_semantic_triggers') - let g:ycm_semantic_triggers = {} - endif - let g:ycm_semantic_triggers.tex = [ - \ 're!\\[A-Za-z]*(ref|cite)[A-Za-z]*([^]]*])?{([^}]*, ?)*' - \ ] set guifont=Gohu\ GohuFont -inoremap =g:UltiSnips_Complete() -map b JavagetsetInsertBothGetterSetter -map a O:Autoformat:v/\S/d:nohlsearch -inoremap getline(".") =~ '^\s*\([#"]\)\s*$' ? "\" : "\" +"inoremap =g:UltiSnips_Complete() +"map b JavagetsetInsertBothGetterSetter +"map a O:Autoformat:v/\S/d:nohlsearch +"inoremap getline(".") =~ '^\s*\([#"]\)\s*$' ? "\" : "\"