Skip to content

Instantly share code, notes, and snippets.

@rxw1
Created March 27, 2015 00:48
Show Gist options
  • Save rxw1/b4a4324a98cb8ebb7fdb to your computer and use it in GitHub Desktop.
Save rxw1/b4a4324a98cb8ebb7fdb to your computer and use it in GitHub Desktop.
My slow and old vim config
" http://www.github.com/rwilhelm/dotfiles/vimrc
" Thu Dec 19 04:03:00 CET 2013
" 2007-2013 (c) [email protected]
set nocompatible
filetype on
set viminfo+=n~/.vim/viminfo
" crontab: temp file must be edited in place
au BufEnter /private/tmp/crontab.* setl backupcopy=yes
set backupskip=/tmp/*,/private/tmp/*
" https://github.com/ggreer/the_silver_searcher
"let g:ackprg = 'ag --nogroup --nocolor --column'
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" REMINDER: vim +BundleInstall +qall
Bundle 'kien/ctrlp.vim'
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
"Bundle 'FuzzyFinder'
"Bundle 'L9'
"Bundle 'LaTeX-Box-Team/LaTeX-Box'
"Bundle 'Lokaltog/vim-easymotion'
"Bundle 'coot/atp_vim' " latex (heavier)
"Bundle 'git://git.wincent.com/command-t.git' " textmates <C-t>
"Bundle 'jacekd/vim-iawriter.git'
"Bundle 'juvenn/mustache.vim'
"Bundle 'kchmck/vim-coffee-script'
"Bundle 'laktek/distraction-free-writing-vim'
"Bundle 'rizzatti/dash.vim'
"Bundle 'rizzatti/funcoo.vim'
"Bundle 'rking/ag.vim'
"Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
"Bundle 'tpope/vim-speeddating'
"Bundle 'xolox/vim-notes'
"Bundle 'gabrielelana/vim-markdown'
"Bundle 'wavded/vim-stylus'
Bundle 'digitaltoad/vim-jade'
Bundle 'gmarik/vundle'
Bundle 'mattn/emmet-vim.git'
"Bundle 'scrooloose/syntastic.git'
"Bundle 'tpope/vim-commentary'
"Bundle 'tpope/vim-fugitive'
"Bundle 'tpope/vim-rails'
"Bundle 'wincent/Command-T'
Bundle 'cwoac/nvim'
filetype plugin indent on
syntax on
"colorscheme solarized
"let g:solarized_hitrail=1
set background=light
set rtp+=$GOROOT/misc/vim
"autocmd FocusLost * :set number
"autocmd FocusGained * :set relativenumber
"autocmd InsertEnter * :set number
"autocmd InsertLeave * :set relativenumber
"autocmd CursorMoved * :set relativenumber
"let mapleader="\\" " FIXME
if has("gui_running")
set background=light
set guicursor=a:blinkon0-blinkoff1500
set guifont=Envy\ Code\ R\ 11
set guioptions=aem
set guitablabel=%N\ %t\ %M
endif
"let g:LatexBox_viewer = 'mupdf'
"xelatex --interaction=batchmode --file-line-error --synctex=1 "$file"
"let g:LatexBox_latexmk_options = "-pdf -e '$pdflatex=q/xelatex %O %S/g'"
"au BufEnter * cd %:p:h " conflicts with ctrl-p
"iab cc \cite[125]{mon69}
iab xdate <C-r>=strftime("%Y-%m-%d %H:%M:%S")<C-i>
iab _date <C-r>=strftime("%+")<C-i>
"nnoremap ; : " FIXME
map ,h :nohlsearch<CR>
map ,s :set spell! spell?<CR>
map ,p :set paste! paste?<CR>
cmap w!! w !sudo tee % >/dev/null
map ,n :set relativenumber! relativenumber?<CR>
"set cindent
"set copyindent
"set smarttab " tabs at beginning of line
set softtabstop=2
set autoindent
set shiftwidth=2
set smartindent
set tabstop=2
set undolevels=1000
set history=9999
set wildignore=*.swp,*.bak,*.pyc,*.class
"set backup
"set backupdir=.vimbackups
"set backupskip+=hg-editor-*.txt
"set backupdir=~/.vim/backup
"set directory=~/.vim/backup
highlight Identifier ctermfg=white cterm=bold
highlight LineNr cterm=bold ctermfg=0
highlight CursorLineNr ctermfg=1 gui=bold guifg=Brown
highlight Todo ctermbg=red ctermfg=white
highlight Note ctermbg=green ctermfg=white
highlight CursorLine cterm=NONE ctermbg=0
nnoremap ,l :set cursorline!<CR>
highlight Search cterm=underline ctermbg=NONE ctermfg=NONE
nnoremap ,h :set hlsearch! hlsearch?<CR>
nnoremap ,. :source ~/.vim/vimrc<CR>
highlight Comment term=NONE cterm=NONE guifg=NONE ctermfg=darkgrey ctermbg=NONE gui=NONE
highlight MatchParen term=NONE ctermbg=darkgrey ctermfg=1 guibg=NONE
"nnoremap <esc> :noh<return><esc>
" verluste sozialisierte - gewinne subventioniert(?) (vom staat wieder
" ausgebuegelt)
"map <up> <nop>
"map <down> <nop>
"map <left> <nop>
"map <right> <nop>
"
set backspace=2
set foldmethod=syntax
au BufRead * normal zR
set hidden " hide buffers instead of closing them
set hlsearch
set ignorecase
set infercase
set laststatus=1 " have a permanent statusline to color if 2
set matchtime=2
set modeline
set mouse=a
set mousehide
set number
set ruler
set scroll=1
set scrolloff=2
set showcmd
set showfulltag
set showmatch
set smartcase " ignore case if searchterm lowercase, otherwise not
set spelllang=de
set splitbelow
set splitright
set title
set wildmenu
set wildmode=list:longest
"stops executing this file OMG
":finish
"in insert mode highlight current line {{{
" hi CursorLine ctermbg=black cterm=none
" au InsertEnter * set cursorline
" au InsertLeave * set nocursorline
"}}}
"function! InsertStatuslineColor(mode)
" if a:mode == 'i'
" hi statusline guibg=red
" "set cursorcolumn
" elseif a:mode == 'r'
" hi statusline guibg=blue
" else
" hi statusline guibg=magenta
" endif
"endfunction
"
"function! InsertLeaveActions()
" hi statusline guibg=green
" "set nocursorcolumn
"endfunction
"
"au InsertEnter * call InsertStatuslineColor(v:insertmode)
"au InsertLeave * call InsertLeaveActions()
" to handle exiting insert mode via a control-C
"inoremap <c-c> <c-o>:call InsertLeaveActions()<cr><c-c>
" default the statusline to green when entering Vim
"hi statusline guibg=green
" LaTeX {{{
"au BufNewFile *.tex r ~/vim/skeleton.tex
"au BufRead *.tex set textwidth=72
"autocmd FileType tex setlocal et sta sw=2 sts=2
"filetype plugin indent on
"let g:Tex_BibtexFlavor = 'biber'
"let g:Tex_CompileRule_pdf = "xelatex -interaction=nonstopmode $*"
"let g:Tex_DefaultTargetFormat = "pdf"
"let g:tex_flavor = 'xelatex'
"let g:Tex_Flavor = 'xelatex'
"let g:Tex_MultipleCompileFormats = 'pdf'
"let g:Tex_ViewRule_pdf = 'zathura'
"set grepprg=grep\ -nH\ $*
" }}}
" FIXME need to toggle this on/off mark missplaced whitespaces and tabs
"au Syntax * syn match Error /\s\+$/ | syn match Error /^\s* \t\s*/
match Error /\s\+$/
" syn match Error /RNW/ " FIXME
" EMACS *cough*
"imap <C-b> <Left>
"imap <C-f> <Right>
"imap <C-a> <C-o>:call <SID>home()<CR>
"imap <C-e> <End>
"imap <M-b> <C-o>b
"imap <M-f> <C-oo>e<Right>
"imap <C-d> <Del>
"imap <C-h> <BS>
"imap <M-d> <C-o>de
"imap <M-h> <C-w>
"imap <C-k> <C-r>=<SID>kill_line()<CR>
"function! s:home()
" let start_col = col('.')
" normal! ^
" if col('.') == start_col
" normal! 0
" endif
" return ''
"endfunction
"nnoremap \\ :s/^/#<CR> :nohlsearch<CR>
"nnoremap j gj
"noremap k gk
"map <F11> :silent !mupdf %:r.pdf &<CR>
"map <F12> :silent !~/bin/tx<CR>|:redraw " SHIT
"map <F12> :!~/bin/tx<CR>
"au BufRead *.hs compiler ghci
"au BufRead *.lhs compiler ghci
"au BufRead *.rb let g:rubycomplete_rails=1
"au BufRead *.rb map \C :!ruby -c %<CR>
"au BufRead *.rb map \c :!ruby %<CR>
"au BufRead *.txt set printoptions=number:n
"map \a :set fo-=a<CR>"
"map \A :set fo+=a<CR>
"map <C-Z> :shell<CR>
"map <F1> :browse confirm e<CR>
"map <F2> :w<CR>
"map <F4> ^"*P
"map <F5> :set spell! spell?<CR>
"map <F6> :set number! number?<CR>
"map <S-F11> :tabedit ~/.vimrc<CR>
"map <S-F2> :wa<CR>
"map \. :source %<CR>
"map \s :!sort<CR>
"cnoremap <C-a> <Home>
"cnoremap <C-b> <Left>
"cnoremap <C-d> <Delete>
"cnoremap <C-f> <Right>
"cnoremap <C-g> <C-c>
"cnoremap <C-h> <Backspace>
"cnoremap <Esc>b <S-Left>
"cnoremap <Esc>f <S-Right>
"let g:S = 0 "result in global variable S
"function! Sum(number)
" let g:S = g:S + a:number
" return a:number
"endfunction
"map \S :%s/EUR\ \+\zs\d\+\.\d\+/\=Sum(submatch(0))/g
" http://superuser.com/questions/110054/custom-vim-highlighting
"highlight MyQuestions guifg=red guibg=green
"match MyQuestions /Question/
"if has("autocmd")
" " Highlight TODO, FIXME, NOTE, etc.
" if v:version > 701
" autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|CHANGED\|XXX\|BUG\|HACK\)')
" autocmd Syntax * call matchadd('Debug', '\W\zs\(NOTE\|INFO\|IDEA\)')
" endif
"endif":syntax match MyQuestions /.*Question.*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment