blackoperat
12/23/2015 - 2:51 PM

.nvimrc

 " Note: Skip initialization for vim-tiny or vim-small.
 if 0 | endif

 if has('vim_starting')
   if &compatible
     set nocompatible               " Be iMproved
   endif

   " Required:
   set runtimepath+=~/.vim/bundle/neobundle.vim/
 endif

 " Required:
 call neobundle#begin(expand('~/.vim/bundle/'))

 " Let NeoBundle manage NeoBundle
 " Required:
  NeoBundleFetch 'Shougo/neobundle.vim'

 " My Bundles here:
 " Refer to |:NeoBundle-examples|.
 " Note: You don't set neobundle setting in .gvimrc!
  
  NeoBundle 'altercation/vim-colors-solarized'
  
  NeoBundle 'Shougo/neosnippet.vim'
  NeoBundle 'Shougo/neosnippet-snippets'
 " NeoBundle 'Shougo/neocomplete.vim'
  NeoBundle 'Shougo/unite.vim'
  NeoBundle 'nsf/gocode', {'rtp': 'vim/'}
  NeoBundle 'flazz/vim-colorschemes'
  NeoBundle 'kien/ctrlp.vim'
  NeoBundle 'mileszs/ack.vim'
  NeoBundle 'tpope/vim-git'
  NeoBundle 'airblade/vim-gitgutter'
  NeoBundle 'tpope/vim-markdown'
  NeoBundle 'tpope/vim-bundler'
  NeoBundle 'tpope/vim-endwise'
  NeoBundle 'tpope/vim-eunuch'
  NeoBundle 'tpope/vim-fugitive'
  "NeoBundle 'tpope/vim-rails'
  NeoBundle 'tpope/vim-rake'
  NeoBundle 'tpope/vim-repeat'
  NeoBundle 'tpope/vim-sensible'
  NeoBundle 'tpope/vim-surround'
  NeoBundle 'tpope/vim-cucumber'
  NeoBundle 'tpope/vim-obsession'
  
  NeoBundle 'thoughtbot/vim-rspec'
 "NeoBundle 'mfukar/robotframework-vim'
  NeoBundle 'tfnico/vim-gradle' 
  NeoBundle 'stephenmckinney/vim-solarized-powerline'
  NeoBundle 'powerline/powerline'
  NeoBundle 'scrooloose/nerdtree'
  NeoBundle 'scrooloose/syntastic'
  NeoBundle 'scrooloose/nerdcommenter'
  NeoBundle 'Xuyuanp/nerdtree-git-plugin'
  NeoBundle 'majutsushi/tagbar'
  
  "NeoBundle 'floobits/floobits-neovim'
  NeoBundle 'jeetsukumaran/vim-buffergator'
  NeoBundle 'skalnik/vim-vroom'

  NeoBundle 'elixir-lang/vim-elixir'
  NeoBundle 'tmux-plugins/vim-tmux'
  NeoBundle 'vim-ruby/vim-ruby'
  NeoBundle 'rust-lang/rust.vim'
 " NeoBundle 'phildawes/racer', {
 " \   'build' : {
 " \     'mac': 'cargo build --release',
 " \     'unix': 'cargo build --release',
 " \   }
 " \ }
  NeoBundle 'elzr/vim-json'
  NeoBundle 'moll/vim-node' 
  NeoBundle 'walm/jshint.vim'
  NeoBundle 'rizzatti/dash.vim'
  NeoBundle 'lambdatoast/elm.vim'
  NeoBundle 'fatih/vim-go'
  NeoBundle 'ntpeters/vim-better-whitespace'

 call neobundle#end()

 " Required:
 filetype plugin indent on

 " If there are uninstalled bundles found on startup,
 " this will conveniently prompt you to install them.
 NeoBundleCheck
let g:neocomplete#enable_at_startup = 1
 """" FOLDS

"RUST 
set hidden
"let g:racer_cmd = "<path-to-racer>/target/release/racer"
"let $RUST_SRC_PATH="<path-to-rust-srcdir>/src/"

" GO LANG
" format with goimports instead of gofmt
let g:go_fmt_command = "goimports"



"Enable folding
set foldenable
set foldlevel=2
"Enable the fold column
set foldcolumn=3

"Use space bar to fold"
noremap <space> za

"Fold using syntax
set foldmethod=syntax
syntax enable

fu! CustomFoldText()
    "get first non-blank line
    let fs = v:foldstart
    while getline(fs) =~ '^\s*$' | let fs = nextnonblank(fs + 1)
    endwhile
    if fs > v:foldend
        let line = getline(v:foldstart)
    else
        let line = substitute(getline(fs), '\t', repeat(' ', &tabstop), 'g')
    endif

    let w = winwidth(0) - &foldcolumn - (&number ? 8 : 0)
    let foldSize = 1 + v:foldend - v:foldstart
    let foldSizeStr = " " . foldSize . " lines "
    let foldLevelStr = repeat("+--", v:foldlevel)
    let lineCount = line("$")
    let foldPercentage = printf("[%.1f", (foldSize*1.0)/lineCount*100) . "%] "
    let expansionString = repeat(" ", w - strwidth(foldSizeStr.line.foldLevelStr.foldPercentage))
    return line . expansionString . foldSizeStr . foldPercentage . foldLevelStr
endf
set foldtext=CustomFoldText()


""" STATUS LINE

" Always display the statusline in all windows
set laststatus=2 

" Hide the default mode text (e.g. -- INSERT -- below the statusline)
set noshowmode

" Enable Tagbar
noremap <leader>tr :TagbarToggle<CR>

" Open nerdtree
noremap <leader>n :NERDTreeToggle<CR>

" Turn on numbers in gutter
set relativenumber
set number

"""" CURSOR
" Add cursor lines
set cursorline
set cursorcolumn

"""" THEME
"let g:solarized_bold = 0
"let g:solarized_termcolors = 256
set background=dark
colorscheme solarized

" Turn off arrow key's to force usage of hjkl
" Disable arrow keys {{{
noremap  <Up>     <NOP>
inoremap <Down>   <NOP>
inoremap <Left>   <NOP>
inoremap <Right>  <NOP>
noremap  <Up>     <NOP>
noremap  <Down>   <NOP>
noremap  <Left>   <NOP>
noremap  <Right>  <NOP>

"Open vimrc file in split pane
":nnoremap <leader>ev :vsplit $MYVIMRC<cr>

"Source the vimrc
":nnoremap <leader>sv :source $MYVIMRC<cr>

" set the cursor to a vertical line in insert mode and a solid block
" in command mode

let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
"let $NVIM_TUI_ENABLE_TRUE_COLOR=1

" format the entire file
nnoremap <leader>fef :normal! gg=G``<CR>

" Toggle hlsearch with <leader>hs
nmap <leader>hs :set hlsearch! hlsearch?<CR>

set guicursor+=i:blinkwait0
set guifont=Source\ Code\ Pro\ for\ Powerline:h13

"python from powerline.vim import setup as powerline_setup
"python powerline_setup()
"python del powerline_setup

" Indent ruby correctly
autocmd FileType ruby set tabstop=8|set shiftwidth=2|set expandtab

"default indentation
set tabstop=8
set shiftwidth=2
set expandtab

" Turn on mouse control
set ttyfast
set mouse=a
"set ttymouse=xterm


"Highlight while searching
set incsearch 

let g:netrw_banner       = 0
let g:netrw_keepdir      = 1
let g:netrw_liststyle    = 3
let g:netrw_preview      = 1
"let g:netrw_sort_options = 'i'

" Use system clipboard
vmap <C-x> :!pbcopy<CR>  
vmap <C-c> :w !pbcopy<CR><CR> 

map <c-m> :CtrlPBufTag<CR>

" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>

set listchars=tab:▸\ ,eol:¬

set grepprg=ag\ --vimgrep\ $*
set grepformat=%f:%l:%c:%m