UserConfig / .vimrc

" .vimrc

set nocompatible
filetype off

set rtp+=~/.vim/vundle.git/
call vundle#rc()

" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vimfiles/'}
Bundle 'scrooloose/nerdtree'
Bundle 'vim-scripts/Vimball'
Bundle 'vim-scripts/Rainbow-Parenthsis-Bundle'
" vim-scripts repos
Bundle 'TVO--The-Vim-Outliner'
" non github repos

filetype plugin indent on

set rtp+=~/.vim

set modelines=0

set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab

set encoding=utf-8
""set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set undofile

let mapleader = ","

nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %

set wrap
set textwidth=79
set formatoptions=qrn1
"" remap j and k so that behavior is screen-specific, not line specific
nnoremap j gj
nnoremap k gk

"" remap help key
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>

" remap ';' to ':' in normal mode
nnoremap ; :

" use ',ev' for editing ~\_vimrc
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
nnoremap <leader>bn :bn<cr>
nnoremap <leader>bp :bp<cr>

" use ',nt' for NERDtree
nnoremap <leader>nt :NERDtree 

" remap 'jj' to the Escape key in insert mode
inoremap jj <ESC>

" make a new key to open a window split
nnoremap <leader>w <C-w>v<C-w>l
nnoremap <leader>s <C-w>s<C-w>l
nnoremap <leader>n <C-w>v<C-w>:enew<cr>

" map keys for window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" map for pasting
imap <Leader>v <C-O>:set paste<CR><C-r>*<C-O>:set nopaste<CR>

nnoremap <leader>cn :cnext<cr>
nnoremap <leader>cp :cprev<cr>
"
"" Set up the color
if has('gui_running')
    set colorcolumn=85
    set guifont=Consolas:h10
    set background=dark
    colorscheme molokai
"    colorscheme solarized
    set lines=60 columns=125
else
    "let g:solarized_termcolors=16
    "set background=dark
endif

syn on
set cursorline

"call pathogen#helptags()
"call pathogen#runtime_append_all_bundles()

" SETUP TFS integration
function! Tfco()
    exe '!C:\Tools\msvs\tf checkout "' expand('%:p') '" '
endfunction
command! Tfco :call Tfco()

function! Tfci()
    exe '!C:\Tools\msvs\tf checkin "' expand('%:p') '" '
endfunction
command! Tfci :call Tfci()

function! Tfu()
    exe '!C:\Tools\msvs\tf undo "' expand('%:p') '" '
endfunction
command! Tfu :call Tfu()


"function! Tfhi()
"    if bufnr("TFhistory") > 0
"        exe "sb Tfhistory"
"    else
"        exe "split TFhistory"
"    endif
"    setlocal noswapfile
"    set buftype=nofile
"    setlocal modifiable
"    silent! exe 'r!C:\Tools\tfpt\tfpt history "#"'
"    setlocal nomodified
"    normal 1G
"    wincmd J
"endfunction
"command! Tfhi :call Tfhi()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.