Last active
August 29, 2015 14:26
-
-
Save roboguy13/17db62b9418d964d7354 to your computer and use it in GitHub Desktop.
My current .vimrc
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
execute pathogen#infect() | |
augroup HighlightTODO | |
autocmd! | |
autocmd WinEnter,VimEnter * :silent! call matchadd('Todo', '\(TODO\)\|\(FIXME\)\|\(XXX\)\|\(NOTE\)', -1) | |
augroup END | |
" No beeps | |
set noerrorbells | |
set visualbell | |
" Change terminal title | |
set title | |
" Set <Leader> to the space key | |
let mapleader=" " | |
map <C-n> :NERDTreeToggle<CR> | |
map <C-s> :NERDTreeToggle<CR> | |
" Indent as many times as you want in visual mode without losing focus | |
vnoremap < <gv | |
vnoremap > >gv | |
set wildignore=*.o,*.obj,*.hi,*.dyn_o,*.dyn_hi,*~ | |
set nocompatible | |
set showcmd | |
" Sane backspace in terminal | |
set backspace=indent,eol,start | |
filetype plugin indent on | |
" tabs -> 2 spaces | |
set expandtab | |
set smarttab | |
set shiftwidth=2 | |
set tabstop=8 | |
" Incremental search | |
set incsearch | |
set hlsearch | |
" nnoremap <CR> :nohlsearch<CR><CR> | |
nnoremap <C-l> :noh<CR><C-l> | |
" Line numbers | |
set number | |
set relativenumber | |
syntax enable | |
" set background=light | |
" let g:solarized_visibility = 'high' | |
" let g:solarized_contrast = 'high' | |
" let g:solarized_termcolors = 256 | |
" colorscheme solarized | |
colorscheme gruvbox | |
"let hscoptions="rbhA" | |
set ambiwidth=double | |
set guicursor+=a:blinkon0 | |
let g:syntastic_cpp_compiler = 'clang++' | |
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++' | |
let g:syntastic_disabled_filetypes = ['ipp'] | |
let g:syntastic_idris_checkers = [] | |
let g:syntastic_haskell_checkers = ['ghcmod'] | |
let g:syntastic_haskell_options = ['check'] | |
set splitbelow | |
set splitright | |
set colorcolumn=80 | |
" Invisible CursorLine | |
hi CursorLine term=none cterm=none | |
set cursorline "cursorline required to continuously update cursor position | |
nmap <Leader>o m`O<Esc>``m`o<Esc>`` | |
autocmd FileType haskell set commentstring=--\ %s | |
autocmd FileType cabal set commentstring=--\ %s | |
autocmd FileType idris set commentstring=--\ %s | |
" Don't lose my place when switching buffers | |
se nostartofline | |
command! InsLanguagePragma :normal i{-# LANGUAGE #-} | |
nmap <silent> <Leader>l :InsLanguagePragma<Esc>4h :startinsert <Esc> | |
command! InsImportQualified :normal iimport qualified | |
command! InsImport :normal iimport | |
nmap <silent> <Leader>q :InsImportQualified<Esc>a | |
nmap <silent> <Leader>m :InsImport<Esc>a | |
" Enable airline | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline_right_sep='' | |
let g:airline_left_sep='' | |
" let g:airline_branch_empty_message='' | |
let g:airline_detect_modified=1 | |
let g:airline_detect_paste=1 | |
let g:airline_powerline_fonts=0 | |
let g:airline#extensions#tabline#enabled = 1 | |
set laststatus=2 | |
highlight ExtraWhitespace ctermbg=red guifg=red guibg=darkred | |
match ExtraWhitespace /\s\+$/ | |
set list listchars=tab:>-,trail:-,precedes:<,extends:> | |
" Hide buffers instead of closing them | |
set hidden | |
map <C-j> :bn<CR> | |
map <C-k> :bp<CR> | |
" List buffers and prompt for the buffer number to go to | |
nnoremap <Leader>b :ls<CR>:b<Space> | |
" Don't really need ex-mode, so remap Q to quit and ask if the file isn't | |
" saved. | |
nmap Q :q<CR> | |
set autoindent | |
set smartindent | |
" set guifont=Monospace:h20 | |
set guifont=Menlo\ Regular:h15 | |
autocmd BufEnter *.rkt,*.cljs,*.clj,*.cljs.hl RainbowParenthesesActivate | |
autocmd BufEnter *.rkt,*.cljs,*.clj,*.cljs.hl RainbowParenthesesLoadRound | |
autocmd BufEnter *.rkt,*.cljs,*.clj,*.cljs.hl RainbowParenthesesLoadSquare | |
autocmd BufEnter *.rkt,*.cljs,*.clj,*.cljs.hl RainbowParenthesesLoadBraces | |
autocmd BufEnter *.rkt,*.cljs,*.clj,*.cljs.hl setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,: | |
" -- Rainbow parenthesis options | |
let g:rbpt_colorpairs = [ | |
\ ['darkyellow', 'RoyalBlue3'], | |
\ ['darkgreen', 'SeaGreen3'], | |
\ ['darkcyan', 'DarkOrchid3'], | |
\ ['Darkblue', 'firebrick3'], | |
\ ['DarkMagenta', 'RoyalBlue3'], | |
\ ['darkred', 'SeaGreen3'], | |
\ ['darkyellow', 'DarkOrchid3'], | |
\ ['darkgreen', 'firebrick3'], | |
\ ['darkcyan', 'RoyalBlue3'], | |
\ ['Darkblue', 'SeaGreen3'], | |
\ ['DarkMagenta', 'DarkOrchid3'], | |
\ ['Darkblue', 'firebrick3'], | |
\ ['darkcyan', 'SeaGreen3'], | |
\ ['darkgreen', 'RoyalBlue3'], | |
\ ['darkyellow', 'DarkOrchid3'], | |
\ ['darkred', 'firebrick3'], | |
\ ] | |
" let &t_SI = "\<Esc>]50;CursorShape=1\x7" | |
" let &t_EI = "\<Esc>]50;CursorShape=0\x7" | |
" For tmux: | |
" let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\" | |
" let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\" | |
" leave insert mode quickly | |
if ! has('gui_running') | |
set ttimeoutlen=10 | |
augroup FastEscape | |
autocmd! | |
au InsertEnter * set timeoutlen=0 | |
au InsertLeave * set timeoutlen=1000 | |
augroup END | |
endif | |
nnoremap <CR> : | |
function! SendBuffer(cmd) | |
let tempfile = tempname() . '.hs' | |
silent call writefile(getbufline(bufname('%'), 1, '$'), tempfile) | |
try | |
silent execute ("!" . a:cmd . " " . shellescape(fnameescape(tempfile))) | |
catch | |
echoerr v:exception | |
finally | |
call delete(tempfile) | |
endtry | |
! | |
" let tmpfile = tempname() | |
" w tmpfile | |
" cmd = cmd . " " . tmpfile | |
" delete tmpfile | |
endfunction | |
" Disable code folding-by-default | |
set nofoldenable | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment