Populate repo
This commit is contained in:
348
vim/.vim/after/syntax/java.vim
Normal file
348
vim/.vim/after/syntax/java.vim
Normal file
@ -0,0 +1,348 @@
|
||||
" Vim syntax file " Language: Java
|
||||
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" URL: http://www.fleiner.com/vim/syntax/java.vim
|
||||
" Last Change: 2011 Dec 30
|
||||
" This file is modified by Devajit Asem <devajitasem@outloook.com>
|
||||
" Please check :help java.vim for comments on some of the options available.
|
||||
|
||||
" Quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
" we define it here so that included files can test for it
|
||||
let main_syntax='java'
|
||||
syn region javaFold start="{" end="}" transparent fold
|
||||
endif
|
||||
|
||||
" don't use standard HiLink, it will not work with included syntax files
|
||||
if version < 508
|
||||
command! -nargs=+ JavaHiLink hi link <args>
|
||||
else
|
||||
command! -nargs=+ JavaHiLink hi def link <args>
|
||||
endif
|
||||
|
||||
" some characters that cannot be in a java program (outside a string)
|
||||
syn match javaError "[\\@`]"
|
||||
syn match javaError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
|
||||
syn match javaOK "\.\.\."
|
||||
|
||||
" use separate name so that it can be deleted in javacc.vim
|
||||
syn match javaError2 "#\|=<"
|
||||
JavaHiLink javaError2 javaError
|
||||
|
||||
|
||||
|
||||
" keyword definitions
|
||||
syn keyword javaExternal native package main
|
||||
syn match javaExternal "\<import\>\(\s\+static\>\)\?"
|
||||
syn keyword javaError goto const
|
||||
syn keyword javaConditional if else switch
|
||||
syn keyword javaRepeat while for do
|
||||
syn keyword javaBoolean true false
|
||||
syn keyword javaConstant null String args
|
||||
syn keyword javaTypedef this super
|
||||
syn keyword javaOperator new instanceof
|
||||
syn keyword javaType boolean char byte short int long float double
|
||||
syn keyword javaType void
|
||||
syn match javaBraces display '[(\)\{\}\[\]\*\&\&&\||\+\=\-\_\.\,\;\:]'
|
||||
syn keyword javaStatement return
|
||||
syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable
|
||||
syn keyword javaExceptions throw try catch finally System out print println in
|
||||
syn keyword javaAssert assert
|
||||
syn keyword javaMethodDecl synchronized throws
|
||||
syn keyword javaClassDecl extends implements interface
|
||||
" to differentiate the keyword class from MyClass.class we use a match here
|
||||
syn match javaTypedef "\.\s*\<class\>"ms=s+1
|
||||
syn keyword javaClassDecl enum
|
||||
syn match javaClassDecl "^class\>"
|
||||
syn match javaClassDecl "[^.]\s*\<class\>"ms=s+1
|
||||
syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>"
|
||||
syn match javaClassDecl "@interface\>"
|
||||
syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite
|
||||
syn match javaUserLabelRef "\k\+" contained
|
||||
syn match javaVarArg "\.\.\."
|
||||
syn keyword javaScopeDecl public protected private abstract
|
||||
|
||||
if exists("java_highlight_java_lang_ids")
|
||||
let java_highlight_all=1
|
||||
endif
|
||||
if exists("java_highlight_all") || exists("java_highlight_java") || exists("java_highlight_java_lang")
|
||||
" java.lang.*
|
||||
syn match javaLangClass "\<System\>"
|
||||
syn keyword javaR_JavaLang NegativeArraySizeException ArrayStoreException IllegalStateException RuntimeException IndexOutOfBoundsException UnsupportedOperationException ArrayIndexOutOfBoundsException ArithmeticException ClassCastException EnumConstantNotPresentException StringIndexOutOfBoundsException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException NumberFormatException NullPointerException TypeNotPresentException SecurityException
|
||||
syn cluster javaTop add=javaR_JavaLang
|
||||
syn cluster javaClasses add=javaR_JavaLang
|
||||
JavaHiLink javaR_JavaLang javaR_Java
|
||||
syn keyword javaC_JavaLang Process RuntimePermission StringKeySet CharacterData01 Class ThreadLocal ThreadLocalMap CharacterData0E Package Character StringCoding Long ProcessImpl ProcessEnvironment Short AssertionStatusDirectives 1PackageInfoProxy UnicodeBlock InheritableThreadLocal AbstractStringBuilder StringEnvironment ClassLoader ConditionalSpecialCasing CharacterDataPrivateUse StringBuffer StringDecoder Entry StringEntry WrappedHook StringBuilder StrictMath State ThreadGroup Runtime CharacterData02 MethodArray Object CharacterDataUndefined Integer Gate Boolean Enum Variable Subset StringEncoder Void Terminator CharsetSD IntegerCache CharacterCache Byte CharsetSE Thread SystemClassLoaderAction CharacterDataLatin1 StringValues StackTraceElement Shutdown ShortCache String ConverterSD ByteCache Lock EnclosingMethodInfo Math Float Value Double SecurityManager LongCache ProcessBuilder StringEntrySet Compiler Number UNIXProcess ConverterSE ExternalData CaseInsensitiveComparator CharacterData00 NativeLibrary
|
||||
syn cluster javaTop add=javaC_JavaLang
|
||||
syn cluster javaClasses add=javaC_JavaLang
|
||||
JavaHiLink javaC_JavaLang javaC_Java
|
||||
syn keyword javaE_JavaLang IncompatibleClassChangeError InternalError UnknownError ClassCircularityError AssertionError ThreadDeath IllegalAccessError NoClassDefFoundError ClassFormatError UnsupportedClassVersionError NoSuchFieldError VerifyError ExceptionInInitializerError InstantiationError LinkageError NoSuchMethodError Error UnsatisfiedLinkError StackOverflowError AbstractMethodError VirtualMachineError OutOfMemoryError
|
||||
syn cluster javaTop add=javaE_JavaLang
|
||||
syn cluster javaClasses add=javaE_JavaLang
|
||||
JavaHiLink javaE_JavaLang javaE_Java
|
||||
syn keyword javaX_JavaLang CloneNotSupportedException Exception NoSuchMethodException IllegalAccessException NoSuchFieldException Throwable InterruptedException ClassNotFoundException InstantiationException
|
||||
syn cluster javaTop add=javaX_JavaLang
|
||||
syn cluster javaClasses add=javaX_JavaLang
|
||||
JavaHiLink javaX_JavaLang javaX_Java
|
||||
|
||||
JavaHiLink javaR_Java javaR_
|
||||
JavaHiLink javaC_Java javaC_
|
||||
JavaHiLink javaE_Java javaE_
|
||||
JavaHiLink javaX_Java javaX_
|
||||
JavaHiLink javaX_ javaExceptions
|
||||
JavaHiLink javaR_ javaExceptions
|
||||
JavaHiLink javaE_ javaExceptions
|
||||
JavaHiLink javaC_ javaConstant
|
||||
|
||||
syn keyword javaLangObject clone equals finalize getClass hashCode
|
||||
syn keyword javaLangObject notify notifyAll toString wait
|
||||
JavaHiLink javaLangObject javaConstant
|
||||
syn cluster javaTop add=javaLangObject
|
||||
endif
|
||||
|
||||
if filereadable(expand("<sfile>:p:h")."/javaid.vim")
|
||||
source <sfile>:p:h/javaid.vim
|
||||
endif
|
||||
|
||||
if exists("java_space_errors")
|
||||
if !exists("java_no_trail_space_error")
|
||||
syn match javaSpaceError "\s\+$"
|
||||
endif
|
||||
if !exists("java_no_tab_space_error")
|
||||
syn match javaSpaceError " \+\t"me=e-1
|
||||
endif
|
||||
endif
|
||||
|
||||
syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":" contains=javaNumber,javaCharacter
|
||||
syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contains=javaLabel
|
||||
syn keyword javaLabel default
|
||||
|
||||
" highlighting C++ keywords as errors removed, too many people find it
|
||||
" annoying. Was: if !exists("java_allow_cpp_keywords")
|
||||
|
||||
" The following cluster contains all java groups except the contained ones
|
||||
syn cluster javaTop add=javaExternal,javaError,javaError,javaBranch,javaLabelRegion,javaLabel,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaClassDecl,javaClassDecl,javaScopeDecl,javaError,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg
|
||||
|
||||
|
||||
" Comments
|
||||
syn keyword javaTodo contained TODO FIXME XXX
|
||||
if exists("java_comment_strings")
|
||||
syn region javaCommentString contained start=+"+ end=+"+ end=+$+ end=+\*/+me=s-1,he=s-1 contains=javaSpecial,javaCommentStar,javaSpecialChar,@Spell
|
||||
syn region javaComment2String contained start=+"+ end=+$\|"+ contains=javaSpecial,javaSpecialChar,@Spell
|
||||
syn match javaCommentCharacter contained "'\\[^']\{1,6\}'" contains=javaSpecialChar
|
||||
syn match javaCommentCharacter contained "'\\''" contains=javaSpecialChar
|
||||
syn match javaCommentCharacter contained "'[^\\]'"
|
||||
syn cluster javaCommentSpecial add=javaCommentString,javaCommentCharacter,javaNumber
|
||||
syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber
|
||||
endif
|
||||
syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell
|
||||
syn match javaCommentStar contained "^\s*\*[^/]"me=e-1
|
||||
syn match javaCommentStar contained "^\s*\*$"
|
||||
syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,@Spell
|
||||
JavaHiLink javaCommentString javaString
|
||||
JavaHiLink javaComment2String javaString
|
||||
JavaHiLink javaCommentCharacter javaCharacter
|
||||
|
||||
syn cluster javaTop add=javaComment,javaLineComment
|
||||
|
||||
if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
|
||||
syntax case ignore
|
||||
" syntax coloring for javadoc comments (HTML)
|
||||
syntax include @javaHtml <sfile>:p:h/html.vim
|
||||
unlet b:current_syntax
|
||||
" HTML enables spell checking for all text that is not in a syntax item. This
|
||||
" is wrong for Java (all identifiers would be spell-checked), so it's undone
|
||||
" here.
|
||||
syntax spell default
|
||||
|
||||
syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell
|
||||
syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag
|
||||
|
||||
syn region javaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
|
||||
syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
|
||||
syn match javaDocParam contained "\s\S\+"
|
||||
syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
|
||||
syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam
|
||||
syn match javaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
|
||||
syntax case match
|
||||
endif
|
||||
|
||||
" match the special comment /**/
|
||||
syn match javaComment "/\*\*/"
|
||||
|
||||
" Strings and constants
|
||||
syn match javaSpecialError contained "\\."
|
||||
syn match javaSpecialCharError contained "[^']"
|
||||
syn match javaSpecialChar contained "\\\([4-9]\d\|[0-3]\d\d\|[\"\\'ntbrf]\|u\x\{4\}\)"
|
||||
syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaSpecialError,@Spell
|
||||
" next line disabled, it can cause a crash for a long line
|
||||
"syn match javaStringError +"\([^"\\]\|\\.\)*$+
|
||||
syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
|
||||
syn match javaCharacter "'\\''" contains=javaSpecialChar
|
||||
syn match javaCharacter "'[^\\]'"
|
||||
syn match javaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||
syn match javaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||
syn match javaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||
syn match javaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||
|
||||
" unicode characters
|
||||
syn match javaSpecial "\\u\d\{4\}"
|
||||
|
||||
syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStringError
|
||||
|
||||
if exists("java_highlight_functions")
|
||||
if java_highlight_functions == "indent"
|
||||
syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
|
||||
syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
|
||||
syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
|
||||
syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]]*([^-+*/()]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses
|
||||
else
|
||||
" This line catches method declarations at any indentation>0, but it assumes
|
||||
" two things:
|
||||
" 1. class names are always capitalized (ie: Button)
|
||||
" 2. method names are never capitalized (except constructors, of course)
|
||||
syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses
|
||||
endif
|
||||
syn match javaBraces "[{}]"
|
||||
syn cluster javaTop add=javaFuncDef,javaBraces
|
||||
endif
|
||||
|
||||
if exists("java_highlight_debug")
|
||||
|
||||
" Strings and constants
|
||||
syn match javaDebugSpecial contained "\\\d\d\d\|\\."
|
||||
syn region javaDebugString contained start=+"+ end=+"+ contains=javaDebugSpecial
|
||||
syn match javaDebugStringError +"\([^"\\]\|\\.\)*$+
|
||||
syn match javaDebugCharacter contained "'[^\\]'"
|
||||
syn match javaDebugSpecialCharacter contained "'\\.'"
|
||||
syn match javaDebugSpecialCharacter contained "'\\''"
|
||||
syn match javaDebugNumber contained "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
|
||||
syn match javaDebugNumber contained "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
|
||||
syn match javaDebugNumber contained "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
|
||||
syn match javaDebugNumber contained "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
|
||||
syn keyword javaDebugBoolean contained true false
|
||||
syn keyword javaDebugType contained null this super
|
||||
syn region javaDebugParen start=+(+ end=+)+ contained contains=javaDebug.*,javaDebugParen
|
||||
|
||||
" to make this work you must define the highlighting for these groups
|
||||
syn match javaDebug "\<System\.\(out\|err\)\.print\(ln\)*\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
|
||||
syn match javaDebug "\<p\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
|
||||
syn match javaDebug "[A-Za-z][a-zA-Z0-9_]*\.printStackTrace\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
|
||||
syn match javaDebug "\<trace[SL]\=\s*("me=e-1 contains=javaDebug.* nextgroup=javaDebugParen
|
||||
|
||||
syn cluster javaTop add=javaDebug
|
||||
|
||||
if version >= 508 || !exists("did_c_syn_inits")
|
||||
JavaHiLink javaDebug Debug
|
||||
JavaHiLink javaDebugString DebugString
|
||||
JavaHiLink javaDebugStringError javaError
|
||||
JavaHiLink javaDebugType DebugType
|
||||
JavaHiLink javaDebugBoolean DebugBoolean
|
||||
JavaHiLink javaDebugNumber Debug
|
||||
JavaHiLink javaDebugSpecial DebugSpecial
|
||||
JavaHiLink javaDebugSpecialCharacter DebugSpecial
|
||||
JavaHiLink javaDebugCharacter DebugString
|
||||
JavaHiLink javaDebugParen Debug
|
||||
|
||||
JavaHiLink DebugString String
|
||||
JavaHiLink DebugSpecial Special
|
||||
JavaHiLink DebugBoolean Boolean
|
||||
JavaHiLink DebugType Type
|
||||
JavaHiLink javaBraces Arithmetics
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists("java_mark_braces_in_parens_as_errors")
|
||||
syn match javaInParen contained "[{}]"
|
||||
JavaHiLink javaInParen javaError
|
||||
syn cluster javaTop add=javaInParen
|
||||
endif
|
||||
|
||||
" catch errors caused by wrong parenthesis
|
||||
syn region javaParenT transparent matchgroup=javaParen start="(" end=")" contains=@javaTop,javaParenT1
|
||||
syn region javaParenT1 transparent matchgroup=javaParen1 start="(" end=")" contains=@javaTop,javaParenT2 contained
|
||||
syn region javaParenT2 transparent matchgroup=javaParen2 start="(" end=")" contains=@javaTop,javaParenT contained
|
||||
syn match javaParenError ")"
|
||||
" catch errors caused by wrong square parenthesis
|
||||
syn region javaParenT transparent matchgroup=javaParen start="\[" end="\]" contains=@javaTop,javaParenT1
|
||||
syn region javaParenT1 transparent matchgroup=javaParen1 start="\[" end="\]" contains=@javaTop,javaParenT2 contained
|
||||
syn region javaParenT2 transparent matchgroup=javaParen2 start="\[" end="\]" contains=@javaTop,javaParenT contained
|
||||
syn match javaParenError "\]"
|
||||
|
||||
JavaHiLink javaParenError javaError
|
||||
|
||||
if !exists("java_minlines")
|
||||
let java_minlines = 10
|
||||
endif
|
||||
exec "syn sync ccomment javaComment minlines=" . java_minlines
|
||||
|
||||
" The default highlighting.
|
||||
if version >= 508 || !exists("did_java_syn_inits")
|
||||
if version < 508
|
||||
let did_java_syn_inits = 1
|
||||
endif
|
||||
JavaHiLink javaFuncDef Function
|
||||
JavaHiLink javaVarArg Function
|
||||
JavaHiLink javaBraces Function
|
||||
JavaHiLink javaBranch Conditional
|
||||
JavaHiLink javaUserLabelRef javaUserLabel
|
||||
JavaHiLink javaLabel Label
|
||||
JavaHiLink javaUserLabel Label
|
||||
JavaHiLink javaConditional Conditional
|
||||
JavaHiLink javaRepeat Repeat
|
||||
JavaHiLink javaExceptions Exception
|
||||
JavaHiLink javaAssert Statement
|
||||
JavaHiLink javaStorageClass StorageClass
|
||||
JavaHiLink javaMethodDecl javaStorageClass
|
||||
JavaHiLink javaClassDecl javaStorageClass
|
||||
JavaHiLink javaScopeDecl javaStorageClass
|
||||
JavaHiLink javaBoolean Boolean
|
||||
JavaHiLink javaSpecial Special
|
||||
JavaHiLink javaSpecialError Error
|
||||
JavaHiLink javaBraces Arithmetics
|
||||
JavaHiLink javaSpecialCharError Error
|
||||
JavaHiLink javaString String
|
||||
JavaHiLink javaCharacter Character
|
||||
JavaHiLink javaSpecialChar SpecialChar
|
||||
JavaHiLink javaNumber Number
|
||||
JavaHiLink javaError Error
|
||||
JavaHiLink javaStringError Error
|
||||
JavaHiLink javaStatement Statement
|
||||
JavaHiLink javaOperator Operator
|
||||
JavaHiLink javaComment Comment
|
||||
JavaHiLink javaDocComment String
|
||||
JavaHiLink javaLineComment Comment
|
||||
JavaHiLink javaConstant Constant
|
||||
JavaHiLink javaTypedef Typedef
|
||||
JavaHiLink javaTodo Todo
|
||||
JavaHiLink javaAnnotation PreProc
|
||||
|
||||
JavaHiLink javaCommentTitle SpecialComment
|
||||
JavaHiLink javaDocTags Special
|
||||
JavaHiLink javaDocParam Function
|
||||
JavaHiLink javaDocSeeTagParam Function
|
||||
JavaHiLink javaCommentStar javaComment
|
||||
|
||||
JavaHiLink javaType Type
|
||||
JavaHiLink javaExternal Include
|
||||
|
||||
JavaHiLink htmlComment Special
|
||||
JavaHiLink htmlCommentPart Special
|
||||
JavaHiLink javaSpaceError Error
|
||||
endif
|
||||
|
||||
delcommand JavaHiLink
|
||||
|
||||
let b:current_syntax = "java"
|
||||
|
||||
if main_syntax == 'java'
|
||||
unlet main_syntax
|
||||
endif
|
||||
|
||||
let b:spell_options="contained"
|
||||
|
||||
" vim: ts=8
|
2802
vim/.vim/autoload/plug.vim
Normal file
2802
vim/.vim/autoload/plug.vim
Normal file
File diff suppressed because it is too large
Load Diff
21
vim/.vim/prefs/ale.vim
Normal file
21
vim/.vim/prefs/ale.vim
Normal file
@ -0,0 +1,21 @@
|
||||
function! s:FindProjectRoot(buffer) abort
|
||||
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||
if filereadable(l:path . '/BUILD')
|
||||
return l:path
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
let ciderlsp = {
|
||||
\ 'name': 'CiderLSP',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': '/google/bin/releases/cider/ciderlsp/ciderlsp',
|
||||
\ 'command': '%e --noforward_sync_responses',
|
||||
\ 'project_root': function('s:FindProjectRoot'),
|
||||
\}
|
||||
|
||||
call ale#linter#Define('java', ciderlsp)
|
||||
let g:ale_lint_on_save = 1
|
||||
let g:ale_detail_to_floating_preview = 1
|
||||
let g:ale_linters={'java': ['CiderLSP']}
|
||||
let g:ale_completion_enabled = 1
|
53
vim/.vim/prefs/asynclsp.vim
Normal file
53
vim/.vim/prefs/asynclsp.vim
Normal file
@ -0,0 +1,53 @@
|
||||
Plug 'prabirshrestha/vim-lsp'
|
||||
Plug 'prabirshrestha/asyncomplete.vim'
|
||||
Plug 'prabirshrestha/asyncomplete-lsp.vim'
|
||||
|
||||
au User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'CiderLSP',
|
||||
\ 'cmd': {server_info->[
|
||||
\ '/google/bin/releases/cider/ciderlsp/ciderlsp',
|
||||
\ '--tooltag=vim-lsp',
|
||||
\ '--noforward_sync_responses',
|
||||
\ '-hub_addr=blade:languageservices-staging'
|
||||
\ ]},
|
||||
\ 'allowlist': ['c', 'cpp', 'java', 'kotlin', 'proto', 'textproto', 'go', 'python', 'bzl', 'sql', 'yaml', 'googlesql', 'build', 'typescript', 'gcl', 'soy'],
|
||||
\})
|
||||
|
||||
" Send async completion requests.
|
||||
" WARNING: Might interfere with other completion plugins.
|
||||
let g:lsp_async_completion = 1
|
||||
|
||||
" Enable UI for diagnostics
|
||||
let g:lsp_signs_enabled = 1 " enable diagnostics signs in the gutter
|
||||
let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode
|
||||
let g:lsp_diagnostics_float_cursor = 1 " enable floating window diagnostics
|
||||
|
||||
|
||||
" Automatically show completion options
|
||||
let g:asyncomplete_auto_popup = 1
|
||||
|
||||
function! s:on_lsp_buffer_enabled() abort
|
||||
setlocal omnifunc=lsp#complete
|
||||
setlocal signcolumn=yes
|
||||
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
||||
nmap <buffer> gd <plug>(lsp-definition)
|
||||
nmap <buffer> gs <plug>(lsp-document-symbol-search)
|
||||
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
|
||||
nmap <buffer> gr <plug>(lsp-references)
|
||||
nmap <buffer> gi <plug>(lsp-implementation)
|
||||
nmap <buffer> gt <plug>(lsp-type-definition)
|
||||
nmap <buffer> ga <plug>(lsp-code-action)
|
||||
nmap <buffer> <leader>rn <plug>(lsp-rename)
|
||||
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
|
||||
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
|
||||
inoremap <buffer> <expr><c-f> lsp#scroll(+4)
|
||||
inoremap <buffer> <expr><c-d> lsp#scroll(-4)
|
||||
|
||||
nmap <buffer> L <plug>(lsp-hover)
|
||||
endfunction
|
||||
|
||||
augroup lsp_install
|
||||
au!
|
||||
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
|
||||
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
|
||||
augroup END
|
5
vim/.vim/prefs/cmp.vim
Normal file
5
vim/.vim/prefs/cmp.vim
Normal file
@ -0,0 +1,5 @@
|
||||
lua << EOF
|
||||
require 'lspconfig'
|
||||
require("lsp")
|
||||
require("diagnostics")
|
||||
EOF
|
172
vim/.vim/prefs/coc.vim
Normal file
172
vim/.vim/prefs/coc.vim
Normal file
@ -0,0 +1,172 @@
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
Plug 'IngoMeyer441/coc_current_word'
|
||||
" Set internal encoding of vim, not needed on neovim, since coc.nvim using some
|
||||
" unicode characters in the file autoload/float.vim
|
||||
set encoding=utf-8
|
||||
|
||||
" TextEdit might fail if hidden is not set.
|
||||
set hidden
|
||||
|
||||
" Some servers have issues with backup files, see #649.
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
|
||||
" Give more space for displaying messages.
|
||||
set cmdheight=2
|
||||
|
||||
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
||||
" delays and poor user experience.
|
||||
set updatetime=300
|
||||
|
||||
" Don't pass messages to |ins-completion-menu|.
|
||||
set shortmess+=c
|
||||
|
||||
" Formatting selected code.
|
||||
" xmap <leader>f <Plug>(coc-format-selected)
|
||||
" nmap <leader>f <Plug>(coc-format-selected)
|
||||
nmap <leader>rn <Plug>(coc-rename)
|
||||
" pc = pick color
|
||||
nmap <leader>pc :call CocAction('pickColor')<CR>
|
||||
|
||||
" yaml outline
|
||||
nmap <leader>yo <C-S-O><cr>
|
||||
nmap <leader>pm :CocCommand markdown-preview-enhanced.openPreview
|
||||
|
||||
nmap <leader>cr :CocRestart<CR>
|
||||
" let g:node_client_debug = 1
|
||||
let g:coc_global_extensions = [ 'coc-emoji', 'coc-eslint', 'coc-tsserver', 'coc-tslint', 'coc-tslint-plugin', 'coc-css', 'coc-json', 'coc-pyls', 'coc-yaml', 'coc-html', 'coc-go', 'coc-git', 'coc-css', 'coc-sql', 'coc-sh', 'coc-rust-analyzer', 'coc-java', 'coc-kotlin', 'coc-explorer', 'coc-highlight', 'coc-marketplace', 'coc-zi', 'coc-syntax', 'coc-fzf-preview', 'coc-mocword']
|
||||
|
||||
" Don't pass messages to |ins-completion-menu|.
|
||||
set shortmess+=c
|
||||
|
||||
" Always show the signcolumn, otherwise it would shift the text each time
|
||||
" diagnostics appear/become resolved.
|
||||
if has("nvim-0.5.0") || has("patch-8.1.1564")
|
||||
" Recently vim can merge signcolumn and number column into one
|
||||
set signcolumn=number
|
||||
else
|
||||
set signcolumn=yes
|
||||
endif
|
||||
|
||||
" Use tab for trigger completion with characters ahead and navigate.
|
||||
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
||||
" other plugin before putting this into your config.
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
if has('nvim')
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
else
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
endif
|
||||
|
||||
" Make <CR> auto-select the first completion item and notify coc.nvim to
|
||||
" format on enter, <cr> could be remapped by other vim plugin
|
||||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
|
||||
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
|
||||
" Applying codeAction to the selected region.
|
||||
" Example: `<leader>aap` for current paragraph
|
||||
xmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
nmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
vmap <leader>a <Plug>(coc-codeaction-selected)
|
||||
|
||||
" Remap keys for applying codeAction to the current buffer.
|
||||
nmap <leader>ca <Plug>(coc-codeaction)
|
||||
" Apply AutoFix to problem on the current line.
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
|
||||
" Run the Code Lens action on the current line.
|
||||
nmap <leader>cl <Plug>(coc-codelens-action)
|
||||
|
||||
"" Remap for do codeAction of selected region
|
||||
function! s:cocActionsOpenFromSelected(type) abort
|
||||
execute 'CocCommand actions.open ' . a:type
|
||||
endfunction
|
||||
|
||||
|
||||
" Use `[g` and `]g` to navigate diagnostics
|
||||
nmap <silent> [g <Plug>(coc-diagnostic-prev)
|
||||
nmap <silent> ]g <Plug>(coc-diagnostic-next)
|
||||
|
||||
" Remap keys for gotos
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
nmap <silent> gy <Plug>(coc-type-definition)
|
||||
nmap <silent> gi <Plug>(coc-implementation)
|
||||
nmap <silent> gr <Plug>(coc-references)
|
||||
|
||||
" Apply AutoFix to problem on the current line.
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
|
||||
" Map function and class text objects
|
||||
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
|
||||
xmap if <Plug>(coc-funcobj-i)
|
||||
omap if <Plug>(coc-funcobj-i)
|
||||
xmap af <Plug>(coc-funcobj-a)
|
||||
omap af <Plug>(coc-funcobj-a)
|
||||
xmap ic <Plug>(coc-classobj-i)
|
||||
omap ic <Plug>(coc-classobj-i)
|
||||
xmap ac <Plug>(coc-classobj-a)
|
||||
omap ac <Plug>(coc-classobj-a)
|
||||
|
||||
" We're going to define single-letter keymaps, so don't try to define them
|
||||
" in the terminal window. The debugger CLI should continue accepting text commands.
|
||||
function! NvimGdbNoTKeymaps()
|
||||
tnoremap <silent> <buffer> <esc> <c-\><c-n>
|
||||
endfunction
|
||||
|
||||
let g:nvimgdb_config_override = {
|
||||
\ 'key_next': 'n',
|
||||
\ 'key_step': 's',
|
||||
\ 'key_finish': 'f',
|
||||
\ 'key_continue': 'c',
|
||||
\ 'key_until': 'u',
|
||||
\ 'key_breakpoint': 'b',
|
||||
\ 'set_tkeymaps': "NvimGdbNoTKeymaps",
|
||||
\ }
|
||||
|
||||
" Use K to show documentation in preview window.
|
||||
nnoremap <silent> L :call <SID>show_documentation()<CR>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
elseif (coc#rpc#ready())
|
||||
call CocActionAsync('doHover')
|
||||
else
|
||||
execute '!' . &keywordprg . " " . expand('<cword>')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
|
||||
|
||||
" Apply AutoFix to problem on the current line.
|
||||
nmap <leader>qf <Plug>(coc-fix-current)
|
||||
nmap zg :CocCommand cSpell.addWordToDictionary<CR>
|
||||
|
||||
" Mappings for CoCList
|
||||
" Show all diagnostics.
|
||||
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
|
||||
" Manage extensions.
|
||||
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
|
||||
" Show commands.
|
||||
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
|
||||
" Find symbol of current document.
|
||||
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
|
||||
" Search workspace symbols.
|
||||
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
|
||||
" Do default action for next item.
|
||||
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
|
||||
" Do default action for previous item.
|
||||
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
|
||||
" Resume latest coc list.
|
||||
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
|
63
vim/.vim/prefs/golang.vim
Normal file
63
vim/.vim/prefs/golang.vim
Normal file
@ -0,0 +1,63 @@
|
||||
" -------- VIM-GO --------
|
||||
let g:go_def_mode='gopls'
|
||||
let g:go_info_mode="gopls"
|
||||
let g:go_auto_type_info='gopls'
|
||||
let g:go_fmt_command = "goimports"
|
||||
let g:go_metalinter_autosave = 0
|
||||
let g:go_metalinter_command = "golangci-lint"
|
||||
let g:go_metalinter_enabled = ['govet', 'errcheck', 'deadcode', 'staticcheck', 'ineffassign']
|
||||
let g:go_metalinter_deadline = "10s"
|
||||
let g:go_metalinter_autosave_enabled = ['govet', 'errcheck', 'deadcode', 'staticcheck', 'ineffassign']
|
||||
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_function_calls = 1
|
||||
let g:go_highlight_methods = 1
|
||||
let g:go_highlight_fields = 1
|
||||
let g:go_highlight_types = 1
|
||||
let g:go_highlight_structs = 1
|
||||
let g:go_highlight_interfaces = 1
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_build_constraints = 1
|
||||
let g:go_code_completion_enabled = 1
|
||||
|
||||
let g:go_auto_type_info = 1
|
||||
|
||||
let g:syntastic_c_checkers = []
|
||||
let g:syntastic_rust_checkers = []
|
||||
let g:syntastic_cpp_checkers = []
|
||||
let g:syntastic_python_python_exec = 'python3'
|
||||
|
||||
" get rid of bull shit mappings
|
||||
let g:go_doc_keywordprg_enabled = 0
|
||||
let g:go_def_mapping_enabled = 0
|
||||
let g:go_bin_path = "/usr/lib/google-golang/bin/go "
|
||||
"let $GOPATH = $HOME."/go"
|
||||
|
||||
" --------- GOLANG MAPPINGS ---------
|
||||
nmap <leader>d :GoDef<cr>
|
||||
nmap <leader>b :GoBuild<cr>
|
||||
nmap <leader>tf :GoTestFunc<cr>
|
||||
nmap <leader>fs :GoFillStruct<cr>
|
||||
nmap <leader>at :GoAddTags<cr>
|
||||
nmap <leader>ie :GoIfErr<cr>
|
||||
|
||||
nmap <leader>ga :GoAlternate<cr>
|
||||
nmap <leader>gat :GoAddTags<cr>
|
||||
nmap <leader>grt :GoRemoveTags<cr>
|
||||
nmap <leader>gc :GoCoverageToggle<cr>
|
||||
nmap <leader>gd :GoDef<cr>
|
||||
nmap <leader>gfs :GoFillStruct<cr>
|
||||
nmap <leader>gl :GoMetaLinter<cr>
|
||||
nmap <leader>gr :GoRun<cr>
|
||||
nmap <leader>gt :GoTest<cr>
|
||||
nmap <leader>gtf :GoTestFunc<cr>
|
||||
nmap <leader>gv :GoVet<cr>
|
||||
|
||||
autocmd FileType go nmap gtj :CocCommand go.tags.add json<cr>
|
||||
autocmd FileType go nmap gty :CocCommand go.tags.add yaml<cr>
|
||||
autocmd FileType go nmap gtx :CocCommand go.tags.clear<cr>
|
||||
|
||||
"nmap <leader>gd <Plug>(coc-definition)
|
||||
"nmap <leader>gy <Plug>(coc-type-definition)
|
||||
"nmap <leader>gi <Plug>(coc-implementation)
|
||||
"nmap <leader>gr <Plug>(coc-references)
|
169
vim/.vim/prefs/google.vim
Normal file
169
vim/.vim/prefs/google.vim
Normal file
@ -0,0 +1,169 @@
|
||||
source /usr/share/vim/google/glug/bootstrap.vim
|
||||
source /usr/share/vim/google/core.vim
|
||||
source /google/data/ro/projects/vigor/vigor.vim
|
||||
" source /usr/share/vim/google/google.vim
|
||||
|
||||
Plug 'vim-scripts/vcscommand.vim'
|
||||
|
||||
if has('nvim') || has('patch-8.0.902')
|
||||
Plug 'mhinz/vim-signify'
|
||||
else
|
||||
Plug 'mhinz/vim-signify', { 'branch': 'legacy' }
|
||||
endif
|
||||
let g:signify_skip_filename_pattern = ['\.pipertmp.*']
|
||||
|
||||
Glug alert
|
||||
Glug csearch
|
||||
Glug codefmt-google
|
||||
Glug languages
|
||||
" applies google coding style settings to files whitelisted as google code. probably also want
|
||||
Glug googlestyle
|
||||
" internal spell-checking integration and improved default configuration.
|
||||
Glug googlespell
|
||||
" hooks for google-internal virtual file paths such as //depot and /cns.
|
||||
Glug googlepaths
|
||||
" core syntax and filetype settings for google-internal filetypes.
|
||||
Glug google-filetypes
|
||||
Glug ft-java
|
||||
Glug ft-proto
|
||||
Glug critique
|
||||
Glug piper
|
||||
Glug gtimporter
|
||||
Glug blaze
|
||||
let g:blazevim_quickfix_autoopen = 1
|
||||
|
||||
Glug buganizer plugin[mappings]
|
||||
Glug relatedfiles plugin[mappings]
|
||||
Glug g4
|
||||
Glug corpweb
|
||||
Glug google-csimporter
|
||||
Glug blazedeps
|
||||
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() }, 'commit': '3f75a83' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Glug outline-window
|
||||
Glug fzf-query
|
||||
|
||||
function s:blazeExec(cmd, targets)
|
||||
if len(a:targets) == 0
|
||||
exe VimuxRunCommand("build_target.py " . expand('%:p') . " " . a:cmd)<CR>
|
||||
else
|
||||
exe VimuxRunCommand(a:cmd . " " . join(a:targets, ' '))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function BlazeBuild() abort
|
||||
call <SID>blazeExec("blaze build", blaze#GetTargets())
|
||||
endfunction
|
||||
|
||||
function BlazeTest() abort
|
||||
call <SID>blazeExec("blaze test", blaze#GetTargets())
|
||||
endfunction
|
||||
|
||||
function BlazeTestDebug() abort
|
||||
call <SID>blazeExec("blaze test --java_debug", blaze#GetTargets())
|
||||
endfunction
|
||||
|
||||
nnoremap <Leader>bb :call BlazeBuild()<cr>
|
||||
nnoremap <Leader>bt :call BlazeTest()<cr>
|
||||
nnoremap <Leader>btd :call BlazeTestDebug()<cr>
|
||||
|
||||
let g:asyncrun_open = 1
|
||||
|
||||
function! s:AsyncBlaze(cmd, targets) abort
|
||||
"open cwindow manually and immediately when blaze starts.
|
||||
"simulate the same behavior from google-emacs blaze plugin.
|
||||
let l:aro = g:asyncrun_open
|
||||
let g:asyncrun_open = 0
|
||||
let l:target = ':'.expand('%:r')
|
||||
call setqflist([]) | copen 15
|
||||
" don't use !, so we scrolling the output.
|
||||
call asyncrun#run("", {"rows": 15}, a:cmd . ' ' . join(a:targets, ' '))
|
||||
let g:asyncrun_open = l:aro
|
||||
endfunction
|
||||
|
||||
function AsyncBlazeBuild() abort
|
||||
call <SID>AsyncBlaze("blaze build", blaze#GetTargets())
|
||||
endfunction
|
||||
|
||||
function AsyncBlazeTest() abort
|
||||
call <SID>AsyncBlaze("blaze test", blaze#GetTargets())
|
||||
endfunction
|
||||
|
||||
augroup autoformat_settings
|
||||
autocmd FileType borg,gcl,patchpanel AutoFormatBuffer gclfmt
|
||||
autocmd FileType bzl AutoFormatBuffer buildifier
|
||||
autocmd FileType c,cpp,javascript,typescript AutoFormatBuffer clang-format
|
||||
autocmd FileType dart AutoFormatBuffer dartfmt
|
||||
autocmd FileType go AutoFormatBuffer gofmt
|
||||
autocmd FileType java AutoFormatBuffer google-java-format
|
||||
autocmd FileType jslayout AutoFormatBuffer jslfmt
|
||||
autocmd FileType markdown AutoFormatBuffer mdformat
|
||||
autocmd FileType ncl AutoFormatBuffer nclfmt
|
||||
autocmd FileType python AutoFormatBuffer pyformat
|
||||
autocmd FileType soy AutoFormatBuffer soyfmt
|
||||
autocmd FileType textpb AutoFormatBuffer text-proto-format
|
||||
autocmd FileType proto AutoFormatBuffer protofmt
|
||||
autocmd FileType sql AutoFormatBuffer format_sql
|
||||
autocmd FileType kt AutoFormatBuffer ktfmt
|
||||
" autocmd FileType html,css,json AutoFormatBuffer js-beautify
|
||||
augroup END
|
||||
|
||||
function! CitCWorkspace()
|
||||
let l:workspace = substitute(getcwd(), '/google/src/cloud/[^/]\+/\([^/]\+\)/.*', '\1', 'g')
|
||||
return l:workspace
|
||||
endfunction
|
||||
|
||||
function! CitCObsession()
|
||||
execute 'Obsess ~/.sessions/' . CitCWorkspace() . '.vim'
|
||||
endfunction
|
||||
|
||||
|
||||
function! G4Blame(...)
|
||||
" Grab the filename from the argument, use expand() to expand '%'.
|
||||
if a:0 > 0
|
||||
let file = expand(a:1)
|
||||
else
|
||||
let file = expand('%')
|
||||
endif
|
||||
" Lock scrolling in right pane
|
||||
setl scb
|
||||
" Create left pane
|
||||
vnew
|
||||
" It's 37 columns wide
|
||||
vert res 37
|
||||
" Get the output, split it on newline and keep empty lines, skip the first 2
|
||||
" lines because they're headers we don't need, and put it in starting on line
|
||||
" 1 of the left pane
|
||||
call setline(1, split(system('g4 blame ' . file), '\n', 1)[2:])
|
||||
" Lock scrolling in left pane, turn off word wrap, set the buffer as
|
||||
" not-modified, remove any listchars highlighting (common in google code), set
|
||||
" it readonly (to make modifications slightly more annoying).
|
||||
setl scb nowrap nomod nolist ro
|
||||
" Move back to the right pane (not sure if there's a better way to do this?)
|
||||
exe "normal \<c-w>\<right>"
|
||||
" if a file was specified, open it
|
||||
if a:0 > 0
|
||||
execute "e ". file
|
||||
endif
|
||||
" Get the non-active pane scrolled to the same relative offset.
|
||||
syncbind
|
||||
endfunction
|
||||
|
||||
com! -nargs=? -complete=file Blame :call G4Blame(<f-args>)
|
||||
|
||||
nnoremap <leader>cs :FzfCs<space>
|
||||
nnoremap <leader>csi :CsImporter<cr>
|
||||
nnoremap <leader>CS :FzfCs<Space> <C-r><C-w> <cr>
|
||||
nnoremap <leader>cc :CritiqueUnresolvedComments<space><cr>
|
||||
nnoremap <leader>s :call CitCObsession()<CR>
|
||||
nnoremap <leader>g :GoogleOutlineWindow<CR>
|
||||
|
||||
nnoremap <leader>ps :PiperSelectActiveFiles<CR>
|
||||
nnoremap <leader>pl :PiperLoadActiveAsBuffers<CR>
|
||||
nnoremap <leader>po :PiperOpenPath<CR>
|
||||
|
||||
" search in codesearch for the word under the cursor
|
||||
nnoremap <leader>ws :CorpWebCs <cword> <CR>
|
||||
" search in codesearch for the current file
|
||||
nnoremap <leader>wf :CorpWebCsFile<CR>
|
64
vim/.vim/prefs/init.vim
Normal file
64
vim/.vim/prefs/init.vim
Normal file
@ -0,0 +1,64 @@
|
||||
set directory=/tmp
|
||||
set undodir=/tmp
|
||||
set nobackup
|
||||
set nowritebackup
|
||||
au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")
|
||||
|
||||
autocmd BufWritePre * StripWhitespace
|
||||
set termguicolors
|
||||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
||||
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
||||
let &t_AB="\e[48;5;%dm"
|
||||
let &t_AF="\e[38;5;%dm"
|
||||
syntax on
|
||||
|
||||
|
||||
set laststatus=2
|
||||
set cmdheight=1
|
||||
set ttyfast
|
||||
set relativenumber
|
||||
set copyindent
|
||||
set preserveindent
|
||||
set lazyredraw " Enable if running slow...
|
||||
set autoindent
|
||||
|
||||
set wrap
|
||||
set linebreak
|
||||
set textwidth=79
|
||||
set showbreak=⇇
|
||||
|
||||
" use intelligent indentation for C
|
||||
" configure tabwidth and insert spaces instead of tabs
|
||||
set tabstop=4 " tab width is 4 spaces
|
||||
set shiftwidth=4 " indent also with 4 spaces
|
||||
set expandtab " expand tabs to spaces
|
||||
|
||||
set number
|
||||
set showcmd
|
||||
set cursorline
|
||||
set showmatch
|
||||
set visualbell " don't beep
|
||||
set history=6000 " remember more commands and search history
|
||||
set undolevels=6000 " use many levels of undo
|
||||
|
||||
" ------------------------------------------------
|
||||
" -------------------SEARCHING--------------------
|
||||
" ------------------------------------------------
|
||||
set ignorecase " ignore case when searching
|
||||
set smartcase " ignore case if search pattern is all lowercase, case-sensitive otherwise
|
||||
set incsearch " search as characters are entered
|
||||
set hlsearch " highlight matches
|
||||
|
||||
set splitright " Puts new vsplit windows to the right of the current
|
||||
set splitbelow " Puts new split windows to the bottom of the current
|
||||
|
||||
set scrolljump=5 " Line to scroll when cursor leaves screen
|
||||
set scrolloff=3 " Minumum lines to keep above and below cursor
|
||||
|
||||
" makes sure that when opening, files are normal, i.e. not folded.
|
||||
set nofoldenable
|
||||
|
||||
" set clipboard=unnamed
|
||||
set shortmess=A
|
||||
|
||||
set updatetime=100
|
183
vim/.vim/prefs/leader.vim
Normal file
183
vim/.vim/prefs/leader.vim
Normal file
@ -0,0 +1,183 @@
|
||||
" --------- MAPPINGS FOR QUICK CONFIG EDITS ---------
|
||||
" mnemonic: (e)dit (v)imrc
|
||||
nmap <leader>ev :tabedit $MYVIMRC<cr>
|
||||
|
||||
" mnemonic: (e)dit (t)mux.conf
|
||||
nmap <leader>et :tabedit ~/.tmux.conf<cr>
|
||||
|
||||
" mnemonic: (e)dit (g)oogle.vim
|
||||
nmap <leader>eg :tabedit ~/.vim/prefs/google.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (b)ash_profile
|
||||
nmap <leader>eb :tabedit ~/.bash_profile<cr>
|
||||
|
||||
" mnemonic: (e)dit (f)tplugin
|
||||
nmap <leader>ef :tabedit ~/.vim/after/ftplugin<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)lugins
|
||||
nmap <leader>ep :tabedit ~/.vim/prefs/plugins.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (c)onfigs * opens NERDTree on the prefs dir
|
||||
nmap <leader>ec :tabedit ~/.vim/prefs/<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)refs, (i)nit.vim
|
||||
nmap <leader>epi :tabedit ~/.vim/prefs/init.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)refs, (l)eader.vim
|
||||
nmap <leader>epl :tabedit ~/.vim/prefs/leader.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)refs, (c)oc.vim
|
||||
nmap <leader>epc :tabedit ~/.vim/prefs/coc.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)refs, (m)appings.vim
|
||||
nmap <leader>epm :tabedit ~/.vim/prefs/mappings.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)refs, (p)lug_prefs.vim
|
||||
nmap <leader>epp :tabedit ~/.vim/prefs/plug_prefs.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (p)refs, (u)i.vim
|
||||
nmap <leader>epu :tabedit ~/.vim/prefs/ui.vim<cr>
|
||||
"
|
||||
" mnemonic: (e)dit (p)refs, (g)olang.vim
|
||||
nmap <leader>epg :tabedit ~/.vim/prefs/google.vim<cr>
|
||||
|
||||
" mnemonic: (e)dit (z)shrc
|
||||
nmap <leader>ez :tabedit ~/.zshrc<cr>
|
||||
"
|
||||
" mnemonic: (i)nsert (l)ambda
|
||||
imap <leader>il <C-K>l*
|
||||
|
||||
|
||||
" HEX<->ASCII
|
||||
" mnemonic: (h)ex (t)o (a)scii
|
||||
vnoremap <leader>hta :<c-u>s/\%V\x\x/\=nr2char(printf("%d", "0x".submatch(0)))/g<cr><c-l>`<
|
||||
" mnemonic: (a)scii (t)o (h)ex
|
||||
vnoremap <leader>ath :<c-u>s/\%V./\=printf("%x",char2nr(submatch(0)))/g<cr><c-l>`<
|
||||
|
||||
|
||||
|
||||
let g:windowswap_map_keys = 0 "prevent default bindings
|
||||
nnoremap <silent> <leader>yw :call WindowSwap#MarkWindowSwap()<CR>
|
||||
|
||||
|
||||
" --------- SURROUND MAPPINGS ---------
|
||||
" <leader>" Surround a word with "quotes"
|
||||
map <leader>" ysiw"
|
||||
vmap <leader>" c"<C-R>""<ESC>
|
||||
|
||||
" <leader>' Surround a word with 'single quotes'
|
||||
map <leader>' ysiw'
|
||||
vmap <leader>' c'<C-R>"'<ESC>
|
||||
|
||||
" <leader>' Surround a word with 'ticks'
|
||||
map <leader>` ysiw`
|
||||
vmap <leader>` c`<C-R>"`<ESC>
|
||||
|
||||
" --------- SEARCH MAPPINGS ---------
|
||||
" unhilight search
|
||||
nnoremap <leader><space> :nohlsearch<CR>
|
||||
|
||||
" EZ Ack search
|
||||
" nnoremap <leader>a :Ack!<Space>
|
||||
" nnoremap <leader>A :Ack!<Space> <C-r><C-w>
|
||||
|
||||
" --------- CLIPBOARD MAPPINGS ---------
|
||||
" Paste from OS clipboard
|
||||
map <leader>v i<ESC> :r!xclip -o<CR>
|
||||
vmap <leader>v c<ESC> :r!xclip -o<CR>
|
||||
imap <leader>v <ESC> :r!xclip -o<CR>
|
||||
" map <leader>v i<ESC>"+pa<ESC>
|
||||
" vmap <leader>v c<ESC>"+p<ESC>
|
||||
" imap <leader>v <ESC>"+pa
|
||||
"
|
||||
|
||||
" Copy to OS clipboard
|
||||
vnoremap <silent><Leader>y "yy <Bar> :call system('xclip', @y)<CR>
|
||||
" map <leader>y !xclip -selection clipboard
|
||||
" vmap <leader>y !xclip -selection clipboard<cr>
|
||||
" map <leader>y "+Y
|
||||
" vmap <leader>y "+y
|
||||
|
||||
" --------- WINDOW/PANE MAPPINGS ---------
|
||||
map <leader>wr <C-W>r
|
||||
map <leader>H :wincmd H<cr>
|
||||
map <leader>K :wincmd K<cr>
|
||||
map <leader>L :wincmd L<cr>
|
||||
map <leader>J :wincmd J<cr>
|
||||
map <leader>x :wincmd x<cr>
|
||||
|
||||
" resize vertical split to 1/3 or 2/3 size
|
||||
nnoremap <silent> <Leader>s+ :exe "vertical resize " . (winwidth(0) * 5/4)<CR>
|
||||
nnoremap <silent> <Leader>s- :exe "vertical resize " . (winwidth(0) * 4/5)<CR>
|
||||
|
||||
" resize horizontal split to 1/3 or 2/3 size
|
||||
nnoremap <silent> <Leader>x+ :exe "resize " . (winheight(0) * 3/2)<CR>
|
||||
nnoremap <silent> <Leader>x- :exe "resize " . (winheight(0) * 2/3)<CR>
|
||||
|
||||
|
||||
" --------- FORMATTING MAPPINGS ---------
|
||||
" indent file
|
||||
map <leader>= gg=G ``
|
||||
|
||||
" format HTML/JSON
|
||||
map <leader>fh :%s/>\s*</>\r</g<cr>
|
||||
map <leader>fj :%!python -m json.tool<cr>
|
||||
|
||||
map <leader>fjs :call UnMinify()<cr>
|
||||
"command! UnMinify call UnMinify()
|
||||
function! UnMinify()
|
||||
%s/{\ze[^\r\n]/{\r/g
|
||||
%s/){/) {/g
|
||||
%s/};\?\ze[^\r\n]/\0\r/g
|
||||
%s/;\ze[^\r\n]/;\r/g
|
||||
%s/[^\s]\zs[=&|]\+\ze[^\s]/ \0 /g
|
||||
normal ggVG=
|
||||
endfunction
|
||||
|
||||
|
||||
nmap <leader>toi :CocCommand tsserver.organizeImports<cr>
|
||||
|
||||
|
||||
" --------- FUGITIVE MAPPINGS ---------
|
||||
nmap <leader>dg :diffget<cr>
|
||||
nmap <leader>dp :diffput<cr>
|
||||
nmap <leader>du :diffupdate<cr>
|
||||
vmap <leader>dg :diffget<cr>
|
||||
vmap <leader>dp :diffput<cr>
|
||||
vmap <leader>du :diffupdate<cr>
|
||||
|
||||
nmap <leader>giw :Gwrite<cr>
|
||||
nmap <leader>gic :Gcommit -v<cr>
|
||||
nmap <leader>gid :Gdiff<cr>
|
||||
nmap <leader>gis :Gstatus<cr>
|
||||
|
||||
"" --------- NERD Commenter
|
||||
" Create default mappings
|
||||
let g:NERDCreateDefaultMappings = 0
|
||||
|
||||
" Add spaces after comment delimiters by default
|
||||
let g:NERDSpaceDelims = 1
|
||||
|
||||
" Use compact syntax for prettified multi-line comments
|
||||
let g:NERDCompactSexyComs = 1
|
||||
|
||||
" Align line-wise comment delimiters flush left instead of following code indentation
|
||||
let g:NERDDefaultAlign = 'left'
|
||||
|
||||
" Set a language to use its alternate delimiters by default
|
||||
let g:NERDAltDelims_java = 1
|
||||
|
||||
" Allow commenting and inverting empty lines (useful when commenting a region)
|
||||
let g:NERDCommentEmptyLines = 1
|
||||
|
||||
" Enable trimming of trailing whitespace when uncommenting
|
||||
let g:NERDTrimTrailingWhitespace = 1
|
||||
|
||||
"Enable NERDCommenterToggle to check all selected lines is commented or not
|
||||
let g:NERDToggleCheckAllLines = 1
|
||||
|
||||
nnoremap ,c<Space> :call nerdcommenter#Comment(0,"toggle")<CR>
|
||||
vnoremap ,c<Space> :call nerdcommenter#Comment(0,"toggle")<CR>
|
||||
|
||||
nnoremap ,c$ :call nerdcommenter#Comment(0,"ToEOL")<CR>
|
||||
vnoremap ,c$ :call nerdcommenter#Comment(0,"ToEOL")<CR>
|
70
vim/.vim/prefs/mappings.vim
Normal file
70
vim/.vim/prefs/mappings.vim
Normal file
@ -0,0 +1,70 @@
|
||||
" DO NOT PLACE PLUGIN RELATED MAPPINGS HERE
|
||||
|
||||
" jk is escape -.-
|
||||
inoremap jk <esc>
|
||||
|
||||
" make tmux and vim play nicely together
|
||||
map <Esc>[A <Up>
|
||||
map <Esc>[B <Down>
|
||||
map <Esc>[C <Right>
|
||||
map <Esc>[D <Left>
|
||||
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
tnoremap <C-H> <C-\><C-n><C-w>h
|
||||
tnoremap <C-J> <C-\><C-n><C-w>j
|
||||
tnoremap <C-K> <C-\><C-n><C-w>k
|
||||
tnoremap <C-L> <C-\><C-n><C-w>l
|
||||
|
||||
" remove mapping to be used in nerdtree
|
||||
inoremap <Nul> <C-n>
|
||||
|
||||
" Fox for Ack
|
||||
cnoreabbrev Ack Ack!
|
||||
cnoremap %% <C-R>=fnameescape(expand("%:p:h")."/")<CR>
|
||||
|
||||
" move vertically by visual line
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
|
||||
" no shift for colon cmds
|
||||
nnoremap ; :
|
||||
vnoremap ; :
|
||||
|
||||
" tab navigation
|
||||
nnoremap J :tabprevious<CR>
|
||||
nnoremap K :tabnext<CR>
|
||||
|
||||
" tab arrangement, Shift-H and Shift-L to move tabs
|
||||
"nnoremap <silent> <S-H> :execute 'silent! tabmove ' . (tabpagenr()-2)<CR>
|
||||
"nnoremap <silent> <S-L> :execute 'silent! tabmove ' . (tabpagenr()+1)<CR>
|
||||
"
|
||||
" tab opening
|
||||
nnoremap tt :tabedit<Space>
|
||||
nnoremap td :tabclose<CR>
|
||||
|
||||
" Shift-U and D for document navigation(page up, page down)
|
||||
nnoremap <S-U> <C-U>
|
||||
map <S-D> <nop>
|
||||
nnoremap <S-D> <C-D>
|
||||
|
||||
" Line swapping. I don't really use this that often
|
||||
nnoremap [e :<c-u>execute 'move -1-'. v:count1<cr>
|
||||
nnoremap ]e :<c-u>execute 'move +'. v:count1<cr>
|
||||
|
||||
" Create window splits easier. The default
|
||||
nnoremap <silent> vv <C-w>v
|
||||
nnoremap <silent> ss <C-w>s
|
||||
|
||||
nnoremap <C-t> <Cmd>CocCommand explorer<CR>
|
||||
|
||||
" always use very magic mode when searching
|
||||
"nnoremap / /\v
|
||||
"vnoremap / /\v
|
||||
"
|
||||
vnoremap // y/\V<C-r>=escape(@",'/\')<CR><CR>
|
||||
|
||||
nmap <F1> :CocCommand java.debug.vimspector.start<CR>
|
185
vim/.vim/prefs/plug_prefs.vim
Normal file
185
vim/.vim/prefs/plug_prefs.vim
Normal file
@ -0,0 +1,185 @@
|
||||
let pyxversion = 3
|
||||
|
||||
|
||||
" -------- FZF --------
|
||||
nmap <C-P> :FZF<CR>
|
||||
|
||||
nmap <leader><tab> <plug>(fzf-maps-n)
|
||||
xmap <leader><tab> <plug>(fzf-maps-x)
|
||||
omap <leader><tab> <plug>(fzf-maps-o)
|
||||
let g:fzf_preview_window = ['right:50%', 'ctrl-/']
|
||||
|
||||
let g:fzf_command_prefix = 'Fzf'
|
||||
" use the same keybindings for fzf as in shell
|
||||
" nnoremap <silent> <c-s-t> :FzfHgFiles<CR>
|
||||
" nnoremap <silent> <c-s-f> :FzfHgRg<space>
|
||||
let s:hg_command = 'hg files 2>/dev/null'
|
||||
|
||||
command! -bang FzfHgFiles
|
||||
\ call fzf#run(fzf#wrap({
|
||||
\ 'source': s:hg_command,
|
||||
\ 'options': $FZF_DEFAULT_OPTS . " " . $FZF_CTRL_T_OPTS,
|
||||
\ }),
|
||||
\ <bang>0
|
||||
\ )
|
||||
command! -bang -nargs=* FzfHgRg
|
||||
\ call fzf#vim#grep(
|
||||
\ s:rg_command . " " . <q-args> . " " . "$(" . s:hg_command . ")", 1,
|
||||
\ <bang>0 ? fzf#vim#with_preview('up:60%')
|
||||
\ : fzf#vim#with_preview('right:50%'),
|
||||
\ <bang>0)
|
||||
|
||||
"
|
||||
"
|
||||
" -------- CTRL-P --------
|
||||
" let g:ctrlp_map = '<c-o>'
|
||||
" let g:ctrlp_show_hidden = 1
|
||||
" let g:ctrlp_working_path_mode = 'ra'
|
||||
" set wildignore+=*/tmp/*,*.so,*.swo,*.swp,*.zip,*.o,*.d " MacOSX/Linux
|
||||
" "let g:ctrlp_custom_ignore = '\v[\/](vendor|node_modules|target|dist|build)|(\.(swp|ico|git|svn))$'
|
||||
" let g:ctrlp_custom_ignore = {
|
||||
" \ 'dir': 'vendor\|node_modules\|target\|dist\|build\|mntdeps',
|
||||
" \'file': '\v\.(swp|ico|git|svn|exe)'
|
||||
" \ }
|
||||
" "let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
||||
" let g:ctrlp_extensions = ['smarttabs']
|
||||
" let g:ctrlp_switch_buffer = 'ETVH'
|
||||
" let g:ctrlp_open_new_file = 't'
|
||||
"
|
||||
" " Let CtrlP not go all the way up to the root of the client. Instead, consider a
|
||||
" " METADATA file to delimit a project.
|
||||
" let g:ctrlp_root_markers = ['METADATA']
|
||||
"
|
||||
" " CtrlP auto cache clearing.
|
||||
" function! SetupCtrlP()
|
||||
" if exists("g:loaded_ctrlp") && g:loaded_ctrlp
|
||||
" augroup CtrlPExtension
|
||||
" autocmd!
|
||||
" autocmd FocusGained * CtrlPClearCache
|
||||
" autocmd BufWritePost * CtrlPClearCache
|
||||
" augroup END
|
||||
" endif
|
||||
" endfunction
|
||||
" if has("autocmd")
|
||||
" autocmd VimEnter * :call SetupCtrlP()
|
||||
" endif
|
||||
"
|
||||
" " Ripgrep (rg) is a super fast search utility
|
||||
" " Use rg for ctrl-p plugin
|
||||
" if executable('rg')
|
||||
" set grepprg=rg\ --hidden\ --color=never
|
||||
" let g:ctrlp_use_caching = 0
|
||||
" let g:ctrlp_user_command = 'rg --files --hidden --color=never * %s'
|
||||
" endif
|
||||
|
||||
|
||||
" -------- VIM-MARKDOWN --------
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
|
||||
|
||||
" -------- LATEX --------
|
||||
let g:windowswap_map_keys = 0 "prevent default bindings
|
||||
nnoremap <silent> <leader>ww :call WindowSwap#EasyWindowSwap()<CR>
|
||||
|
||||
"Don't ask to save when changing buffers (i.e. when jumping to a type definition)
|
||||
set hidden
|
||||
|
||||
let g:UltiSnipsExpandTrigger = "<nop>"
|
||||
inoremap <expr> <CR> pumvisible() ? "<C-R>=UltiSnips#ExpandSnippetOrJump()<CR>" : "\<CR>"
|
||||
let g:vim_php_refactoring_use_default_mapping = 0
|
||||
nnoremap <Leader>da :call PhpDocAll()<CR>
|
||||
|
||||
" If you want :UltiSnipsEdit to split your window.
|
||||
let g:UltiSnipsEditSplit="vertical"
|
||||
|
||||
let g:php_html_in_heredoc = 0
|
||||
let g:php_html_in_nowdoc = 0
|
||||
let g:php_sql_query = 0
|
||||
let g:php_sql_heredoc = 0
|
||||
let g:php_sql_nowdoc = 0
|
||||
|
||||
let jshint2_read = 1
|
||||
" set statusline+=%#warningmsg#
|
||||
" set statusline+=%{SyntasticStatuslineFlag()}
|
||||
" set statusline+=%*
|
||||
set statusline=%{pathshorten(expand('%:f'))}
|
||||
|
||||
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
|
||||
|
||||
" FZF
|
||||
"nnoremap <silent> <C-p> :FZF -m<cr>
|
||||
"let $FZF_DEFAULT_COMMAND = 'ag -g ""'
|
||||
let g:fzf_history_dir = '~/.local/share/fzf-history'
|
||||
|
||||
" vim-easy-align
|
||||
|
||||
" Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||
xmap ga <Plug>(EasyAlign)
|
||||
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||
nmap ga <Plug>(EasyAlign)
|
||||
let g:scratchpad_ftype = 'md'
|
||||
|
||||
" NERDTree
|
||||
" Help w/ lag
|
||||
let g:NERDTreeLimitedSyntax = 1
|
||||
|
||||
let s:brown = "964B00"
|
||||
let s:aqua = "3AFFDB"
|
||||
let s:blue = "689FB6"
|
||||
let s:darkBlue = "44788E"
|
||||
let s:purple = "834F79"
|
||||
let s:lightPurple = "834F79"
|
||||
let s:red = "AE403F"
|
||||
let s:beige = "F5C06F"
|
||||
let s:yellow = "F09F17"
|
||||
let s:orange = "D4843E"
|
||||
let s:darkOrange = "F16529"
|
||||
let s:pink = "CB6F6F"
|
||||
let s:salmon = "EE6E73"
|
||||
let s:green = "8FAA54"
|
||||
let s:lightGreen = "31B53E"
|
||||
let s:white = "FFFFFF"
|
||||
let s:rspec_red = 'FE405F'
|
||||
let s:git_orange = 'F54D27'
|
||||
|
||||
" If you have vim-devicons you can customize your icons for each file type.
|
||||
let g:NERDTreeExtensionHighlightColor = {} "this line is needed to avoid error
|
||||
let g:NERDTreeExtensionHighlightColor['java'] = s:lightGreen "assigning it to an empty string will skip highlight
|
||||
|
||||
let g:jdbPort="5005"
|
||||
|
||||
" Set a nicer foldtext function
|
||||
set foldtext=MyFoldText()
|
||||
function! MyFoldText()
|
||||
let line = getline(v:foldstart)
|
||||
if match( line, '^[ \t]*\(\/\*\|\/\/\)[*/\\]*[ \t]*$' ) == 0
|
||||
let initial = substitute( line, '^\([ \t]\)*\(\/\*\|\/\/\)\(.*\)', '\1\2', '' )
|
||||
let linenum = v:foldstart + 1
|
||||
while linenum < v:foldend
|
||||
let line = getline( linenum )
|
||||
let comment_content = substitute( line, '^\([ \t\/\*]*\)\(.*\)$', '\2', 'g' )
|
||||
if comment_content != ''
|
||||
break
|
||||
endif
|
||||
let linenum = linenum + 1
|
||||
endwhile
|
||||
let sub = initial . ' ' . comment_content
|
||||
else
|
||||
let sub = line
|
||||
let startbrace = substitute( line, '^.*{[ \t]*$', '{', 'g')
|
||||
if startbrace == '{'
|
||||
let line = getline(v:foldend)
|
||||
let endbrace = substitute( line, '^[ \t]*}\(.*\)$', '}', 'g')
|
||||
if endbrace == '}'
|
||||
let sub = sub.substitute( line, '^[ \t]*}\(.*\)$', '...}\1', 'g')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let n = v:foldend - v:foldstart + 1
|
||||
let info = " " . n . " lines"
|
||||
let sub = sub . " "
|
||||
let num_w = getwinvar( 0, '&number' ) * getwinvar( 0, '&numberwidth' )
|
||||
let fold_w = getwinvar( 0, '&foldcolumn' )
|
||||
let sub = strpart( sub, 0, winwidth(0) - strlen( info ) - num_w - fold_w - 1 )
|
||||
return sub . info
|
||||
endfunction
|
116
vim/.vim/prefs/plugins.vim
Normal file
116
vim/.vim/prefs/plugins.vim
Normal file
@ -0,0 +1,116 @@
|
||||
packadd termdebug
|
||||
" packadd lspconfig
|
||||
|
||||
" LSP
|
||||
Plug 'hrsh7th/cmp-buffer'
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'hrsh7th/cmp-nvim-lua'
|
||||
Plug 'hrsh7th/cmp-path'
|
||||
Plug 'hrsh7th/cmp-vsnip'
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
Plug 'hrsh7th/vim-vsnip'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'onsails/lspkind-nvim'
|
||||
Plug 'folke/trouble.nvim'
|
||||
|
||||
" UI EXTENSIONS
|
||||
Plug 'ntpeters/vim-better-whitespace' "auto-set tab/space size
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'vim-airline/vim-airline' " ...
|
||||
Plug 'nathanaelkane/vim-indent-guides'
|
||||
Plug 'Konfekt/vim-scratchpad'
|
||||
|
||||
" INTEGRATION
|
||||
Plug 'tpope/vim-fugitive' " git
|
||||
Plug 'junegunn/gv.vim' " git commit browser
|
||||
Plug 'tpope/vim-git'
|
||||
Plug 'airblade/vim-gitgutter' " live git diff gutter
|
||||
Plug 'tmux-plugins/vim-tmux' " tmux
|
||||
Plug 'benmills/vimux'
|
||||
" Plug 'dense-analysis/ale'
|
||||
|
||||
Plug 'christoomey/vim-tmux-navigator' " tmux
|
||||
Plug 'ferrine/md-img-paste.vim' " copy-paste images to markdown
|
||||
Plug 'junegunn/vim-easy-align' " markdown table aligns
|
||||
Plug 'skywind3000/asyncrun.vim'
|
||||
" Plug 'vim-vdebug/vdebug' " xdebug
|
||||
Plug 'dhruvasagar/vim-table-mode' " git readme tables
|
||||
Plug 'NLKNguyen/cloudformation-syntax.vim'
|
||||
Plug 'stephpy/vim-yaml'
|
||||
Plug 'towolf/vim-helm'
|
||||
Plug 'tell-k/vim-autoflake' " remove unused python imports
|
||||
Plug 'embear/vim-uncrustify'
|
||||
Plug 'sakhnik/nvim-gdb', { 'do': 'bash ./install.sh \| UpdateRemotePlugins' }
|
||||
Plug 'kburdett/vim-nuuid'
|
||||
|
||||
" AUTO-COMPLETION
|
||||
Plug 'christoomey/vim-titlecase'
|
||||
Plug 'chiedo/vim-case-convert'
|
||||
|
||||
" FILE INTERACTIONS
|
||||
Plug 'mileszs/ack.vim' " Ack bindings
|
||||
|
||||
Plug 'preservim/nerdtree' " File Tree
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||
|
||||
" LANGUAGE PLUGINS
|
||||
Plug 'udalov/kotlin-vim'
|
||||
Plug 'hsanson/vim-android'
|
||||
Plug 'uiiaoo/java-syntax.vim'
|
||||
Plug 'OmniSharp/omnisharp-vim'
|
||||
Plug 'whatyouhide/vim-tmux-syntax'
|
||||
Plug 'chase/vim-ansible-yaml'
|
||||
Plug 'justinmk/vim-syntax-extra'
|
||||
Plug 'NLKNguyen/c-syntax.vim'
|
||||
Plug 'octol/vim-cpp-enhanced-highlight'
|
||||
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
|
||||
Plug 'hexdigest/gounit-vim'
|
||||
Plug 'pangloss/vim-javascript'
|
||||
Plug 'mattn/emmet-vim'
|
||||
|
||||
Plug 'jparise/vim-graphql'
|
||||
Plug 'StanAngeloff/php.vim'
|
||||
Plug 'sealemar/vtl'
|
||||
Plug 'wavded/vim-stylus'
|
||||
Plug 'nikvdp/ejs-syntax'
|
||||
Plug 'lepture/vim-velocity'
|
||||
au BufNewFile,BufRead *.vtl, set ft=velocity
|
||||
|
||||
" MARKUP/OBJECT NOTATION
|
||||
Plug 'plasticboy/vim-markdown'
|
||||
Plug 'elzr/vim-json'
|
||||
|
||||
" FUNCTIONALITY STUFF
|
||||
Plug 'tmux-plugins/vim-tmux-focus-events'
|
||||
set autoread
|
||||
Plug 'tpope/vim-obsession' " auto vim-sessions session
|
||||
Plug 'Valloric/MatchTagAlways' " hilight closing tags in HTML etc.
|
||||
Plug 'wesQ3/vim-windowswap'
|
||||
|
||||
" FORMATTING
|
||||
Plug 'tpope/vim-surround' " easily surround with delimiters
|
||||
Plug 'scrooloose/nerdcommenter' " comment bindings
|
||||
Plug 'junegunn/vim-easy-align'
|
||||
Plug 'tommcdo/vim-exchange'
|
||||
|
||||
" THEMES
|
||||
Plug 'altercation/vim-colors-solarized'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
Plug 'jdkanani/vim-material-theme'
|
||||
Plug 'kristijanhusak/vim-hybrid-material'
|
||||
Plug 'NLKNguyen/papercolor-theme'
|
||||
Plug 'tyrannicaltoucan/vim-quantum'
|
||||
Plug 'arcticicestudio/nord-vim'
|
||||
Plug 'chase/focuspoint-vim'
|
||||
Plug 'patstockwell/vim-monokai-tasty' " airline
|
||||
Plug 'fxn/vim-monochrome'
|
||||
Plug 'robertmeta/nofrils'
|
||||
Plug 'kristiandupont/shades-of-teal'
|
||||
Plug 'joshdick/onedark.vim'
|
||||
Plug 'google/vim-colorscheme-primary'
|
||||
|
||||
" Plug 'google/vim-maktaba'
|
||||
" Plug 'google/vim-glaive'
|
||||
"
|
||||
" call glaive#Install()
|
96
vim/.vim/prefs/ui.vim
Normal file
96
vim/.vim/prefs/ui.vim
Normal file
@ -0,0 +1,96 @@
|
||||
" disable/enable the cursor line on window enter/exit
|
||||
au WinEnter * setlocal cursorline
|
||||
au WinLeave * setlocal nocursorline
|
||||
|
||||
highlight ExtraWhitespace ctermbg=red
|
||||
|
||||
" enable extra syntax hilighting for C++
|
||||
let g:cpp_class_scope_highlight = 1
|
||||
let g:cpp_experimental_template_highlight = 1
|
||||
|
||||
" AirLine visual settings
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
endif
|
||||
|
||||
let g:airline_theme='onedark'
|
||||
" let g:airline_stl_path_style = 'short'
|
||||
|
||||
let g:airline#extensions#coc#enabled = 1
|
||||
|
||||
let g:airline_left_sep=''
|
||||
let g:airline_left_alt_sep = ''
|
||||
let g:airline_right_sep=''
|
||||
let g:airline_right_alt_sep = ''
|
||||
let g:airline_symbols.branch = ''
|
||||
let g:airline_symbols.readonly = ''
|
||||
let g:airline_symbols.dirty = ''
|
||||
let g:airline_symbols.linenr = ''
|
||||
"let g:airline_symbols.whitespace = 'Ξ'
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
let g:airline#extensions#tabline#show_buffers = 0
|
||||
let g:airline#extensions#tabline#show_splits = 1
|
||||
let g:airline#extensions#tabline#show_tabs = 1
|
||||
let g:airline#extensions#tabline#show_tab_nr = 0
|
||||
let g:airline#extensions#tabline#show_tab_type = 0
|
||||
let g:airline#extensions#tabline#exclude_preview = 1
|
||||
let g:airline#extensions#tabline#show_close_button = 0
|
||||
let g:airline#extensions#tabline#fnamemod = ':t'
|
||||
|
||||
|
||||
let g:airline_mode_map = {
|
||||
\ '__' : '------',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'c' : 'COMMAND',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 's' : 'SELECT',
|
||||
\ 'S' : 'S-LINE',
|
||||
\ '' : 'S-BLOCK',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
\ '' : 'V-BLOCK',
|
||||
\ }
|
||||
|
||||
let g:PaperColor_Theme_Options = {
|
||||
\ 'language': {
|
||||
\ 'python': {
|
||||
\ 'highlight_builtins' : 1
|
||||
\ },
|
||||
\ 'cpp': {
|
||||
\ 'highlight_standard_library': 1
|
||||
\ },
|
||||
\ 'c': {
|
||||
\ 'highlight_builtins' : 1
|
||||
\ }
|
||||
\ },
|
||||
\ 'theme': {
|
||||
\ 'default.dark': {
|
||||
\ 'transparent_background': 1
|
||||
\ }
|
||||
\ }
|
||||
\ }
|
||||
|
||||
|
||||
" Function to let me know what syntax hilighting group is under the cursor.
|
||||
" Not used often
|
||||
function! SynGroup()
|
||||
let l:s = synID(line('.'), col('.'), 1)
|
||||
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
|
||||
endfun
|
||||
|
||||
function! PhpSyntaxOverride()
|
||||
" Put snippet overrides in this function.
|
||||
hi! link phpDocTags phpDefine
|
||||
hi! link phpDocParam phpType
|
||||
endfunction
|
||||
|
||||
augroup phpSyntaxOverride
|
||||
autocmd!
|
||||
autocmd FileType php call PhpSyntaxOverride()
|
||||
augroup END
|
||||
|
||||
|
||||
" Highlight the symbol and its references when holding the cursor.
|
4
vim/.vim/prefs/ultisnips.vim
Normal file
4
vim/.vim/prefs/ultisnips.vim
Normal file
@ -0,0 +1,4 @@
|
||||
Plug 'SirVer/ultisnips'
|
||||
Plug 'honza/vim-snippets'
|
||||
|
||||
Glug ultisnips-google
|
36
vim/.vim/prefs/ycm.vim
Normal file
36
vim/.vim/prefs/ycm.vim
Normal file
@ -0,0 +1,36 @@
|
||||
Glug youcompleteme-google
|
||||
|
||||
let g:ycm_key_invoke_completion = '<C-Space>'
|
||||
let g:ycm_filetype_specific_completion_to_disable = {'cpp': 1, 'c': 1}
|
||||
|
||||
let g:ycm_language_server =
|
||||
\ [
|
||||
\ {
|
||||
\ 'name': 'ciderlsp',
|
||||
\ 'cmdline': [ '/google/bin/releases/cider/ciderlsp/ciderlsp', '--noforward_sync_responses' ],
|
||||
\ 'filetypes': [ 'java' ]
|
||||
\ },
|
||||
\ ]
|
||||
|
||||
nmap <silent> gd :YcmCompleter GoToDeclaration<CR>
|
||||
nmap <silent> gt :YcmCompleter GetType<CR>
|
||||
nmap <silent> gr :YcmCompleter GoToReferences<CR>
|
||||
nmap <leader>qf :YcmCompleter FixIt<CR>
|
||||
nmap <leader>rn :YcmCompleter RefactorRename<space>
|
||||
|
||||
let s:ycm_hover_popup = -1
|
||||
function s:Hover()
|
||||
let response = youcompleteme#GetCommandResponse( 'GetDoc' )
|
||||
if response == ''
|
||||
return
|
||||
endif
|
||||
|
||||
call popup_hide( s:ycm_hover_popup )
|
||||
let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} )
|
||||
endfunction
|
||||
|
||||
" CursorHold triggers in normal mode after a delay
|
||||
autocmd CursorHold * call s:Hover()
|
||||
" Or, if you prefer, a mapping:
|
||||
" nnoremap <silent> <leader>D :call <SID>Hover()<CR>
|
||||
nnoremap <silent> <leader>D <plug>(YCMHover)
|
62
vim/.vimrc
Normal file
62
vim/.vimrc
Normal file
@ -0,0 +1,62 @@
|
||||
set nocompatible " be iMproved, required
|
||||
|
||||
let mapleader="," " BEST LEADER OF ALL TIME (BLOT)
|
||||
filetype off " required
|
||||
set rtp+=~/.vim/after
|
||||
|
||||
" -----------------------------------------------------------
|
||||
" ------------------------PLUGINS----------------------------
|
||||
" -----------------------------------------------------------
|
||||
call plug#begin('~/.vim/plugged')
|
||||
source ~/.vim/prefs/plugins.vim
|
||||
source ~/.vim/prefs/init.vim
|
||||
if filereadable(expand("~/.vimrc.local"))
|
||||
source ~/.vim/prefs/google.vim
|
||||
endif
|
||||
source ~/.vim/prefs/mappings.vim
|
||||
source ~/.vim/prefs/leader.vim
|
||||
source ~/.vim/prefs/plug_prefs.vim
|
||||
source ~/.vim/prefs/ui.vim
|
||||
source ~/.vim/prefs/golang.vim
|
||||
source ~/.vim/prefs/ultisnips.vim
|
||||
" source ~/.vim/prefs/coc.vim
|
||||
" source ~/.vim/prefs/asynclsp.vim
|
||||
" source ~/.vim/prefs/ycm.vim
|
||||
call plug#end() " required
|
||||
|
||||
source ~/.vim/prefs/cmp.vim
|
||||
" source ~/.vim/prefs/ale.vim
|
||||
|
||||
filetype plugin on " redundant?
|
||||
filetype plugin indent on
|
||||
|
||||
" auto-reload vimrc on save
|
||||
augroup myvimrc
|
||||
au!
|
||||
au BufWritePost .vimrc,_vimrc,.vimrc.local,vimrc,.gvimrc,_gvimrc,gvimrc,*.vim nested so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
|
||||
augroup END
|
||||
|
||||
fun! NewInitBex()
|
||||
let &bex = '-' . strftime("(%Y%m%d)-{%H%M}")
|
||||
endfun
|
||||
|
||||
autocmd BufWritePre * call NewInitBex()
|
||||
|
||||
set noshowmode
|
||||
set encoding=utf-8
|
||||
|
||||
let base16colorspace=256
|
||||
set colorcolumn=100
|
||||
if has('macunix')
|
||||
let g:python3_host_prog='/usr/local/bin/python3'
|
||||
let g:python_host_prog='/usr/local/bin/python3'
|
||||
else
|
||||
let g:python3_host_prog='/usr/bin/python3'
|
||||
let g:python_host_prog='/usr/bin/python'
|
||||
endif
|
||||
|
||||
set background=dark
|
||||
colorscheme onedark
|
||||
set modifiable
|
||||
"highlight Normal ctermbg=NONE guibg=NONE
|
||||
"highlight NonText ctermbg=NONE guibg=NONE
|
0
vim/.vimrc.local
Normal file
0
vim/.vimrc.local
Normal file
Reference in New Issue
Block a user