Created
December 29, 2015 07:20
-
-
Save lazyvalue/1c909f106fec7e505dd0 to your computer and use it in GitHub Desktop.
vim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" http://yannesposito.com/Scratch/en/blog/Vim-as-IDE/ | |
call plug#begin('~/.vim/plugged') | |
Plug 'altercation/vim-colors-solarized' | |
Plug 'bronson/vim-trailing-whitespace' | |
Plug 'Shougo/vimproc.vim' | |
Plug 'Shougo/unite.vim' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'tpope/vim-fugitive' | |
" -- nav | |
Plug 'scrooloose/nerdtree' | |
" -- haskell | |
Plug 'yogsototh/haskell-vim' | |
Plug 'eagletmt/ghcmod-vim' | |
Plug 'eagletmt/neco-ghc' | |
Plug 'Twinside/vim-hoogle' | |
call plug#end() | |
" -- general behavior | |
set noerrorbells | |
set nocompatible | |
let mapleader="-" | |
let g:mapleader="-" | |
" -- display | |
set number | |
set ruler | |
" -- search | |
set ignorecase | |
" -- code formatting http://vim.wikia.com/wiki/Indenting_source_code | |
syntax on | |
set shiftwidth=2 | |
set tabstop=2 | |
set expandtab | |
set smarttab | |
set softtabstop=2 " uncertain if this is needed | |
set autoindent | |
" -- solarized personal conf | |
set background=dark | |
if has('gui_running') | |
colorscheme solarized | |
endif | |
" -- vim-trailing-whitespace | |
if (exists('+colorcolumn')) | |
set colorcolumn=100 | |
highlight ColorColumn ctermbg=9 | |
endif | |
let g:unite_source_history_yank_enable = 1 | |
try | |
let g:unite_source_rec_async_command='ag --nocolor --nogroup -g ""' | |
call unite#filters#matcher_default#use(['matcher_fuzzy']) | |
catch | |
endtry | |
" search a file in the filetree | |
nnoremap <space><space>:Unite -start-insert file_rec/async<cr> | |
" reset not it is <C-l> normally | |
:nnoremap <space>r <Plug>(unite_restart) | |
" ------------------- | |
" Haskell | |
" ------------------- | |
set tm=2000 | |
nmap <silent> <leader>ht :GhcModType<CR> | |
nmap <silent> <leader>hh :GhcModTypeClear<CR> | |
nmap <silent> <leader>hT :GhcModTypeInsert<CR> | |
nmap <silent> <leader>hc :SyntasticCheck ghc_mod<CR>:lopen<CR> | |
let g:syntastic_mode_map={'mode': 'active', 'passive_filetypes': ['haskell']} | |
let g:syntastic_always_populate_loc_list = 1 | |
nmap <silent> <leader>hl :SyntasticCheck hlint<CR>:lopen<CR> | |
" Auto-checking on writing | |
autocmd BufWritePost *.hs,*.lhs GhcModCheckAndLintAsync | |
" neocomplcache (advanced completion) | |
autocmd BufEnter *.hs,*.lhs let g:neocomplcache_enable_at_startup = 1 | |
function! SetToCabalBuild() | |
if glob("*.cabal") != '' | |
set makeprg=stack\ build | |
endif | |
endfunction | |
autocmd BufEnter *.hs,*.lhs :call SetToCabalBuild() | |
" -- neco-ghc | |
let $PATH=$PATH.':'.expand("~/.cabal/bin") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment