Browse Source

Update bashrc, nvim conf, and scripts

master
Tovi Jaeschke-Rogers 4 years ago
parent
commit
ed25fae40c
3 changed files with 68 additions and 27 deletions
  1. +52
    -23
      .bashrc
  2. +9
    -4
      .config/nvim/init.vim
  3. +7
    -0
      .local/bin/remap-keys

+ 52
- 23
.bashrc View File

@ -1,11 +1,56 @@
#!/bin/bash #!/bin/bash
#set -o vi
#bind -m vi-insert "\C-l":clear-screen
export PATH=~/go/bin:/snap/bin:/usr/sandbox/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/share/games:/usr/local/sbin:/usr/sbin:/sbin:$PATH
set -o vi
bind -m vi-insert "\C-l":clear-screen
shopt -s extglob
HISTSIZE= HISTSIZE=
HISTFILESIZE= HISTFILESIZE=
export EDITOR='nvim'
export GIT_AUTHOR_NAME="Tovi Jaeschke-Rogers"
export GIT_AUTHOR_EMAIL="tovi@tovijaeschke.xyz"
export GIT_COMMITTER_NAME="Tovi Jaeschke-Rogers"
export GIT_COMMITTER_EMAIL="tovi@tovijaeschke.xyz"
export LESS='-R'
export LESSOPEN='|~/.lessfilter %s'
alias ls="ls --color=auto" \
vb='nvim ~/.bashrc && source ~/.bashrc' \
va='nvim ~/.config/aliasrc && source ~/.bashrc'
if [[ $(uname) != "Linux" ]]; then
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" || true
export HOMEBREW_NO_INSTALL_CLEANUP=1
export GIT_AUTHOR_EMAIL="tovi.jaeschke-rogers@thirty4.com"
export GIT_COMMITTER_EMAIL="tovi.jaeschke-rogers@thirty4.com"
alias ls="ls -G" \
vb='nvim ~/.bash_profile && source ~/.bash_profile' \
va='nvim ~/.config/aliasrc && source ~/.bash_profile'
mount-hdd() {
if [ -z $1 ]; then
sudo umount /dev/disk2s1 && sudo /usr/local/bin/ntfs-3g /dev/disk2s1 /Volumes/NTFS -olocal -oallow_other
else
sudo umount /dev/$1 && sudo /usr/local/bin/ntfs-3g /dev/$1 /Volumes/NTFS -olocal -oallow_other
fi
}
else
aupdate() {
sudo "apt update && apt upgrade"
}
fi
# set PATH so it includes user's private bin if it exists # set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then if [ -d "$HOME/.local/bin" ] ; then
@ -14,12 +59,11 @@ fi
source ~/.config/aliasrc source ~/.config/aliasrc
parse_git_branch() { parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
} }
export PS1="\[\033[0;35m\]\u\[\033[0;32m\]@\[\033[0;34m\]\h \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[31m\] \n$\[\033[00m\] "
export PS1=" \[\033[0;36m\]\t \[\033[0;35m\]\u\[\033[0;32m\]@\[\033[0;34m\]\h \[\033[32m\]\W\[\033[33m\]\$(parse_git_branch)\[\033[31m\] \n$\[\033[00m\] "
mkcd() { mkcd() {
if [ ! -d "$1" ]; then if [ ! -d "$1" ]; then
@ -44,10 +88,12 @@ git() {
fi fi
} }
# git branch -vv | grep 'gone\]' | awk ' { print $1 }' | xargs -p git branch -d
git-prune() { git-prune() {
if [[ $@ == "prune" ]]; then
if [[ $@ == "--apply" ]]; then
command git branch --merged develop | grep -vEw "develop$|master$" | xargs git branch -d command git branch --merged develop | grep -vEw "develop$|master$" | xargs git branch -d
else else
echo "Run \"git prune --apply\" to delete the following branches:"
command git branch --merged develop | grep -vEw "develop$|master$" command git branch --merged develop | grep -vEw "develop$|master$"
fi fi
} }
@ -60,28 +106,11 @@ color-diff() {
diff -bur $1 $2 | colordiff | less diff -bur $1 $2 | colordiff | less
} }
export EDITOR='nvim'
shopt -s extglob
export GIT_AUTHOR_NAME="Tovi Jaeschke-Rogers"
export GIT_AUTHOR_EMAIL="tovi.jaeschke-rogers@thirty4.com"
export GIT_COMMITTER_NAME="Tovi Jaeschke-Rogers"
export GIT_COMMITTER_EMAIL="tovi.jaeschke-rogers@thirty4.com"
export NVM_DIR="$HOME/.nvm"
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"
eval $(thefuck --alias)
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash" || true
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
export LESS='-R'
export LESSOPEN='|~/.lessfilter %s'
export TMPDIR=/tmp

+ 9
- 4
.config/nvim/init.vim View File

@ -25,6 +25,8 @@ Plug 'tpope/vim-fugitive'
Plug 'rbong/vim-flog' Plug 'rbong/vim-flog'
Plug 'ap/vim-css-color' Plug 'ap/vim-css-color'
Plug 'justinmk/vim-sneak' Plug 'justinmk/vim-sneak'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'darrikonn/vim-gofmt', { 'do': ':GoUpdateBinaries' }
call plug#end() call plug#end()
" Some basics: " Some basics:
@ -35,6 +37,7 @@ call plug#end()
set incsearch set incsearch
set ignorecase set ignorecase
set smartcase set smartcase
set linebreak
set noswapfile set noswapfile
set nobackup set nobackup
@ -93,6 +96,8 @@ call plug#end()
nnoremap <C-q> :GFiles<CR> nnoremap <C-q> :GFiles<CR>
nnoremap <C-a> :Files<CR> nnoremap <C-a> :Files<CR>
let g:fzf_layout = { 'window': { 'width': 0.8, 'height': 0.5, 'highlight': 'Comment' } }
" php-doc-modded " php-doc-modded
nnoremap <C-c> :call PhpDocSingle()<CR>i nnoremap <C-c> :call PhpDocSingle()<CR>i
"nnoremap <C-P> :call PhpDocSingle()<CR> "nnoremap <C-P> :call PhpDocSingle()<CR>
@ -122,10 +127,10 @@ call plug#end()
set splitbelow splitright set splitbelow splitright
" Shortcutting split navigation, saving a keypress: " Shortcutting split navigation, saving a keypress:
" nnoremap <C-h> <C-w>h
" nnoremap <C-j> <C-w>j
" nnoremap <C-k> <C-w>k
" nnoremap <C-l> <C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Check file in shellcheck: " Check file in shellcheck:
map <leader>s :!clear && shellcheck %<CR> map <leader>s :!clear && shellcheck %<CR>


+ 7
- 0
.local/bin/remap-keys View File

@ -0,0 +1,7 @@
#!/bin/sh
xmodmap -e 'clear Lock' &
xmodmap -e 'keycode 135 = Super_R' &
xmodmap -e 'keycode 66 = Escape' &
xmodmap -e 'keycode 9 = Caps_Lock' &

Loading…
Cancel
Save