Skip to content

Instantly share code, notes, and snippets.

@NetoBuenrostro
Last active April 28, 2018 01:44
Show Gist options
  • Save NetoBuenrostro/bf6c16e1c97163f4f4a7 to your computer and use it in GitHub Desktop.
Save NetoBuenrostro/bf6c16e1c97163f4f4a7 to your computer and use it in GitHub Desktop.
Dotfiles --moved
# OSX Autocomplete for ssh
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=$( \
cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" \
; \
cat ~/.ssh/config | \
grep "^Host " | \
awk '{print $2}' \
; \
)
COMPREPLY=( $(compgen -W "${comp_ssh_hosts}" -- $cur))
return 0
}
complete -F _complete_ssh_hosts ssh
#System aliases
alias ll='ls -FAlh'
alias df="df -Tha --total"
alias du="du -ach | sort -h"
# free output more human friendly
alias free="free -mth"
# alias that searches our process for an argument we'll pass
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
alias whatismyip='curl http://ipecho.net/plain; echo'
# Upgraded utility for df as well that's called pydf. It provides colorized output and text-based usage bars.
#alias df="pydf"
# `ncdu` command can be downloaded which presents file and directory sizes in an interactive ncurses display that you can browse and use to perform simple file actions:
#alias du="ncdu"
# `top` command with an enhanced version that is much easier on the eyes and can be sorted, searched, and scrolled without complications:
#alias top="htop"
# search our history easily like with a grep of the history command's output
alias histg="history | grep"
# `-c` flag in order to continue the download in case of problems.
alias wget="wget -c"
# add `-p` flag to make any necessary parent directories
# add a `-v` flag on top of that so we are told of every directory creation
alias mkdir="mkdir -pv"
alias hist-usage="history | awk '{CMD[\$2\" \"\$3]++;count++;}END { for (a in CMD)print CMD[a] \" \" CMD[a]/count*100 \"% \" a;}' | grep -v \"./\" | column -c3 -s ' ' -t | sort -nr | nl | head -n10"
# useful aliases
alias virtup='vagrant up && vagrant ssh'
alias virtoff='vagrant halt'
# Make everythign writable by user and group
umask 0002
" Allow the terminal to use 256 color
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
" Required:
call neobundle#begin(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
" My Bundles here:
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'bling/vim-airline'
NeoBundle 'airblade/vim-gitgutter'
NeoBundle 'chriskempson/base16-vim'
NeoBundle 'tomasr/molokai'
NeoBundle 'terryma/vim-multiple-cursors'
" You can specify revision/branch/tag.
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
call neobundle#end()
" Required:
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
" Integrate with powerline fonts
let g:airline_powerline_fonts = 1
" Molokai
let g:molokai_original = 1
" Display git gutter
let g:gitgutter_sign_column_always = 1
" Display status bar
set laststatus=2
"set ambiwidth=double
" Display line number
set number
" Move lines with ctrl <up/down>
nnoremap <C-Down> :m .+1<CR>==
nnoremap <C-Up> :m .-2<CR>==
inoremap <C-Down> <Esc>:m .+1<CR>==gi
inoremap <C-Up> <Esc>:m .-2<CR>==gi
vnoremap <C-Down> :m '>+1<CR>gv=gv
vnoremap <C-Up> :m '<-2<CR>gv=gv
set background=dark
colorscheme molokai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment