From 87eb242cf0a827781f846204276daa5237d7dd2c Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 17 Dec 2020 11:34:25 -0500 Subject: [PATCH 1/7] vim searching, ctrlp, and setup --- .vimrc | 10 ++++++++-- setup.sh | 19 ++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index f3924f3..d29b198 100644 --- a/.vimrc +++ b/.vimrc @@ -7,11 +7,11 @@ call vundle#begin() " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' Plugin 'vim-airline/vim-airline' +Plugin 'kien/ctrlp.vim' +Plugin 'tpop/vim-fugitive' Plugin 'scrooloose/nerdtree' -Plugin 'tpope/vim-fugitive' Plugin 'edkolev/tmuxline.vim' Plugin 'vim-airline/vim-airline-themes' -Plugin 'chrisbra/csv.vim' "Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'} " All of your Plugins must be added before the following line call vundle#end() " required @@ -46,3 +46,9 @@ map f :bp map d :bp:bd # "-----nerdtree-------------------- nmap e :NERDTreeToggle +" Search as you type, highlight results +set incsearch +set showmatch +set hlsearch +nnoremap \\ :noh " Clear higlighting +"nnoremap :noh diff --git a/setup.sh b/setup.sh index 67841fb..3c0326a 100755 --- a/setup.sh +++ b/setup.sh @@ -38,7 +38,7 @@ then read -p "do you want to install golang and go-powerline?" yn case $yn in [Yy]* ) - sudo apt-get install golang; + sudo apt-get install golang -y; go get -u github.com/justjanne/powerline-go; break;; [Nn]* ) @@ -48,6 +48,23 @@ then done fi +#----------------------------------------------------------install go-powerline--------------------------------------------------------------------------- + +if [ -z "$GOPATH" ] +then + while true; do + read -p "do you want to install golang and go-powerline?" yn + case $yn in + [Yy]* ) + sudo apt-get install golang -y; + go get -u github.com/justjanne/powerline-go; + break;; + [Nn]* ) + exit;; + * ) echo "Please answer yes or no.";; + esac + done +fi #----------------------------------------------------------install power line fonts------------------------------------------------------------------------ if [ ! -d ~/fonts ] From 6488d20fcc53faa550e9a2fc99252fccd2cc1f1d Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 12 Mar 2021 21:49:46 -0500 Subject: [PATCH 2/7] strip out unnecesary things --- .bashrc | 20 ++++++++------------ .vimrc | 5 ++--- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.bashrc b/.bashrc index 4fdea88..9733ce1 100644 --- a/.bashrc +++ b/.bashrc @@ -119,17 +119,13 @@ fi EDITOR=/usr/bin/vim.basic PAGER="less" LESS="-S" -export IPTOKEN="6ac0a563fc06ab" -export PG="psql -U ptrowbridge -d ubm -p 5432 -h 192.168.1.110" -export NVM_DIR="/home/pt/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm +# export PG="psql -U ptrowbridge -d ubm -p 5432 -h 192.168.1.110" - -GOPATH=$HOME/go -function _update_ps1() { - PS1="$($GOPATH/bin/powerline-go -error $?)" -} -if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then - PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" -fi +# GOPATH=$HOME/go +# function _update_ps1() { +# PS1="$($GOPATH/bin/powerline-go -error $?)" +# } +# if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then +# PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" +# fi diff --git a/.vimrc b/.vimrc index d29b198..b94d298 100644 --- a/.vimrc +++ b/.vimrc @@ -8,7 +8,6 @@ call vundle#begin() Plugin 'gmarik/Vundle.vim' Plugin 'vim-airline/vim-airline' Plugin 'kien/ctrlp.vim' -Plugin 'tpop/vim-fugitive' Plugin 'scrooloose/nerdtree' Plugin 'edkolev/tmuxline.vim' Plugin 'vim-airline/vim-airline-themes' @@ -37,8 +36,8 @@ let g:netrw_winsize = 25 "----airline tabs for buffers------- let g:airline#extensions#tabline#enabled = 1 let g:airline_theme = 'dark' -let g:tmuxline_powerline_separators = 1 -let g:airline_powerline_fonts = 1 +let g:tmuxline_powerline_separators = 0 +let g:airline_powerline_fonts = 0 let mapleader = ";" set showcmd map a :bn From 804f6800d28ca38e17b1c36c0a852207953b240f Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 12 Mar 2021 21:53:04 -0500 Subject: [PATCH 3/7] break out installation pieces and layer powerline go inside of go install --- setup.sh | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index 3c0326a..ff0005f 100755 --- a/setup.sh +++ b/setup.sh @@ -32,14 +32,14 @@ done #----------------------------------------------------------install go and go-powerline-------------------------------------------------------------------- +# if $GOPATH is null the prompt for golang install if [ -z "$GOPATH" ] then while true; do - read -p "do you want to install golang and go-powerline?" yn + read -p "do you want to install golang (needed for go-powerline)?" yn case $yn in [Yy]* ) sudo apt-get install golang -y; - go get -u github.com/justjanne/powerline-go; break;; [Nn]* ) exit;; @@ -50,13 +50,13 @@ fi #----------------------------------------------------------install go-powerline--------------------------------------------------------------------------- -if [ -z "$GOPATH" ] +# see if this file exists, if not prompt for install +if [ ! -f ~/go/bin/powerline-go ] then while true; do - read -p "do you want to install golang and go-powerline?" yn + read -p "do you want to install go-powerline?" yn case $yn in [Yy]* ) - sudo apt-get install golang -y; go get -u github.com/justjanne/powerline-go; break;; [Nn]* ) @@ -65,12 +65,13 @@ then esac done fi + #----------------------------------------------------------install power line fonts------------------------------------------------------------------------ if [ ! -d ~/fonts ] then while true; do - read -p "do you want to install powerline fonts from https://github.com/powerline/fonts?" yn + read -p "do you want to install powerline fonts from 'https://github.com/powerline/fonts' ?" yn case $yn in [Yy]* ) git clone https://github.com/powerline/fonts ~/fonts; @@ -90,7 +91,7 @@ fi if [ ! -d ~/.tmux/plugins/tpm ] then while true; do - read -p "do you want to install the tmux plugin manager from https://github.com/tmux-plugins/tpm" yn + read -p "do you want to install the tmux plugin manager from 'https://github.com/tmux-plugins/tpm' ?" yn case $yn in [Yy]* ) git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm; @@ -105,14 +106,24 @@ fi #----------------------------------------------------------see if Vundle has been cloned yet and do so----------------------------------------------------- -if [ ! -d ~/.vim ] +if [ ! -d ~/.vim/bundle ] then - git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim while true; do - read -p "Do you want to install the vim plugins now?" yn + read -p "do you want to install the Vundle plugin manager for vim from https://github.com/VundleVim/Vundle.vim.git?" yn case $yn in - [Yy]* ) vim +PluginInstall +qall; break;; - [Nn]* ) exit;; + [Yy]* ) + git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim + break;; + [Nn]* ) + while true; do + read -p "Do you want to install the vim plugins now?" yn + case $yn in + [Yy]* ) vim +PluginInstall +qall; break;; + [Nn]* ) exit;; + * ) echo "Please answer yes or no.";; + esac + done + exit;; * ) echo "Please answer yes or no.";; esac done From d21d617af949d5e6ed767ae2ef90c8d7e0d0d5d6 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 12 Mar 2021 22:05:37 -0500 Subject: [PATCH 4/7] replace exits with break --- setup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index ff0005f..70b4fe0 100755 --- a/setup.sh +++ b/setup.sh @@ -42,7 +42,7 @@ then sudo apt-get install golang -y; break;; [Nn]* ) - exit;; + break;; * ) echo "Please answer yes or no.";; esac done @@ -60,7 +60,7 @@ then go get -u github.com/justjanne/powerline-go; break;; [Nn]* ) - exit;; + break;; * ) echo "Please answer yes or no.";; esac done @@ -79,7 +79,7 @@ then ./install.sh; break;; [Nn]* ) - exit;; + break;; * ) echo "Please answer yes or no.";; esac done @@ -97,7 +97,7 @@ then git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm; break;; [Nn]* ) - exit;; + break;; * ) echo "Please answer yes or no.";; esac done @@ -119,11 +119,11 @@ then read -p "Do you want to install the vim plugins now?" yn case $yn in [Yy]* ) vim +PluginInstall +qall; break;; - [Nn]* ) exit;; + [Nn]* ) break;; * ) echo "Please answer yes or no.";; esac done - exit;; + break;; * ) echo "Please answer yes or no.";; esac done From 5c6ddd41cbc04fcc067c0543f751d6e6fc6750de Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sat, 13 Mar 2021 03:10:17 +0000 Subject: [PATCH 5/7] install vim plugins after installing vundle otherwise do nothgin --- setup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 70b4fe0..2c8d6e0 100755 --- a/setup.sh +++ b/setup.sh @@ -113,8 +113,7 @@ then case $yn in [Yy]* ) git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim - break;; - [Nn]* ) + # ask to install plugins after vundle installed while true; do read -p "Do you want to install the vim plugins now?" yn case $yn in @@ -124,8 +123,9 @@ then esac done break;; + [Nn]* ) + break;; * ) echo "Please answer yes or no.";; esac done fi -echo "you may need to run vim and execute :PluginInstall to sync packages with the new .vimrc, or \"vim +PluginInstall +qall\" from the command line" From 7e29a16a96c500355bd6cf7a1281d59d8b858f6c Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 15 Apr 2021 22:57:40 -0400 Subject: [PATCH 6/7] shift j/k scrolls the page without moving the cursor, and arrows change splits --- .vimrc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index b94d298..a624c9d 100644 --- a/.vimrc +++ b/.vimrc @@ -21,7 +21,7 @@ map k map h map l let NERDTreeShowHidden=1 -set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab +set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab colorscheme desert syntax on set splitright @@ -43,6 +43,9 @@ set showcmd map a :bn map f :bp map d :bp:bd # +"---move the whole page without moving the cursor--- +nnoremap J +nnoremap K "-----nerdtree-------------------- nmap e :NERDTreeToggle " Search as you type, highlight results @@ -51,3 +54,8 @@ set showmatch set hlsearch nnoremap \\ :noh " Clear higlighting "nnoremap :noh +" Resize windows +nnoremap 5+ +nnoremap 5- +nnoremap 10> +nnoremap 10< From 99a7e580e7e15b6dd6c3cd19ddff93b458db52ea Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 15 Apr 2021 23:31:12 -0400 Subject: [PATCH 7/7] check to make sure basic tools are installed for ubuntu --- setup.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/setup.sh b/setup.sh index 2c8d6e0..ffc1325 100755 --- a/setup.sh +++ b/setup.sh @@ -7,6 +7,38 @@ dir=~/dot_config backup=~/dot_config_backup files=".bashrc .vimrc .tmux.conf .psqlrc .gitconfig" +#-------------------------------------------------install debian tooling----------------------------------------------------------------------------------- + +#----------curl----------- +if [ "$(dpkg-query -W -f='${Status}' "curl" 2>/dev/null | grep -c "ok installed")" == "1" ] +then + echo "curl already installed" +else + echo "installing curl" + apt update -q4 + apt install curl -y +fi + +#----------vim----------- +if [ "$(dpkg-query -W -f='${Status}' "curl" 2>/dev/null | grep -c "ok installed")" == "1" ] +then + echo "vim already installed" +else + echo "installing vim" + apt update -q4 + apt install vim -y +fi + +#----------tmux----------- +if [ "$(dpkg-query -W -f='${Status}' "tmux" 2>/dev/null | grep -c "ok installed")" == "1" ] +then + echo "tmux already installed" +else + echo "installing tmux" + apt update -q4 + apt install tmux -y +fi + #------------------------------------------------ create the resore directory if it doesn't already exist-------------------------------------------------- if [ ! -d $backup ]