From ee70ba4caca270dca89baa0bae0e511e32d37965 Mon Sep 17 00:00:00 2001 From: Adam Veldhousen Date: Fri, 23 Feb 2018 18:24:34 -0600 Subject: [PATCH] some updates --- .environment | 27 +++++++++++++++++------- .gitconfig | 2 +- .profile | 10 ++++++++- .vimrc | 52 +++++++++++++++++++++++++++++------------------ bootstrap.sh | 28 ++++++++++++++++--------- install/debian.sh | 30 +++++++++++++++++++++++++++ rakefile | 8 ++++---- 7 files changed, 114 insertions(+), 43 deletions(-) diff --git a/.environment b/.environment index ba4536d..fda9972 100644 --- a/.environment +++ b/.environment @@ -1,14 +1,24 @@ #!/bin/bash # Bash behavior -shopt -s checkwinsize # Checks window size to get proper line wrapping -shopt -s cdspell # Corrects minor spelling errors when cd-ing -set -o vi # Set prompt to vi mode -set -o notify # Report status of terminated background jobs immediately +shopt -s checkwinsize # Checks window size to get proper line wrapping +shopt -s cdspell # Corrects minor spelling errors when cd-ing +shopt -s checkjobs # Stops bash from exiting if there are jobs running. A second attempt at exiting will ignore. +set -o vi # Set prompt to vi mode +set -o notify # Report status of terminated background jobs immediately +set -b # report job status immediately + +bind '"\C-l"':redraw-current-line # -l +bind '"\e\C-l"':clear-screen # --l + +set show-mode-in-prompt on # Shows vi mode status: + for vi insert mode, : for vi command mode +set print-completions-horizontally on # Prints tab completions horizontally in alphabetical order +set colored-stats on # completions are printed colored based on their file type +set visible-stats on # completions are printed colored based on their file type # History -HISTCONTROL=ignoreboth:erasedups # No duplicate commands in history -HISTSIZE=50000 # For a huge history +export HISTCONTRO=Lignoreboth:erasedups # No duplicate commands in history +export HISTSIZE=-1 export HISTIGNORE="[ ]*:&:bg:fg:exit:clear" # Don't save these commands in the history shopt -s histappend # Append to the history file, not overwrite @@ -18,6 +28,7 @@ export PAGER=less # Used to display text / man files export LANG="en_US.UTF-8" export POWERLINE_CONFIG_COMMAND=~/Tools/modules/powerline/scripts/powerline-config + export WINDOWS=false if [ -d "${HOME}/.bin" ] ; then @@ -35,10 +46,12 @@ if [ -d "/c/Windows" ]; then if [ -f ~/.windows ]; then . ~/.windows fi +else + export GOPATH=~/projects/go fi export EDITOR=$GIT_EDITOR -export VISUAL=$EDITOR +export VISUAL=$EDITOR if [ -d "${HOME}/tools/vim" ] ; then PATH=${HOME}/tools/vim:${PATH} diff --git a/.gitconfig b/.gitconfig index 0569415..5adc968 100644 --- a/.gitconfig +++ b/.gitconfig @@ -167,4 +167,4 @@ # for OSX #helper = osxkeychain # for Linux - helper =/usr/lib/git-core/git-credential/git-credential-gnome-keyring + helper = store --file ~/.git-credentials diff --git a/.profile b/.profile index 70f7c82..c56b86a 100644 --- a/.profile +++ b/.profile @@ -1,5 +1,11 @@ #!/bin/bash +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + # source environment settings if [ -f ~/.environment ]; then . ~/.environment @@ -24,7 +30,9 @@ fi # Sources a folder with shell extensions if [ -d ~/.extensions ]; then for plugin in ~/.extensions/*; do - source $plugin + if [ -f $plugin ]; then + source $plugin + fi done fi diff --git a/.vimrc b/.vimrc index 868fb15..78566cb 100644 --- a/.vimrc +++ b/.vimrc @@ -1,29 +1,27 @@ " change runtime path -set runtimepath=$VIMRUNTIME,~/tools/vim +set runtimepath=~/tools/vim execute pathogen#infect() execute pathogen#helptags() - "we don't want vi compatibility AKA Make Vim more useful -set nocompatible +set nocompatible "color schemes -colorscheme jellybeans +colorscheme desert +"colorscheme jellybeans "colorscheme molokai +"colorscheme hickop "colorscheme moria "colorscheme CandyPaper "colorscheme sunburst -"colorscheme hickop "colorscheme pablo "colorscheme torte "colorscheme slate "colorscheme evening "colorscheme darkblue -"colorscheme desert "colorscheme base16-flat "colorscheme inkpot -"colorscheme jellybeans "colorscheme liquidcarbon "colorscheme pinksea "colorscheme sonofobsidian @@ -46,7 +44,7 @@ set autoread set selection=exclusive set ttimeoutlen=50 " Use the OS clipboard by default (on versions compiled with `+clipboard`) -set clipboard=unnamed +set clipboard=unnamedplus " Enhance command-line completion set wildmenu " Allow cursor keys in insert mode @@ -62,16 +60,20 @@ set encoding=utf-8 "nobomb " Change mapleader let mapleader = "," +map :HardTimeToggle + map :noh +"replace with regular newlines +map nf :%s/ //g + "list buffers map w :buffers -map q :buffer# " open erros map e :lw 5 -" mini buffer explorer toggle +" mini buffer explorer toggle map b :MBEToggle " easymotion mappings @@ -111,6 +113,9 @@ noremap l map x :%s/\s\+$//:noh +"reload vim config +noremap rr :so ~/.vimrc + "open vimrc in a new tab map v :tabedit ~/.vimrc map @@ -160,8 +165,8 @@ set number syntax on " Highlight current line set cursorline -" Make tabs as wide as two spaces -set tabstop=2 +" Make tabs as wide as four spaces +set tabstop=4 set expandtab set shiftwidth=2 " Show “invisible” characters @@ -250,10 +255,14 @@ let g:ctrlp_extensions = ['line'] "'r' - the nearest ancestor of the current file that contains one of these directories or files: .git .hg .svn .bzr _darcs "'w' - modifier to "r": start search from the cwd instead of the current file's directory "0 or '' (empty string) - disable this feature. -let g:ctrlp_working_path_mode = 'rc' +let g:ctrlp_working_path_mode = 'ra' let g:ctrlp_by_filename = 0 let g:ctrlp_max_files = 5000 +let g:ctrlp_custom_ignore = { + \ 'dir': '\v[\/]\.(git|hg|svn)$', + \ 'file': '\v\.(exe|so|dll)$', + \ } let g:go_disable_autoinstall = 0 @@ -269,7 +278,7 @@ let g:airline_detect_modified=1 let g:airline_detect_paste=1 " enable iminsert detection > let g:airline_detect_iminsert=1 -" determine whether inactive windows should have the left section collapsed to only the filename of that buffer. +" determine whether inactive windows should have the left section collapsed to only the filename of that buffer. let g:airline_inactive_collapse=1 " enable/disable csv integration for displaying the current column. let g:airline#extensions#csv#enabled = 1 @@ -277,7 +286,7 @@ let g:airline#extensions#csv#enabled = 1 let g:airline#extensions#whitespace#symbol = '.' " themes are automatically selected based on the matching colorscheme. this can be overridden by defining a value. "let g:airline_theme= -" if you want to patch the airline theme before it gets applied, you can supply the name of a function where you can modify the palette. +" if you want to patch the airline theme before it gets applied, you can supply the name of a function where you can modify the palette. let g:airline_theme_patch_func = 'AirlineThemePatch' function! AirlineThemePatch(palette) if g:airline_theme == 'badwolf' @@ -286,9 +295,9 @@ function! AirlineThemePatch(palette) endfor endif endfunction -" enable/disable automatic population of the `g:airline_symbols` dictionary with powerline symbols. +" enable/disable automatic population of the `g:airline_symbols` dictionary with powerline symbols. let g:airline_powerline_fonts=1 -" define the set of text to display for each mode. +" define the set of text to display for each mode. let g:airline_mode_map = { \ '__' : '-', \ 'n' : 'N', @@ -327,6 +336,11 @@ let g:ycm_key_list_select_completion = ['', ''] " Enable file type detection filetype plugin indent on +augroup myvimrc + au! + au BufWritePost .vimrc so $MYVIMRC +augroup END + " Automatic commands if has("autocmd") " Treat .json files as .js @@ -347,6 +361,4 @@ au GUIEnter * set vb t_vb= if has('gui_running') set go =mt set guifont=Literation\ Mono\ for\ Powerline:h12,Literation_Mono_for_Powerline:h12,Inconsolata\ for\ Powerline:h10,Ubuntu\ Mono:h26,Consolas:h12,Courier:h12 -endif - -let g:ruby_path = ':C:\ruby193\bin' \ No newline at end of file +endif \ No newline at end of file diff --git a/bootstrap.sh b/bootstrap.sh index 0e594b9..4df9ae8 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -7,7 +7,7 @@ dest="$(pwd)" bkup="$dest/.home_bkup" -if [[ -d ${bkup} ]]; then +if [ -d ${bkup} ]; then echo "A backup folder already exists, it must be moved/deleted before bootstrap can apply the new dotfiles." exit -1; fi @@ -17,7 +17,7 @@ echo "Making a backup of old dotfiles into ${bkup}..." mkdir -p "${bkup}" IFS=$'\n' -if [[ -f ${dest}/.ssh/config ]]; then +if [ -f ${dest}/.ssh/config ]; then mkdir -p "${bkup}/.ssh" cp "${dest}/.ssh/config" "${bkup}/.ssh/config" fi @@ -36,7 +36,7 @@ popd echo "" echo "copying \"./tools\" directories..." -if [[ -z "${dest}/Tools" ]]; then +if [ -z "${dest}/Tools" ]; then mkdir -p ${dest}/tools fi @@ -48,17 +48,18 @@ echo "" echo "linking dotfiles from ${source} into ${dest}" # ln on windows pretty much only works with hardlinks it seems ls -lA "${source}" | grep "^-" | awk '{print $9}' | xargs -I file ln -fs "${source}/file" "${dest}/file" -if [[ -z "${dest}/.ssh" ]]; then +if [ -z "${dest}/.ssh" ]; then mkdir -p "${dest}/.ssh" fi echo "" +echo "setting up ssh default" # a check to see if they're using a config file and if it has a host setup -if [[ -f "${dest}/.ssh/config" && -z $(cat "${dest}/.ssh/config" | grep "[hH]ost \*") ]]; then +if [ -f "${dest}/.ssh/config" && -z $(cat "${dest}/.ssh/config" | grep "[hH]ost \*") ]; then echo "Appending ssh config" # we append it so we don't destroy any custom settings they may have cat "${source}/.ssh/config" >> "${dest}/.ssh/config" -elif [[ -f "${dest}/.ssh/config" ]]; then +elif [ -f "${dest}/.ssh/config" ]; then echo "Your SSHfu is strong, skipping config copy..." else echo "Copying new ssh config" @@ -66,7 +67,10 @@ else cp -n "${source}/.ssh/config" "${dest}/.ssh/" fi -if [[ $(uname -s) == "Darwin" ]]; then + +echo "" +echo "installing platform stuff" +if [ $(uname -s) == "Darwin" ]; then echo "installing fonts" find ${source}/tools/modules/powerline-fonts | grep "\.[to]tf" | xargs -I {} cp {} /Users/$(whoami)/Library/Fonts/ @@ -75,7 +79,11 @@ if [[ $(uname -s) == "Darwin" ]]; then #rake #~/tools/vim/bundle/YouCompleteMe/install.py --all -elif [[ $(uname -o) == "Msys" ]]; then + +elif [ $(uname -s) == "Linux" ]; then + echo "installing linux stuff" + sudo ./install/debian.sh +elif [ $(uname -o) == "Msys" ]; then echo "If you would like to install vim plugins, ensure you have ruby 1.9.3 + rake installed and do the following:" echo "rake;" @@ -101,7 +109,7 @@ All script files in this folder get loaded by the .profile, so this is a nice pl or enhancements to the dotfile setup EOF -if [[ -f "~/.bashrc" ]]; then +if [ -f "~/.bashrc" ]; then echo "sourcing .profile in .bashrc" echo "source ./.profile" >> ~/.bashrc fi @@ -120,7 +128,7 @@ README.md" for f in ${cleanup} do filetorm=${dest}/${f}; - if [[ -f ${filetorm} ]]; then + if [ -f ${filetorm} ]; then rm -rf $filetorm fi done diff --git a/install/debian.sh b/install/debian.sh index a9bf588..ff5157e 100755 --- a/install/debian.sh +++ b/install/debian.sh @@ -1 +1,31 @@ #!/bin/bash + +if [ -d "${dest}/.config" ]; then + echo ".config exists" +else + mkdir -p "${dest}/.config" +fi + +cp -r ${source}/config/ ${dest}/.config/ + +sudo apt-get update && sudo apt-get install \ + build-essential \ + cmake \ + curl \ + nvm \ + python \ + rbenv \ + tmux \ + wget \ + git; + + +rbenv install 1.9.3-p125; +rbenv global 1.9.3-p125; + +rm -rf ~/tools/modules/iTerm2-Color-Schemes +rm -rf ~/tools/modules/tmux-MacOSX-pasteboard + +rake + +echo "You must install YouCompleteMe by going to ~/tools/vim/bundle/YouCompleteMe/ and following the instructions in the README.md" diff --git a/rakefile b/rakefile index 3be1ea2..a743739 100644 --- a/rakefile +++ b/rakefile @@ -2,12 +2,13 @@ require 'rake/clean' require 'fileutils' vimFolder = "tools/vim" -bundles_dir = File.join(File.dirname(__FILE__), "#{vimFolder}/bundle/") -pluginsFile = File.join(File.dirname(__FILE__), "#{vimFolder}/plugins.txt") +bundles_dir = File.join("#{vimFolder}/bundle/") +pluginsFile = File.join("#{vimFolder}/plugins.txt") CLOBBER.include "#{bundles_dir}" +CLEAN.include "#{bundles_dir}" -task :default => ['clobber', 'vim:reinstall'] +task :default => ['vim:reinstall'] namespace :vim do @@ -58,4 +59,3 @@ def gitName(gitRepo) return gitRepo.split('/').last.sub(/\.git$/, '') end -