# (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values)
set_prompts()
{
+# GREEN="\[$(tput setaf 2)\]"
+# RESET="\[$(tput sgr0)\]"
+#
+## Reset
+#Color_Off="\[\033[0m\]" # Text Reset
+#
+## Regular Colors
+#Black="\[\033[0;30m\]" # Black
+#Red="\[\033[0;31m\]" # Red
+#Green="\[\033[0;32m\]" # Green
+#Yellow="\[\033[0;33m\]" # Yellow
+#Blue="\[\033[0;34m\]" # Blue
+#Purple="\[\033[0;35m\]" # Purple
+#Cyan="\[\033[0;36m\]" # Cyan
+#White="\[\033[0;37m\]" # White
+#
+## Bold
+#BBlack="\[\033[1;30m\]" # Black
+#BRed="\[\033[1;31m\]" # Red
+#BGreen="\[\033[1;32m\]" # Green
+#BYellow="\[\033[1;33m\]" # Yellow
+#BBlue="\[\033[1;34m\]" # Blue
+#BPurple="\[\033[1;35m\]" # Purple
+#BCyan="\[\033[1;36m\]" # Cyan
+#BWhite="\[\033[1;37m\]" # White
+#
+## Underline
+#UBlack="\[\033[4;30m\]" # Black
+#URed="\[\033[4;31m\]" # Red
+#UGreen="\[\033[4;32m\]" # Green
+#UYellow="\[\033[4;33m\]" # Yellow
+#UBlue="\[\033[4;34m\]" # Blue
+#UPurple="\[\033[4;35m\]" # Purple
+#UCyan="\[\033[4;36m\]" # Cyan
+#UWhite="\[\033[4;37m\]" # White
+#
+## Background
+#On_Black="\[\033[40m\]" # Black
+#On_Red="\[\033[41m\]" # Red
+#On_Green="\[\033[42m\]" # Green
+#On_Yellow="\[\033[43m\]" # Yellow
+#On_Blue="\[\033[44m\]" # Blue
+#On_Purple="\[\033[45m\]" # Purple
+#On_Cyan="\[\033[46m\]" # Cyan
+#On_White="\[\033[47m\]" # White
+#
+## High Intensty
+#IBlack="\[\033[0;90m\]" # Black
+#IRed="\[\033[0;91m\]" # Red
+#IGreen="\[\033[0;92m\]" # Green
+#IYellow="\[\033[0;93m\]" # Yellow
+#IBlue="\[\033[0;94m\]" # Blue
+#IPurple="\[\033[0;95m\]" # Purple
+#ICyan="\[\033[0;96m\]" # Cyan
+#IWhite="\[\033[0;97m\]" # White
+#
+## Bold High Intensty
+#BIBlack="\[\033[1;90m\]" # Black
+#BIRed="\[\033[1;91m\]" # Red
+#BIGreen="\[\033[1;92m\]" # Green
+#BIYellow="\[\033[1;93m\]" # Yellow
+#BIBlue="\[\033[1;94m\]" # Blue
+#BIPurple="\[\033[1;95m\]" # Purple
+#BICyan="\[\033[1;96m\]" # Cyan
+#BIWhite="\[\033[1;97m\]" # White
+#
+## High Intensty backgrounds
+#On_IBlack="\[\033[0;100m\]" # Black
+#On_IRed="\[\033[0;101m\]" # Red
+#On_IGreen="\[\033[0;102m\]" # Green
+#On_IYellow="\[\033[0;103m\]" # Yellow
+#On_IBlue="\[\033[0;104m\]" # Blue
+#On_IPurple="\[\033[10;95m\]" # Purple
+#On_ICyan="\[\033[0;106m\]" # Cyan
+#On_IWhite="\[\033[0;107m\]" # White
+#
+## Various variables you might want for your PS1 prompt instead
+#Time12h="\T"
+#Time12a="\@"
+#PathShort="\w"
+#PathFull="\W"
+#NewLine="\n"
+#Jobs="\j"
+#export PS1="${GREEN}my prompt${RESET}> "
+
if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then
bold=$(tput bold)
reset=$(tput sgr0)
export HISTCONTROL=ignoreboth:erasedups
export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help";
# Whenever displaying the prompt, write the previous line to disk
-export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
+export PROMPT_COMMAND="history -a"
" section: plugins {{{1
" ---------------------
-"silent call plug#begin('~/.cache/vim/plugged')
-
-call plug#begin('~/.cache/vim/plugged')
+call plug#begin('~/.cache/vim/bundle')
"Plug 'tpope/vim-sensible'
"Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-repeat'
Plug 'majutsushi/tagbar'
"Plug 'airblade/vim-gitgutter'
"Plug 'Lokaltog/powerline',{'rtp': 'powerline/binding/vim/'}
-Plug 'junegunn/fzf.vim'
+"Plug 'junegunn/fzf.vim'
Plug 'thanthese/Tortoise-Typing'
Plug 'altercation/vim-colors-solarized'
Plug 'editorconfig/editorconfig-vim'
Plug 'vim-scripts/a.vim'
-Plug 'Shougo/vimfiler.vim'
Plug 'Shougo/unite.vim'
Plug 'bronson/vim-trailing-whitespace'
Plug 'junegunn/vim-easy-align'
-
+Plug 'kana/vim-tabpagecd'
+" Load on nothing
+Plug 'SirVer/ultisnips', { 'on': [] }
+Plug 'Valloric/YouCompleteMe', { 'on': [] }
call plug#end()
" section: options {{{1
set cmdheight=2
setglobal commentstring=#\ %s
set complete-=i " searching includes can be slow
+"if has("win32") || has("win64")
+" does not work for msys2
set clipboard=unnamed
+"else
+"set clipboard=unnamedplus
+"endif
set fileformats=unix,dos,mac
"set foldlevel=99
"set foldmethod=indent
set foldmethod=marker
set foldopen+=jump
+set guioptions+=a
set history=200
set incsearch " incremental search
set laststatus=2 " always show status line
set linebreak
set mouse=nvi
set mousemodel=popup
-set pastetoggle=<f2>
+"set pastetoggle=<f2>
set printoptions=paper:letter
set scrolloff=1
set shiftround
set number
" plugin settings {{{2
-
+let g:netrw_liststyle=3
+let g:netrw_banner = 0
+let g:netrw_sort_sequence = '[\/]$,*'
let g:solarized_menu=0
let g:markdown_fenced_languages = ['html', 'python', 'bash=sh']
" %s is replaced with fzf command
"let g:fzf_launcher = 'xterm -e bash -ic %s'
-let g:fzf_launcher = "in_a_new_term_function %s"
+"let g:fzf_launcher = "in_a_new_term_function %s"
"for airline
"let g:airline#extensions#tabline#enabled = 1
set colorcolumn=80
highlight ColorColumn ctermbg=9
+" block cursor in normal mode
+let &t_ti.="\e[1 q"
+let &t_SI.="\e[5 q"
+let &t_EI.="\e[1 q"
+let &t_te.="\e[0 q"
+
" }}}2
" section: commands {{{1
"-----------------------
-"
+
if has("cscope")
set nocscopetag
set cscopequickfix=s-,c-,d-,i-,t-,e-
endif
set cscopeverbose
- nnoremap <leader>fs :cscope find s <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fg :cscope find g <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fc :cscope find c <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>ft :cscope find t <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fe :cscope find e <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>ff :cscope find f <c-r>=expand("<cfile>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fd :cscope find d <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
- nnoremap <leader>fi :cscope find i ^<c-r>=expand("<cfile>")<cr>$<cr>:botright cwindow<cr>
- "todo: figure out how to get cstag output in quickfix or a popup menu.
- map <c-_> :cstag <c-r>=expand("<cword>")<cr><cr>
-
function! Cscoperebuild()
cscope kill .git/cscope.out
silent execute "!./.git/hooks/cscope"
command! Cscope call Cscoperebuild()
endif"
-"
-"
+
+
" section: mappings {{{1
" ----------------------
+"
+let mapleader = "\<space>"
-"split navigations
-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>
+if has("cscope")
+ nnoremap <leader>fs :cscope find s <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fg :cscope find g <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fc :cscope find c <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>ft :cscope find t <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fe :cscope find e <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>ff :cscope find f <c-r>=expand("<cfile>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fd :cscope find d <c-r>=expand("<cword>")<cr><cr>:botright cwindow<cr>
+ nnoremap <leader>fi :cscope find i ^<c-r>=expand("<cfile>")<cr>$<cr>:botright cwindow<cr>
+ "todo: figure out how to get cstag output in quickfix or a popup menu.
+ map <c-_> :cstag <c-r>=expand("<cword>")<cr><cr>
+endif
+
+" copy/paste from system clipboard
+if has("win32")
+vnoremap <Leader>y "*y
+vnoremap <Leader>d "*d
+nnoremap <Leader>p "*p
+nnoremap <Leader>P "*P
+vnoremap <Leader>p "*p
+vnoremap <Leader>P "*P
+else
+"nnoremap <Leader>y "*y
+"nnoremap <Leader>p "*p
+"nnoremap <Leader>Y "+y
+"nnoremap <Leader>P "+p
+"nnoremap <Leader>y "*y
+"nnoremap <Leader>yy "*yy
+"noremap <Leader>p "*p
+"noremap <Leader>P "*P
+endif
+
+" cd to same directory as file
+nnoremap <leader>cd :cd %:p:h<cr>:pwd<cr>
+" source .vimrc
+nnoremap <leader>v :so ~/.vimrc<cr>
+" split navigations
+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>
" folding
-nnoremap <space> za
+nnoremap <cr> za
"exit insert mode
inoremap jj <esc>
inoremap j<space> j
-map <leader>v :so ~/.vimrc<cr>
+" explorer
+"nnoremap <leader>e :e .<cr>
+nnoremap <leader>e :Lexplore .<cr>
" section: autocommands {{{1
" --------------------------
if !exists('g:colors_name')
silent! colorscheme solarized
endif
- endif
+endif
" }}}1
if filereadable(expand('~/.vimrc_local'))