Skip to content

Instantly share code, notes, and snippets.

@MggMuggins
Created April 12, 2018 00:23
Show Gist options
  • Save MggMuggins/e9b17d42359ee2845f66f041e46bd2e5 to your computer and use it in GitHub Desktop.
Save MggMuggins/e9b17d42359ee2845f66f041e46bd2e5 to your computer and use it in GitHub Desktop.
Dotfiles
# Prefix Binding to Ctrl-a
unbind C-b
set -g prefix C-a
# Bindings for Window Splitting
unbind '"'
unbind %
unbind c
unbind &
bind | split-window -h
bind _ split-window -v
bind + new-window
bind - kill-window
# Enable mouse control (clickable windows, panes, resizable panes)
#set -g mouse on
# Vim-style X-Clipboard bindings
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
#Clipboard Integration
# Selection with mouse should copy right away, in addition to the default action
#unbind -n -Tcopy-mode-vi MouseDragEnd1Pane
#bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /home/wesley/#tmuxclip.log"
# Copy mode should also copy it to the cliboard as well
#unbind -Tcopy-mode-vi Enter
#bind -Tcopy-mode-vi Enter send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /home/wesley/tmuxclip.log"
# Middle Click to paste from clipboard
#unbind-key MouseDown2Pane
#bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
set shell=/usr/bin/bash
set nocompatible
filetype off
scriptencoding utf-8
set encoding=utf-8
" A few options for fm pane
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_altv = 1
let g:netrw_winsize = 25
" Actually run the fm pane
"augroup ProjectDrawer
" autocmd!
" autocmd VimEnter * ; :Vexplore
"augroup END
" Or Alias it
command Fm Vexplore
" Tab Preferences
set tabstop=4
set shiftwidth=4
set expandtab
set smartindent
" Render Invisibles
set listchars=eol:¬,trail:·,tab:»·
" Hack to only show leading spaces
highlight WhiteSpaceBol guifg=blue
highlight WhiteSpaceMol guifg=white
match WhiteSpaceMol / /
2match WhiteSpaceBol /^ \+/
# Belongs in ~/.config/fish
set -x EDITOR vim
# Run Tmux if we're in Konsole
set EMULATOR (basename "/"(ps -f -p (cat /proc/(echo %self)/stat | cut -d \ -f 4) | tail -1 | sed 's/^.* //'))
test $EMULATOR = "konsole"; and test $TERM != "screen"; and exec tmux
#echo $EMULATOR $TERM
# Belongs in ~/.config/fish/functions
function fish_prompt --description 'Write out the prompt'
set laststatus $status
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
if [ (_git_branch_name) ]
set -l git_branch (set_color -o blue)(_git_branch_name)
if [ (_is_git_dirty) ]
for i in (git branch -qv --no-color | string match -r '\*' | cut -d' ' -f4- | cut -d] -f1 | tr , \n)\
(git status --porcelain | cut -c 1-2 | uniq)
switch $i
case "*[ahead *"
set git_status "$git_status"(set_color red)⬆
case "*behind *"
set git_status "$git_status"(set_color red)⬇
case "."
set git_status "$git_status"(set_color green)✚
case " D"
set git_status "$git_status"(set_color red)✖
case "*M*"
set git_status "$git_status"(set_color green)✱
case "*R*"
set git_status "$git_status"(set_color purple)➜
case "*U*"
set git_status "$git_status"(set_color brown)═
case "??"
set git_status "$git_status"(set_color red)≠
end
end
else
set git_status (set_color green):
end
set git_info "(git$git_status$git_branch"(set_color white)")"
end
set_color -b black
printf '%s%s%s%s%s%s%s%s%s%s%s%s%s' (set_color -o white) '❰' (set_color green) $USER (set_color white) '❙' (set_color yellow) (echo $PWD | sed -e "s|^$HOME|~|") (set_color white) $git_info (set_color white) '❱' (set_color white)
if test $laststatus -eq 0
printf "%s$status%s\$%s " (set_color --bold green) (set_color --bold white) (set_color normal)
else
printf "%s$status%s\$%s " (set_color --bold red) (set_color --bold white) (set_color normal)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment