Giter Site home page Giter Site logo

dev-env's Introduction

dev-env

Setup ~/.bash_profile

# Prompt
export PS1="__________________________________\n\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ \n=> "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

# Aliases
alias ll='ls -FGlAhp' 
alias vim='mvim -v'
alias rm-swp="find . -type f -name \".*.swp\" -exec rm -f {} \\;"
alias ls-swp="find . -type f -name \".*.swp\""
alias shsource="source ~/.bash_profile"
alias shedit="vim ~/.bash_profile"

# Functions
cd() { builtin cd "$@"; ll; }   
ii() {
	echo -e "\nYou are logged on ${RED}$HOST"
	echo -e "\nAdditionnal information:$NC " ; uname -a
	echo -e "\n${RED}Users logged on:$NC " ; w -h
	echo -e "\n${RED}Current date :$NC " ; date
	echo -e "\n${RED}Machine stats :$NC " ; uptime
	echo -e "\n${RED}Current network location :$NC " ; scselect
	echo -e "\n${RED}Public facing IP Address :$NC " ;myip
	#echo -e "\n${RED}DNS Configuration:$NC " ; scutil --dns
	echo
}
parse_git_branch() {
		git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
if [ -f ~/.git-completion.bash ]; then
	. ~/.git-completion.bash
fi

eval "$(direnv hook bash)"

[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
HISTSIZE=""

fortune | pokemonsay

Install stuff

  1. Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  1. Install git

brew install git

  1. Install the silver searcher

brew install the_silver_searcher

  1. Install fzf
brew install fzf

# To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install

Setup GitHub

  1. Generate ssh key and add to GitHub
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
$ pbcopy < ~/.ssh/id_rsa.pub

Setup vim

  1. Install vim Plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  1. Setup ~/.vimrc
" Plugins will be downloaded under the specified directory.
call plug#begin('~/.vim/plugged')

" Declare the list of plugins.
Plug 'tpope/vim-sensible'
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf', { 'do': './install --bin' }
Plug 'junegunn/fzf.vim'

" :PlugInstall
" :PlugUpdate
" :PlugClean

" List ends here. Plugins become visible to Vim after this call.
call plug#end()

"On Mac OSX
"visual mode  copy :w !pbcopy
"copy the whole file :%w !pbcopy
"paste from the clipboard :r !pbpaste

syntax on
filetype plugin indent on
" system clipboard yank
set clipboard=unnamedplus
let mapleader=","

" MAPPING
nmap <silent> <leader>ev :e $MYVIMRC<CR>
" maps ,sv to source .vimrc
nnoremap <leader>sv :source $MYVIMRC
" maps ; to :
nnoremap ; :
" clears search buffer when ,/
nmap <silent> ,/ :nohlsearch<CR>
" // will search that word
vnoremap // y/<C-R>"<CR>

" maps pane navigation to shortcut 
" ctrl-w + j => ctrl-j
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
inoremap jk <esc>`

" OPTIONS
" Add full file path to your existing statusline
set laststatus=2
" Indenting Options
set tabstop=2 shiftwidth=2
set copyindent " copy the previous line's indent

" Buffer Options
set hidden " hides buffers when they are unsaved and a new buffer is opened
" Syntax Options
"
set showmatch " show matching paranthesis
" Search Options
"
set history=1000 " larger search history
set ignorecase " ignore case when searching
set hlsearch " highlight search terms
set incsearch " show search matches as you type
set smartcase " ignore case if pattern is all lowercase only
set backspace=indent,eol,start " backspace everything in insert
set number
set undolevels=1000 " larger undo history
set wildignore=*.swp " ignore swp files
set clipboard=unnamedplus " yank will copy to system clipboard
set pastetoggle=<F5> " F5 in insert allows for pasting w/o indent
set mouse=a
" split panes down for vertical
" split panes right for horizontal
set splitbelow
set splitright

" NERDTREE
map <C-n> :NERDTreeToggle<CR>
let g:NERDTreeNodeDelimiter = "\u00a0"
 
" fzf
set rtp+=/usr/local/opt/fzf

" the silver searcher
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -l -g ""'
nnoremap <C-p> :Files<CR>
nnoremap <C-b> :Buffer<CR>
nnoremap <C-f> :Ag<CR>

" Fix tmux colorscheme issues
set background=dark
set t_Co=256
colorscheme wasabi256

" silver searcher preview window
" ? on silver searcher result to preview
" Navigate preview using shift + arrow key
command! -bang -nargs=* Ag
	\ call fzf#vim#ag(<q-args>,
	\					<bang>0 ? fzf#vim#with_preview('up:60%')
	\							: fzf#vim#with_preview('right:50%:hidden', '?'),
	\					<bang>0)
set noexpandtab

Node

  1. Install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash

dev-env's People

Contributors

ephapox avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.