Skip to content

Instantly share code, notes, and snippets.

@haskellcamargo
Last active August 3, 2016 17:27
Show Gist options
  • Save haskellcamargo/5b3906ad938220dd34cbbc408770f689 to your computer and use it in GitHub Desktop.
Save haskellcamargo/5b3906ad938220dd34cbbc408770f689 to your computer and use it in GitHub Desktop.
Camargo's Vim Configuration
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours
set t_Co=256
call vundle#begin()
" Also, let Vundle manage itself
Plugin 'VundleVim/Vundle.vim'
Plugin 'morhetz/gruvbox'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'airblade/vim-gitgutter'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'tpope/vim-fugitive'
Plugin 'wakatime/vim-wakatime'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'hsanson/vim-android'
Plugin 'scrooloose/nerdtree'
Plugin 'artur-shaik/vim-javacomplete2'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
" All of your Plugins must be added before the following line
call vundle#end()
filetype plugin indent on
set history=500
set autoread
set so=0
let lang='en'
set langmenu=en
set wildmenu
set ruler
set backspace=eol,start,indent
if has('mouse')
set mouse=a
endif
set history=500
set autoread
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
set ignorecase
set smartcase
set hlsearch
set incsearch
set showmatch
set ai
set si
set wrap
set magic
syntax enable
set encoding=utf8
set ffs=unix,dos,mac
set nobackup
set nowb
set noswapfile
set expandtab
set smarttab
set shiftwidth=4
set tabstop=4
set lbr
set tw=500
set nu
syntax enable
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
autocmd vimenter * NERDTree
autocmd BufWritePre * StripWhitespace
execute pathogen#infect()
call pathogen#helptags()
colorscheme gruvbox
set background=dark
let g:airline_powerline_fonts = 1
" If the current buffer has never been saved, it will have no name,
" call the file browser to save it, otherwise just save it.
command -nargs=0 -bar Update if &modified
\| if empty(bufname('%'))
\| browse confirm write
\| else
\| confirm write
\| endif
\|endif
nnoremap <silent> <C-S> :<C-u>Update<CR>
set ww+=<,>
" Because I love tabs
nnoremap <C-Left> :tabp<CR>
nnoremap <C-Right> :tabn<CR>
" Allow NERDTree to exist when tabs are created
map <Leader>n <plug>NERDTreeTabsToggle<CR>
let g:nerdtree_tabs_open_on_console_startup=1
" Set path for Android SDK (Android plugin)
let g:android_sdk_path='/home/haskell/Android/Sdk'
let g:gradle_path='./ngi/ginga-android/gradlew'
" Compile and install Android project
nmap <F5> <ESC>:Gradle assembleDebug<CR>
nmap <F10> <ESC>:AndroidInstall debug<CR>
nmap <F4> <ESC>:Gradle lint<CR>
" Show information about Gradle status on airline
"let g:gradle_glyph_android = 'Android'
let g:gradle_glyph_android = ''
let g:gradle_glyph_error = '✗'
let g:gradle_glyph_warning = '☢'
call airline#parts#define_function('vim-gradle-status', 'gradle#statusLine')
let g:airline_section_x=airline#section#create_right(['tagbar', 'filetype', 'vim-gradle-status'])
" Java/Android omnicompletion
autocmd FileType java setlocal omnifunc=javacomplete#Complete
" Quit all
nmap <F2> <ESC>:quitall!<CR>
" Quack shortcuts
nmap <F3> <ESC>:! make -C /quack/quack qtest<CR>
nmap <F6> <ESC>:! quack -f <CR>
" General conceal settings
set conceallevel=1
" (*disable*) set concealcursor=nvic
let g:javascript_conceal_function = "λ"
let g:javascript_conceal_null = "ø"
let g:javascript_conceal_this = "@"
let g:javascript_conceal_return = "⇚"
let g:javascript_conceal_undefined = "¿"
let g:javascript_conceal_NaN = "ℕ"
let g:javascript_conceal_prototype = "¶"
let g:javascript_conceal_static = "•"
let g:javascript_conceal_super = "Ω"
let g:javascript_conceal_arrow_function = "⇒"
" Configure development for React
let g:jsx_ext_required = 0
" Convert `.md' files for Markdown instead of Modula 2
au BufRead,BufNewFile *.md set filetype=markdown
if exists('g:no_php_conceal') || !has('conceal') || &enc != 'utf-8'
finish
endif
syntax match phpNiceOperator "||" conceal cchar=∨ contained containedin=phpRegion
syntax match phpNiceOperator "&&" conceal cchar=∧ contained containedin=phpRegion
syntax match phpNiceOperator "!" conceal cchar=¬ contained containedin=phpRegion
syntax match phpNiceOperator "<=" conceal cchar=≤ contained containedin=phpRegion
syntax match phpNiceOperator ">=" conceal cchar=≥ contained containedin=phpRegion
syntax match phpNiceOperator "==" conceal cchar=≈ contained containedin=phpRegion
syntax match phpNiceOperator "===" conceal cchar=≡ contained containedin=phpRegion
syntax match phpNiceOperator "::" conceal cchar=∷ contained containedin=phpRegion
syntax match phpNiceOperator "!==" conceal cchar=≠ contained containedin=phpRegion
syntax match phpNiceRelation "=>" conceal cchar=⇛ contained containedin=phpRegion
syntax match phpNiceMemberSelector "\->" conceal cchar=→ contained containedin=phpRegion
syntax keyword phpKeyword function conceal cchar=λ
syntax keyword phpKeyword extends conceal cchar=:
syntax keyword phpKeyword return conceal cchar=
hi link phpNiceOperator phpOperator
hi link phpNiceStatement phpStatement
hi link phpNiceRelation phpRelation
hi link phpNiceMemberSelector phpMemberSelector
hi! link Conceal phpOperator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment