mirror of
https://github.com/mr0xb/dotfiles.git
synced 2026-08-28 03:44:57 -04:00
first commit
This commit is contained in:
commit
4019af67ec
10 changed files with 2906 additions and 0 deletions
40
.bash_profile
Normal file
40
.bash_profile
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
export GOPATH=$HOME/go_projects
|
||||||
|
alias fp='stat --format "%a"'
|
||||||
|
gsay() { if [[ "${1}" =~ -[a-z]{2} ]]; then local lang=${1#-}; local text="${*#$1}"; else local lang=${LANG%_*}; local text="$*";fi; mplayer "http://translate.google.com/translate_tts?ie=UTF-8&tl=${lang}&q=${text}" &> /dev/null ; }
|
||||||
|
function google {
|
||||||
|
xdg-open "https://www.google.com/search?q=`urlencode "${(j: :)@}"`"
|
||||||
|
}
|
||||||
|
# https://stackoverflow.com/questions/6250698/how-to-decode-url-encoded-string-in-shell
|
||||||
|
# Encode with URLEncode
|
||||||
|
|
||||||
|
function urlencode {
|
||||||
|
python -c "import sys; from urllib.parse import quote_plus; print(quote_plus(sys.stdin.read()))"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Decode URLencoded string
|
||||||
|
function urldecode {
|
||||||
|
python -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()), end='')"
|
||||||
|
}
|
||||||
|
#public c ip
|
||||||
|
function myip {
|
||||||
|
local api
|
||||||
|
case "$1" in
|
||||||
|
"-4")
|
||||||
|
api="http://v4.ipv6-test.com/api/myip.php"
|
||||||
|
;;
|
||||||
|
"-6")
|
||||||
|
api="http://v6.ipv6-test.com/api/myip.php"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
api="http://ipv6-test.com/api/myip.php"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
curl -s "$api"
|
||||||
|
echo # Newline.
|
||||||
|
}
|
||||||
|
|
||||||
|
alias such=git
|
||||||
|
alias very=git
|
||||||
|
alias wow='git status'
|
||||||
|
alias hogs="ps aux | sort -nk +4 | tail -n 20"
|
||||||
|
alias perms="stat -c '%A %a %n'"
|
||||||
116
.bashrc
Normal file
116
.bashrc
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||||
|
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||||
|
# for examples
|
||||||
|
|
||||||
|
# If not running interactively, don't do anything
|
||||||
|
case $- in
|
||||||
|
*i*) ;;
|
||||||
|
*) return;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# don't put duplicate lines or lines starting with space in the history.
|
||||||
|
# See bash(1) for more options
|
||||||
|
HISTCONTROL=ignoreboth
|
||||||
|
|
||||||
|
# append to the history file, don't overwrite it
|
||||||
|
shopt -s histappend
|
||||||
|
|
||||||
|
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||||
|
HISTSIZE=1000
|
||||||
|
HISTFILESIZE=2000
|
||||||
|
|
||||||
|
# check the window size after each command and, if necessary,
|
||||||
|
# update the values of LINES and COLUMNS.
|
||||||
|
shopt -s checkwinsize
|
||||||
|
|
||||||
|
# If set, the pattern "**" used in a pathname expansion context will
|
||||||
|
# match all files and zero or more directories and subdirectories.
|
||||||
|
#shopt -s globstar
|
||||||
|
|
||||||
|
# make less more friendly for non-text input files, see lesspipe(1)
|
||||||
|
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||||
|
|
||||||
|
# set variable identifying the chroot you work in (used in the prompt below)
|
||||||
|
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||||
|
debian_chroot=$(cat /etc/debian_chroot)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||||
|
case "$TERM" in
|
||||||
|
xterm-color|*-256color) color_prompt=yes;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||||
|
# off by default to not distract the user: the focus in a terminal window
|
||||||
|
# should be on the output of commands, not on the prompt
|
||||||
|
force_color_prompt=yes
|
||||||
|
|
||||||
|
if [ -n "$force_color_prompt" ]; then
|
||||||
|
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||||
|
# We have color support; assume it's compliant with Ecma-48
|
||||||
|
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||||
|
# a case would tend to support setf rather than setaf.)
|
||||||
|
color_prompt=yes
|
||||||
|
else
|
||||||
|
color_prompt=
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$color_prompt" = yes ]; then
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||||
|
else
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||||
|
fi
|
||||||
|
unset color_prompt force_color_prompt
|
||||||
|
|
||||||
|
# If this is an xterm set the title to user@host:dir
|
||||||
|
case "$TERM" in
|
||||||
|
xterm*|rxvt*)
|
||||||
|
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# enable color support of ls and also add handy aliases
|
||||||
|
if [ -x /usr/bin/dircolors ]; then
|
||||||
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
#alias dir='dir --color=auto'
|
||||||
|
#alias vdir='vdir --color=auto'
|
||||||
|
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
alias fgrep='fgrep --color=auto'
|
||||||
|
alias egrep='egrep --color=auto'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# colored GCC warnings and errors
|
||||||
|
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||||
|
|
||||||
|
# some more ls aliases
|
||||||
|
#alias ll='ls -l'
|
||||||
|
#alias la='ls -A'
|
||||||
|
#alias l='ls -CF'
|
||||||
|
|
||||||
|
# Alias definitions.
|
||||||
|
# You may want to put all your additions into a separate file like
|
||||||
|
# ~/.bash_aliases, instead of adding them here directly.
|
||||||
|
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||||
|
|
||||||
|
if [ -f ~/.bash_aliases ]; then
|
||||||
|
. ~/.bash_aliases
|
||||||
|
fi
|
||||||
|
if [ -f ~/.bash_profile ]; then
|
||||||
|
. ~/.bash_profile
|
||||||
|
fi
|
||||||
|
# enable programmable completion features (you don't need to enable
|
||||||
|
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||||
|
# sources /etc/bash.bashrc).
|
||||||
|
if ! shopt -oq posix; then
|
||||||
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
elif [ -f /etc/bash_completion ]; then
|
||||||
|
. /etc/bash_completion
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
85
.screenrc
Normal file
85
.screenrc
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
# the following two lines give a two-line status, with the current window highlighted
|
||||||
|
hardstatus alwayslastline
|
||||||
|
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
|
||||||
|
|
||||||
|
# huge scrollback buffer
|
||||||
|
defscrollback 5000
|
||||||
|
|
||||||
|
# no welcome message
|
||||||
|
startup_message off
|
||||||
|
|
||||||
|
# 256 colors
|
||||||
|
attrcolor b ".I"
|
||||||
|
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
|
||||||
|
defbce on
|
||||||
|
|
||||||
|
# mouse tracking allows to switch region focus by clicking
|
||||||
|
mousetrack on
|
||||||
|
|
||||||
|
# default windows
|
||||||
|
screen -t Shell1 1 bash
|
||||||
|
screen -t Shell2 2 bash
|
||||||
|
screen -t Python 3 python
|
||||||
|
screen -t Media 4 bash
|
||||||
|
select 0
|
||||||
|
bind c screen 1 # window numbering starts at 1 not 0
|
||||||
|
bind 0 select 10
|
||||||
|
|
||||||
|
# get rid of silly xoff stuff
|
||||||
|
bind s split
|
||||||
|
|
||||||
|
# layouts
|
||||||
|
layout autosave on
|
||||||
|
layout new one
|
||||||
|
select 1
|
||||||
|
layout new two
|
||||||
|
select 1
|
||||||
|
split
|
||||||
|
resize -v +8
|
||||||
|
focus down
|
||||||
|
select 4
|
||||||
|
focus up
|
||||||
|
layout new three
|
||||||
|
select 1
|
||||||
|
split
|
||||||
|
resize -v +7
|
||||||
|
focus down
|
||||||
|
select 3
|
||||||
|
split -v
|
||||||
|
resize -h +10
|
||||||
|
focus right
|
||||||
|
select 4
|
||||||
|
focus up
|
||||||
|
|
||||||
|
layout attach one
|
||||||
|
layout select one
|
||||||
|
|
||||||
|
# navigating regions with Ctrl-arrows
|
||||||
|
bindkey "^[[1;5D" focus left
|
||||||
|
bindkey "^[[1;5C" focus right
|
||||||
|
bindkey "^[[1;5A" focus up
|
||||||
|
bindkey "^[[1;5B" focus down
|
||||||
|
|
||||||
|
# switch windows with F3 (prev) and F4 (next)
|
||||||
|
bindkey "^[OR" prev
|
||||||
|
bindkey "^[OS" next
|
||||||
|
|
||||||
|
# switch layouts with Ctrl+F3 (prev layout) and Ctrl+F4 (next)
|
||||||
|
bindkey "^[O1;5R" layout prev
|
||||||
|
bindkey "^[O1;5S" layout next
|
||||||
|
|
||||||
|
# F2 puts Screen into resize mode. Resize regions using hjkl keys.
|
||||||
|
bindkey "^[OQ" eval "command -c rsz" # enter resize mode
|
||||||
|
|
||||||
|
# use hjkl keys to resize regions
|
||||||
|
bind -c rsz h eval "resize -h -5" "command -c rsz"
|
||||||
|
bind -c rsz j eval "resize -v -5" "command -c rsz"
|
||||||
|
bind -c rsz k eval "resize -v +5" "command -c rsz"
|
||||||
|
bind -c rsz l eval "resize -h +5" "command -c rsz"
|
||||||
|
|
||||||
|
# quickly switch between regions using tab and arrows
|
||||||
|
bind -c rsz \t eval "focus" "command -c rsz" # Tab
|
||||||
|
bind -c rsz -k kl eval "focus left" "command -c rsz" # Left
|
||||||
|
bind -c rsz -k kr eval "focus right" "command -c rsz" # Right
|
||||||
|
bind -c rsz -k ku eval "focus up" "command -c rsz" # Up
|
||||||
|
bind -c rsz -k kd eval "focus down" "command -c rsz" # Down
|
||||||
2597
.vim/autoload/plug.vim
Normal file
2597
.vim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load diff
1
.vim/bundle/ag
Submodule
1
.vim/bundle/ag
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 4a0dd6e190f446e5a016b44fdaa2feafc582918e
|
||||||
1
.vim/bundle/gundo
Submodule
1
.vim/bundle/gundo
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 99e6240340d9ba07b66c544daf44fa7caffbf7e7
|
||||||
1
.vim/plugged/nerdtree
Submodule
1
.vim/plugged/nerdtree
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 07612557ebb4118ef4a337faa7033d0270773c71
|
||||||
1
.vim/plugged/vim-fugitive
Submodule
1
.vim/plugged/vim-fugitive
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 460664018a8eaecd89fb2b095fad59c0e16f5f06
|
||||||
58
.vimrc
Normal file
58
.vimrc
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
syntax enable
|
||||||
|
set tabstop=2
|
||||||
|
set softtabstop=2
|
||||||
|
set expandtab
|
||||||
|
set number
|
||||||
|
set showcmd
|
||||||
|
set cursorline
|
||||||
|
set wrap
|
||||||
|
|
||||||
|
filetype indent on
|
||||||
|
set wildmenu
|
||||||
|
set lazyredraw
|
||||||
|
set showmatch
|
||||||
|
" highlight matching pairs of brackets, use % to jump between them.
|
||||||
|
set matchpairs+=<:>
|
||||||
|
set incsearch
|
||||||
|
set hlsearch
|
||||||
|
set ignorecase
|
||||||
|
nnoremap <leader><space> :nohlsearch<CR>
|
||||||
|
|
||||||
|
set foldenable
|
||||||
|
set foldlevelstart=10
|
||||||
|
set foldnestmax=10
|
||||||
|
set foldmethod=indent
|
||||||
|
|
||||||
|
nnoremap j gj
|
||||||
|
nnoremap k gk
|
||||||
|
|
||||||
|
nnoremap B ^
|
||||||
|
nnoremap E $
|
||||||
|
nnoremap $ <nop>
|
||||||
|
nnoremap ^ <nop>
|
||||||
|
nnoremap gV `[v`]
|
||||||
|
|
||||||
|
map <F6> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
|
let mapleader=","
|
||||||
|
inoremap jk <esc>
|
||||||
|
|
||||||
|
" save session
|
||||||
|
nnoremap <leader>s :mksession<CR>
|
||||||
|
|
||||||
|
nnoremap <leader>a :Ag
|
||||||
|
|
||||||
|
|
||||||
|
" Enable backups in tmp dir
|
||||||
|
set backup
|
||||||
|
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
|
||||||
|
set backupskip=/tmp/*
|
||||||
|
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
|
||||||
|
set writebackup
|
||||||
|
|
||||||
|
" nerdtree stuff
|
||||||
|
let NERDTreeShowHidden=1
|
||||||
|
|
||||||
|
if filereadable(expand("~/.vimrc.plug"))
|
||||||
|
source ~/.vimrc.plug
|
||||||
|
endif
|
||||||
6
.vimrc.plug
Normal file
6
.vimrc.plug
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
call plug#begin('~/.vim/plugged')
|
||||||
|
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
Plug 'preservim/nerdtree'
|
||||||
|
|
||||||
|
call plug#end()
|
||||||
Loading…
Reference in a new issue