Skip to content

Instantly share code, notes, and snippets.

@Bahad001
Created August 9, 2018 01:34
Show Gist options
  • Save Bahad001/9e719a95f0aba807b2d57130991bbebe to your computer and use it in GitHub Desktop.
Save Bahad001/9e719a95f0aba807b2d57130991bbebe to your computer and use it in GitHub Desktop.
My Configuration (Thanks to Jeffrey Way - Laracasts)
set nocompatible
source ~/.vim/plugins.vim
syntax enable
set number
set expandtab
set tabstop=2
set shiftwidth=2
set softtabstop=2
set backspace=indent,eol,start
"-------------Visuals------------"
set t_Co=256
colorscheme atom-dark-256
"-------------Split Management--------------"
set splitbelow "Make splits default to below...
set splitright "And to the right. This feels more natural.
"We'll set simpler mappings to switch between splits.
nmap <C-J> <C-W><C-J>
nmap <C-K> <C-W><C-K>
nmap <C-H> <C-W><C-H>
nmap <C-L> <C-W><C-L>
"Make NERDTree easier to toggle.
nmap <C-B> :NERDTreeToggle<CR>
nmap <C-R> :CtrlPBufTag<CR>
"Variables
let mapleader = ',' "The default is \, but a comma is much better.
let NERDTreeHijackNetrw = 0
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:ctrlp_match_window = 'top,order:ttb,min:1,max:30,results:30'
"------------Search---------------"
set incsearch
"-------------Auto-Commands--------------"
"Automatically source the Vimrc file on save.
augroup autosourcing
autocmd!
autocmd BufWritePost .vimrc source %
augroup END
# Unix
alias c="clear"
alias port="netstat -ntlp"
alias copy="xclip -selection clipboard && echo 'Copied to clipboard.'"
alias path="pwd | xclip -selection clipboard && echo 'Path copied to clipboard'"
alias sshkey="cat ~/.ssh/id_rsa.pub | xclip -selection clipboard && echo 'Public SSH copied to clipboard.'"
# Others
alias y="yarn"
# Git and Github
alias git="hub"
alias ga="git add"
alias gd="git diff"
alias gf="get fetch"
alias gs="git status"
alias gb="git branch"
alias gc="git commit -S"
alias gl="git log --oneline --graph"
alias gcl="git clone"
alias gco="git checkout"
alias gpr="git pull-request"
alias gdc="git diff --cached"
alias gpoh='git push origin HEAD'
alias glf="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias nah="git reset --hard; git clean -df;"
# Laravel
alias art="php artisan"
alias tinker="art tinker"
alias migrate="art migrate"
alias routes="art route:list"
alias fresh="art migrate:fresh --seed"
alias serve="art serve --host 0.0.0.0"
# APT
alias purge="sudo apt purge"
alias update="sudo apt update"
alias list="apt list --upgradable"
alias remove="sudo apt autoremove"
alias upgrade="sudo apt full-upgrade"
# Docker
alias dl="docker ps -l -q"
alias dps="docker ps"
alias dpa="docker ps -a"
alias di="docker images"
alias dip="docker inspect --format '{{ .NetworkSettings.IPAddress }}'"
alias dkd="docker run -d -P"
alias dki="docker run -it -P"
alias dex="docker exec -it"
alias dco="docker-compose"
alias dcl="docker-compose logs -f"
# Composer path
export PATH=$HOME/.composer/vendor/bin:$PATH
# SQLCMD path
export PATH=$PATH:/opt/mssql-tools/bin
# Go path
export PATH=$PATH:/usr/local/go/bin
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH=$PATH:$HOME/.rvm/bin
eval "$(hub alias -s)"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/cham11ng/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="gitster"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# plugins=(git docker)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
if [ -f ~/.zsh_aliases ]; then
source ~/.zsh_aliases
fi
if [ -f ~/.zsh_profile ]; then
source ~/.zsh_profile
fi
fpath=(~/.zsh/completion $fpath)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Auto jump
[[ -s /home/cham11ng/.autojump/etc/profile.d/autojump.sh ]] && source /home/cham11ng/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+l",
"command": "editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+i",
"command": "-editor.action.formatDocument",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+1",
"command": "workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+b",
"command": "-workbench.action.toggleSidebarVisibility"
},
{
"key": "ctrl+shift+]",
"command": "workbench.files.action.collapseExplorerFolders"
},
{
"key": "alt+enter",
"command": "editor.action.showContextMenu",
"when": "editorTextFocus"
},
{
"key": "shift+f10",
"command": "-editor.action.showContextMenu",
"when": "editorTextFocus"
}
]
filetype off " required
"Set the runtime path to include Vundle and initialize.
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-vinegar'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'msanders/snipmate.vim'
Plugin 'ervandew/supertab'
Plugin 'pangloss/vim-javascript'
Plugin 'leafgarland/typescript-vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-fugitive'
Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
{
"editor.tabSize": 2,
"editor.fontSize": 13,
"editor.lineHeight": 30,
"editor.formatOnPaste": true,
"editor.minimap.enabled": false,
"editor.snippetSuggestions": "top",
"editor.fontFamily": "Operator Mono Book",
"prettier.printWidth": 120,
"prettier.singleQuote": true,
"files.autoSave": "onFocusChange",
"window.zoomLevel": 0,
"workbench.colorTheme": "Slime",
"workbench.iconTheme": "vscode-icons",
"workbench.statusBar.visible": false,
"sublimeTextKeymap.promptV3Features": true,
"workbench.activityBar.visible": false,
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.fontSize": 13,
"explorer.confirmDelete": false,
"explorer.openEditors.visible": 0,
"explorer.confirmDragAndDrop": false,
"extensions.ignoreRecommendations": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment