Initial commit

This commit is contained in:
Julian Ospald 2018-05-26 19:18:09 +02:00
commit 27ff84ab87
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
14 changed files with 4261 additions and 0 deletions

154
.ycm_extra_conf.py Executable file
View File

@ -0,0 +1,154 @@
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org/>
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wc++98-compat',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-DNDEBUG',
'-DUSE_CLANG_COMPLETER',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c99',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x',
'c',
'-isystem',
'../BoostParts',
'-isystem',
# This path will only work on OS X, but extra paths that don't exist are not
# harmful
'/System/Library/Frameworks/Python.framework/Headers',
'-isystem',
'../llvm/include',
'-isystem',
'../llvm/tools/clang/include',
'-I',
'.',
'-I',
'./ClangCompleter',
'-isystem',
'./tests/gmock/gtest',
'-isystem',
'./tests/gmock/gtest/include',
'-isystem',
'./tests/gmock',
'-isystem',
'./tests/gmock/include'
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if compilation_database_folder:
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def FlagsForFile( filename ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile( filename )
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% YOU NEED IT.
try:
final_flags.remove( '-stdlib=libc++' )
except ValueError:
pass
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}

8
after/ftplugin/c.vim Normal file
View File

@ -0,0 +1,8 @@
let g:ale_linters = {'c':['clang']}
"let g:ale_fixers = {
" \ 'c': ['clang-format'],
" \}
let g:ale_c_clangformat_options = '-style=file'
let g:ycm_goto_buffer_command = 'same-buffer'

View File

@ -0,0 +1 @@
call CmdAlias('Piggie','Piggieback (figwheel-sidecar.repl-api/repl-env)')

67
after/ftplugin/go.vim Normal file
View File

@ -0,0 +1,67 @@
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
let g:go_auto_type_info = 0
" mappings
noremap <C-B> :TagbarToggle<CR>
inoremap <C-B> <C-O>:TagbarToggle<CR>
nmap <F3> :GoInfo<CR>
function! MakePublic()
let l:wordUnderCursor = expand('<cword>')
let l:upperCaseWord = substitute(l:wordUnderCursor, '[A-Za-z]', '\\U&', '')
execute 'GoRename ' l:upperCaseWord
endfunction
nmap <F6> :GoDocBrowser<CR><CR>
nmap <F7> :GoDoc<CR>
nmap <F8> :call MakePublic()<CR><CR>
" ALE
" let g:ale_linters = {'go':['gofmt', "go build"], 'c':['clang']}
let g:ale_linters = {'go':['go build', 'gometalinter', 'gofmt'], 'c':['clang']}
let g:ale_fixers = {
\ 'go': ['gofmt', 'goimports'],
\ 'c': ['clang-format'],
\ 'cpp': ['clang-format'],
\ 'js': ['eslint'],
\ 'python': ['yapf'],
\}
let g:ale_go_gobuild_options = "-gcflags='-e'"
let g:ale_go_gometalinter_options = '--fast'
" vim-go
let g:go_highlight_functions = 1
let g:go_highlight_space_tab_error = 1
let g:go_highlight_chan_whitespace_error = 1

View File

@ -0,0 +1,98 @@
setlocal ts=2 sw=2 expandtab omnifunc=necoghc#omnifunc
"set background=light
"set guifont=Neep\ Medium\ Semi-Condensed\ 18
let g:haskell_classic_highlighting = 1
let g:ghcmod_hlint_options = ['--ignore=Eta reduce $']
syntax on
filetype plugin indent on
call CmdAlias('hasktags', '!/home/jule/.cabal/bin/hasktags -c .<CR>')
let g:necoghc_enable_detailed_browse = 1
" ALE
let g:ale_linters = {'haskell':['ghc-mod', 'hdevtools'], 'c':['clang']}
" let g:ale_fixers = {
" \ 'go': ['gofmt', 'goimports'],
" \}
let g:ale_haskell_hdevtools_options = "-g '-Wall' -g '-Wno-orphans'"
" neco-ghc
let g:haskellmode_completion_ghc = 0
let g:necoghc_enable_detailed_browse = 1
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
let g:ycm_semantic_triggers = {'haskell' : ['.']}
function! HaskellDocCurrentWord()
let word = expand("<cword>")
exe "IDoc " . word
endfunction
" clear search
nmap <F2> :noh<CR>:GhcModTypeClear<CR>
imap <F2> <C-O>:noh<CR>:GhcModTypeClear<CR>
" unmap <F3>
" unmap <F4>
nmap <F6> :GhcModType<CR>
nmap <F8> :call HaskellDocCurrentWord()<CR><CR>
nmap <silent> <F3> :silent update <bar> HsimportModule<CR>
nmap <silent> <F4> :silent update <bar> HsimportSymbol<CR>
" haskell-vim
" let g:haskell_enable_quantification = 1
" let g:haskell_enable_recursivedo = 1
" let g:haskell_enable_arrowsyntax = 1
" let g:haskell_enable_pattern_synonyms = 1
" let g:haskell_enable_typeroles = 1
" let g:haskell_indent_if = 3
" let g:haskell_indent_case = 5
" let g:haskell_indent_let = 4
" let g:haskell_indent_where = 6
" let g:haskell_indent_do = 3
" let g:haskell_indent_in = 1
" liquid-types
let g:vim_annotations_offset = '/.liquid/'
" autocmd BufWritePost *.hs call s:check_and_lint()
" function! s:check_and_lint()
" let l:path = expand('%:p')
" let l:qflist = ghcmod#make('check', l:path)
" call extend(l:qflist, ghcmod#make('lint', l:path))
" call setqflist(l:qflist)
" cwindow
" if empty(l:qflist)
" echo "No errors found"
" endif
" endfunction
" let g:deoplete#enable_at_startup = 1
" set hidden
" let g:LanguageClient_serverCommands = {
" \ 'haskell': ['hie', '--lsp', '-d', '-l', '/home/hasufell/lang-server.log'],
" \ }
" nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
" nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
" nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
" autocmd VimEnter * LanguageClientStart

21
after/ftplugin/rust.vim Normal file
View File

@ -0,0 +1,21 @@
let g:rustfmt_autosave = 0
let g:tagbar_ctags_bin = '/usr/bin/universal-ctags'
let g:rust_doc#define_map_K = 0
let g:rust_doc#downloaded_rust_doc_dir = '~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
function! s:search_under_cursor(query) range
if a:query ==# ''
echomsg "rust-doc: No identifier is found under the cursor"
return
endif
call rust_doc#open_fuzzy(a:query)
endfunction
nnoremap <buffer><silent><F6> :<C-u>call <SID>search_under_cursor(expand('<cword>'))<CR>
vnoremap <buffer><silent><F6> "gy:call <SID>search_under_cursor(getreg('g'))<CR>
let g:ale_fixers = { }

353
autoload/pathogen.vim.bak Normal file
View File

@ -0,0 +1,353 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.4
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
" For management of individually installed plugins in ~/.vim/bundle (or
" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
" .vimrc is the only other setup necessary.
"
" The API is documented inline below.
if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1
" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). Curly braces are expanded with pathogen#expand():
" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
" in the runtime path.
function! pathogen#infect(...) abort
for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
call pathogen#surround(path)
elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
elseif path =~# '[{}*]'
call pathogen#interpose(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#interpose(path . '/{}')
endif
endfor
call pathogen#cycle_filetype()
if pathogen#is_disabled($MYVIMRC)
return 'finish'
endif
return ''
endfunction
" Split a path into a list.
function! pathogen#split(path) abort
if type(a:path) == type([]) | return a:path | endif
if empty(a:path) | return [] | endif
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
endfunction
" Convert a list to a path.
function! pathogen#join(...) abort
if type(a:1) == type(1) && a:1
let i = 1
let space = ' '
else
let i = 0
let space = ''
endif
let path = ""
while i < a:0
if type(a:000[i]) == type([])
let list = a:000[i]
let j = 0
while j < len(list)
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
let path .= ',' . escaped
let j += 1
endwhile
else
let path .= "," . a:000[i]
endif
let i += 1
endwhile
return substitute(path,'^,','','')
endfunction
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
function! pathogen#legacyjoin(...) abort
return call('pathogen#join',[1] + a:000)
endfunction
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() abort
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction
" Check if a bundle is disabled. A bundle is considered disabled if its
" basename or full name is included in the list g:pathogen_blacklist or the
" comma delimited environment variable $VIMBLACKLIST.
function! pathogen#is_disabled(path) abort
if a:path =~# '\~$'
return 1
endif
let sep = pathogen#slash()
let blacklist =
\ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
\ pathogen#split($VIMBLACKLIST)
if !empty(blacklist)
call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")')
endif
return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
endfunction
" Prepend the given directory to the runtime path and append its corresponding
" after directory. Curly braces are expanded with pathogen#expand().
function! pathogen#surround(path) abort
let sep = pathogen#slash()
let rtp = pathogen#split(&rtp)
let path = fnamemodify(a:path, ':s?[\\/]\=$??')
let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp, 'index(before + after, v:val) == -1')
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction
" For each directory in the runtime path, add a second entry with the given
" argument appended. Curly braces are expanded with pathogen#expand().
function! pathogen#interpose(name) abort
let sep = pathogen#slash()
let name = a:name
if has_key(s:done_bundles, name)
return ""
endif
let s:done_bundles[name] = 1
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
else
let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction
let s:done_bundles = {}
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort
let sep = pathogen#slash()
for glob in pathogen#split(&rtp)
for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
silent! execute 'helptags' pathogen#fnameescape(dir)
endif
endfor
endfor
endfunction
command! -bar Helptags :call pathogen#helptags()
" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort
for command in a:000
execute command
endfor
return ''
endfunction
" Section: Unofficial
function! pathogen#is_absolute(path) abort
return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
endfunction
" Given a string, returns all possible permutations of comma delimited braced
" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
" and globbed. Actual globs are preserved.
function! pathogen#expand(pattern, ...) abort
let after = a:0 ? a:1 : ''
if a:pattern =~# '{[^{}]\+}'
let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
let found = map(split(pat, ',', 1), 'pre.v:val.post')
let results = []
for pattern in found
call extend(results, pathogen#expand(pattern))
endfor
elseif a:pattern =~# '{}'
let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
let post = a:pattern[strlen(pat) : -1]
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
else
let results = [a:pattern]
endif
let vf = pathogen#slash() . 'vimfiles'
call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
return filter(results, '!empty(v:val)')
endfunction
" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#slash() abort
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction
function! pathogen#separator() abort
return pathogen#slash()
endfunction
" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
endfunction
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction
" Remove duplicates from a list.
function! pathogen#uniq(list) abort
let i = 0
let seen = {}
while i < len(a:list)
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
call remove(a:list,i)
elseif a:list[i] ==# ''
let i += 1
let empty = 1
else
let seen[a:list[i]] = 1
let i += 1
endif
endwhile
return a:list
endfunction
" Backport of fnameescape().
function! pathogen#fnameescape(string) abort
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
return '\-'
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
endif
endfunction
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
return ''
else
return fnamemodify(file,':p')
endif
endfunction
" Section: Deprecated
function! s:warn(msg) abort
echohl WarningMsg
echomsg a:msg
echohl NONE
endfunction
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) abort
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#slash() . '{}')
endfunction
function! pathogen#incubate(...) abort
let name = a:0 ? a:1 : 'bundle/{}'
call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
return pathogen#interpose(name)
endfunction
" Deprecated alias for pathogen#interpose().
function! pathogen#runtime_append_all_bundles(...) abort
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
else
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
endif
return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
endfunction
if exists(':Vedit')
finish
endif
let s:vopen_warning = 0
function! s:find(count,cmd,file,lcd)
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
endif
if !s:vopen_warning
let s:vopen_warning = 1
let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
else
let warning = ''
endif
if a:lcd
let path = file[0:-strlen(a:file)-2]
execute 'lcd `=path`'
return a:cmd.' '.pathogen#fnameescape(a:file) . warning
else
return a:cmd.' '.pathogen#fnameescape(file) . warning
endif
endfunction
function! s:Findcomplete(A,L,P)
let sep = pathogen#slash()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
\'f': 'ftplugin',
\'i': 'indent',
\'p': 'plugin',
\'s': 'syntax'}
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
let request = cheats[a:A[0]].a:A[1:-1]
else
let request = a:A
endif
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
let found = {}
for path in pathogen#split(&runtimepath)
let path = expand(path, ':p')
let matches = split(glob(path.sep.pattern),"\n")
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
for match in matches
let found[match] = 1
endfor
endfor
return sort(keys(found))
endfunction
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':

2504
autoload/plug.vim Normal file

File diff suppressed because it is too large Load Diff

14
plugin/ale.vim Normal file
View File

@ -0,0 +1,14 @@
let g:ale_open_list = 0
let g:ale_set_quickfix = 0
let g:ale_set_loclist = 1
let g:ale_fix_on_save = 1
let g:ale_lint_delay = 100
highlight clear ALEWarningSign
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
let g:ale_sign_column_always = 1
let g:ale_quiet_messages = { 'sub_type': 'style' }
"Lint only on save
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 1

2
plugin/filetype.vim Normal file
View File

@ -0,0 +1,2 @@
au BufNewFile,BufRead *.log setf log

152
plugin/keys.vim Normal file
View File

@ -0,0 +1,152 @@
nnoremap <SPACE> <Nop>
let g:mapleader = ' '
" easy config
nmap <S-F9> :e $HOME/.vimrc<CR>
nmap <S-F10> :so $HOME/.vimrc<CR>
" Force saving files that require root permission
command! SUDOwrite :execute 'w !sudo tee > /dev/null %' | edit!
" Bubble single lines
nmap <silent> <C-S-Up> :m-2<CR>==
nmap <silent> <C-S-Down> :m+<CR>==
imap <silent> <C-S-Up> <Esc>:m-2<CR>==gi
imap <silent> <C-S-Down> <Esc>:m+<CR>==gi
" Bubble multiple lines
vmap <silent> <C-S-Up> :m-2<CR>gv=gv
vmap <silent> <C-S-Down> :m'>+<CR>gv=gv
" Indent lines using <Left> and <Right>
vmap <C-S-Right> >gv
nmap <C-S-Right> >>
imap <C-S-Right> <Esc>>>i
vmap <C-S-Left> <gv
nmap <C-S-Left> <<
imap <C-S-Left> <Esc><<i
" moving through location list items
" noremap <S-Up> :lprevious<CR>
" noremap <S-Down> :lnext<CR>
" moving through buffers
" noremap <S-Left> :bn<CR>
" noremap <S-Right> :bp<CR>
noremap <leader>bd <Esc>:bd<CR>
noremap <leader>wc <Esc>:bd<CR>
noremap <leader>bo <Esc>:Bufonly<CR>
" Remap window commands
" map <leader>ws <Esc>:wincmd s<CR>
" map <leader>wv <Esc>:wincmd v<CR>
" map <leader>wc <Esc>:wincmd c<CR>
" map <leader>wn <Esc>:wincmd n<CR>
" map <leader>wo <Esc>:wincmd o<CR>
" map <leader>w+ <Esc>:wincmd _<CR>
" map <leader>w- <Esc>:wincmd <Bar><CR>
" map <leader>w= <Esc>:wincmd =<CR>
" nmap + :vertical resize +20<CR>
" nmap - :vertical resize -20<CR>
" map <C-S--> <Esc>:wincmd ><CR>
" map <C-Down> <Esc>:wincmd j<CR>
" map <C-j> <Esc>:wincmd j<CR>
" map <C-Up> <Esc>:wincmd k<CR>
" map <C-k> <Esc>:wincmd k<CR>
" map <C-Left> <Esc>:wincmd h<CR>
" map <C-h> <Esc>:wincmd h<CR>
" map <C-Right> <Esc>:wincmd l<CR>
" map <C-l> <Esc>:wincmd l<CR>
nnoremap <silent> <A-i> :wincmd K<CR>
nnoremap <silent> <A-k> :wincmd J<CR>
nnoremap <silent> <A-j> :wincmd H<CR>
nnoremap <silent> <A-l> :wincmd L<CR>
nnoremap <silent> <A-Up> :wincmd k<CR>
nnoremap <silent> <A-Down> :wincmd j<CR>
nnoremap <silent> <A-Left> :wincmd h<CR>
nnoremap <silent> <A-Right> :wincmd l<CR>
inoremap <silent> <A-Up> <Esc>:wincmd k<CR>
inoremap <silent> <A-Down> <Esc>:wincmd j<CR>
inoremap <silent> <A-Left> <Esc>:wincmd h<CR>
inoremap <silent> <A-Right> <Esc>:wincmd l<CR>
" tags
nmap <S-F3> :exec("tjump ".expand("<cword>"))<CR>
nmap <S-F4> :split<CR>:exec("tjump ".expand("<cword>"))<CR>
" trigger NERDTree, Tagbar $ Co.
nmap <leader>n <Esc>:NERDTreeToggle<CR>
nmap <leader>t <Esc>:TagbarToggle<CR>
" nmap <leader>f "zyaw :exe ":Ack ".@z.""<CR>
nmap <C-f> :CtrlP<CR>
nmap <C-t> :CtrlPTag<CR>
nmap <C-b> :CtrlPBuffer<CR>
" grep word under cursor
nnoremap <silent><leader>f :lgr! "\b<C-R><C-W>\b"<CR>:cw<CR>
" paste from system clipboard
inoremap <silent> <S-Insert> <ESC>:set paste<CR>"+p :set nopaste<CR>
" toggle spellcheck
nmap <silent> <S-F7> :setlocal spell! spelllang=en_us<CR>
" cursor jump
nnoremap <S-Up> 3k
inoremap <S-Up> <Esc>:-3<CR>i
vnoremap <S-Up> 3k
nnoremap <S-Down> 3j
inoremap <S-Down> <Esc>:+3<CR>i
vnoremap <S-Down> 3j
nnoremap <C-Up> 6k
inoremap <C-Up> <Esc>:-6<CR>i
vnoremap <C-Up> 6k
nnoremap <C-Down> 6j
inoremap <C-Down> <Esc>:+6<CR>i
vnoremap <C-Down> 6j
" scrolling
nnoremap <S-PageUp> 10<C-Y>
inoremap <S-PageUp> <Esc>10<C-Y>i
vnoremap <S-PageUp> 10<C-Y>
nnoremap <S-PageDown> 10<C-E>
inoremap <S-PageDown> <Esc>10<C-E>i
vnoremap <S-PageDown> 10<C-E>
" F keys
nmap <F2> :noh<CR>
imap <F2> <C-O>:noh<CR>
nmap <F3> :YcmCompleter GoToDeclaration<CR>
nmap <F4> :YcmCompleter GoTo<CR>
nmap <C-F4> :YcmCompleter GoTo<CR>:wincmd o<CR>
noremap <F5> :FufBuffer<CR>
nmap <F7> :call ManCurrentWord()<CR><CR>
nmap <F8> :call DevHelpCurrentWord()<CR><CR>
nnoremap <silent> <F10> :call NERDComment("n", "Toggle")<cr>
vnoremap <silent> <F10> <ESC>:call NERDComment("v", "Toggle")<cr>
" nmap <F4> <C-]>
" plugins etc
noremap <C-F> :NERDTreeToggle<CR>
noremap <C-B> :TagbarToggle<CR>
inoremap <C-B> <C-O>:TagbarToggle<CR>
" remap visual block
nnoremap <S-B> <c-v>
" write
noremap <C-s> :w<CR>
inoremap <C-s> <C-O>:w<CR>
" exit
noremap <C-q> :qa!<CR>
inoremap <C-q> <C-O>:qa!<CR>
" paste
nnoremap <C-V> "+gPl
vnoremap <C-V> :<C-U>call Paste("v")<CR>
inoremap <C-V> <C-O>:call Paste("i")<CR>
" select all
nnoremap <C-A> ggVG<CR>
inoremap <C-A> <C-O>:call Select()<CR>

379
syntax/haskell.vim.bak Executable file
View File

@ -0,0 +1,379 @@
" Vim syntax file
"
" Modification of vims Haskell syntax file:
" - match types using regular expression
" - highlight toplevel functions
" - use "syntax keyword" instead of "syntax match" where appropriate
" - functions and types in import and module declarations are matched
" - removed hs_highlight_more_types (just not needed anymore)
" - enable spell checking in comments and strings only
" - FFI highlighting
" - QuasiQuotation
" - top level Template Haskell slices
" - PackageImport
"
" TODO: find out which vim versions are still supported
"
" From Original file:
" ===================
"
" Language: Haskell
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
" Last Change: 2010 Feb 21
" Original Author: John Williams <jrw@pobox.com>
"
" Thanks to Ryan Crumley for suggestions and John Meacham for
" pointing out bugs. Also thanks to Ian Lynagh and Donald Bruce Stewart
" for providing the inspiration for the inclusion of the handling
" of C preprocessor directives, and for pointing out a bug in the
" end-of-line comment handling.
"
" Options-assign a value to these variables to turn the option on:
"
" hs_highlight_delimiters - Highlight delimiter characters--users
" with a light-colored background will
" probably want to turn this on.
" hs_highlight_boolean - Treat True and False as keywords.
" hs_highlight_types - Treat names of primitive types as keywords.
" hs_highlight_debug - Highlight names of debugging functions.
" hs_allow_hash_operator - Don't highlight seemingly incorrect C
" preprocessor directives but assume them to be
" operators
"
"
if version < 600
syn clear
elseif exists("b:current_syntax")
finish
endif
"syntax sync fromstart "mmhhhh.... is this really ok to do so?
syntax sync linebreaks=15 minlines=50 maxlines=500
syn match hsSpecialChar contained "\\\([0-9]\+\|o[0-7]\+\|x[0-9a-fA-F]\+\|[\"\\'&\\abfnrtv]\|^[A-Z^_\[\\\]]\)"
syn match hsSpecialChar contained "\\\(NUL\|SOH\|STX\|ETX\|EOT\|ENQ\|ACK\|BEL\|BS\|HT\|LF\|VT\|FF\|CR\|SO\|SI\|DLE\|DC1\|DC2\|DC3\|DC4\|NAK\|SYN\|ETB\|CAN\|EM\|SUB\|ESC\|FS\|GS\|RS\|US\|SP\|DEL\)"
syn match hsSpecialCharError contained "\\&\|'''\+"
sy region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar,@Spell
sy match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError
sy match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError
" (Qualified) identifiers (no default highlighting)
syn match ConId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[A-Z][a-zA-Z0-9_']*\>"
syn match VarId "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=\<[a-z][a-zA-Z0-9_']*\>"
" Infix operators--most punctuation characters and any (qualified) identifier
" enclosed in `backquotes`. An operator starting with : is a constructor,
" others are variables (e.g. functions).
syn match hsVarSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[-!#$%&\*\+/<=>\?@\\^|~.][-!#$%&\*\+/<=>\?@\\^|~:.]*"
syn match hsConSym "\(\<[A-Z][a-zA-Z0-9_']*\.\)\=:[-!#$%&\*\+./<=>\?@\\^|~:]*"
syn match hsVarSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[a-z][a-zA-Z0-9_']*`"
syn match hsConSym "`\(\<[A-Z][a-zA-Z0-9_']*\.\)\=[A-Z][a-zA-Z0-9_']*`"
" Toplevel Template Haskell support
"sy match hsTHTopLevel "^[a-z]\(\(.\&[^=]\)\|\(\n[^a-zA-Z0-9]\)\)*"
sy match hsTHIDTopLevel "^[a-z]\S*"
sy match hsTHTopLevel "^\$(\?" nextgroup=hsTHTopLevelName
sy match hsTHTopLevelName "[a-z]\S*" contained
" Reserved symbols--cannot be overloaded.
syn match hsDelimiter "(\|)\|\[\|\]\|,\|;\|_\|{\|}"
sy region hsInnerParen start="(" end=")" contained contains=hsInnerParen,hsConSym,hsType,hsVarSym
sy region hs_InfixOpFunctionName start="^(" end=")\s*[^:`]\(\W\&\S\&[^'\"`()[\]{}@]\)\+"re=s
\ contained keepend contains=hsInnerParen,hs_HlInfixOp
sy match hs_hlFunctionName "[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained
sy match hs_FunctionName "^[a-z_]\(\S\&[^,\(\)\[\]]\)*" contained contains=hs_hlFunctionName
sy match hs_HighliteInfixFunctionName "`[a-z_][^`]*`" contained
sy match hs_InfixFunctionName "^\S[^=]*`[a-z_][^`]*`"me=e-1 contained contains=hs_HighliteInfixFunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter
sy match hs_HlInfixOp "\(\W\&\S\&[^`(){}'[\]]\)\+" contained contains=hsString
sy match hs_InfixOpFunctionName "^\(\(\w\|[[\]{}]\)\+\|\(\".*\"\)\|\('.*'\)\)\s*[^:]=*\(\W\&\S\&[^='\"`()[\]{}@]\)\+"
\ contained contains=hs_HlInfixOp,hsCharacter
sy match hs_OpFunctionName "(\(\W\&[^(),\"]\)\+)" contained
"sy region hs_Function start="^["'a-z_([{]" end="=\(\s\|\n\|\w\|[([]\)" keepend extend
sy region hs_Function start="^["'a-zA-Z_([{]\(\(.\&[^=]\)\|\(\n\s\)\)*=" end="\(\s\|\n\|\w\|[([]\)"
\ contains=hs_OpFunctionName,hs_InfixOpFunctionName,hs_InfixFunctionName,hs_FunctionName,hsType,hsConSym,hsVarSym,hsString,hsCharacter
sy match hs_TypeOp "::"
sy match hs_DeclareFunction "^[a-z_(]\S*\(\s\|\n\)*::" contains=hs_FunctionName,hs_OpFunctionName,hs_TypeOp
" hi hs_TypeOp guibg=red
" hi hs_InfixOpFunctionName guibg=yellow
" hi hs_Function guibg=green
" hi hs_InfixFunctionName guibg=red
" hi hs_DeclareFunction guibg=red
sy keyword hsStructure data family class where instance default deriving
sy keyword hsTypedef type newtype
sy keyword hsInfix infix infixl infixr
sy keyword hsStatement do case of let in
sy keyword hsConditional if then else
"if exists("hs_highlight_types")
" Primitive types from the standard prelude and libraries.
sy match hsType "\<[A-Z]\(\S\&[^,.]\)*\>"
sy match hsType "()"
"endif
" Not real keywords, but close.
if exists("hs_highlight_boolean")
" Boolean constants from the standard prelude.
syn keyword hsBoolean True False
endif
syn region hsPackageString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained
sy match hsModuleName excludenl "\([A-Z]\w*\.\?\)*" contained
sy match hsImport "\<import\>\s\+\(qualified\s\+\)\?\(\<\(\w\|\.\)*\>\)"
\ contains=hsModuleName,hsImportLabel
\ nextgroup=hsImportParams,hsImportIllegal skipwhite
sy keyword hsImportLabel import qualified contained
sy match hsImportIllegal "\w\+" contained
sy keyword hsAsLabel as contained
sy keyword hsHidingLabel hiding contained
sy match hsImportParams "as\s\+\(\w\+\)" contained
\ contains=hsModuleName,hsAsLabel
\ nextgroup=hsImportParams,hsImportIllegal skipwhite
sy match hsImportParams "hiding" contained
\ contains=hsHidingLabel
\ nextgroup=hsImportParams,hsImportIllegal skipwhite
sy region hsImportParams start="(" end=")" contained
\ contains=hsBlockComment,hsLineComment, hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName
\ nextgroup=hsImportIllegal skipwhite
" hi hsImport guibg=red
"hi hsImportParams guibg=bg
"hi hsImportIllegal guibg=bg
"hi hsModuleName guibg=bg
"sy match hsImport "\<import\>\(.\|[^(]\)*\((.*)\)\?"
" \ contains=hsPackageString,hsImportLabel,hsImportMod,hsModuleName,hsImportList
"sy keyword hsImportLabel import contained
"sy keyword hsImportMod as qualified hiding contained
"sy region hsImportListInner start="(" end=")" contained keepend extend contains=hs_OpFunctionName
"sy region hsImportList matchgroup=hsImportListParens start="("rs=s+1 end=")"re=e-1
" \ contained
" \ keepend extend
" \ contains=hsType,hsLineComment,hsBlockComment,hs_hlFunctionName,hsImportListInner
" new module highlighting
syn region hsDelimTypeExport start="\<[A-Z]\(\S\&[^,.]\)*\>(" end=")" contained
\ contains=hsType
sy keyword hsExportModuleLabel module contained
sy match hsExportModule "\<module\>\(\s\|\t\|\n\)*\([A-Z]\w*\.\?\)*" contained contains=hsExportModuleLabel,hsModuleName
sy keyword hsModuleStartLabel module contained
sy keyword hsModuleWhereLabel where contained
syn match hsModuleStart "^module\(\s\|\n\)*\(\<\(\w\|\.\)*\>\)\(\s\|\n\)*"
\ contains=hsModuleStartLabel,hsModuleName
\ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel
syn region hsModuleCommentA start="{-" end="-}"
\ contains=hsModuleCommentA,hsCommentTodo,@Spell contained
\ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl
syn match hsModuleCommentA "--.*\n"
\ contains=hsCommentTodo,@Spell contained
\ nextgroup=hsModuleCommentA,hsModuleExports,hsModuleWhereLabel skipwhite skipnl
syn region hsModuleExports start="(" end=")" contained
\ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl
\ contains=hsBlockComment,hsLineComment,hsType,hsDelimTypeExport,hs_hlFunctionName,hs_OpFunctionName,hsExportModule
syn match hsModuleCommentB "--.*\n"
\ contains=hsCommentTodo,@Spell contained
\ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl
syn region hsModuleCommentB start="{-" end="-}"
\ contains=hsModuleCommentB,hsCommentTodo,@Spell contained
\ nextgroup=hsModuleCommentB,hsModuleWhereLabel skipwhite skipnl
" end module highlighting
" FFI support
sy keyword hsFFIForeign foreign contained
"sy keyword hsFFIImportExport import export contained
sy keyword hsFFIImportExport export contained
sy keyword hsFFICallConvention ccall stdcall contained
sy keyword hsFFISafety safe unsafe contained
sy region hsFFIString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=hsSpecialChar
sy match hsFFI excludenl "\<foreign\>\(.\&[^\"]\)*\"\(.\)*\"\(\s\|\n\)*\(.\)*::"
\ keepend
\ contains=hsFFIForeign,hsFFIImportExport,hsFFICallConvention,hsFFISafety,hsFFIString,hs_OpFunctionName,hs_hlFunctionName
sy match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
sy match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
" Comments
sy keyword hsCommentTodo TODO FIXME XXX TBD contained
sy match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsCommentTodo,@Spell
sy region hsBlockComment start="{-" end="-}" contains=hsBlockComment,hsCommentTodo,@Spell
sy region hsPragma start="{-#" end="#-}"
" Liquid Types
sy region hsLiquidAnnot start="{-@\s*" end="@-}" contains=hsLiquidKeyword,hsLiquidReftA,hsLiquidReftB,hsLiquidReftC
sy region hsLiquidAnnot start="{-@\s*\<invariant\>" end="@-}" contains=hsLiquidKeyword,hsLiquidReftA,hsLiquidReftB,hsLiquidReftC
sy region hsLiquidAnnot start="{-@\s*\<predicate\>" end="@-}" contains=hsLiquidKeyword,hsLiquidReftA,hsLiquidReftB,hsLiquidReftC
sy region hsLiquidAnnot start="{-@\s*\<assert\>" end="@-}" contains=hsLiquidKeyword,hsLiquidReftA,hsLiquidReftB,hsLiquidReftC
sy region hsLiquidAnnot start="{-@\s*\<type\>" end="@-}" contains=hsLiquidKeyword,hsLiquidReftA,hsLiquidReftB,hsLiquidReftC
sy region hsLiquidAnnot start="{-@\s*\<data\>" end="@-}" contains=hsLiquidKeyword,hsLiquidReftA,hsLiquidReftB,hsLiquidReftC
sy keyword hsLiquidKeyword assume assert invariant predicate type data contained
sy region hsLiquidReftA start="{\(\s\|\w\)" end=":" contained
sy region hsLiquidReftB start="|" end="}" contained
sy match hsLiquidReftC "\w*:" contained
" QuasiQuotation
sy region hsQQ start="\[\$" end="|\]"me=e-2 keepend contains=hsQQVarID,hsQQContent nextgroup=hsQQEnd
sy region hsQQNew start="\[\(.\&[^|]\&\S\)*|" end="|\]"me=e-2 keepend contains=hsQQVarIDNew,hsQQContent nextgroup=hsQQEnd
sy match hsQQContent ".*" contained
sy match hsQQEnd "|\]" contained
sy match hsQQVarID "\[\$\(.\&[^|]\)*|" contained
sy match hsQQVarIDNew "\[\(.\&[^|]\)*|" contained
if exists("hs_highlight_debug")
" Debugging functions from the standard prelude.
syn keyword hsDebug undefined error trace
endif
" C Preprocessor directives. Shamelessly ripped from c.vim and trimmed
" First, see whether to flag directive-like lines or not
if (!exists("hs_allow_hash_operator"))
syn match cError display "^\s*\(%:\|#\).*$"
endif
" Accept %: for # (C99)
syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=cComment,cCppString,cCommentError
syn match cPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
syn region cCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=cCppOut2
syn region cCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cCppSkip
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cCppSkip
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match cIncluded display contained "<[^>]*>"
syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cCppOut,cCppOut2,cCppSkip,cCommentStartError
syn region cDefine matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$"
syn region cPreProc matchgroup=cPreCondit start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=cCommentStartError,cSpaceError contained
syntax match cCommentError display "\*/" contained
syntax match cCommentStartError display "/\*"me=e-1 contained
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial contained
if version >= 508 || !exists("did_hs_syntax_inits")
if version < 508
let did_hs_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink hs_hlFunctionName Function
HiLink hs_HighliteInfixFunctionName Function
HiLink hs_HlInfixOp Function
HiLink hs_OpFunctionName Function
HiLink hsTypedef Typedef
HiLink hsVarSym hsOperator
HiLink hsConSym hsOperator
if exists("hs_highlight_delimiters")
" Some people find this highlighting distracting.
HiLink hsDelimiter Delimiter
endif
HiLink hsModuleStartLabel Structure
HiLink hsExportModuleLabel Keyword
HiLink hsModuleWhereLabel Structure
HiLink hsModuleName Normal
HiLink hsImportIllegal Error
HiLink hsAsLabel hsImportLabel
HiLink hsHidingLabel hsImportLabel
HiLink hsImportLabel Include
HiLink hsImportMod Include
HiLink hsPackageString hsString
HiLink hsOperator Operator
HiLink hsInfix Keyword
HiLink hsStructure Structure
HiLink hsStatement Statement
HiLink hsConditional Conditional
HiLink hsSpecialCharError Error
HiLink hsSpecialChar SpecialChar
HiLink hsString String
HiLink hsFFIString String
HiLink hsCharacter Character
HiLink hsNumber Number
HiLink hsFloat Float
HiLink hsLiterateComment hsComment
HiLink hsBlockComment hsComment
HiLink hsLineComment hsComment
HiLink hsModuleCommentA hsComment
HiLink hsModuleCommentB hsComment
HiLink hsComment Comment
HiLink hsCommentTodo Todo
HiLink hsPragma SpecialComment
HiLink hsBoolean Boolean
" Liquid Types
HiLink hsLiquidAnnot SpecialComment "String
HiLink hsLiquidKeyword Operator "Float
HiLink hsLiquidReftA Include
HiLink hsLiquidReftB Include
HiLink hsLiquidReftC Include
if exists("hs_highlight_types")
HiLink hsDelimTypeExport hsType
HiLink hsType Type
endif
HiLink hsDebug Debug
HiLink hs_TypeOp hsOperator
HiLink cCppString hsString
HiLink cCommentStart hsComment
HiLink cCommentError hsError
HiLink cCommentStartError hsError
HiLink cInclude Include
HiLink cPreProc PreProc
HiLink cDefine Macro
HiLink cIncluded hsString
HiLink cError Error
HiLink cPreCondit PreCondit
HiLink cComment Comment
HiLink cCppSkip cCppOut
HiLink cCppOut2 cCppOut
HiLink cCppOut Comment
HiLink hsFFIForeign Keyword
HiLink hsFFIImportExport Structure
HiLink hsFFICallConvention Keyword
HiLink hsFFISafety Keyword
HiLink hsTHIDTopLevel Macro
HiLink hsTHTopLevelName Macro
HiLink hsQQVarID Keyword
HiLink hsQQVarIDNew Keyword
HiLink hsQQEnd Keyword
HiLink hsQQContent String
delcommand HiLink
endif
let b:current_syntax = "haskell"

105
syntax/proto.vim Normal file
View File

@ -0,0 +1,105 @@
" Protocol Buffers - Google's data interchange format
" Copyright 2008 Google Inc. All rights reserved.
" https://developers.google.com/protocol-buffers/
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are
" met:
"
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above
" copyright notice, this list of conditions and the following disclaimer
" in the documentation and/or other materials provided with the
" distribution.
" * Neither the name of Google Inc. nor the names of its
" contributors may be used to endorse or promote products derived from
" this software without specific prior written permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" This is the Vim syntax file for Google Protocol Buffers.
"
" Usage:
"
" 1. cp proto.vim ~/.vim/syntax/
" 2. Add the following to ~/.vimrc:
"
" augroup filetype
" au! BufRead,BufNewFile *.proto setfiletype proto
" augroup end
"
" Or just create a new file called ~/.vim/ftdetect/proto.vim with the
" previous lines on it.
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case match
syn keyword pbTodo contained TODO FIXME XXX
syn cluster pbCommentGrp contains=pbTodo
syn keyword pbSyntax syntax import option
syn keyword pbStructure package message group oneof
syn keyword pbRepeat optional required repeated
syn keyword pbDefault default
syn keyword pbExtend extend extensions to max reserved
syn keyword pbRPC service rpc returns
syn keyword pbType int32 int64 uint32 uint64 sint32 sint64
syn keyword pbType fixed32 fixed64 sfixed32 sfixed64
syn keyword pbType float double bool string bytes
syn keyword pbTypedef enum
syn keyword pbBool true false
syn match pbInt /-\?\<\d\+\>/
syn match pbInt /\<0[xX]\x+\>/
syn match pbFloat /\<-\?\d*\(\.\d*\)\?/
syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp
syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp
syn region pbString start=/"/ skip=/\\./ end=/"/
syn region pbString start=/'/ skip=/\\./ end=/'/
if version >= 508 || !exists("did_proto_syn_inits")
if version < 508
let did_proto_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink pbTodo Todo
HiLink pbSyntax Include
HiLink pbStructure Structure
HiLink pbRepeat Repeat
HiLink pbDefault Keyword
HiLink pbExtend Keyword
HiLink pbRPC Keyword
HiLink pbType Type
HiLink pbTypedef Typedef
HiLink pbBool Boolean
HiLink pbInt Number
HiLink pbFloat Float
HiLink pbComment Comment
HiLink pbString String
delcommand HiLink
endif
let b:current_syntax = "proto"

403
vimrc Normal file
View File

@ -0,0 +1,403 @@
" ===== hasufell's vimrc ))))
" plugin stuff
filetype plugin on
filetype indent on
" Section pathogen
" let g:pathogen_disabled = []
" call add(g:pathogen_disabled, 'syntastic')
" call pathogen#infect()
" vim-plug settings (Plugin declaration)
call plug#begin('~/.vim/plugged')
Plug 'mileszs/ack.vim'
Plug 'romainl/Apprentice'
Plug 'chriskempson/base16-vim'
Plug 'fneu/breezy'
Plug 'vim-scripts/cmdalias.vim'
Plug 'Raimondi/delimitMate'
Plug 'romainl/Disciple'
Plug 'vim-scripts/genindent.vim'
Plug 'sjl/gundo.vim'
Plug 'idris-hackers/idris-vim'
Plug 'wimstefan/Lightning'
Plug 'vim-scripts/LustyJuggler'
Plug 'yegappan/mru'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'NLKNguyen/papercolor-theme'
Plug 'powerline/powerline', {
\ 'branch': 'develop',
\ 'do': 'python setup.py install --user',
\ 'rtp': 'powerline/bindings/vim',
\ }
Plug 'vim-scripts/promela.vim'
Plug 'AndrewRadev/simple_bookmarks.vim'
Plug 'Keithbsmiley/swift.vim'
Plug 'majutsushi/tagbar'
Plug 'ternjs/tern_for_vim'
Plug 'flazz/vim-colorschemes'
Plug 'reedes/vim-colors-pencil'
Plug 'altercation/vim-colors-solarized'
Plug 'xolox/vim-easytags'
Plug 'tpope/vim-fugitive'
Plug 'whatyouhide/vim-gotham'
Plug 'noahfrederick/vim-hemisu'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'xolox/vim-misc'
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'tpope/vim-rhubarb'
" LSP
" Plug 'autozimu/LanguageClient-neovim', {
" \ 'branch': 'next',
" \ 'do': 'bash install.sh',
" \ 'for': 'haskell',
" \ }
" (Optional) Multi-entry selection UI.
" Plug 'junegunn/fzf', { 'for': 'haskell' }
" autocomplet
" Plug 'Shougo/deoplete.nvim', { 'for': 'haskell' }
" Plug 'roxma/nvim-yarp', { 'for': 'haskell' }
" Plug 'roxma/vim-hug-neovim-rpc', { 'for': 'haskell' }
" linting/compilation
Plug 'w0rp/ale'
" completion
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer --rust-completer --system-boost --system-libclang',
\ 'for': ['haskell', 'c', 'python', 'sh', 'go', 'clojure'],
\ }
" haskell
Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
Plug 'lukerandall/haskellmode-vim', { 'for': 'haskell' }
Plug 'raichoo/haskell-vim', { 'for': 'haskell' }
Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
Plug 'bitc/lushtags', {
\ 'do': 'bash -c \"cabal clean && cabal sandbox delete && cabal sandbox init && cabal install && cp .cabal-sandbox/bin/lushtags ~/.cabal/bin/lushtags\"',
\ 'for': 'haskell',
\ }
" Plug 'timmytofu/vim-cabal-context', { 'for': 'haskell' }
Plug 'itchyny/vim-haskell-indent', { 'for': 'haskell' }
Plug 'dan-t/vim-hsimport', { 'for': 'haskell' }
" clojure
" Plug '~/.vim/unmanaged-vim-plug/paredit', { 'for': 'clojure' }
" Plug '~/.vim/unmanaged-vim-plug/tslime', { 'for': 'clojure' }
Plug 'tpope/vim-salve', { 'for': 'clojure' }
Plug 'tpope/vim-projectionist', { 'for': 'clojure' }
Plug 'tpope/vim-dispatch', { 'for': 'clojure' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
" go
Plug 'garyburd/go-explorer', { 'for': 'go' }
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries', 'for': 'go' }
" rust
Plug 'rhysd/rust-doc.vim', { 'for': 'rust' }
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
" javascript
Plug 'moll/vim-node', { 'for': 'javascript' }
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
" python
Plug 'icedwater/vimpython', { 'for': 'python' }
" scala
Plug 'derekwyatt/vim-scala', { 'for': 'scala' }
" unmanaged
Plug '~/.vim/unmanaged-vim-plug/bufonly'
Plug '~/.vim/unmanaged-vim-plug/colorschemedegrade'
Plug '~/.vim/unmanaged-vim-plug/fontzoom'
Plug '~/.vim/unmanaged-vim-plug/fuzzyfinder'
Plug '~/.vim/unmanaged-vim-plug/L9'
Plug '~/.vim/unmanaged-vim-plug/log'
Plug '~/.vim/unmanaged-vim-plug/ScrollColor'
Plug '~/.vim/unmanaged-vim-plug/txtfmt'
" Initialize plugin system
call plug#end()
" ===== further plugin initialization =====
so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
"powerline
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
set laststatus=2
" lj
let g:LustyJugglerSuppressRubyWarning = 1
" global settings
set foldmethod=syntax "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i useset directory=~/.vimtmp
set mouse=a
set autoread
set number
set encoding=utf8
set guifont=Monospace\ 14
set clipboard=unnamedplus
set textwidth=0
set tabstop=4
set shiftwidth=4
set directory=~/.vimtmp
set modeline
set modelines=1
let g:nickID = "hasufell"
" haskellmode, needs to load early
let g:haddock_browser='/usr/bin/firefox'
let g:haddock_browser_callformat='%s file://%s >/dev/null 2>&1 &'
" ==== conque ====
" command aliases
call CmdAlias('t','tabnew')
" call CmdAlias('cmd','ConqueTermSplit')
" call CmdAlias('bash','ConqueTermSplit bash<CR>')
call CmdAlias('openall','tab sball')
call CmdAlias('stripw','call StripTrailingWhitespaces()<CR>')
call CmdAlias('hotkeys', 'tabnew ~/.vim/hotkeys')
call CmdAlias('TC', 'call ToggleComment()<CR>')
call CmdAlias('TF', 'call ToggleFoldText()<CR>')
call CmdAlias('ctags', '!/usr/bin/ctags -R --langmap=c:.c.h --c++-kinds=+p --c-kinds=+p+x --fields=+i+a+S+t+l+m+n --extra=+q .<CR>')
" cabbrev git Git
" Disable annoying auto line break
fu! DisableBr()
set wrap
set linebreak
set nolist " list disables linebreak
set textwidth=0
set wrapmargin=0
set fo-=t
endfu
" Disable line breaks for all file types
au BufNewFile,BufRead *.* call DisableBr()
" ==========copy/paste===========
function! Paste(mode)
if a:mode == "v"
normal gv
normal "_d
normal "+gP
normal l
elseif a:mode == "i"
set virtualedit=all
normal `^"+gP
let &virtualedit = ""
endif
endfunction
" ======select all=======
function! Select()
set virtualedit=all
normal `^ggVG
let &virtualedit = ""
endfunction
" =======================
" don't yank to buffer on deletion
" vnoremap d "_d
" nnoremap d "_d
vnoremap x "_x
nnoremap x "_x
" Syntax
syntax enable
" ==== delimitMate ====
let g:delimitMate_matchpairs = "(:),[:],{:}"
let g:delimitMate_expand_cr = 1
let g:delimitMate_expand_space = 1
let g:delimitMate_autoclose = 1
" pane navigation
" Use ctrl-[hjkl] to select the active split!
let g:C_Ctrl_j = 'off'
let g:BASH_Ctrl_j = 'off'
" ==========colors===========
"set t_Co=256
"let g:solarized_termcolors=256
if has('gui_running')
set background=dark
colorscheme solarized
else
set background=dark
colorscheme solarized
" colorscheme dante
endif
" ===========================
" Solarized stuff
" let g:solarized_termtrans=0
" let g:solarized_degrade=0
" let g:solarized_bold=1
" let g:solarized_underline=1
" let g:solarized_italic=1
" let g:solarized_termcolors=16
" let g:solarized_contrast="normal"
let g:solarized_visibility="high"
" let g:solarized_diffmode="normal"
" let g:solarized_hitrail=0
let g:solarized_menu=1
try
lang en_US
catch
endtry
" ====== traling whitespace =====
fun! ShowTrailingWhitespace(pattern)
if &ft == 'conque_term'
call clearmatches()
return
endif
if &ft == 'diff'
call clearmatches()
return
endif
let str=a:pattern
if str == '1'
match ExtraWhitespace /\s\+$/
elseif str == '2'
call clearmatches()
" match ExtraWhitespace /\s\+\%#\@<!$/
elseif str == '3'
match ExtraWhitespace /\s\+$/
endif
endfun
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * call ShowTrailingWhitespace('1')
autocmd InsertEnter * call ShowTrailingWhitespace('2')
autocmd InsertLeave * call ShowTrailingWhitespace('3')
autocmd BufWinLeave * call clearmatches()
fun! StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
" ===========================
" youcompleteme
let g:ycm_filetype_blacklist = {
\ 'notes' : 1,
\ 'markdown' : 1,
\ 'text' : 1,
\ 'java' : 1,
\}
let g:ycm_confirm_extra_conf = 0
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_seed_identifiers_with_syntax = 0
" let g:ycm_always_populate_location_list = 1
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_key_invoke_completion = '<C-Space>'
let g:ycm_key_list_select_completion = ['<TAB>']
let g:ycm_key_list_previous_completion = ['<S-TAB>']
" nnoremap <F4> :YcmCompleter GoToDefinition<CR>
let g:ycm_server_log_level = 'error'
let g:ycm_semantic_triggers = {'haskell' : ['. ', '$ ']}
let g:ycm_goto_buffer_command = 'horizontal-split'
" commenting
let NERDSpaceDelims=1
let NERDCreateDefaultMappings=0
" comment hiding
func! IsComment( lnum )
return synIDattr(synID(a:lnum, match(getline(a:lnum),'\S')+1, 1),"name") =~? 'comment'
endfun
"set fdm=expr
set fde=IsComment(v:lnum)?1:IsComment(prevnonblank(v:lnum))?1:IsComment(nextnonblank\(v:lnum))?1:0
" light #073642 dark #002b36 grey #586e75
highlight Folded gui=NONE guifg=#586e75 guibg=#002b36
set foldtext='\ '
let g:folded = 0
function! ToggleComment()
if (g:folded == 0)
highlight Comment guifg=#002b36
let g:folded=1
else
highlight Comment guifg=#586e75
let g:folded=0
endif
endfunction
let g:myfoldtext = 0
function! ToggleFoldText()
if (g:myfoldtext == 0)
set foldtext='--'.v:folddashes.'\ '.getline(v:foldstart).'\ '
let g:myfoldtext=1
else
set foldtext='\ '
let g:myfoldtext=0
endif
endfunction
""""""""""""""""""""""""""""""
" vim macro to jump to devhelp topics.
""""""""""""""""""""""""""""""
function! DevHelpCurrentWord()
let word = expand("<cword>")
exe "!devhelp -s " . word . " &"
endfunction
function! ManCurrentWord()
let word = expand("<cword>")
exe "!man 3 " . word
endfunction
" vim:foldmethod=marker:foldlevel=0