Update to rawhide and fix broken configs

This commit is contained in:
viktorbarzin 2020-03-12 14:21:14 +00:00
parent 27d62639c4
commit 16e496df5e
4 changed files with 57 additions and 10 deletions

View file

@ -14,6 +14,7 @@ alias pmmm='python manage.py makemigrations'
# Start vim with system clipboard
alias vim="vimx" # don't alias this - make symlink instead
alias vi="vim"
alias vimdiff="vim -d"
# git aliases
alias g='git'
@ -26,6 +27,8 @@ alias gl="git log --graph --abbrev-commit --decorate --format=format:'%C(bold bl
alias gd="git diff"
alias gb="git branch"
alias gpp='git push production master' # push to production for personal website
# pull all remote branches
alias git-pull-branches='git branch -r | grep -v "\->" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done'
# useful for daily stand-up
git-standup() {
AUTHOR=${AUTHOR:="`git config user.name`"}
@ -412,13 +415,15 @@ users={
"44:03:2C:6B:04:5E": "nasko-laptop",
"48:01:C5:39:A6:3D": "ioana-phone",
"F4:0F:24:2B:FE:14": "ioana-laptop",
"50:EB:71:23:BC:11": "gabi-laptop",
"FE:43:0A:04:03:BA": "gabi-phone",
}
# print("Connected device: ")
for line in sys.argv[1].split("\n"):
ip = line.split()[1].replace("(", "").replace(")", "")
mac = line.split()[3].upper()
if mac in users:
print(f"{users[mac]}")
print(f"{users[mac]}:{ip}")
' "$(arp -a | grep -v incomplete)"
}
@ -431,3 +436,26 @@ bindkey '^[0' autosuggest-accept;
bindkey '^[9' autosuggest-fetch;
# bindkey '^[9' autosuggest-clear;
#bindkey '^ ' autosuggest-fetch
alias sp="snapper -c home"
function snp(){
# Runs a command wrapped in btrfs snapper pre-post snapshots.
# Usage: $ snp <commands>
# e.g.: $ snp dnf install htop
cmd="$@"
snapshot_nbr=$(snapper -c home create --type=pre --cleanup-algorithm=number --print-number --description="${cmd}")
# snapshot_nbr=$(sudo snapper create --type=pre --cleanup-algorithm=number --print-number --description="${cmd}")
eval "$cmd"
snapshot_nbr=$(snapper -c home create --type=post --cleanup-algorithm=number --print-number --pre-number="$snapshot_nbr")
# snapshot_nbr=$(sudo snapper create --type=post --cleanup-algorithm=number --print-number --pre-number="$snapshot_nbr")
}
function waitfor() {
while pidof $1 > /dev/null; do sleep 2; done;
}
alias toclip="xclip -selection clipboard"
alias clearsessions="rm -rf ~/.vim/tmp/sessions/*"

View file

@ -162,13 +162,14 @@ bind P choose-buffer # choose which buffer to paste from
# -- user defined overrides ----------------------------------------------------
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'
# if '[ -f ~/.tmux.conf.local ]'
source ~/.tmux.conf.local
# -- 8< ------------------------------------------------------------------------
run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
run -b '[ -z "#{session_id}" ] && [ -z "#{version}" ] && tmux set display-time 3000 \; display "This configuration will soon require tmux >= 2.4" \; set -u display-time || true'
# run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# run -b '[ -z "#{session_id}" ] && [ -z "#{version}" ] && tmux set display-time 3000 \; display "This configuration will soon require tmux >= 2.4" \; set -u display-time || true'
# EOF

View file

@ -301,7 +301,7 @@ bind M-x send-prefix
# move status line to top
#set -g status-position top
bind \ split-window -h -c "#{pane_current_path}" # Split panes horizontal
bind \\ split-window -h -c "#{pane_current_path}" # Split panes horizontal
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
@ -328,3 +328,19 @@ bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -in -selecti
bind-key s set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
set-option -g default-shell /bin/zsh
# Custom added - MUST be in the end
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @resurrect-processes 'vi vim nvim man less more tail top htop'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

12
.vimrc
View file

@ -1,7 +1,3 @@
" Source vimrc on vim startup
" autocmd! VimEnter * source ~/.vimrc
" Load rename plugin
" so ~/.vim/Rename.vim
" let g:EclimCompletionMethod = 'omnifunc'
@ -332,7 +328,7 @@ noremap <leader>- :sp<CR>
"autocmd VimEnter * wincmd p
" Toggle NEDRTree plugin
noremap <C-b> :NERDTreeToggle<CR>
let NERDTreeIgnore = ['\.pyc$', '__pycache__']
let NERDTreeIgnore = ['\.pyc$', '__pycache__', '.mypy_cache', '.pytest_cache']
let NERDTreeShowHidden=1
" Better navigating through omnicomplete option list
@ -467,3 +463,9 @@ endfunction
autocmd VimLeave,BufWritePost * call SaveSess()
autocmd VimEnter * nested call RestoreSess()
set updatetime=100
" highlight GitGutterDelete guifg=#990000 ctermfg=1
" highlight GitGutterAdd guifg=#009900 ctermfg=2
" highlight GitGutterChange guifg=#997c00 ctermfg=3