From 78876b1fe9b7bd57c12ac7f3547a07d8928c0161 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 13 Mar 2023 16:46:45 -0400 Subject: [PATCH] alias to list files with open vim buffers and execute them with psql --- .bashrc | 12 ++++++++++-- .vimrc | 5 +++-- setup.sh | 8 ++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.bashrc b/.bashrc index 59d14f4..49f46a0 100644 --- a/.bashrc +++ b/.bashrc @@ -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 diff --git a/.vimrc b/.vimrc index b5a59de..826cafe 100644 --- a/.vimrc +++ b/.vimrc @@ -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------------ diff --git a/setup.sh b/setup.sh index 8d61664..2eb193d 100755 --- a/setup.sh +++ b/setup.sh @@ -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--------------------------------------------------