Skip to content

Instantly share code, notes, and snippets.

@tigrus
Last active June 10, 2017 00:10
Show Gist options
  • Save tigrus/5261e8d6ef4138d8125d2efc9717428c to your computer and use it in GitHub Desktop.
Save tigrus/5261e8d6ef4138d8125d2efc9717428c to your computer and use it in GitHub Desktop.
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
filetype off
" Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Plugins by Vundle
Bundle 'gmarik/vundle'
Bundle 'altercation/vim-colors-solarized'
Bundle 'jimenezrick/vimerl'
Bundle 'Lokaltog/vim-powerline'
Bundle 'vim-ruby/vim-ruby'
Bundle 'pangloss/vim-javascript'
Bundle 'tpope/vim-fugitive'
Bundle 'clang-complete'
Bundle 'tpope/vim-markdown'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'kien/ctrlp.vim'
Bundle 'The-NERD-tree'
Bundle 'The-NERD-Commenter'
Bundle 'idris-hackers/idris-vim'
Bundle 'wting/rust.vim'
Bundle 'uarun/vim-protobuf'
Bundle 'vim-scripts/sideways.vim'
Bundle 'vim-erlang/vim-dialyzer'
Bundle 'elixir-lang/vim-elixir'
Bundle 'tpope/vim-dispatch'
Bundle 'glsl.vim'
Bundle 'JSON.vim'
Bundle 'vim-indent-object'
Bundle 'adimit/prolog.vim'
Bundle 'edkolev/erlang-motions.vim'
Bundle 'Shougo/vimproc.vim'
Bundle 'eagletmt/ghcmod-vim'
Bundle 'eagletmt/neco-ghc'
Bundle 'Twinside/vim-haskellConceal'
Bundle 'lukerandall/haskellmode-vim'
Bundle 'phildawes/racer'
Bundle 'fatih/vim-go'
filetype plugin indent on
" Appearance
"set term=xterm-256color
let g:solarized_termtrans = 1
set background=dark
colorscheme solarized
if has('gui_running')
set background=dark
colorscheme solarized
set transparency=2
set guioptions-=T
endif
call togglebg#map("<M-D-F5>")
" Vim settings
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set number
set showcmd " display incomplete commands
set incsearch " do incremental searching
set ignorecase
set smartcase
set wildmenu
set hlsearch
"set autochdir
" Folding
set foldmethod=syntax
set foldminlines=20
" Indentation
set tabstop=4
set softtabstop=4
set shiftwidth=4
" move .swp away
set dir=/private/tmp
" invisibles marks for 'set list'
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set switchbuf=usetab,newtab
set completeopt=menuone,menu,longest
" Save on compile
set autowrite
set fileencodings=utf-8,cp1251,cp866,koi8-r
" Statusline
set laststatus=2
set statusline=%F%m%r%h%w\ %{fugitive#statusline()}\ [format=%{&ff}]\ [type=%Y]\ [ascii=\%03.3b]\[hex=\%02.2B]\ [pos=%04l,%04v]\ [len=%L]\ [%p%%]
" Keymappings
map <F9> :make!<CR>
map! <F9> <ESC>:make!<CR>
nnoremap <silent> <C-l> :nohlsearch<CR><C-l>
"autocmd InsertEnter * let @/=""
" C-c and C-v - Copy/Paste to/from system clipboard
"vmap <C-C> "+yi
"imap <C-V> <esc>"+gPi
" CtrlP
"let g:ctrlp_map = '<D-T>'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.beam,*.obj
let g:ctrlp_follow_symlinks = 1
let g:ctrlp_working_path_mode = 'rw'
let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix',
\ 'line', 'mixed']
let g:ctrlp_prompt_mappings = { 'AcceptSelection("t")': ['<c-t>', '<d-cr>'] }
" Haskell
au Bufenter *.hs compiler ghc
au FileType erlang setl sw=4 sts=4 ts=8 et
let b:ghc_staticoptions = ''
let g:ghc="/usr/local/bin/ghc"
let g:haddock_browser = "open"
let g:haddock_browser_callformat = "%s %s"
autocmd FileType haskell set omnifunc=necoghc#omnifunc
" Arduino
autocmd FileType arduino runtime! indent/cpp.vim
" Ruby
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_bufer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby setl sw=2 sts=2 ts=8 et
autocmd FileType ruby,eruby setl foldmethod=indent
" Erlang options
au FileType erlang setl sw=4 sts=4 ts=8 et
let erlang_completion_cache=0
let erlang_folding=1
let erlang_keywordprg="man"
"let g:erlang_man_path="/usr/local/share/man/"
let erlang_skel_dir="~/.erlang_tools/skels/"
let erlang_skel_header = {
\"author": "Valery Meleshkin <valery.meleshkin@wooga.com>",
\"owner" : "Wooga"}
if !exists(":DialyzeFile")
command DialyzeFile :cexpr system('dialyzer -Wno_return -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs ' . expand('%:p'))
endif
" Clang complete opts
let g:clang_user_options='|| exit 0'
let g:clang_complete_auto=1
let g:clang_complete_copen=1
let g:clang_complete_macros=1
let g:clang_complete_patterns=1
let g:clang_hl_errors=1
let g:clang_auto_user_options='.clang_complete'
let g:clang_debug=1
let g:clang_use_library=1
let g:clang_library_path='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/'
" let g:clang_periodic_quickfix=1
" let g:clang_debug=1
" let g:clang_user_options='-I/usr/include/c++/4.7 -I/usr/include/c++/4.7/i486-linux-gnu -I/usr/include/c++/4.7/backward'
" Rust
let $RUST_SRC_PATH="/Users/sumerman/.cargo/rust/src/"
" Powerline
let g:Powerline_theme = 'default'
let g:Powerline_colorscheme = 'default'
call Pl#Theme#InsertSegment('ws_marker', 'after', 'lineinfo')
" Part of standard vimrc...
" Don't use Ex mode, use Q for formatting
map Q gq
" In many terminal emulators the mouse works just fine, thus enable it.
set mouse=a
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
"set hlsearch
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment