Skip to content

Instantly share code, notes, and snippets.

@snowe2010
Forked from prabirshrestha/.bash_profile
Created April 17, 2016 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snowe2010/592109ed5c65863944faedb7995839ec to your computer and use it in GitHub Desktop.
Save snowe2010/592109ed5c65863944faedb7995839ec to your computer and use it in GitHub Desktop.
Font=Powerline Consolas
ForegroundColour=131,148,150
BackgroundColour=0,43,54
CursorColour=220,50,47
Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
Yellow=181,137,0
BoldYellow=101,123,131
Blue=38,139,210
BoldBlue=131,148,150
Magenta=211,54,130
BoldMagenta=108,113,196
Cyan=42,161,152
BoldCyan=147,161,161
White=238,232,213
BoldWhite=253,246,227
Transparency=low
FontHeight=12
Scrollbar=none
# curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.tmux.conf -o ~/.tmux.conf
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Change the prefix to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# enable pretty colors
set -g default-terminal "screen-256color"
# increase scroll-back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# start window index at 1
set -g base-index 1
# start pane index at 1
set -g pane-base-index 1
# change the default delay to make it more responsive
set -sg escape-time 1
# Splitting panes
bind \ split-window -h
bind - split-window -v
# pane movements
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# pane resizing
bind H resize-pane -L 5
bind J resize-pane -D 5
bind K resize-pane -U 5
bind L resize-pane -R 5
# pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# window movement
bind -r C-h select-window -t:-
bind -r C-l select-window -t:+
# remapping copy paste to vim
# unbind [
bind Escape copy-mode
unbind p
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# setw -g monitory-activity on
set -g visual-activity on
# Enable mouse support in ~/.tmux.conf
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-window-option -g mode-mouse on
# mouse can be used to resize panes (by dragging dividers)
set -g mouse-resize-pane on
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
set-option -g renumber-windows on
setw -g aggressive-resize on
# status bar
set -g status-interval 2
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #S #[fg=colour252,bg=colour238,nobold]#[fg=colour245,bg=colour238,bold] #(whoami)#[fg=colour238,bg=colour234,nobold]'
set -g window-status-format "#[fg=white,bg=colour234] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]#[fg=colour25,bg=colour39,noreverse,bold] #I  #W #[fg=colour39,bg=colour234,nobold]"
set -g status-right "#[fg=colour235,bg=colour252,bold] %d %b#[fg=colour238,bg=colour252,nobold]#[fg=colour245,bg=colour238,bold]%r"
" For windows:
" install chocolatey
" choco install curl
" install fonts from ~/.config/nvim/cache/fonts (note: nerd-fonts is over 1gb when cloning)
" install python2 and python 3 and add to path
" download lua from: http://sourceforge.net/projects/luabinaries/files/5.3/Windows%20Libraries/Dynamic/lua-5.3_Win64_dllw4_lib.zip/download
set nocompatible
let mapleader = ' '
nnoremap ; :
let s:is_win = has('win32') || has('win64')
let s:is_cygwin = has('win32unix')
let s:is_mac = has('macunix') || (executable('uname') && system('uname') =~? '^darwin')
let settings = {}
let settings.rtp = expand('~/.config/nvim')
let settings.cache = settings.rtp . '/cache'
let settings.plugins = settings.cache . '/plugins'
let settings.completionlib = ''
let settings.snippets=0
" bootstrap/vim-plug {{{
function! Mkdirp(dirname)
if !isdirectory(expand(a:dirname))
call mkdir(expand(a:dirname), 'p')
endif
endfunction
if has('vim_starting') && !has('nvim')
execute printf('set rtp+=%s', g:settings.rtp)
endif
if !filereadable(g:settings.rtp . '/autoload/plug.vim')
execute 'silent !curl -fkLo ' . expand(g:settings.rtp . '/autoload/plug.vim') ' --create-dirs'
\ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
execute 'silent !git clone https://github.com/eugeii/consolas-powerline-vim.git --depth 1' . expand(g:settings.cache . '/fonts/consolas-powerline-vim')
execute 'silent !git clone https://github.com/powerline/fonts --depth 1' . expand(g:settings.cache . '/fonts/powerline-fonts')
execute 'silent !git clone https://github.com/ryanoasis/nerd-fonts.git --depth 1 ' . expand(g:settings.cache . '/fonts/nerd-fonts')
autocmd VimEnter * PlugInstall
end
" }}}
if s:is_win
set shellslash
endif
" plugins {{{
call plug#begin(g:settings.plugins)
" plugins-colorscheme {{{
Plug 'mhartington/oceanic-next'
Plug 'altercation/vim-colors-solarized'
" }}}
" plugins-ui {{{
Plug 'vim-airline/vim-airline'
Plug 'ryanoasis/vim-devicons'
Plug 'Yggdroot/indentLine'
Plug 'ntpeters/vim-better-whitespace'
Plug 'yonchu/accelerated-smooth-scroll'
" }}}
" plugins-ctrlp {{{
Plug 'ctrlpvim/ctrlp.vim'
Plug 'FelikZ/ctrlp-py-matcher'
Plug 'dbeecham/ctrlp-commandpalette.vim'
Plug 'endel/ctrlp-filetype.vim'
Plug 'hara/ctrlp-href'
Plug 'mattn/ctrlp-google'
Plug 'mattn/ctrlp-launcher'
Plug 'mattn/ctrlp-vimpatches'
Plug 'mattn/ctrlp-windowselector'
Plug 'okcompute/vim-ctrlp-session'
Plug 'ompugao/ctrlp-history'
Plug 'pasela/ctrlp-cdnjs'
Plug 'prabirshrestha/ctrlp-env'
Plug 'tacahiroy/ctrlp-funky'
Plug 'voronkovich/ctrlp-nerdtree.vim'
" }}}
" plugins-filetypes {{{
Plug 'chrisbra/csv.vim', { 'for': 'csv' }
Plug 'elzr/vim-json', { 'for': 'json' }
Plug 'mattn/emmet-vim'
" Plug 'leafgarland/typescript-vim'
Plug 'HerringtonDarkholme/yats.vim', { 'for': 'typescript' }
Plug 'Quramy/tsuquyomi', { 'for': 'typescript' }
Plug 'OrangeT/vim-csharp'
Plug 'amirh/HTML-AutoCloseTag'
if (s:is_win && has('python'))
Plug 'OmniSharp/omnisharp-vim', { 'do': 'cd server && C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\msbuild.exe' }
endif
" }}}
" plugins-unite.vim {{{
Plug 'Shougo/unite.vim'
Plug 'Shougo/unite-outline'
Plug 'beans15/unite-maven'
Plug 'choplin/unite-spotlight'
Plug 'f110/vim-unite-jenkins'
Plug 'farseer90718/unite-workflow'
Plug 'jbking/unite-spell-suggest'
Plug 'joker1007/unite-pull-request'
Plug 'junkblocker/unite-codesearch'
" Plug 'kamichidu/vim-unite-javaimport'
Plug 'mackee/unite-httpstatus'
Plug 'mattn/unite-gist'
Plug 'mmisono/unite-compiler'
Plug 'mopp/unite-rss'
Plug 'osyo-manga/unite-airline_themes'
Plug 'osyo-manga/unite-env'
Plug 'osyo-manga/unite-filetype'
Plug 'osyo-manga/unite-fold'
Plug 'osyo-manga/unite-quickfix'
Plug 'osyo-manga/unite-vimpatches'
Plug 'pasela/unite-webcolorname'
Plug 'prabirshrestha/unite-hackernews'
Plug 'prabirshrestha/unite-nuget'
Plug 'rhysd/unite-mac-apps'
Plug 'rhysd/unite-ruby-require.vim'
Plug 'rhysd/unite-stackoverflow.vim'
Plug 'ryotakato/unite-outline-objc'
Plug 'shiena/unite-path'
Plug 'skeept/Ultisnips-neocomplete-unite'
Plug 'tacroe/unite-alias'
Plug 'tacroe/unite-mark'
Plug 'thinca/vim-unite-history'
Plug 'tsukkee/unite-help'
Plug 'tsukkee/unite-tag'
Plug 'ujihisa/unite-colorscheme'
Plug 'ujihisa/unite-font'
Plug 'ujihisa/unite-launch'
Plug 'ujihisa/unite-rake'
Plug 'zhaocai/unite-scriptnames'
Plug 'zoncoen/unite-autojump'
" }}}
" plugins-misc {{{
Plug 'DataWraith/auto_mkdir'
Plug 'Lokaltog/vim-easymotion'
Plug 'Shougo/vimshell.vim'
Plug 'airblade/vim-rooter'
Plug 'jreybert/vimagit'
Plug 'mattn/webapi-vim'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'gregsexton/gitv'
Plug 'tomtom/tcomment_vim'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tyru/open-browser.vim'
Plug 'wellle/targets.vim'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-shell'
Plug 'jiangmiao/auto-pairs'
Plug 'vim-scripts/loremipsum'
Plug 'rking/ag.vim'
Plug 'prabirshrestha/async.vim'
if s:is_win
Plug 'Shougo/vimproc.vim', { 'do': 'curl -fkLo ' . expand(g:settings.plugins . '/vimproc.vim/lib/vimproc_win64.dll')
\ . ' --create-dirs https://github.com/Shougo/vimproc.vim/releases/download/ver.9.2/vimproc_win64.dll' }
else
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
endif
" }}}
if has('python') || has('python3')
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
let g:settings.snippets = 1
endif
if has('nvim') && has('python3')
Plug 'Shougo/deoplete.nvim'
Plug 'benekastah/neomake'
let g:settings.completionlib = 'deoplete'
elseif has('python') || has('python3')
Plug 'Shougo/neocomplete.vim'
let g:settings.completionlib = 'neocomplete'
endif
call plug#end()
" }}}
" vimrc {{{
nnoremap <leader>ev :e $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
" }}}
" colorscheme {{{
if has('nvim')
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
endif
if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "gnome-terminal"
set t_Co=256
endif
try
colorscheme OceanicNext
catch
endtry
set background=dark
set noantialias " Turn on/off Anti-Aliased Fonts
" set guifont=Anonymice\ Powerline:h12
" set guifont=Consolas\ for\ Powerline\ FixedD:h11
" set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11
" set guifont=DroidSansMonoPLNerd:h12
" set guifont=Droid\ Sans\ Mono\ for\ Powerline:h11
" set guifont=Droid\ Sans\ Mono\ for\ Powerline:h11
" set guifont=Inconsolata\ for\ Powerline:h14
" set guifont=ProFontWindows:h11
" set guifont=Source_Code_Pro:h11:cANSI
" set guifont=Ubuntu\ Mono\ derivative\ Powerline:h12
" set guifont=Sauce\ Code\ Pro\ Medium:h12
set guifont=Ubuntu_Mono_derivative_Powerlin:h12:cANSI
syntax enable
" }}}
" general {{{
inoremap jj <ESC>
inoremap jk <ESC>
set mouse=a " Automatically enable mouse usage
set mousehide " Hide the mouse cursor while typing
" Paste.
nnoremap <RightMouse> "+p
xnoremap <RightMouse> "+p
inoremap <RightMouse> <C-r><C-o>+
cnoremap <RightMouse> <C-r>+
if has('clipboard')
if has('unnamedplus') " When possible use + register for copy-paste
set clipboard=unnamed,unnamedplus
else " On mac and Windows, use * register for copy-paste
set clipboard=unnamed
endif
endif
" copy cut and paste settings for clipboard
vmap <C-c> "+y
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <C-r><C-o>+
set shortmess+=fIlmnrxoOtT " Abbrev. of messages (avoids 'hit enter')
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
" disable entering ex mode
map Q <Nop>
" Clear current search highlighting by fast //
nmap <silent> // :nohlsearch<CR>
" use Ctrl-S for saving, also in insert mode
" make sure to set these two lines in ~/.bash_profile and ~/.zshrc
" bind -r '\C-s'
" stty -ixon
nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a
imap <c-s> <Esc><c-s>
" Quit
inoremap <C-Q> <esc>:q<cr>
nnoremap <C-Q> :q<cr>
vnoremap <C-Q> <esc>
nnoremap <Leader>q :q<cr>
nnoremap <Leader>Q :qa!<cr>
" Make Y behave like other capitals
nnoremap Y y$
" Stupid shift key fixes
if has("user_commands")
command! -bang -nargs=* -complete=file E e<bang> <args>
command! -bang -nargs=* -complete=file W w<bang> <args>
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Q q<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
endif
" reselect what was just pasted
nnoremap <leader>v V`]
" Shortcuts
" Change working Directory to that of the current file
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h
" Visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
" No annoying sound on errors
" set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
if !has('nvim')
set encoding=utf-8
scriptencoding utf-8
endif
setglobal fileencoding=utf-8
"setglobal bomb
set fileencodings=ucs-bom,utf-8,latin1
endif
" set autowrite " Automatically write a file when leaving a modified buffer
set viewoptions=folds,options,cursor,unix,slash " Better unix / windows compatibility
set virtualedit=onemore " Allow for cursor beyond last character
set history=1000 " Allow for cursor beyond last character
if !has ('gui_running') && !s:is_win
set spell " Spell checking on
set spelllang=en_us " Set en-us as default language
set spellsuggest=best,5
endif
set hidden " Allow buffer switching without saving
" Setting up the directories
set nobackup
set noswapfile
if has('persistent_undo')
call Mkdirp(g:settings.cache . '/undo')
execute 'set undodir='. g:settings.cache . '/undo'
set undofile " So is persistent undo ...
set undolevels=1000 " Maximum number of changes that can be undone
set undoreload=1000 " Maximum number lines to save for undo on a buffer reload
endif
set tabpagemax=15 " Only show 15 tabs
set showmode " Display current mode
set cursorline " Highlight current line
highlight clear SignColumn " SignColumn should match background
highlight clear LineNr " Current line number row will have same background color in relative mode
set backspace=indent,eol,start " Backspace for dummies
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
set showmatch " Show matching brackets/parenthesis
set incsearch " Find as you type search
set hlsearch " Highlight search terms
set winminheight=0 " Windows can be 0 line height
set ignorecase " Case insensitive search
set smartcase " Case sensitive when uc present
set wildmenu " Show list instead of just completing
set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all.
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too
set scrolljump=5 " Lines to scroll when cursor leaves screen
set scrolloff=3 " Minimum lines to keep above and below cursor
set foldenable " Auto fold code
set list
" Highlight problematic whitespace
set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
set showbreak=···
set nowrap " Do not wrap long lines
set autoindent " Indent at the same level of the previous line
set shiftwidth=4 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set splitright " Puts new vertical split windows to the right of the current
set splitbelow " Puts new split windows to the bottom of the current
set pastetoggle=<F12> " paste toggle (sane indentation pastes)
" Disable menu.vim
if has('gui_running')
set guioptions=Mc
endif
" easier split navigations: http://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally
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>
nnoremap <silent> <leader>p :call ToggleOption('paste')<CR>
nnoremap <silent> <leader>w :call ToggleOption('wrap')<CR>
nnoremap <silent> <leader>sp :call ToggleOption('spelling')<CR>
nnoremap <silent> <leader>ln :call ToggleOption('relativenumber')<CR>
nnoremap <silent> <leader>t2 :setl shiftwidth=2 softtabstop=2<CR>
nnoremap <silent> <leader>t4 :setl shiftwidth=4 softtabstop=4<CR>
nnoremap <silent> <leader>t8 :setl shiftwidth=8 softtabstop=8<CR>
" }}}
" vim-airline {{{
set laststatus=2 " Make the second to last line of vim our status line
let g:Powerline_symbols="fancy"
let g:airline_theme="oceanicnext"
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline#extensions#tabline#enabled = 0
let g:airline#extensions#tabline#show_buffers = 0
"if using consolas uncomment the following lines
" let g:airline_left_sep = "\u2b80" "use double quotes here
" let g:airline_left_alt_sep = "\u2fb81"
" let g:airline_right_sep = "\u2b82"
" let g:airline_right_alt_sep = "\u2b83"
" }}}
" ctrlp.vim {{{
let g:ctrlp_cache_dir = g:settings.cache . '/ctrlp'
let g:ctrlp_max_files = 0
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_lazy_update = 1
let g:ctrlp_max_files = 0 " set no max file limit
let g:ctrlp_clear_cache_on_exit = 0 " don't clear cache when exit
let g:ctrlp_switch_buffer = 0
let g:ctrlp_funky_syntax_highlight = 1
let g:ctrlp_nerdtree_show_hidden = 1
let g:ctrlp_extensions = ['filetype', 'session']
let g:ctrlp_root_markers = ['[root]']
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|node_modules$\|\.svn$\|out$\|objd$',
\ 'file': '\.exe$\|\.exe.config$\|\.so$\|\.dll$\|\.pdb$\|\.pyc$' }
call Mkdirp(g:settings.cache . '/vim-ctrlp-session')
let g:ctrlp_session_path = g:settings.cache . '/vim-ctrlp-session'
" map <Leader>fd :CtrlPCurFile<CR>
" map <Leader>fb :CtrlPBuffer<CR>
" nnoremap <Leader>ft :CtrlPFiletype<CR>
" nnoremap <Leader>cs :CtrlPColorscheme<CR>
nnoremap <Leader>s :CtrlPSession<CR>
nnoremap <Leader>r :CtrlPMRUFiles<Cr>
nnoremap <Leader>m :CtrlPMRU<Cr>
nnoremap <Leader>o :CtrlPFunky<Cr>
" nnoremap <Leader>O :execute 'CtrlPFunky '.expand('<cword>')<Cr>
" nnoremap <Leader>hn :CtrlPHackerNews<Cr>
" }}}
" unite.vim {{{
let g:unite_data_directory=g:settings.cache . '/unite'
let g:unite_enable_start_insert = 1
let g:unite_split_rule = "botright"
let g:unite_force_overwrite_statusline = 0
let g:unite_winheight = 10
let g:unite_source_history_yank_enable = 1
let g:unite_update_time = 300
let g:unite_source_file_mru_limit = 100
let g:unite_source_session_enable_auto_save = 1
let g:unite_source_rec_max_cache_files = -1
let g:unite_prompt='» '
let g:unite_marked_icon = '✓'
call unite#custom_source('file_rec,file_rec/async,file_mru,file,buffer,grep',
\ 'ignore_pattern', join([
\ '\.git/',
\ 'tmp/',
\ 'node_modules/',
\ 'vendor/',
\ 'Vendor/',
\ 'bower_components/',
\ ], '\|'))
call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank'])
nnoremap <silent> <leader>u :Unite<CR>
nnoremap <silent> <leader>c :Unite command<CR>
nnoremap <silent> <leader>fo :Unite fold<CR>
nnoremap <silent> <leader>qf :Unite quickfix<CR>
autocmd FileType unite call s:unite_settings()
function! s:unite_settings()
let b:SuperTabDisabled=1
" exit with esc
nmap <buffer> <ESC> <Plug>(unite_exit)
imap <buffer> <ESC> <Plug>(unite_exit)
" exit with ctrl-c
imap <buffer> <c-c> <Plug>(unite_exit)
nmap <buffer> <c-c> <Plug>(unite_exit)
" Ctrl jk mappings
imap <buffer> <c-j> <Plug>(unite_insert_leave)
imap <buffer> <c-k> <Plug>(unite_insert_leave)
nmap <buffer> <c-j> <Plug>(unite_loop_cursor_down)
nmap <buffer> <c-k> <Plug>(unite_loop_cursor_up)
" jj becuase you're lazy, and leave insert mode
imap <buffer> jj <Plug>(unite_insert_leave)
" qq `` becuase you're lazy, and quit unite
imap <buffer> qq <Plug>(unite_exit)
imap <buffer> `` <Plug>(unite_exit)
" refresh unite
nmap <buffer> <C-r> <Plug>(unite_redraw)
imap <buffer> <C-r> <Plug>(unite_redraw)
" choose action
nmap <buffer> <C-a> <Plug>(unite_choose_action)
imap <buffer> <C-a> <Plug>(unite_choose_action)
" split control
inoremap <silent><buffer><expr> <C-s> unite#do_action('split')
nnoremap <silent><buffer><expr> <C-s> unite#do_action('split')
inoremap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
nnoremap <silent><buffer><expr> <C-v> unite#do_action('vsplit')
imap <buffer> <Tab> <Plug>(unite_complete)
imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
endfunction
" }}}
" NERDTree {{{
nnoremap <silent> <leader>e :NERDTreeFind<CR>
nnoremap <silent> <leader>E :NERDTreeToggle<CR>
" nnoremap <C-\> :NERDTreeToggle<CR>
" nnoremap \| :NERDTreeFind<CR>
" function! NTFinderP()
" if g:NERDTree.IsOpen()
" :NERDTreeClose
" else
" :NERDTreeFind
" endif
" endfunction
"
" map <silent> <leader>e :call NTFinderP()<CR>
let NERDTreeShowHidden=1
let g:NERDTreeWinSize=45
let g:NERDTreeAutoDeleteBuffer=1
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd FileType nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd FileType nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('jade', 'green', 'NONE', 'green', 'NONE')
call NERDTreeHighlightFile('md', 'blue', 'NONE', '#6699CC', 'NONE')
call NERDTreeHighlightFile('config', 'yellow', 'NONE', '#d8a235', 'NONE')
call NERDTreeHighlightFile('conf', 'yellow', 'NONE', '#d8a235', 'NONE')
call NERDTreeHighlightFile('json', 'green', 'NONE', '#d8a235', 'NONE')
call NERDTreeHighlightFile('html', 'yellow', 'NONE', '#d8a235', 'NONE')
call NERDTreeHighlightFile('css', 'cyan', 'NONE', '#5486C0', 'NONE')
call NERDTreeHighlightFile('scss', 'cyan', 'NONE', '#5486C0', 'NONE')
call NERDTreeHighlightFile('coffee', 'Red', 'NONE', 'red', 'NONE')
call NERDTreeHighlightFile('js', 'Red', 'NONE', '#ffa500', 'NONE')
call NERDTreeHighlightFile('ts', 'Blue', 'NONE', '#6699cc', 'NONE')
call NERDTreeHighlightFile('ds_store', 'Gray', 'NONE', '#686868', 'NONE')
call NERDTreeHighlightFile('gitconfig', 'black', 'NONE', '#686868', 'NONE')
call NERDTreeHighlightFile('gitignore', 'Gray', 'NONE', '#7F7F7F', 'NONE')
" }}}
" nerdtree-git-plugin {{{
let g:NERDTreeIndicatorMapCustom = {
\ "Modified" : "✹",
\ "Staged" : "✚",
\ "Untracked" : "✭",
\ "Renamed" : "➜",
\ "Unmerged" : "═",
\ "Deleted" : "✖",
\ "Dirty" : "✗",
\ "Clean" : "✔︎",
\ "Unknown" : "?"
\ }
" }}}
" emmet-vim {{{
imap <C-e> <plug>(emmet-expand-abbr)
" }}}
" vim-shell {{{
let g:shell_fullscreen_message = 0
let g:shell_fullscreen_always_on_top = 0
nmap <C-CR> :Fullscreen<CR>
" }}}
" vim-easymotion {{{
let g:EasyMotion_keys='hklyuiopnm,qwertzxcvbasdgjf'
nmap s <Plug>(easymotion-s)
" }}}
" OmniSharp {{{
let g:OmniSharp_selector_ui = 'unite' " Use unite.vim
let g:OmniSharp_selector_ui = 'ctrlp' " Use ctrlp.vim
" }}}
" autocomplete {{{
if g:settings.completionlib == 'deoplete'
let g:deoplete#enable_at_startup=1
let g:deoplete#data_directory=g:settings.cache . '/deoplete'
let g:deoplete#auto_completion_start_length=1
let g:deoplete#enable_ignore_case='ignorecase'
elseif g:settings.completionlib == 'neocomplete'
let g:neocomplete#data_directory = g:settings.cache . '/neocomplete'
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#synatx#min_keyword_length=1
if !exists('g:neocomplete#keyword_patters')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
endif
" set ballooneval
augroup omnifuncs
autocmd!
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType cs setlocal omnifunc=OmniSharp#Complete
" autocmd BufNewFile,BufRead *.ts setlocal balloonexpr=tsuquyomi#balloonexpr()
augroup end
if !empty(g:settings.completionlib)
" https://github.com/rafi/vim-config/blob/master/config/plugins/neocomplete.vim
" https://github.com/Valloric/YouCompleteMe/issues/420
let g:UltiSnipsExpandTrigger = "<nop>"
let g:ulti_expand_or_jump_res = 0
function! ExpandSnippetOrCarriageReturn()
if g:settings.snippets
let snippet = UltiSnips#ExpandSnippetOrJump()
if g:ulti_expand_or_jump_res > 0
return snippet
endif
return "\<CR>"
endfunction
" <Tab> completion
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><S-Tab> pumvisible() ? "\<C-p>" : "\<C-h>"
inoremap <expr><CR> pumvisible() ? "<C-R>=ExpandSnippetOrCarriageReturn()<CR>" : "\<CR>"
" Movement within 'ins-completion-menu'
imap <expr><C-j> pumvisible() ? "\<C-n>" : "\<C-j>"
imap <expr><C-k> pumvisible() ? "\<C-p>" : "\<C-k>"
" Scroll pages in menu
inoremap <expr><C-f> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<Right>"
inoremap <expr><C-b> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<Left>"
imap <expr><C-d> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<C-d>"
imap <expr><C-u> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<C-u>"
" Undo completion
inoremap <expr><C-g> g:settings.completionlib == 'deoplete' ? deoplete#mappings#undo_completion() : neocomplete#undo_completion()
" Redraw candidates
if g:settings.completionlib == 'deoplete'
inoremap <expr><C-l> deoplete#mappings#refresh()
endif
endif
" }}}
au FileType html setlocal expandtab
" Use local vimrc if available {{{
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
" }}}}
" vim: set sw=2 ts=2 sts=2 et tw=78 foldmarker={{{,}}} foldlevel=0 foldmethod=marker spell:
# curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.zshrc -o ~/.zshrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="babun"
# use agnoster if you want powerlines
#ZSH_THEME="agnoster"
plugins=(colored-man docker git jake-node jump npm nvm z)
source $ZSH/oh-my-zsh.sh
# User configuration
export PATH=$HOME/bin:/usr/local/bin:$PATH
# 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"
# enable vi bindings
bindkey -v
bindkey -M viins 'jj' vi-cmd-mode
stty -ixon
#!/bin/zsh
# curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/babun-post-install | zsh
successfully() {
$* || (echo "\nfailed" 1>&2 && exit 1)
}
fancy_echo() {
echo "\n$1"
}
fancy_echo "Updating babun"
successfully pact update
fancy_echo "Updating ~/.zshrc"
successfully curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.zshrc -o ~/.zshrc
fancy_echo "Installing tmux"
successfully pact install tmux
fancy_echo "Installing solarized dark theme and powerconsolas for mintty"
successfully curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.minttyrc -o ~/.minttyrc
fancy_echo "Installing the_silver_searcher (ag)"
successfully pact install automake pkg-config libpcre-devel liblzma-devel
successfully git clone https://github.com/ggreer/the_silver_searcher ~/ag
successfully pushd ~/ag
successfully bash -x -o igncr ./build.sh && make install
successfully cd ..
successfully rm -rf ~/ag
successfully popd
fanyc_echo "Updating gitconfig"
successfully git config --global core.autocrlf true
successfully git config --global user.name "prabirshrestha"
successfully git config --global user.email "mail@prabir.me"
echo "execute 'chere -i -t mintty' in admin mode to enable Zsh Prompt Here"
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment