Skip to content

Instantly share code, notes, and snippets.

@duythinht
Last active August 29, 2015 14:06
Show Gist options
  • Save duythinht/d8c567f4b282f327176b to your computer and use it in GitHub Desktop.
Save duythinht/d8c567f4b282f327176b to your computer and use it in GitHub Desktop.
VIM working Environment
#set-option -g default-command "reattach-to-user-namespace -l bash"
set -g default-terminal "screen-256color"
set -g base-index 1
set -g pane-base-index 1
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim
# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright
# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01
# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# clock
set-window-option -g clock-mode-colour colour64 #green
set nocompatible " be iMproved
set hidden
filetype off " required!
set omnifunc=syntaxcomplete#Complete
set rtp+=~/.vim/bundle/vundle/
call vundle#begin()
" let Vundle manage Vundle
" required!
Plugin 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Plugin 'duythinht/inori'
Plugin 'bling/vim-airline'
Plugin 'kien/ctrlp.vim'
"Plugin 'wincent/command-t'
Plugin 'scrooloose/nerdcommenter'
Plugin 'kchmck/vim-coffee-script'
Plugin 'mattn/emmet-vim'
Plugin 'klen/python-mode'
Plugin 'davidhalter/jedi-vim'
Plugin 'derekwyatt/vim-scala'
Plugin 'tpope/vim-surround'
Plugin 'scrooloose/nerdtree'
Plugin 'mileszs/ack.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tfnico/vim-gradle'
" Github repos of the user 'vim-scripts'
" => can omit the username part
Plugin 'L9'
" non github repos
" ...
call vundle#end()
filetype plugin indent on " required!
" Hide MacVim scrollbar
set guioptions-=r
set guioptions-=L
" Change the key
let mapleader=","
nnoremap ; :
" stop using arrow key
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
" Re-map move around for wrapping line
nnoremap j gj
nnoremap k gk
" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Setting for quick copy & paste
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>yy "+yy
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P
" Binding paste mode
set pastetoggle=<F2>
" Generic setings
set nowrap " don't wrap lines
set tabstop=2 " a tab is four spaces
set backspace=2 " allow backspacing over everything in insert mode
set autoindent " always set autoindenting on
set cindent " copy the previous indentation on autoindenting
set smartindent " smart indent
set number " always show line numbers
set shiftwidth=2 " number of spaces to use for autoindenting
set softtabstop=2 " tabstap is 4
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch " set show matching parenthesis
set smarttab " insert tabs on the start of a line according to shiftwidth, not tabstop
set incsearch " show search matches as you type
set nobackup " no backup
set noswapfile " no swap files
syntax enable " enable syntax hightlight
" Personal settings
colorscheme inori " using inori colorscheme
set background=dark " change background to dark
hi LineNr ctermbg=None
" Tabs
"hi TabLine guifg=208 guibg=None gui=None ctermfg=11 ctermbg=None cterm=None
"hi TabLineFill guifg=None guibg=None gui=None ctermfg=None ctermbg=None cterm=None
"hi TabLineSel guifg=100 guibg=None gui=bold ctermfg=160 ctermbg=None cterm=bold
" Indent for FileType
autocmd FileType python setl sw=4 sts=4 et
"autocmd FileType html setl sw=4 sts=4 et
" Airline
set laststatus=2
let g:airline_theme="bubblegum"
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
"let g:airline_left_sep = '»'
"let g:airline_left_sep = '▶'
"let g:airline_right_sep = '«'
"let g:airline_right_sep = '◀'
"let g:airline_symbols.linenr = '␊'
"let g:airline_symbols.linenr = '␤'
"let g:airline_symbols.linenr = '¶'
"let g:airline_symbols.branch = '⎇'
"let g:airline_symbols.paste = 'ρ'
"let g:airline_symbols.paste = 'Þ'
"let g:airline_symbols.paste = '∥'
"let g:airline_symbols.whitespace = 'Ξ'
"
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = ''
let g:airline_symbols.whitespace = 'Ξ'
" Command-T
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.o,*.obj,.git,*/vendor/*,*/target/*,*/build/*,*/node_modules/*
" autocmd FileType python set omnifunc=pythoncomplete#Complete
" autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
" autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
" autocmd FileType css set omnifunc=csscomplete#CompleteCSS
" Python-mode
" Activate rope
" Keys:
" K Show python docs
" <Ctrl-Space> Rope autocomplete
" <Ctrl-c>g Rope goto definition
" <Ctrl-c>d Rope show documentation
" <Ctrl-c>f Rope find occurrences
" <Leader>b Set, unset breakpoint (g:pymode_breakpoint enabled)
" [[ Jump on previous class or function (normal, visual, operator modes)
" ]] Jump on next class or function (normal, visual, operator modes)
" [M Jump on previous class or method (normal, visual, operator modes)
" ]M Jump on next class or method (normal, visual, operator modes)
let g:pymode_rope = 0
let g:pymode_options_max_line_length = 999
" Documentation
let g:pymode_doc = 1
let g:pymode_doc_key = 'K'
"Linting
let g:pymode_lint = 0
let g:pymode_lint_checker = "pyflakes,pep8"
" Auto check on save
let g:pymode_lint_write = 1
" Support virtualenv
let g:pymode_virtualenv = 1
" Enable breakpoints plugin
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_key = '<leader>b'
" syntax highlighting
let g:pymode_syntax = 1
let g:pymode_syntax_all = 1
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
let g:pymode_syntax_space_errors = g:pymode_syntax_all
" Don't autofold code
let g:pymode_folding = 0
" Don't show preview
autocmd FileType python setlocal completeopt-=preview
let g:jedi#popup_on_dot = 0
map <C-n> :NERDTreeToggle<CR>
let NERDTreeIgnore = ['\.pyc$']
"Remove trailling
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc
noremap <leader>t :call DeleteTrailingWS()<CR>
inoremap {<CR> {<CR>}<Esc>O
inoremap [<CR> [<CR>]<Esc>O<Tab>
export TERM=xterm-256color
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory autocd beep extendedglob nomatch notify
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/duythinht/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Enable prompt themes
autoload -U promptinit
promptinit
prompt redhat
#End of prompt themes
# Run commands alias
[ -f ~/.cmd_alias ] && while read line; do eval "alias $line"; done < ~/.cmd_alias
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# deb cdrom:[Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2)]/ trusty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty main restricted
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-updates main restricted
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty universe
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty universe
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-updates universe
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty multiverse
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty multiverse
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-updates multiverse
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-backports main restricted universe multiverse
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-security main restricted
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-security main restricted
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-security universe
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-security universe
deb http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-security multiverse
deb-src http://mirror-fpt-telecom.fpt.net/ubuntu/ trusty-security multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment