alias to list files with open vim buffers and execute them with psql

This commit is contained in:
Paul Trowbridge 2023-03-13 16:46:45 -04:00
parent ecda413f11
commit 78876b1fe9
3 changed files with 17 additions and 8 deletions

12
.bashrc
View File

@ -120,10 +120,14 @@ EDITOR=/usr/bin/vim.basic
PAGER="less"
LESS="-S"
export IPTOKEN="6ac0a563fc06ab"
export PG="psql -U ptrowbridge -d ubm -p 5030 -h usmidlnx01"
export PGD="psql -U ptrowbridge -d ubm -p 5432 -h usmidlnx01"
export PG="psql -U ptrowbridge -d ubm -p 5432 -h usmidsap01"
export MS="sqlcmd.exe -S mid-sql02 -i"
export PSQL_PAGER="pspg"
alias opg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g'"
#alias opg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r realpath"
alias osw="lsof +D . | awk '\$NF ~ /swp$/ {print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g'"
alias xpg="lsof +D . | grep 'pg.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f"
alias xsw="lsof +D . | grep '.*swp$' | awk '{print \$9}' | sed 's/\.swp//g' | sed 's/\/\./\//g' | xargs -r $PG -f"
if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
GIT_PROMPT_ONLY_IN_REPO=1
@ -145,3 +149,7 @@ export PATH=$PATH:"$DENO_INSTALL/bin:$PATH"
eval `keychain --eval id_rsa`
bind 'set bell-style none'
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

5
.vimrc
View File

@ -26,7 +26,7 @@ let NERDTreeShowHidden=1
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
set mouse=a
set nowrap
colorscheme ron
colorscheme darkblue
syntax on
set splitright
set splitbelow
@ -39,7 +39,8 @@ let g:netrw_altv = 1
let g:netrw_winsize = 25
"----airline tabs for buffers-------
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme = 'dark'
let g:airline_theme = 'violet'
let g:airline_solarized_bg='dark'
let g:tmuxline_powerline_separators = 1
let g:airline_powerline_fonts = 1
"----markdown folding------------

View File

@ -16,7 +16,7 @@ then
else
echo "installing curl..."
apt update -q4
apt install curl -y
sudo apt install curl -y
fi
#----------vim-----------
@ -26,7 +26,7 @@ then
else
echo "installing vim..."
apt update -q4
apt install vim -y
sudo apt install vim -y
fi
#----------tmux-----------
@ -36,7 +36,7 @@ then
else
echo "installing tmux..."
apt update -q4
apt install tmux -y
sudo apt install tmux -y
fi
#----------pspg-----------
@ -46,7 +46,7 @@ then
else
echo "installing pspg..."
apt update -q4
apt install pspg -y
sudo apt install pspg -y
fi
#------------------------------------------------ create the resore directory if it doesn't already exist--------------------------------------------------