Skip to content

Instantly share code, notes, and snippets.

@edwintorok
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwintorok/d74a3dd0aa71a840b7d2 to your computer and use it in GitHub Desktop.
Save edwintorok/d74a3dd0aa71a840b7d2 to your computer and use it in GitHub Desktop.
vim segv
set nocompatible
" Set up XDG basedir env vars
set directory^=$HOME/.local/share//vim//
set backupdir^=$HOME/.local/share//vim//
set undodir^=$HOME/.local/share//vim//
set viminfo+=n$HOME/.local/share//vim//viminfo
set undofile
set backup
set spelllang=en_gb
let g:netrw_home=$HOME . "/.local/share//vim"
" Pathogen
execute pathogen#infect()
" :Man command
runtime ftplugin/man.vim
" Terminal settings
set background=dark
set lazyredraw
set ttyfast
set bg=dark
set noerrorbells
set mouse=a
" colorscheme zenburn
" colorscheme kolor
colorscheme wombat256
if has('gui_running')
set guifont=Source\ Code\ Pro\ 14
endif
" Tabs and spaces
set textwidth=80
set softtabstop=4
set shiftwidth=4
set expandtab
" C indenting
set cindent
" Generic
set nomodeline
set cmdheight=2
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" highlight whitespace errors
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" OCaml
autocmd FileType ocaml setlocal shiftwidth=2
autocmd FileType ocaml setlocal softtabstop=2
" autocmd FileType ocaml compiler ocaml
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim"
let g:syntastic_ocaml_checkers = ['merlin']
autocmd FileType ocaml nmap <LocalLeader>* <Plug>(MerlinSearchOccurencesForward)
autocmd FileType ocaml nmap <LocalLeader># <Plug>(MerlinSearchOccurencesBackward)
autocmd FileType ocaml nmap <LocalLeader>r <Plug>(MerlinRename)
autocmd FileType ocaml nmap <LocalLeader>R <Plug>(MerlinRenameAppend)
autocmd FileType ocaml nmap <LocalLeader>e :GrowEnclosing<CR>
autocmd FileType ocaml nmap <LocalLeader>E :ShrinkEnclosing<CR>
autocmd FileType ocaml nmap <LocalLeader>d :Destruct<CR>
let g:merlin_textobject_grow = 'm'
let g:merlin_textobject_shrink = 'M'
autocmd FileType gitcommit setlocal spell
autocmd FileType markdown setlocal spell
endif " has("autocmd")
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_powerline_fonts=0
let g:airline_left_sep = '»'
let g:airline_left_sep = ''
let g:airline_right_sep = '«'
let g:airline_right_sep = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = ''
let g:airline_symbols.whitespace = 'Ξ'
let g:unite_force_overwrite_statusline = 0
let g:vimfiler_force_overwrite_statusline = 0
let g:vimshell_force_overwrite_statusline = 0
set noshowmode
"let g:syntastic_quiet_messages = {'level': 'warnings'}
let g:syntastic_ocaml_checkers=['merlin']
let g:syntastic_c_clang_check_post_args = ""
let g:syntastic_cpp_clang_check_post_args = ""
let g:syntastic_c_checkers=['clang_check']
let g:syntastic_cpp_checkers=['clang_check']
let g:neocomplete#enable_at_startup = 1
if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {}
endif
let g:neocomplete#force_omni_input_patterns.ocaml = '[^. *\t]\.\w*\|\h\w*|#'
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
let g:vimwiki_folding = 'list'
autocmd FileType vimwiki silent! nnoremap <silent> <unique> t :<C-U>call signature#marker#Toggle('@')<CR>
autocmd FileType orgagenda silent! nnoremap <silent> <unique> t :<C-U>call signature#marker#Toggle('@')<CR>
let g:org_agenda_files = ['~/org/*.org']
" TODO: shortcut that opens the agenda even if we are not in an orgmode file
" :OrgAgendaTodo, but needs to have orgmode ftplugin initialized
" also check whether buffer exists already and switch to it, this way we don't
" loose our marks!
" nnoremap <silent> <unique> <Leader>a :<C-U>OrgAgendaTodo<CR>
let g:ctrlp_by_filename = 1
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'git --git-dir=%s/.git ls-files --cached --exclude-standard'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
\ },
\ 'fallback': 'find %s -type f'
\ }
let g:ctrlp_extensions = ['smarttabs']
nnoremap <M-p> :CtrlPSmartTabs<CR> " Alt+p to open SmartTabs
function! VimuxSlime()
call VimuxSendText(@v)
call VimuxSendKeys("Enter")
endfunction
" start vim under tmux for the following to work!
" If text is selected, save it in the v buffer and send that buffer it to tmux
vmap <LocalLeader>vs "vy :call VimuxSlime()<CR>
" Select current paragraph and send it to tmux
nmap <LocalLeader>vs vip<LocalLeader>vs<CR>
map <Leader>vp :VimuxPromptCommand<CR>
" latex-suite
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
let g:startify_change_to_vcs_root = 1
let g:startify_session_delete_buffers = 1
let g:startify_custom_header =
\ map(split(system('fortune'), '\n'), '" ". v:val') + ['']
let g:startify_custom_footer =
\ ['', " Vim is charityware. Please read ':help uganda'.", '']
let g:startify_list_order = ['files', 'bookmarks', 'sessions', 'dir']
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment