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" PAGER="less"
LESS="-S" LESS="-S"
export IPTOKEN="6ac0a563fc06ab" export IPTOKEN="6ac0a563fc06ab"
export PG="psql -U ptrowbridge -d ubm -p 5030 -h usmidlnx01" export PG="psql -U ptrowbridge -d ubm -p 5432 -h usmidsap01"
export PGD="psql -U ptrowbridge -d ubm -p 5432 -h usmidlnx01"
export MS="sqlcmd.exe -S mid-sql02 -i" export MS="sqlcmd.exe -S mid-sql02 -i"
export PSQL_PAGER="pspg" 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 if [ -f "$HOME/.bash-git-prompt/gitprompt.sh" ]; then
GIT_PROMPT_ONLY_IN_REPO=1 GIT_PROMPT_ONLY_IN_REPO=1
@ -145,3 +149,7 @@ export PATH=$PATH:"$DENO_INSTALL/bin:$PATH"
eval `keychain --eval id_rsa` eval `keychain --eval id_rsa`
bind 'set bell-style none' 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 tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
set mouse=a set mouse=a
set nowrap set nowrap
colorscheme ron colorscheme darkblue
syntax on syntax on
set splitright set splitright
set splitbelow set splitbelow
@ -39,7 +39,8 @@ let g:netrw_altv = 1
let g:netrw_winsize = 25 let g:netrw_winsize = 25
"----airline tabs for buffers------- "----airline tabs for buffers-------
let g:airline#extensions#tabline#enabled = 1 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:tmuxline_powerline_separators = 1
let g:airline_powerline_fonts = 1 let g:airline_powerline_fonts = 1
"----markdown folding------------ "----markdown folding------------

View File

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