@ -0,0 +1,8 @@ | |||
# TODOs | |||
- specific run keybinds for certain filetypes | |||
- python | |||
- ipython | |||
- bash | |||
- c/c++? | |||
- java? | |||
@ -1,559 +0,0 @@ | |||
" Vim Color File | |||
" Name: material.vim | |||
" Maintainer: https://github.com/kaicataldo/material.vim | |||
" License: The MIT License (MIT) | |||
" === Configuration === | |||
" Clear any other set colors | |||
highlight clear | |||
if exists('syntax_on') | |||
syntax reset | |||
endif | |||
let g:colors_name = 'material' | |||
let g:material_theme_style = get(g:, 'material_theme_style', 'default') | |||
let g:material_terminal_italics = get(g:, 'material_terminal_italics', 0) | |||
" For backwards compatibility | |||
if (g:material_theme_style == 'dark') | |||
let g:material_theme_style = 'darker' | |||
endif | |||
" === Functions === | |||
function! s:SetHighlight(group, fg, bg, attr) | |||
let l:attr = a:attr | |||
if !g:material_terminal_italics && l:attr == 'italic' | |||
let l:attr = '' | |||
endif | |||
if empty(l:attr) | |||
let l:attr = 'none' | |||
endif | |||
if !empty(a:fg) | |||
exec 'hi ' . a:group . ' guifg=' . a:fg.gui . ' ctermfg=' . a:fg.cterm | |||
endif | |||
if !empty(a:bg) | |||
exec 'hi ' . a:group . ' guibg=' . a:bg.gui . ' ctermbg=' . a:bg.cterm | |||
endif | |||
if !empty(l:attr) | |||
exec 'hi ' . a:group . ' gui=' . l:attr . ' cterm=' . l:attr | |||
endif | |||
endfun | |||
" === Color Definitions === | |||
" Default colors | |||
set background=dark | |||
let s:bg = { 'gui': '#263238', 'cterm': 'none' } | |||
let s:fg = { 'gui': '#eeffff', 'cterm': 231 } | |||
let s:invisibles = { 'gui': '#65738e', 'cterm': 66 } | |||
let s:comments = { 'gui': '#546e7a', 'cterm': 145 } | |||
let s:caret = { 'gui': '#ffcc00', 'cterm': 220 } | |||
let s:selection = { 'gui': '#2c3b41', 'cterm': 239 } | |||
let s:guides = { 'gui': '#37474f', 'cterm': 17 } | |||
let s:line_numbers = { 'gui': '#37474f', 'cterm': 145 } | |||
let s:line_highlight = { 'gui': '#1a2327', 'cterm': 235 } | |||
let s:white = { 'gui': '#ffffff', 'cterm': 231 } | |||
let s:black = { 'gui': '#000000', 'cterm': 232 } | |||
let s:red = { 'gui': '#ff5370', 'cterm': 203 } | |||
let s:orange = { 'gui': '#f78c6c', 'cterm': 209 } | |||
let s:yellow = { 'gui': '#ffcb6b', 'cterm': 11 } | |||
let s:green = { 'gui': '#c3e88d', 'cterm': 2 } " 186 –– almost perfect match | |||
let s:cyan = { 'gui': '#89ddff', 'cterm': 117 } | |||
let s:blue = { 'gui': '#82aaff', 'cterm': 111 } | |||
let s:paleblue = { 'gui': '#b2ccd6', 'cterm': 152 } | |||
let s:purple = { 'gui': '#c792ea', 'cterm': 176 } | |||
let s:brown = { 'gui': '#c17e70', 'cterm': 137 } | |||
let s:pink = { 'gui': '#f07178', 'cterm': 204 } | |||
let s:violet = { 'gui': '#bb80b3', 'cterm': 139 } | |||
" Theme-specific color overrides | |||
if g:material_theme_style == 'palenight' || g:material_theme_style == 'palenight-community' | |||
let s:bg = { 'gui': '#292d3e', 'cterm': 'none' } | |||
let s:fg = { 'gui': '#a6accd', 'cterm': 146 } | |||
let s:invisibles = { 'gui': '#4e5579', 'cterm': 60 } | |||
let s:comments = { 'gui': '#676e95', 'cterm': 60 } | |||
let s:selection = { 'gui': '#343b51', 'cterm': 60 } | |||
let s:guides = { 'gui': '#4e5579', 'cterm': 60 } | |||
let s:line_numbers = { 'gui': '#3a3f58', 'cterm': 60 } | |||
let s:line_highlight = { 'gui': '#1c1f2b', 'cterm': 234 } | |||
elseif g:material_theme_style == 'darker' || g:material_theme_style == 'darker-community' | |||
let s:bg = { 'gui': '#212121', 'cterm': 'none' } | |||
let s:fg = { 'gui': '#eeffff', 'cterm': 231 } | |||
let s:invisibles = { 'gui': '#65737e', 'cterm': 66 } | |||
let s:comments = { 'gui': '#545454', 'cterm': 59 } | |||
let s:selection = { 'gui': '#2c2c2c', 'cterm': 237 } | |||
let s:guides = { 'gui': '#424242', 'cterm': 0 } | |||
let s:line_numbers = { 'gui': '#424242', 'cterm': 0 } | |||
let s:line_highlight = { 'gui': '#171717', 'cterm': 0 } | |||
elseif g:material_theme_style == 'ocean' || g:material_theme_style == 'ocean-community' | |||
let s:bg = { 'gui': '#0f111a', 'cterm': 'none' } | |||
let s:fg = { 'gui': '#8f93a2', 'cterm': 103 } | |||
let s:invisibles = { 'gui': '#80869e', 'cterm': 103 } | |||
let s:comments = { 'gui': '#464b5d', 'cterm': 60 } | |||
let s:selection = { 'gui': '#1f2233', 'cterm': 60 } | |||
let s:guides = { 'gui': '#3b3f51', 'cterm': 17 } | |||
let s:line_numbers = { 'gui': '#3b3f51', 'cterm': 60 } | |||
let s:line_highlight = { 'gui': '#0a0c12', 'cterm': 0 } | |||
elseif g:material_theme_style == 'lighter' || g:material_theme_style == 'lighter-community' | |||
set background=light | |||
let s:bg = { 'gui': '#fafafa', 'cterm': 'none' } | |||
let s:fg = { 'gui': '#90a4ae', 'cterm': 109 } | |||
let s:invisibles = { 'gui': '#e7eaec', 'cterm': 189 } | |||
let s:comments = { 'gui': '#90a4ae', 'cterm': 109 } | |||
let s:caret = { 'gui': '#272727', 'cterm': 0 } | |||
let s:selection = { 'gui': '#ebf4f3', 'cterm': 254 } | |||
let s:guides = { 'gui': '#b0bec5', 'cterm': 146 } | |||
let s:line_numbers = { 'gui': '#cfd8dc', 'cterm': 188 } | |||
let s:line_highlight = { 'gui': '#ecf0f1', 'cterm': 253 } | |||
let s:white = { 'gui': '#ffffff', 'cterm': 231 } | |||
let s:black = { 'gui': '#000000', 'cterm': 0 } | |||
let s:red = { 'gui': '#e53935', 'cterm': 160 } | |||
let s:orange = { 'gui': '#f76d47', 'cterm': 202 } | |||
let s:yellow = { 'gui': '#ffb62c', 'cterm': 214 } | |||
let s:green = { 'gui': '#91b859', 'cterm': 107 } | |||
let s:cyan = { 'gui': '#39adb5', 'cterm': 37 } | |||
let s:blue = { 'gui': '#6182b8', 'cterm': 67 } | |||
let s:paleblue = { 'gui': '#8796b0', 'cterm': 103 } | |||
let s:purple = { 'gui': '#7c4dff', 'cterm': 99 } | |||
let s:brown = { 'gui': '#c17e70', 'cterm': 137 } | |||
let s:pink = { 'gui': '#ff5370', 'cterm': 203 } | |||
let s:violet = { 'gui': '#945eb8', 'cterm': 97 } | |||
endif | |||
" Defined globally so that the Airline theme has access | |||
let g:material_colorscheme_map = {} | |||
let g:material_colorscheme_map.bg = s:bg | |||
let g:material_colorscheme_map.fg = s:fg | |||
let g:material_colorscheme_map.invisibles = s:invisibles | |||
let g:material_colorscheme_map.comments = s:comments | |||
let g:material_colorscheme_map.caret = s:caret | |||
let g:material_colorscheme_map.selection = s:selection | |||
let g:material_colorscheme_map.guides = s:guides | |||
let g:material_colorscheme_map.line_numbers = s:line_numbers | |||
let g:material_colorscheme_map.line_highlight = s:line_highlight | |||
let g:material_colorscheme_map.white = s:white | |||
let g:material_colorscheme_map.black = s:black | |||
let g:material_colorscheme_map.red = s:red | |||
let g:material_colorscheme_map.orange = s:orange | |||
let g:material_colorscheme_map.yellow = s:yellow | |||
let g:material_colorscheme_map.green = s:green | |||
let g:material_colorscheme_map.cyan = s:cyan | |||
let g:material_colorscheme_map.blue = s:blue | |||
let g:material_colorscheme_map.paleblue = s:paleblue | |||
let g:material_colorscheme_map.purple = s:purple | |||
let g:material_colorscheme_map.brown = s:brown | |||
let g:material_colorscheme_map.pink = s:pink | |||
let g:material_colorscheme_map.violet = s:violet | |||
" === Highlights === | |||
" Vim Editor | |||
call s:SetHighlight('ColorColumn', '', s:invisibles, '') | |||
call s:SetHighlight('Cursor', s:bg, s:caret, '') | |||
call s:SetHighlight('CursorColumn', '', s:line_highlight, '') | |||
call s:SetHighlight('CursorLine', '', s:line_highlight, '') | |||
call s:SetHighlight('CursorLineNr', s:comments, '', '') | |||
call s:SetHighlight('Directory', s:blue, '', '') | |||
call s:SetHighlight('DiffAdd', s:green, s:bg, '') | |||
call s:SetHighlight('DiffDelete', s:red, s:bg, '') | |||
call s:SetHighlight('DiffChange', s:yellow, s:bg, '') | |||
call s:SetHighlight('DiffText', s:orange, s:bg, '') | |||
call s:SetHighlight('ErrorMsg', s:bg, s:red, 'bold') | |||
call s:SetHighlight('FoldColumn', s:line_numbers, s:bg, '') | |||
call s:SetHighlight('Folded', s:brown, s:bg, 'bold') | |||
call s:SetHighlight('LineNr', s:line_numbers, '', '') | |||
call s:SetHighlight('MatchParen', s:comments, s:cyan, 'bold') | |||
call s:SetHighlight('ModeMsg', s:green, '', '') | |||
call s:SetHighlight('MoreMsg', s:green, '', '') | |||
call s:SetHighlight('NonText', s:comments, '', '') | |||
call s:SetHighlight('Normal', s:fg, s:bg, '') | |||
call s:SetHighlight('Pmenu', s:fg, s:selection, '') | |||
call s:SetHighlight('PmenuSel', s:bg, s:cyan, '') | |||
call s:SetHighlight('PmenuSbar', '', s:selection, '') | |||
call s:SetHighlight('PmenuThumb', '', s:comments, '') | |||
call s:SetHighlight('Question', s:blue, '', '') | |||
call s:SetHighlight('IncSearch', s:white, s:comments, 'none') | |||
call s:SetHighlight('Search', s:white, s:comments, 'none') | |||
call s:SetHighlight('SignColumn', s:fg, s:bg, '') | |||
call s:SetHighlight('SpecialKey', s:comments, '', '') | |||
call s:SetHighlight('SpellCap', s:blue, '', 'undercurl') | |||
call s:SetHighlight('SpellBad', s:red, '', 'undercurl') | |||
call s:SetHighlight('StatusLine', s:fg, s:selection, '') | |||
call s:SetHighlight('StatusLineNC', s:comments, s:selection, '') | |||
call s:SetHighlight('StatusLineTerm', s:bg, s:green, '') | |||
call s:SetHighlight('StatusLineTermNC', s:bg, s:green, '') | |||
call s:SetHighlight('TabLine', s:fg, s:line_numbers, '') | |||
call s:SetHighlight('TabLineFill', s:fg, s:selection, '') | |||
call s:SetHighlight('TabLineSel', s:bg, s:cyan, '') | |||
call s:SetHighlight('Title', s:green, '', '') | |||
call s:SetHighlight('VertSplit', s:comments, '', '') | |||
call s:SetHighlight('Visual', s:fg, s:selection, '') | |||
call s:SetHighlight('WarningMsg', s:red, '', '') | |||
call s:SetHighlight('WildMenu', s:bg, s:cyan, '') | |||
" Syntax | |||
call s:SetHighlight('Comment', s:comments, '', 'italic') | |||
call s:SetHighlight('Conceal', s:brown, s:bg, '') | |||
call s:SetHighlight('Constant', s:orange, '', '') | |||
call s:SetHighlight('String', s:green, '', '') | |||
call s:SetHighlight('Character', s:green, '', '') | |||
call s:SetHighlight('Identifier', s:red, '', '') | |||
call s:SetHighlight('Function', s:blue, '', '') | |||
call s:SetHighlight('Statement', s:purple, '', '') | |||
call s:SetHighlight('Operator', s:cyan, '', '') | |||
call s:SetHighlight('PreProc', s:cyan, '', '') | |||
call s:SetHighlight('Include', s:blue, '', '') | |||
call s:SetHighlight('Define', s:purple, '', '') | |||
call s:SetHighlight('Macro', s:purple, '', '') | |||
call s:SetHighlight('Type', s:yellow, '', '') | |||
call s:SetHighlight('Structure', s:cyan, '', '') | |||
call s:SetHighlight('Special', s:violet, '', '') | |||
call s:SetHighlight('Underlined', s:blue, '', '') | |||
call s:SetHighlight('Error', s:bg, s:red, '') | |||
call s:SetHighlight('Todo', s:orange, s:bg, 'italic') | |||
" Legacy groups for official git.vim and diff.vim syntax | |||
hi! link diffFile DiffAdd | |||
hi! link diffNewFile DiffDelete | |||
hi! link diffAdded DiffAdd | |||
hi! link diffChanged DiffChange | |||
hi! link diffLine DiffChange | |||
hi! link diffRemoved DiffDelete | |||
" Git Commit Messages | |||
call s:SetHighlight('gitcommitHeader', s:purple, '', '') | |||
call s:SetHighlight('gitcommitUnmerged', s:green, '', '') | |||
call s:SetHighlight('gitcommitSelectedFile', s:green, '', '') | |||
call s:SetHighlight('gitcommitDiscardedFile', s:red, '', '') | |||
call s:SetHighlight('gitcommitUnmergedFile', s:yellow, '', '') | |||
call s:SetHighlight('gitcommitSelectedType', s:green, '', '') | |||
call s:SetHighlight('gitcommitSummary', s:blue, '', '') | |||
call s:SetHighlight('gitcommitDiscardedType', s:red, '', '') | |||
hi link gitcommitNoBranch gitcommitBranch | |||
hi link gitcommitUntracked gitcommitComment | |||
hi link gitcommitDiscarded gitcommitComment | |||
hi link gitcommitSelected gitcommitComment | |||
hi link gitcommitDiscardedArrow gitcommitDiscardedFile | |||
hi link gitcommitSelectedArrow gitcommitSelectedFile | |||
hi link gitcommitUnmergedArrow gitcommitUnmergedFile | |||
" Javascript | |||
call s:SetHighlight('javaScriptBraces', s:fg, '', '') | |||
call s:SetHighlight('javaScriptNull', s:orange, '', '') | |||
call s:SetHighlight('javaScriptIdentifier', s:purple, '', '') | |||
call s:SetHighlight('javaScriptNumber', s:orange, '', '') | |||
call s:SetHighlight('javaScriptRequire', s:cyan, '', '') | |||
call s:SetHighlight('javaScriptReserved', s:purple, '', '') | |||
" pangloss/vim-javascript | |||
if g:material_theme_style !~ '-community$' | |||
call s:SetHighlight('jsArrowFunction', s:purple, '', '') | |||
call s:SetHighlight('jsAsyncKeyword', s:purple, '', '') | |||
call s:SetHighlight('jsBooleanTrue', s:orange, '', '') | |||
call s:SetHighlight('jsBooleanFalse', s:orange, '', '') | |||
call s:SetHighlight('jsBrackets', s:pink, '', '') | |||
call s:SetHighlight('jsCatch', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsClassBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsClassDefinition', s:yellow, '', '') | |||
call s:SetHighlight('jsClassFuncName', s:pink, '', '') | |||
call s:SetHighlight('jsClassProperty', s:pink, '', '') | |||
call s:SetHighlight('jsClassKeyword', s:purple, '', '') | |||
call s:SetHighlight('jsConditional', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsDocParam', s:green, '', '') | |||
call s:SetHighlight('jsDocTags', s:cyan, '', '') | |||
call s:SetHighlight('jsDot', s:cyan, '', '') | |||
call s:SetHighlight('jsException', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsExceptions', s:yellow, '', '') | |||
call s:SetHighlight('jsExport', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsExportDefault', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsExtendsKeyword', s:purple, '', '') | |||
call s:SetHighlight('jsFinally', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsFinallyBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsFlowArgumentDef', s:yellow, '', '') | |||
call s:SetHighlight('jsForAwait', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsFrom', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsFuncBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsFuncCall', s:blue, '', '') | |||
call s:SetHighlight('jsFuncParens', s:cyan, '', '') | |||
call s:SetHighlight('jsFunction', s:purple, '', '') | |||
call s:SetHighlight('jsFunctionKey', s:pink, '', '') | |||
call s:SetHighlight('jsGlobalObjects', s:yellow, '', '') | |||
call s:SetHighlight('jsGlobalNodeObjects', s:yellow, '', '') | |||
call s:SetHighlight('jsIfElseBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsImport', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsModuleAs', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsModuleBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsNull', s:cyan, '', '') | |||
call s:SetHighlight('jsNoise', s:cyan, '', '') | |||
call s:SetHighlight('jsObjectBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsObjectColon', s:cyan, '', '') | |||
call s:SetHighlight('jsObjectKey', s:pink, '', '') | |||
call s:SetHighlight('jsObjectSeparator', s:cyan, '', '') | |||
call s:SetHighlight('jsParens', s:pink, '', '') | |||
call s:SetHighlight('jsRepeat', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsReturn', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsStorageClass', s:purple, '', '') | |||
call s:SetHighlight('jsTemplateBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsTemplateExpression', s:fg, '', '') | |||
call s:SetHighlight('jsTemplateString', s:green, '', '') | |||
call s:SetHighlight('jsThis', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsTry', s:cyan, '', 'italic') | |||
call s:SetHighlight('jsTryCatchBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsUndefined', s:cyan, '', '') | |||
else | |||
call s:SetHighlight('jsArrowFunction', s:purple, '', '') | |||
call s:SetHighlight('jsAsyncKeyword', s:purple, '', '') | |||
call s:SetHighlight('jsExtendsKeyword', s:purple, '', '') | |||
call s:SetHighlight('jsClassKeyword', s:purple, '', '') | |||
call s:SetHighlight('jsDocParam', s:green, '', '') | |||
call s:SetHighlight('jsDocTags', s:cyan, '', '') | |||
call s:SetHighlight('jsForAwait', s:purple, '', '') | |||
call s:SetHighlight('jsFlowArgumentDef', s:yellow, '', '') | |||
call s:SetHighlight('jsFrom', s:purple, '', '') | |||
call s:SetHighlight('jsImport', s:purple, '', '') | |||
call s:SetHighlight('jsExport', s:purple, '', '') | |||
call s:SetHighlight('jsExportDefault', s:purple, '', '') | |||
call s:SetHighlight('jsFuncCall', s:blue, '', '') | |||
call s:SetHighlight('jsFunction', s:purple, '', '') | |||
call s:SetHighlight('jsGlobalObjects', s:yellow, '', '') | |||
call s:SetHighlight('jsGlobalNodeObjects', s:yellow, '', '') | |||
call s:SetHighlight('jsModuleAs', s:purple, '', '') | |||
call s:SetHighlight('jsNull', s:orange, '', '') | |||
call s:SetHighlight('jsStorageClass', s:purple, '', '') | |||
call s:SetHighlight('jsTemplateBraces', s:red, '', '') | |||
call s:SetHighlight('jsTemplateExpression', s:red, '', '') | |||
call s:SetHighlight('jsThis', s:red, '', '') | |||
call s:SetHighlight('jsUndefined', s:orange, '', '') | |||
endif | |||
" MaxMEllon/vim-jsx-pretty | |||
call s:SetHighlight('jsxTag', s:cyan, '', '') | |||
call s:SetHighlight('jsxTagName', s:pink, '', '') | |||
call s:SetHighlight('jsxComponentName', s:yellow, '', '') | |||
call s:SetHighlight('jsxCloseTag', s:cyan, '', '') | |||
call s:SetHighlight('jsxEscapeJs', s:fg, '', '') | |||
call s:SetHighlight('jsxCloseString', s:cyan, '', '') | |||
call s:SetHighlight('jsxAttrib', s:purple, '', 'italic') | |||
call s:SetHighlight('jsxString', s:green, '', '') | |||
call s:SetHighlight('jsxEqual', s:purple, '', '') | |||
call s:SetHighlight('jsxDot', s:cyan, '', '') | |||
call s:SetHighlight('jsxSpreadOperator', s:purple, '', '') | |||
call s:SetHighlight('jsxBraces', s:cyan, '', '') | |||
call s:SetHighlight('jsxNamespace', s:cyan, '', '') | |||
" JSON | |||
call s:SetHighlight('jsonBraces', s:fg, '', '') | |||
" CSS | |||
call s:SetHighlight('cssAttrComma', s:fg, '', '') | |||
call s:SetHighlight('cssPseudoClassId', s:yellow, '', '') | |||
call s:SetHighlight('cssBraces', s:fg, '', '') | |||
call s:SetHighlight('cssClassName', s:yellow, '', '') | |||
call s:SetHighlight('cssClassNameDot', s:yellow, '', '') | |||
call s:SetHighlight('cssFunctionName', s:blue, '', '') | |||
call s:SetHighlight('cssImportant', s:cyan, '', '') | |||
call s:SetHighlight('cssIncludeKeyword', s:purple, '', '') | |||
call s:SetHighlight('cssTagName', s:red, '', '') | |||
call s:SetHighlight('cssMediaType', s:orange, '', '') | |||
call s:SetHighlight('cssProp', s:fg, '', '') | |||
call s:SetHighlight('cssSelectorOp', s:cyan, '', '') | |||
call s:SetHighlight('cssSelectorOp2', s:cyan, '', '') | |||
" Sass | |||
call s:SetHighlight('sassAmpersand', s:red, '', '') | |||
call s:SetHighlight('sassClassChar', s:yellow, '', '') | |||
call s:SetHighlight('sassMixinName', s:blue, '', '') | |||
call s:SetHighlight('sassVariable', s:purple, '', '') | |||
" Less | |||
call s:SetHighlight('lessAmpersand', s:red, '', '') | |||
call s:SetHighlight('lessClassChar', s:yellow, '', '') | |||
call s:SetHighlight('lessCssAttribute', s:fg, '', '') | |||
call s:SetHighlight('lessFunction', s:blue, '', '') | |||
call s:SetHighlight('lessVariable', s:purple, '', '') | |||
" HTML | |||
call s:SetHighlight('htmlTagName', s:pink, '', '') | |||
call s:SetHighlight('htmlEndTag', s:cyan, '', '') | |||
call s:SetHighlight('htmlTag', s:cyan, '', '') | |||
call s:SetHighlight('htmlSpecialTagName', s:yellow, '', '') | |||
call s:SetHighlight('htmlArg', s:purple, '', 'italic') | |||
call s:SetHighlight('htmlTitle', s:fg, '', '') | |||
call s:SetHighlight('htmlLink', s:fg, '', '') | |||
"" Consistency with plasticboy/vim-markdown | |||
call s:SetHighlight('htmlBold', s:pink, '', 'bold') | |||
call s:SetHighlight('htmlH1', s:yellow, '', '') | |||
call s:SetHighlight('htmlH2', s:yellow, '', '') | |||
call s:SetHighlight('htmlH3', s:yellow, '', '') | |||
call s:SetHighlight('htmlH4', s:yellow, '', '') | |||
call s:SetHighlight('htmlH5', s:yellow, '', '') | |||
call s:SetHighlight('htmlH6', s:yellow, '', '') | |||
call s:SetHighlight('htmlItalic', s:pink, '', 'italic') | |||
" XML | |||
call s:SetHighlight('xmlAttrib', s:purple, '', 'italic') | |||
call s:SetHighlight('xmlEndTag', s:cyan, '', '') | |||
call s:SetHighlight('xmlTag', s:cyan, '', '') | |||
call s:SetHighlight('xmlTagName', s:pink, '', '') | |||
" Golang | |||
call s:SetHighlight('goFunctionCall', s:blue, '', '') | |||
call s:SetHighlight('goReceiverType', s:green, '', '') | |||
call s:SetHighlight('goParamName', s:orange, '', '') | |||
call s:SetHighlight('goParamType', s:green, '', '') | |||
call s:SetHighlight('goTypeDecl', s:purple, '', '') | |||
call s:SetHighlight('goTypeName', s:yellow, '', '') | |||
call s:SetHighlight('goBuiltins', s:red, '', '') | |||
call s:SetHighlight('goType', s:purple, '', '') | |||
call s:SetHighlight('goSignedInts', s:purple, '', '') | |||
call s:SetHighlight('goUnsignedInts', s:purple, '', '') | |||
call s:SetHighlight('goFloats', s:purple, '', '') | |||
call s:SetHighlight('goComplexes', s:purple, '', '') | |||
" Ruby | |||
call s:SetHighlight('rubyInterpolation', s:cyan, '', '') | |||
call s:SetHighlight('rubyInterpolationDelimiter', s:violet, '', '') | |||
call s:SetHighlight('rubyRegexp', s:cyan, '', '') | |||
call s:SetHighlight('rubyRegexpDelimiter', s:violet, '', '') | |||
call s:SetHighlight('rubyStringDelimiter', s:green, '', '') | |||
" Rust | |||
call s:SetHighlight('CocRustTypeHint', s:invisibles, '', '') | |||
call s:SetHighlight('CocRustChainingHint', s:invisibles, '', '') | |||
" TeX | |||
call s:SetHighlight('texBeginEndName', s:blue, '', '') | |||
call s:SetHighlight('texMathMatcher', s:blue, '', '') | |||
call s:SetHighlight('texCite', s:green, '', '') | |||
call s:SetHighlight('texRefZone', s:green, '', '') | |||
call s:SetHighlight('texInputFile', s:green, '', '') | |||
call s:SetHighlight('texMath', s:orange, '', '') | |||
call s:SetHighlight('texMathOper', s:yellow, '', '') | |||
" Markdown | |||
if g:material_theme_style !~ '-community$' | |||
call s:SetHighlight('markdownBold', s:pink, '', 'bold') | |||
call s:SetHighlight('markdownBoldDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('markdownCode', s:paleblue, '', '') | |||
call s:SetHighlight('markdownCodeDelimiter', s:green, '', '') | |||
call s:SetHighlight('markdownHeadingDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('markdownH1', s:yellow, '', '') | |||
call s:SetHighlight('markdownH2', s:yellow, '', '') | |||
call s:SetHighlight('markdownH3', s:yellow, '', '') | |||
call s:SetHighlight('markdownH4', s:yellow, '', '') | |||
call s:SetHighlight('markdownH5', s:yellow, '', '') | |||
call s:SetHighlight('markdownH6', s:yellow, '', '') | |||
call s:SetHighlight('markdownItalic', s:pink, '', 'italic') | |||
call s:SetHighlight('markdownItalicDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('markdownLinkDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('markdownLinkText', s:green, '', '') | |||
call s:SetHighlight('markdownLinkTextDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('markdownListMarker', s:cyan, '', '') | |||
call s:SetHighlight('markdownUrl', s:pink, '', 'underline') | |||
call s:SetHighlight('markdownUrlTitleDelimiter', s:green, '', '') | |||
else | |||
call s:SetHighlight('markdownBold', s:yellow, '', 'bold') | |||
call s:SetHighlight('markdownCode', s:cyan, '', '') | |||
call s:SetHighlight('markdownCodeBlock', s:cyan, '', '') | |||
call s:SetHighlight('markdownCodeDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('markdownHeadingDelimiter', s:green, '', '') | |||
call s:SetHighlight('markdownHeadingRule', s:comments, '', '') | |||
call s:SetHighlight('markdownId', s:purple, '', '') | |||
call s:SetHighlight('markdownItalic', s:blue, '', 'italic') | |||
call s:SetHighlight('markdownListMarker', s:orange, '', '') | |||
call s:SetHighlight('markdownOrderedListMarker', s:orange, '', '') | |||
call s:SetHighlight('markdownRule', s:comments, '', '') | |||
call s:SetHighlight('markdownUrl', s:purple, '', '') | |||
call s:SetHighlight('markdownUrlTitleDelimiter', s:yellow, '', '') | |||
endif | |||
" plasticboy/vim-markdown | |||
if g:material_theme_style !~ '-community$' | |||
call s:SetHighlight('mkdBold', s:cyan, '', '') | |||
call s:SetHighlight('mkdCodeStart', s:green, '', '') | |||
call s:SetHighlight('mkdCodeDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('mkdDelimiter', s:cyan, '', '') | |||
call s:SetHighlight('mkdHeading', s:cyan, '', '') | |||
call s:SetHighlight('mkdItalic', s:cyan, '', '') | |||
call s:SetHighlight('mkdLink', s:green, '', '') | |||
call s:SetHighlight('mkdListItem', s:cyan, '', '') | |||
call s:SetHighlight('mkdURL', s:pink, '', 'underline') | |||
endif | |||
" vimwiki/vimwiki | |||
if g:material_theme_style !~ '-community$' | |||
call s:SetHighlight('VimwikiBold', s:pink, '', 'bold') | |||
call s:SetHighlight('VimwikiBoldChar', s:cyan, '', 'bold') | |||
call s:SetHighlight('VimwikiDelText', s:pink, '', 'strikethrough') | |||
call s:SetHighlight('VimwikiDelTextChar', s:cyan, '', '') | |||
call s:SetHighlight('VimwikiCode', s:green, '', '') | |||
call s:SetHighlight('VimwikiCodeChar', s:cyan, '', '') | |||
call s:SetHighlight('VimwikiHeader1', s:yellow, '', '') | |||
call s:SetHighlight('VimwikiHeader2', s:yellow, '', '') | |||
call s:SetHighlight('VimwikiHeader3', s:yellow, '', '') | |||
call s:SetHighlight('VimwikiHeader4', s:yellow, '', '') | |||
call s:SetHighlight('VimwikiHeader5', s:yellow, '', '') | |||
call s:SetHighlight('VimwikiHeader6', s:yellow, '', '') | |||
call s:SetHighlight('VimwikiHeaderChar', s:cyan, '', '') | |||
call s:SetHighlight('VimwikiImage', s:cyan, '', '') | |||
call s:SetHighlight('VimwikiItalic', s:pink, '', 'italic') | |||
call s:SetHighlight('VimwikiItalicChar', s:cyan, '', '') | |||
call s:SetHighlight('VimwikiLink', s:green, '', 'underline') | |||
call s:SetHighlight('VimwikiListTodo', s:cyan, '', '') | |||
call s:SetHighlight('VimwikiPre', s:green, '', '') | |||
call s:SetHighlight('VimwikiWebLink1', s:green, '', 'underline') | |||
endif | |||
" vim-signify | |||
hi link SignifySignAdd GitGutterAdd | |||
hi link SignifySignChange GitGutterChange | |||
hi link SignifySignDelete GitGutterDelete | |||
" vim-better-whitespace | |||
call s:SetHighlight('ExtraWhitespace', '', s:red, '') | |||
" NERDTree | |||
if has('nvim') | |||
call s:SetHighlight('NERDTreeFile', s:fg, '', '') | |||
endif | |||
" coc.nvim | |||
call s:SetHighlight('CocMarkdownLink', s:purple, '', '') | |||
call s:SetHighlight('CocErrorSign', s:red, '', '') | |||
call s:SetHighlight('CocWarningSign', s:orange, '', '') | |||
call s:SetHighlight('CocHintSign', s:yellow, '', '') | |||
call s:SetHighlight('CocInfoSign', s:green, '', '') | |||
" Neovim terminal colors | |||
if has('nvim') | |||
let g:terminal_color_background = s:bg.gui | |||
let g:terminal_color_foreground = s:fg.gui | |||
let g:terminal_color_0 = s:comments.gui | |||
let g:terminal_color_1 = s:red.gui | |||
let g:terminal_color_2 = s:green.gui | |||
let g:terminal_color_3 = s:yellow.gui | |||
let g:terminal_color_4 = s:blue.gui | |||
let g:terminal_color_5 = s:purple.gui | |||
let g:terminal_color_6 = s:cyan.gui | |||
let g:terminal_color_7 = s:white.gui | |||
let g:terminal_color_8 = g:terminal_color_0 | |||
let g:terminal_color_9 = g:terminal_color_1 | |||
let g:terminal_color_10 = g:terminal_color_2 | |||
let g:terminal_color_11 = g:terminal_color_3 | |||
let g:terminal_color_12 = g:terminal_color_4 | |||
let g:terminal_color_13 = g:terminal_color_5 | |||
let g:terminal_color_14 = g:terminal_color_6 | |||
let g:terminal_color_15 = g:terminal_color_7 | |||
endif | |||
@ -1,16 +1,28 @@ | |||
-- Source the plug.vim plugin | |||
vim.cmd('source ~/.config/nvim/colors/material.vim') | |||
vim.cmd('source ~/.vimrc') | |||
-- Set leader key | |||
vim.g.mapleader = ',' | |||
-- Load plugins | |||
require('plugin.init') | |||
-- Load lazy.nvim | |||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |||
if not vim.loop.fs_stat(lazypath) then | |||
vim.fn.system({ | |||
"git", | |||
"clone", | |||
"--filter=blob:none", | |||
"https://github.com/folke/lazy.nvim.git", | |||
"--branch=stable", -- latest stable release | |||
lazypath, | |||
}) | |||
end | |||
-- Initialize Keybinds | |||
require('config.init') | |||
vim.opt.rtp:prepend(lazypath) | |||
require("lazy").setup("plugins") | |||
-- Initialize LSP | |||
require('lsp.init') | |||
-- Initialize Keybinds | |||
require('config') | |||
-- Initialize Keybinds | |||
require('keybinds.init') | |||
require('keybinds') | |||
-- Initialize LSP | |||
require('lsp') | |||
@ -0,0 +1,64 @@ | |||
{ | |||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, | |||
"aerial.nvim": { "branch": "master", "commit": "e2e3bc2df4490690ea005395eecdc8eeb30c4def" }, | |||
"alpha-nvim": { "branch": "main", "commit": "29074eeb869a6cbac9ce1fbbd04f5f5940311b32" }, | |||
"auto-session": { "branch": "main", "commit": "51196ca66b38fc1660fdf50031cb0b31a199b7c9" }, | |||
"barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" }, | |||
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, | |||
"catppuccin": { "branch": "main", "commit": "4fbab1f01488718c3d54034a473d0346346b90e3" }, | |||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, | |||
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, | |||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, | |||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, | |||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, | |||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, | |||
"cmp-snippy": { "branch": "master", "commit": "6e39210aa3a74e2bf6462f492eaf0d436cd2b7d3" }, | |||
"cmp-vimtex": { "branch": "master", "commit": "e0c24bb0da89a71fab02c2a4670a25670714ba36" }, | |||
"copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, | |||
"copilot.lua": { "branch": "master", "commit": "858bbfa6fa81c88fb1f64107d7981f1658619e0a" }, | |||
"dap-buddy.nvim": { "branch": "main", "commit": "bbda2b062e5519cde4e10b6e4240d3dd1f867b20" }, | |||
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, | |||
"gitsigns.nvim": { "branch": "main", "commit": "d195f0c35ced5174d3ecce1c4c8ebb3b5bc23fa9" }, | |||
"harpoon": { "branch": "harpoon2", "commit": "2d3abde3c4db4981294f9405ca11e3156ae78323" }, | |||
"headlines.nvim": { "branch": "master", "commit": "e3d7bfdf40e41a020d966d35f8b48d75b90367d2" }, | |||
"indent-blankline.nvim": { "branch": "master", "commit": "5da5546947f3125dfd6aa85ab21074dc83f776d5" }, | |||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, | |||
"lspkind.nvim": { "branch": "master", "commit": "7f26cf5e27e2bd910ce0ea00c514da2bf97423b8" }, | |||
"lualine.nvim": { "branch": "master", "commit": "566b7036f717f3d676362742630518a47f132fff" }, | |||
"mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, | |||
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, | |||
"mini.nvim": { "branch": "main", "commit": "ea1af8c7d5e72148cae8a04e9887322a53fe66cf" }, | |||
"neodev.nvim": { "branch": "main", "commit": "029899ea32d3dc8ed8c910ceca2ee5d16e566c11" }, | |||
"neogit": { "branch": "master", "commit": "e02121f5aad420dc16411a6cde59879230f9d5b9" }, | |||
"neomutt.vim": { "branch": "main", "commit": "df510c3d5bcff2013accf957854e0f2a5c01d83b" }, | |||
"neotest": { "branch": "master", "commit": "6aa6e4529a4a125b49c48541b97ba146ceee2441" }, | |||
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" }, | |||
"nui.nvim": { "branch": "main", "commit": "c9b4de623d19a85b353ff70d2ae9c77143abe69c" }, | |||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, | |||
"nvim": { "branch": "main", "commit": "4fbab1f01488718c3d54034a473d0346346b90e3" }, | |||
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, | |||
"nvim-dap": { "branch": "master", "commit": "f0dca670fa059eb89dda8869a6310c804241345c" }, | |||
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, | |||
"nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, | |||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, | |||
"nvim-notify": { "branch": "master", "commit": "27a6649ba6b22828ccc67c913f95a5407a2d8bec" }, | |||
"nvim-snippy": { "branch": "master", "commit": "7c8f18e90cad4f56c4e22a49101668735639f286" }, | |||
"nvim-tree.lua": { "branch": "master", "commit": "50f30bcd8c62ac4a83d133d738f268279f2c2ce2" }, | |||
"nvim-treesitter": { "branch": "master", "commit": "27f68c0b6a87cbad900b3d016425450af8268026" }, | |||
"nvim-ufo": { "branch": "main", "commit": "c6d88523f574024b788f1c3400c5d5b9bb1a0407" }, | |||
"nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, | |||
"persisted.nvim": { "branch": "main", "commit": "97bc6260fb85f3472d2f773dc6cc41f7d942a7a2" }, | |||
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, | |||
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, | |||
"rest.nvim": { "branch": "main", "commit": "84e81a19ab24ccf05c9233d34d4dfce61c233abe" }, | |||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, | |||
"telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, | |||
"toggleterm.nvim": { "branch": "main", "commit": "cbd041d91b90cd3c02df03fe6133208888f8e008" }, | |||
"vim-cppman": { "branch": "master", "commit": "de1318252b68fba9b8249254475b6e050d160b73" }, | |||
"vim-snippets": { "branch": "master", "commit": "a8dc763b3f534ec1a0c0ae5082689c10dcaf9d5f" }, | |||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, | |||
"vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" }, | |||
"vimtex": { "branch": "master", "commit": "6179414f2eb3db977a513b7b19c23e7e62a0f388" }, | |||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, | |||
"zen-mode.nvim": { "branch": "main", "commit": "50e2e2a36cc97847d9ab3b1a3555ba2ef6839b50" } | |||
} |
@ -0,0 +1,23 @@ | |||
-- Appearance Settings | |||
-- Set command-line height | |||
vim.opt.cmdheight = 2 | |||
-- Tab and indent settings | |||
vim.opt.expandtab = true | |||
vim.opt.shiftwidth = 2 | |||
vim.opt.tabstop = 2 | |||
-- Status line | |||
vim.opt.laststatus = 2 | |||
-- Material theme style | |||
vim.opt.termguicolors = true | |||
-- Colorscheme settings | |||
vim.opt.background = "dark" | |||
vim.cmd.colorscheme "catppuccin" | |||
vim.wo.relativenumber = true | |||
vim.wo.number = true | |||
@ -0,0 +1,62 @@ | |||
local dap, dapui = require("dap"), require("dapui") | |||
-- Set breakpoint icon | |||
vim.fn.sign_define('DapBreakpoint', {text='', texthl='red', linehl='red', numhl='red'}) | |||
-- Bind nvim-dap-ui to dap events | |||
dap.listeners.after.event_initialized["dapui_config"] = function() | |||
dapui.open() | |||
end | |||
dap.listeners.before.event_terminated["dapui_config"] = function() | |||
dapui.close() | |||
end | |||
dap.listeners.before.event_exited["dapui_config"] = function() | |||
dapui.close() | |||
end | |||
-- Python | |||
dap.adapters.python = { | |||
type = 'executable'; | |||
command = 'python'; | |||
args = { '-m', 'debugpy.adapter' }; | |||
} | |||
dap.configurations.python = { | |||
{ | |||
type = 'python'; | |||
request = 'launch'; | |||
name = "Launch file"; | |||
program = "${file}"; | |||
pythonPath = function() | |||
return '/usr/bin/python' | |||
end; | |||
}, | |||
} | |||
dap.adapters.bashdb = { | |||
type = 'executable'; | |||
command = vim.fn.stdpath("data") .. '/mason/packages/bash-debug-adapter/bash-debug-adapter'; | |||
name = 'bashdb'; | |||
} | |||
dap.configurations.sh = { | |||
{ | |||
type = 'bashdb'; | |||
request = 'launch'; | |||
name = "Launch file"; | |||
showDebugOutput = true; | |||
pathBashdb = vim.fn.stdpath("data") .. '/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb'; | |||
pathBashdbLib = vim.fn.stdpath("data") .. '/mason/packages/bash-debug-adapter/extension/bashdb_dir'; | |||
trace = true; | |||
file = "${file}"; | |||
program = "${file}"; | |||
cwd = '${workspaceFolder}'; | |||
pathCat = "cat"; | |||
pathBash = "/bin/bash"; | |||
pathMkfifo = "mkfifo"; | |||
pathPkill = "pkill"; | |||
args = {}; | |||
env = {}; | |||
terminalKind = "integrated"; | |||
} | |||
} |
@ -0,0 +1,3 @@ | |||
require('config.settings') | |||
require('config.appearance') | |||
require('config.dap') |
@ -0,0 +1,3 @@ | |||
return { | |||
filetypes = {'cmake', 'CMakeLists.txt'} | |||
} |
@ -0,0 +1,109 @@ | |||
local function getTableKeys(tbl) | |||
local keys = {} | |||
for key in pairs(tbl) do | |||
table.insert(keys, key) | |||
end | |||
return keys | |||
end | |||
local function mergeTables(t1, t2) | |||
for k, v in pairs(t2) do | |||
t1[k] = v | |||
end | |||
return t1 | |||
end | |||
local function is_null_ls_formatting_enabled(bufnr) | |||
local file_type = vim.api.nvim_buf_get_option(bufnr, "filetype") | |||
local generators = require("null-ls.generators").get_available( | |||
file_type, | |||
require("null-ls.methods").internal.FORMATTING | |||
) | |||
return #generators > 0 | |||
end | |||
local custom_attach = function(client, bufnr) | |||
-- null-ls formatting support | |||
if client.server_capabilities.documentFormattingProvider then | |||
if | |||
client.name == "null-ls" and is_null_ls_formatting_enabled(bufnr) | |||
or client.name ~= "null-ls" | |||
then | |||
vim.bo[bufnr].formatexpr = "v:lua.vim.lsp.formatexpr()" | |||
vim.keymap.set("n", "<leader>gq", "<cmd>lua vim.lsp.buf.format({ async = true })<CR>", opts) | |||
else | |||
vim.bo[bufnr].formatexpr = nil | |||
end | |||
end | |||
vim.api.nvim_create_autocmd("CursorHold", { | |||
buffer=bufnr, | |||
callback = function() | |||
local opts = { | |||
focusable = false, | |||
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, | |||
border = 'rounded', | |||
source = 'always', -- show source in diagnostic popup window | |||
prefix = ' ' | |||
} | |||
if not vim.b.diagnostics_pos then | |||
vim.b.diagnostics_pos = { nil, nil } | |||
end | |||
local cursor_pos = vim.api.nvim_win_get_cursor(0) | |||
if (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2]) and | |||
#vim.diagnostic.get() > 0 | |||
then | |||
vim.diagnostic.open_float(nil, opts) | |||
end | |||
vim.b.diagnostics_pos = cursor_pos | |||
end | |||
}) | |||
-- Make K show hover menu if it is supported | |||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = bufnr }) | |||
-- The blow command will highlight the current variable and its usages in the buffer. | |||
if client.server_capabilities.document_highlight then | |||
vim.cmd([[ | |||
hi! link LspReferenceRead Visual | |||
hi! link LspReferenceText Visual | |||
hi! link LspReferenceWrite Visual | |||
augroup lsp_document_highlight | |||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight() | |||
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight() | |||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references() | |||
augroup END | |||
]]) | |||
end | |||
if vim.g.logging_level == 'debug' then | |||
local msg = string.format("Language server %s started!", client.name) | |||
vim.notify(msg, 'info', {title = 'Nvim-config'}) | |||
end | |||
end | |||
local lspconfigs = { | |||
clangd = {}, | |||
pyright = {}, | |||
bashls = {}, | |||
html = {}, | |||
tsserver = {}, | |||
lua_ls = require("config.lsp.lua_ls"), | |||
cssls = {}, | |||
asm_lsp = {}, | |||
rust_analyzer = require("config.lsp.rust_analyzer"), | |||
cmake = require("config.lsp.cmake"), | |||
} | |||
local mason_extras = { | |||
"bash-debug-adapter" | |||
} | |||
return { | |||
mason_servers = mergeTables(getTableKeys(lspconfigs), mason_extras), | |||
lspconfigs = lspconfigs, | |||
lsp_onattach = custom_attach | |||
} |
@ -0,0 +1,27 @@ | |||
return { | |||
settings = { | |||
Lua = { | |||
runtime = { | |||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) | |||
version = 'LuaJIT', | |||
-- Setup your lua path | |||
path = vim.split(package.path, ';'), | |||
}, | |||
diagnostics = { | |||
-- Get the language server to recognize the `vim` global | |||
globals = {'vim'}, | |||
}, | |||
workspace = { | |||
-- Make the server aware of Neovim runtime files | |||
library = { | |||
[vim.fn.expand('$VIMRUNTIME/lua')] = true, | |||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, | |||
}, | |||
}, | |||
-- Do not send telemetry data containing a randomized but unique identifier | |||
telemetry = { | |||
enable = false, | |||
}, | |||
}, | |||
}, | |||
} |
@ -0,0 +1,9 @@ | |||
return { | |||
settings = { | |||
['rust-analyzer'] = { | |||
diagnostics = { | |||
enable = false; | |||
} | |||
} | |||
} | |||
} |
@ -0,0 +1,11 @@ | |||
return function () | |||
require('aerial').setup({ | |||
-- Your configuration here | |||
-- To auto-open the aerial window on entering a buffer: | |||
on_attach = function(bufnr) | |||
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr }) | |||
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr }) | |||
require('aerial').open({focus = false}) | |||
end | |||
}) | |||
end |
@ -0,0 +1,32 @@ | |||
vim.g.barbar_auto_setup = false -- disable auto-setup | |||
return { | |||
auto_hide = 1, | |||
clickable = true, | |||
focus_on_close = 'previous', | |||
icons = { | |||
button = '', | |||
-- Enables / disables diagnostic symbols | |||
diagnostics = { | |||
[vim.diagnostic.severity.ERROR] = {enabled = true, icon = ''}, | |||
[vim.diagnostic.severity.WARN] = {enabled = false}, | |||
[vim.diagnostic.severity.INFO] = {enabled = false}, | |||
[vim.diagnostic.severity.HINT] = {enabled = true}, | |||
}, | |||
gitsigns = { | |||
added = {enabled = true, icon = '+'}, | |||
changed = {enabled = true, icon = '~'}, | |||
deleted = {enabled = true, icon = '-'}, | |||
}, | |||
modified = {button = '●'}, | |||
pinned = {button = '', filename = true}, | |||
}, | |||
-- Set the filetypes which barbar will offset itself for | |||
sidebar_filetypes = { | |||
NvimTree = true, | |||
}, | |||
} |
@ -0,0 +1,50 @@ | |||
return { | |||
flavour = "mocha", -- latte, frappe, macchiato, mocha | |||
background = { -- :h background | |||
light = "latte", | |||
dark = "mocha", | |||
}, | |||
transparent_background = false, -- disables setting the background color. | |||
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers | |||
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`) | |||
dim_inactive = { | |||
enabled = false, -- dims the background color of inactive window | |||
shade = "dark", | |||
percentage = 0.15, -- percentage of the shade to apply to the inactive window | |||
}, | |||
no_italic = false, -- Force no italic | |||
no_bold = false, -- Force no bold | |||
no_underline = false, -- Force no underline | |||
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`): | |||
comments = { "italic" }, -- Change the style of comments | |||
conditionals = { "italic" }, | |||
loops = {}, functions = {}, | |||
keywords = {}, | |||
strings = {}, | |||
variables = {}, | |||
numbers = {}, | |||
booleans = {}, | |||
properties = {}, | |||
types = {}, | |||
operators = {}, | |||
}, | |||
color_overrides = {}, | |||
custom_highlights = {}, | |||
integrations = { | |||
cmp = true, | |||
gitsigns = true, | |||
treesitter = true, | |||
which_key = true, | |||
alpha=true, | |||
noice = true, | |||
mason = true, | |||
neogit = true, | |||
nvimtree = true, | |||
mini = { | |||
enabled = true, | |||
indentscope_color = "", | |||
}, | |||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) | |||
}, | |||
} | |||
@ -0,0 +1,24 @@ | |||
-- Set copilot_no_tab_map to true | |||
vim.g.copilot_no_tab_map = true | |||
-- Map <C-J> in insert mode to copilot#Accept("<CR>") | |||
vim.api.nvim_set_keymap('i', '<C-J>', 'v:lua.copilot_accept()', { silent = true, expr = true }) | |||
-- Function to handle copilot#Accept("<CR>") | |||
function copilot_accept() | |||
return vim.fn["copilot#Accept"]("<CR>") | |||
end | |||
-- Disable copilot for certain filetypes | |||
vim.g.copilot_filetypes = { | |||
["*"] = false, | |||
["javascript"] = true, | |||
["typescript"] = true, | |||
["lua"] = false, | |||
["rust"] = true, | |||
["c"] = true, | |||
["c#"] = true, | |||
["c++"] = true, | |||
["go"] = true, | |||
["python"] = true, | |||
} |
@ -0,0 +1,4 @@ | |||
return function () | |||
local harpoon = require('harpoon') | |||
harpoon:setup({}) | |||
end |
@ -0,0 +1,272 @@ | |||
-- Eviline config for lualine | |||
-- Author: shadmansaleh | |||
-- Credit: glepnir | |||
-- Color table for highlights | |||
-- stylua: ignore | |||
local colors = { | |||
bg = '#202328', | |||
fg = '#bbc2cf', | |||
yellow = '#ECBE7B', | |||
cyan = '#008080', | |||
darkblue = '#081633', | |||
green = '#98be65', | |||
orange = '#FF8800', | |||
violet = '#a9a1e1', | |||
magenta = '#c678dd', | |||
blue = '#51afef', | |||
red = '#ec5f67', | |||
} | |||
local function show_macro_recording() | |||
local recording_register = vim.fn.reg_recording() | |||
if recording_register == "" then | |||
return "" | |||
else | |||
return "Recording @" .. recording_register | |||
end | |||
end | |||
local conditions = { | |||
buffer_not_empty = function() | |||
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 | |||
end, | |||
hide_in_width = function() | |||
return vim.fn.winwidth(0) > 80 | |||
end, | |||
check_git_workspace = function() | |||
local filepath = vim.fn.expand('%:p:h') | |||
local gitdir = vim.fn.finddir('.git', filepath .. ';') | |||
return gitdir and #gitdir > 0 and #gitdir < #filepath | |||
end, | |||
} | |||
-- Config | |||
local config = function() | |||
local config = { | |||
extensions = {'nvim-tree', 'nvim-dap-ui', 'aerial'}, | |||
options = { | |||
-- Disable lualine in nvim-tree | |||
-- disabled_filetypes = { 'packer', 'NvimTree' }, | |||
-- Disable sections and component separators | |||
component_separators = '', | |||
section_separators = '', | |||
theme = { | |||
-- We are going to use lualine_c an lualine_x as left and | |||
-- right section. Both are highlighted by c theme . So we | |||
-- are just setting default looks o statusline | |||
normal = { c = { fg = colors.fg, bg = colors.bg } }, | |||
inactive = { c = { fg = colors.fg, bg = colors.bg } }, | |||
}, | |||
}, | |||
sections = { | |||
-- these are to remove the defaults | |||
lualine_a = {}, | |||
lualine_b = {}, | |||
lualine_y = {}, | |||
lualine_z = {}, | |||
-- These will be filled later | |||
lualine_c = {}, | |||
lualine_x = {}, | |||
}, | |||
inactive_sections = { | |||
-- these are to remove the defaults | |||
lualine_a = {}, | |||
lualine_b = {}, | |||
lualine_y = {}, | |||
lualine_z = {}, | |||
lualine_c = {}, | |||
lualine_x = {}, | |||
}, | |||
} | |||
-- Inserts a component in lualine_c at left section | |||
local function ins_left(component) | |||
table.insert(config.sections.lualine_c, component) | |||
end | |||
-- Inserts a component in lualine_x at right section | |||
local function ins_right(component) | |||
table.insert(config.sections.lualine_x, component) | |||
end | |||
ins_left { | |||
function() | |||
return '▊' | |||
end, | |||
color = { fg = colors.blue }, -- Sets highlighting of component | |||
padding = { left = 0, right = 1 }, -- We don't need space before this | |||
} | |||
ins_left { | |||
-- mode component | |||
function() | |||
return '' | |||
end, | |||
color = function() | |||
-- auto change color according to neovims mode | |||
local mode_color = { | |||
n = colors.red, | |||
i = colors.green, | |||
v = colors.blue, | |||
[''] = colors.blue, | |||
V = colors.blue, | |||
c = colors.magenta, | |||
no = colors.red, | |||
s = colors.orange, | |||
S = colors.orange, | |||
[''] = colors.orange, | |||
ic = colors.yellow, | |||
R = colors.violet, | |||
Rv = colors.violet, | |||
cv = colors.red, | |||
ce = colors.red, | |||
r = colors.cyan, | |||
rm = colors.cyan, | |||
['r?'] = colors.cyan, | |||
['!'] = colors.red, | |||
t = colors.red, | |||
} | |||
return { fg = mode_color[vim.fn.mode()] } | |||
end, | |||
padding = { right = 1 }, | |||
} | |||
ins_left { | |||
-- filesize component | |||
'filesize', | |||
cond = conditions.buffer_not_empty, | |||
} | |||
ins_left { | |||
'macro-recording', | |||
fmt = show_macro_recording, | |||
} | |||
ins_left { | |||
'filename', | |||
cond = conditions.buffer_not_empty, | |||
color = { fg = colors.magenta, gui = 'bold' }, | |||
} | |||
ins_left { 'location' } | |||
ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } | |||
ins_left { | |||
'diagnostics', | |||
sources = { 'nvim_diagnostic' }, | |||
symbols = { error = ' ', warn = ' ', info = ' ' }, | |||
diagnostics_color = { | |||
color_error = { fg = colors.red }, | |||
color_warn = { fg = colors.yellow }, | |||
color_info = { fg = colors.cyan }, | |||
}, | |||
} | |||
-- Insert mid section. You can make any number of sections in neovim :) | |||
-- for lualine it's any number greater then 2 | |||
ins_left { | |||
function() | |||
return '%=' | |||
end, | |||
} | |||
ins_left { | |||
-- Lsp server name . | |||
function() | |||
local msg = 'No Active Lsp' | |||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') | |||
local clients = vim.lsp.get_active_clients() | |||
if next(clients) == nil then | |||
return msg | |||
end | |||
for _, client in ipairs(clients) do | |||
local filetypes = client.config.filetypes | |||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then | |||
return client.name | |||
end | |||
end | |||
return msg | |||
end, | |||
icon = ' LSP:', | |||
color = { fg = '#ffffff', gui = 'bold' }, | |||
} | |||
-- Add components to right sections | |||
ins_right { | |||
'o:encoding', -- option component same as &encoding in viml | |||
fmt = string.upper, -- I'm not sure why it's upper case either ;) | |||
cond = conditions.hide_in_width, | |||
color = { fg = colors.green, gui = 'bold' }, | |||
} | |||
ins_right { | |||
'fileformat', | |||
fmt = string.upper, | |||
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh | |||
color = { fg = colors.green, gui = 'bold' }, | |||
} | |||
ins_right { | |||
'branch', | |||
icon = '', | |||
color = { fg = colors.violet, gui = 'bold' }, | |||
} | |||
ins_right { | |||
'diff', | |||
-- Is it me or the symbol for modified us really weird | |||
symbols = { added = ' ', modified = ' ', removed = ' ' }, | |||
diff_color = { | |||
added = { fg = colors.green }, | |||
modified = { fg = colors.orange }, | |||
removed = { fg = colors.red }, | |||
}, | |||
cond = conditions.hide_in_width, | |||
} | |||
ins_right { | |||
function() | |||
return '▊' | |||
end, | |||
color = { fg = colors.blue }, | |||
padding = { left = 1 }, | |||
} | |||
local lualine = require("lualine"); | |||
vim.api.nvim_create_autocmd("RecordingEnter", { | |||
callback = function() | |||
lualine.refresh({ | |||
place = { "statusline" }, | |||
}) | |||
end, | |||
}) | |||
vim.api.nvim_create_autocmd("RecordingLeave", { | |||
callback = function() | |||
-- This is going to seem really weird! | |||
-- Instead of just calling refresh we need to wait a moment because of the nature of | |||
-- `vim.fn.reg_recording`. If we tell lualine to refresh right now it actually will | |||
-- still show a recording occuring because `vim.fn.reg_recording` hasn't emptied yet. | |||
-- So what we need to do is wait a tiny amount of time (in this instance 50 ms) to | |||
-- ensure `vim.fn.reg_recording` is purged before asking lualine to refresh. | |||
local timer = vim.loop.new_timer() | |||
timer:start( | |||
50, | |||
0, | |||
vim.schedule_wrap(function() | |||
lualine.refresh({ | |||
place = { "statusline" }, | |||
}) | |||
end) | |||
) | |||
end, | |||
}) | |||
lualine.setup(config) | |||
end | |||
return config | |||
@ -0,0 +1,7 @@ | |||
return function () | |||
require('mini.surround').setup({}) | |||
require('mini.splitjoin').setup({}) | |||
require('mini.trailspace').setup({}) | |||
require('mini.comment').setup({}) | |||
require('mini.align').setup({}) | |||
end |
@ -0,0 +1,3 @@ | |||
return { | |||
library = { plugins = { "nvim-dap-ui" }, types = true }, | |||
} |
@ -0,0 +1,18 @@ | |||
return { | |||
lsp = { | |||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter** | |||
override = { | |||
["vim.lsp.util.convert_input_to_markdown_lines"] = true, | |||
["vim.lsp.util.stylize_markdown"] = true, | |||
["cmp.entry.get_documentation"] = true, | |||
}, | |||
}, | |||
-- you can enable a preset for easier configuration | |||
presets = { | |||
bottom_search = true, -- use a classic bottom cmdline for search | |||
command_palette = true, -- position the cmdline and popupmenu together | |||
long_message_to_split = true, -- long messages will be sent to a split | |||
inc_rename = false, -- enables an input dialog for inc-rename.nvim | |||
lsp_doc_border = false, -- add a border to hover docs and signature help | |||
}, | |||
} |
@ -0,0 +1,8 @@ | |||
return function() | |||
local null_ls = require("null-ls") | |||
null_ls.setup({ | |||
sources = { | |||
null_ls.builtins.formatting.stylua, | |||
}, | |||
}) | |||
end |
@ -0,0 +1,127 @@ | |||
return function() | |||
local if_nil = vim.F.if_nil | |||
local default_terminal = { | |||
type = "terminal", | |||
command = nil, | |||
width = 69, | |||
height = 8, | |||
opts = { | |||
redraw = true, | |||
window_config = {}, | |||
}, | |||
} | |||
local default_header = { | |||
type = "text", | |||
val = { | |||
[[ :::!~!!!!!:. ]], | |||
[[ .xUHWH!! !!?M88WHX:. ]], | |||
[[ .X*#M@$!! !X!M$$$$$$WWx:. ]], | |||
[[ :!!!!!!?H! :!$!$$$$$$$$$$8X: ]], | |||
[[ !!~ ~:~!! :~!$!#$$$$$$$$$$8X: ]], | |||
[[ :!~::!H!< ~.U$X!?R$$$$$$$$MM! ]], | |||
[[ ~!~!!!!~~ .:XW$$$U!!?$$$$$$RMM! ]], | |||
[[ !:~~~ .:!M"T#$$$$WX??#MRRMMM! ]], | |||
[[ ~?WuxiW*` `"#$$$$8!!!!??!!! ]], | |||
[[ :X- M$$$$ `"T#$T~!8$WUXU~ ]], | |||
[[ :%` ~#$$$m: ~!~ ?$$$$$$ ]], | |||
[[ :!`.- ~T$$$$8xx. .xWW- ~""##*" ]], | |||
[[..... -~~:<` ! ~?T#$$@@W@*?$$ /` ]], | |||
[[W$@@M!!! .!~~ !! .:XUW$W!~ `"~: : ]], | |||
[[#"~~`.:x%`!! !H: !WM$$$$Ti.: .!WUn+!` ]], | |||
[[:::~:!!`:X~ .: ?H.!u "$$$B$$$!W:U!T$$M~ ]], | |||
[[.~~ :X@!.-~ ?@WTWo("*$$$W$TH$! ` ]], | |||
[[Wi.~!X$?!-~ : ?$$$B$Wu("**$RM! ]], | |||
[[$R@i.~~ ! : ~$$$$$B$$en:`` ]], | |||
[[?MXT@Wx.~ : ~"##*$$$$M~ ]], | |||
}, | |||
opts = { | |||
position = "center", | |||
hl = "Type", | |||
-- wrap = "overflow"; | |||
}, | |||
} | |||
local footer = { | |||
type = "text", | |||
val = "", | |||
opts = { | |||
position = "center", | |||
hl = "Number", | |||
}, | |||
} | |||
local leader = "SPC" | |||
--- @param sc string | |||
--- @param txt string | |||
--- @param keybind string? optional | |||
--- @param keybind_opts table? optional | |||
local function button(sc, txt, keybind, keybind_opts) | |||
local sc_ = sc:gsub("%s", ""):gsub(leader, "<leader>") | |||
local opts = { | |||
position = "center", | |||
shortcut = sc, | |||
cursor = 3, | |||
width = 50, | |||
align_shortcut = "right", | |||
hl_shortcut = "Keyword", | |||
} | |||
if keybind then | |||
keybind_opts = if_nil(keybind_opts, { noremap = true, silent = true, nowait = true }) | |||
opts.keymap = { "n", sc_, keybind, keybind_opts } | |||
end | |||
local function on_press() | |||
local key = vim.api.nvim_replace_termcodes(keybind or sc_ .. "<Ignore>", true, false, true) | |||
vim.api.nvim_feedkeys(key, "t", false) | |||
end | |||
return { | |||
type = "button", | |||
val = txt, | |||
on_press = on_press, | |||
opts = opts, | |||
} | |||
end | |||
local buttons = { | |||
type = "group", | |||
val = { | |||
button("e", " New file", "<cmd>ene <CR>"), | |||
button("SPC f f", " Find file"), | |||
button("SPC f h", " Recently opened files"), | |||
button("SPC f r", " Frecency/MRU"), | |||
button("SPC f g", " Find word"), | |||
button("SPC f m", " Jump to bookmarks"), | |||
button("SPC s l", " Open last session"), | |||
}, | |||
opts = { | |||
spacing = 1, | |||
}, | |||
} | |||
local section = { | |||
terminal = default_terminal, | |||
header = default_header, | |||
buttons = buttons, | |||
footer = footer, | |||
} | |||
local config = { | |||
layout = { | |||
{ type = "padding", val = 2 }, | |||
section.header, | |||
{ type = "padding", val = 2 }, | |||
section.buttons, | |||
section.footer, | |||
}, | |||
opts = { | |||
margin = 5, | |||
}, | |||
} | |||
require('alpha').setup(config) | |||
end |
@ -0,0 +1,81 @@ | |||
return function() | |||
local cmp = require'cmp' | |||
local lspkind = require('lspkind') | |||
cmp.setup({ | |||
snippet = { | |||
expand = function(args) | |||
require('snippy').expand_snippet(args.body) -- For `snippy` users. | |||
end, | |||
}, | |||
window = { | |||
completion = cmp.config.window.bordered(), | |||
documentation = cmp.config.window.bordered(), | |||
}, | |||
mapping = cmp.mapping.preset.insert({ | |||
['<C-b>'] = cmp.mapping.scroll_docs(-4), | |||
['<C-f>'] = cmp.mapping.scroll_docs(4), | |||
['<C-Space>'] = cmp.mapping.complete(), | |||
['<C-e>'] = cmp.mapping.abort(), | |||
["<Tab>"] = cmp.mapping(function(fallback) | |||
if cmp.visible() then | |||
local entry = cmp.get_selected_entry() | |||
if not entry then | |||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) | |||
else | |||
cmp.confirm() | |||
end | |||
else | |||
fallback() | |||
end | |||
end, {"i","s","c",}), | |||
}), | |||
sources = cmp.config.sources({ | |||
{ name = 'nvim_lsp' }, | |||
{ name = 'snippy' }, | |||
{ name = 'vimtex', } | |||
}, { | |||
{ name = 'buffer' }, | |||
{ name = 'path' }, | |||
}), | |||
formatting = { | |||
format = lspkind.cmp_format({ | |||
mode = 'symbol_text', | |||
preset = 'codicons', | |||
maxwidth = 50, | |||
ellipsis_char = '...', | |||
before = function (entry, vim_item) | |||
return vim_item | |||
end | |||
}) | |||
} | |||
}) | |||
cmp.setup.filetype('gitcommit', { | |||
sources = cmp.config.sources({ | |||
{ name = 'git' }, | |||
}, { | |||
{ name = 'buffer' }, | |||
}) | |||
}) | |||
cmp.setup.cmdline({ '/', '?' }, { | |||
mapping = cmp.mapping.preset.cmdline(), | |||
view = { | |||
entries = {name = 'wildmenu', separator = '|' } | |||
}, | |||
sources = { | |||
{ name = 'buffer' }, | |||
{ name = 'path' } | |||
} | |||
}) | |||
cmp.setup.cmdline(':', { | |||
mapping = cmp.mapping.preset.cmdline(), | |||
sources = cmp.config.sources({ | |||
{ name = 'path' } | |||
}, { | |||
{ name = 'cmdline' } | |||
}) | |||
}) | |||
end |
@ -0,0 +1,34 @@ | |||
local function open_nvim_tree(data) | |||
-- buffer is a real file on the disk | |||
local real_file = vim.fn.filereadable(data.file) == 1 | |||
if not real_file then | |||
return | |||
end | |||
-- open the tree, find the file but don't focus it | |||
require("nvim-tree.api").tree.open({ focus = false, find_file = true, }) | |||
end | |||
vim.api.nvim_create_autocmd({ "BufCreate" }, { callback = open_nvim_tree }) | |||
return function () | |||
require("nvim-tree").setup({ | |||
sort_by = "case_sensitive", | |||
update_focused_file = { | |||
enable = true, | |||
update_cwd = true, | |||
}, | |||
view = { | |||
adaptive_size = true, | |||
}, | |||
diagnostics = { | |||
enable = true, | |||
show_on_dirs = true | |||
}, | |||
renderer = { | |||
group_empty = false, | |||
}, | |||
}) | |||
end |
@ -0,0 +1,31 @@ | |||
local handler = function(virtText, lnum, endLnum, width, truncate) | |||
local newVirtText = {} | |||
local suffix = (" %d "):format(endLnum - lnum) | |||
local sufWidth = vim.fn.strdisplaywidth(suffix) | |||
local targetWidth = width - sufWidth | |||
local curWidth = 0 | |||
for _, chunk in ipairs(virtText) do | |||
local chunkText = chunk[1] | |||
local chunkWidth = vim.fn.strdisplaywidth(chunkText) | |||
if targetWidth > curWidth + chunkWidth then | |||
table.insert(newVirtText, chunk) | |||
else | |||
chunkText = truncate(chunkText, targetWidth - curWidth) | |||
local hlGroup = chunk[2] | |||
table.insert(newVirtText, { chunkText, hlGroup }) | |||
chunkWidth = vim.fn.strdisplaywidth(chunkText) | |||
-- str width returned from truncate() may less than 2nd argument, need padding | |||
if curWidth + chunkWidth < targetWidth then | |||
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) | |||
end | |||
break | |||
end | |||
curWidth = curWidth + chunkWidth | |||
end | |||
table.insert(newVirtText, { suffix, "MoreMsg" }) | |||
return newVirtText | |||
end | |||
return { | |||
fold_virt_text_handler = handler, | |||
} |
@ -0,0 +1,34 @@ | |||
return function() | |||
require'persisted'.setup { | |||
options = {'globals'}, | |||
pre_save = function() vim.api.nvim_exec_autocmds('User', {pattern = 'SessionSavePre'}) end, | |||
should_autosave = function() | |||
-- do not autosave if the alpha dashboard is the current filetype | |||
if vim.bo.filetype == "alpha" then | |||
return false | |||
end | |||
return true | |||
end, | |||
on_autoload_no_session = function() | |||
vim.notify("No existing session to load.") | |||
end, | |||
ignored_dirs = { | |||
"~/.config", | |||
"~/.local/nvim" | |||
}, | |||
} | |||
local group = vim.api.nvim_create_augroup("PersistedHooks", {}) | |||
vim.api.nvim_create_autocmd({ "User" }, { | |||
pattern = "PersistedTelescopeLoadPre", | |||
group = group, | |||
callback = function(session) | |||
-- Save the currently loaded session using a global variable | |||
require("persisted").save({ session = vim.g.persisted_loaded_session }) | |||
-- Delete all of the open buffers | |||
vim.api.nvim_input("<ESC>:%bd!<CR>") | |||
end, | |||
}) | |||
end |
@ -0,0 +1,29 @@ | |||
local options = { | |||
defaults = { | |||
layout_strategy = 'horizontal', | |||
layout_config = { | |||
height = 0.95, | |||
prompt_position = "top" | |||
}, | |||
sorting_strategy = "ascending", | |||
color_devicons = true, | |||
mappings = { | |||
}, | |||
}, | |||
pickers = { | |||
find_files = { | |||
}, | |||
man_pages = { | |||
sections = { "2", "3" } | |||
} | |||
}, | |||
extensions = { | |||
["ui-select"] = { | |||
require("telescope.themes").get_dropdown { | |||
} | |||
}, | |||
}, | |||
extensions_list = { "ui-select", "persisted" }, | |||
} | |||
return options |
@ -0,0 +1,13 @@ | |||
return { | |||
ensure_installed = { "html", "json", "c", "c++", "css", "bash", "lua", "java", "python", "javascript", "latex", "markdown" }, | |||
sync_install = false, | |||
auto_install = true, | |||
ignore_install = { }, | |||
highlight = { | |||
enable = true, | |||
additional_vim_regex_highlighting = { "markdown" } | |||
}, | |||
} |
@ -0,0 +1,9 @@ | |||
return { | |||
opts = {}, | |||
register = { | |||
["<leader>f"] = { name = "+file" }, | |||
["<leader>s"] = { name = "+search" }, | |||
["<leader>g"] = { name = "+git" }, | |||
["<leader>l"] = { name = "+lsp" }, | |||
} | |||
} |
@ -0,0 +1,68 @@ | |||
-- Enable syntax highlighting | |||
vim.opt.syntax = "on" | |||
-- Autocomplete settings in command mode | |||
vim.opt.wildmenu = true | |||
vim.opt.wildmode = "longest,list,full" | |||
-- Various settings | |||
vim.opt.autoread = true | |||
vim.opt.backspace = { "indent", "eol", "start" } | |||
vim.opt.splitright = true | |||
vim.opt.splitbelow = true | |||
vim.opt.lazyredraw = false | |||
vim.opt.ttyfast = true | |||
vim.opt.wrap = false | |||
vim.opt.backup = false | |||
vim.opt.writebackup = false | |||
vim.opt.swapfile = false | |||
vim.opt.errorbells = false | |||
vim.opt.visualbell = false | |||
vim.opt.history = 500 | |||
vim.opt.hidden = true | |||
vim.opt.ignorecase = true | |||
vim.opt.smartcase = true | |||
vim.opt.incsearch = true | |||
vim.opt.timeoutlen = 500 | |||
vim.opt.ttimeoutlen = 0 | |||
vim.opt.showcmd = true | |||
vim.cmd('nohlsearch') | |||
vim.opt.scrolloff = 5 | |||
vim.opt.sidescrolloff = 10 | |||
vim.opt.shortmess:append("c") | |||
vim.opt.updatetime = 300 | |||
-- Persistent undo settings | |||
vim.opt.undodir = vim.fn.expand('~/.local/share/vim/undo/') | |||
vim.opt.undofile = true | |||
vim.opt.undolevels = 1000 | |||
vim.opt.undoreload = 10000 | |||
-- Wildignore settings | |||
vim.opt.wildignore:append({"*/tmp/*", "*.so", "*.zip", "*/vendor/bundle/*", "*/node_modules/"}) | |||
-- Autocommand to disable auto commenting on new lines | |||
vim.api.nvim_create_autocmd("FileType", { | |||
pattern = "*", | |||
callback = function() | |||
vim.opt_local.formatoptions:remove("c") | |||
vim.opt_local.formatoptions:remove("r") | |||
vim.opt_local.formatoptions:remove("o") | |||
end | |||
}) | |||
-- Filetype settings | |||
vim.cmd('filetype off') | |||
vim.cmd('filetype plugin on') | |||
-- Autocomplete settings | |||
vim.opt.completeopt = {"menu", "menuone", "noselect"} | |||
-- Folding settings | |||
vim.o.foldcolumn = '1' -- '0' is not bad | |||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value | |||
vim.o.foldlevelstart = 99 | |||
vim.o.foldenable = true |
@ -0,0 +1,21 @@ | |||
local function load_skeleton(filetype) | |||
-- do nothing if no filetype | |||
if filetype == "" then return end | |||
-- glob every directory of 'runtimepath' to search for skeleton/filetype | |||
local skeletons = vim.api.nvim_get_runtime_file('skeleton/' .. filetype, true) | |||
if #skeletons == 0 then return end | |||
-- read last skeleton into 1st line. | |||
vim.api.nvim_command('0read ' .. skeletons[#skeletons]) | |||
end | |||
-- augroup setup | |||
vim.api.nvim_create_augroup('aug_skeleton', {clear = true}) | |||
vim.api.nvim_create_autocmd('BufNewFile', { | |||
group = 'aug_skeleton', | |||
pattern = '*', | |||
callback = function() | |||
load_skeleton(vim.bo.filetype) | |||
end, | |||
}) |
@ -0,0 +1,39 @@ | |||
local map = vim.api.nvim_set_keymap | |||
local opts = { noremap = true, silent = true } | |||
-- Move to previous/next | |||
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts) | |||
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts) | |||
-- Re-order to previous/next | |||
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts) | |||
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts) | |||
-- Goto buffer in position... | |||
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts) | |||
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts) | |||
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts) | |||
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts) | |||
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts) | |||
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts) | |||
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts) | |||
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts) | |||
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts) | |||
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts) | |||
-- Pin/unpin buffer | |||
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts) | |||
-- Pin/unpin buffer | |||
map('n', '<A-Tab>', '<Cmd>b#<CR>', opts) | |||
-- Close buffer | |||
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts) | |||
-- Magic buffer-picking mode | |||
map('n', '<C-b>', '<Cmd>BufferPick<CR>', opts) | |||
-- Sort automatically by... | |||
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts) | |||
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts) | |||
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts) | |||
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts) | |||
@ -0,0 +1,13 @@ | |||
local map = vim.api.nvim_set_keymap | |||
-- Toggle breakpoint with F11 | |||
vim.api.nvim_set_keymap('n', '<F11>', "<cmd>lua require'dap'.toggle_breakpoint()<CR>", {noremap = true, silent = true}) | |||
-- Start debugging with F4 | |||
vim.api.nvim_set_keymap('n', '<F4>', "<cmd>lua require'dap'.continue()<CR>", {noremap = true, silent = true}) | |||
-- Step into with F7 | |||
vim.api.nvim_set_keymap('n', '<F7>', "<cmd>lua require'dap'.step_into()<CR>", {noremap = true, silent = true}) | |||
-- Step over with F8 | |||
vim.api.nvim_set_keymap('n', '<F8>', "<cmd>lua require'dap'.step_over()<CR>", {noremap = true, silent = true}) |
@ -0,0 +1,31 @@ | |||
local map = vim.api.nvim_set_keymap | |||
local opts = {noremap = true} | |||
-- [,w] SAVE | |||
map('', '<Leader>w', ':update<CR>', opts) | |||
-- <VISUAL> [Q] REFORMAT TEXT | |||
map('v', 'Q', 'gq', opts) | |||
-- Clipboard Bindings, Prefixing with leader copies to global | |||
map('n', '<Leader>y', '"+y', opts) | |||
map('n', '<Leader>p', '"+p', opts) | |||
map('v', '<Leader>y', '"+y', opts) | |||
map('v', '<Leader>p', '"+p', opts) | |||
map('n', '<Leader>Y', '"+Y', opts) | |||
map('n', '<Leader>P', '"+P', opts) | |||
map('v', '<Leader>d', '"+d', opts) | |||
map('n', '<Leader>D', '"+D', opts) | |||
-- Find and replace with Ctrl-R | |||
map('v', '<C-r>', '"hy:%s/<C-r>h//g<left><left><left>', opts) | |||
-- Apply . to all selected lines | |||
map('v', '.', ':normal .<CR>', opts) | |||
-- Quit window | |||
map('', '<Leader>qb', ':q<CR>', opts) | |||
-- Quit all without saving | |||
map('', '<Leader>qq', ':qa!<CR>', opts) |
@ -0,0 +1,7 @@ | |||
require('keybinds.editor') -- Vim native keybinds | |||
require('keybinds.telescope') -- Keybinds for use with telescope | |||
require('keybinds.plugin') -- Keybinds for use nvim tree | |||
require('keybinds.barbar') | |||
require('keybinds.terminal') | |||
require('keybinds.dap') |
@ -0,0 +1,56 @@ | |||
local map = vim.api.nvim_set_keymap | |||
local harpoon = require('harpoon') | |||
-- basic telescope configuration | |||
local conf = require("telescope.config").values | |||
local function toggle_telescope(harpoon_files) | |||
local file_paths = {} | |||
for _, item in ipairs(harpoon_files.items) do | |||
table.insert(file_paths, item.value) | |||
end | |||
require("telescope.pickers").new({}, { | |||
prompt_title = "Harpoon", | |||
finder = require("telescope.finders").new_table({ | |||
results = file_paths, | |||
}), | |||
previewer = conf.file_previewer({}), | |||
sorter = conf.generic_sorter({}), | |||
}):find() | |||
end | |||
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself | |||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds) | |||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds) | |||
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end, | |||
{ desc = "Open harpoon window" }) | |||
map('n', '<Leader>tt', "<Cmd> NvimTreeToggle<CR>", { | |||
noremap = true, | |||
desc = "Toggle directory tree" | |||
}) | |||
map('n', '<Leader>tf', "<Cmd> NvimTreeFindFile<CR>", { | |||
noremap = true, | |||
desc = "Go to current file in dir tree" | |||
}) | |||
map('n', '<Leader>ta', "<Cmd> AerialToggle<CR>", { | |||
noremap = true, | |||
desc = "Open aerial sidebar" | |||
}) | |||
map('n', '<Leader>tn', "<Cmd> AerialNavToggle<CR>", { | |||
noremap = true, | |||
desc = "Toggle aerial navigator" | |||
}) | |||
map('n', '<Leader>Z', "<Cmd> lua require('zen-mode').toggle({})<CR>", { | |||
noremap = true, | |||
desc = "Toggle zen mode" | |||
}) | |||
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end, | |||
{ desc = "Open harpoon window" }) |
@ -0,0 +1,69 @@ | |||
local map = vim.api.nvim_set_keymap | |||
-- == LSP Pickers == | |||
map('n', '<Leader>ll', "<Cmd> Telescope <CR>", { | |||
noremap = true, | |||
desc = "Open main telescope picket" | |||
}) | |||
map('n', '<C-p>', "<Cmd> Telescope commands <CR>", { | |||
noremap = true, | |||
desc = "Open main telescope picket" | |||
}) | |||
map('n', '<Leader><Leader>', "<Cmd>lua vim.lsp.buf.code_action()<CR>", { | |||
noremap = true, | |||
desc = "Resume last pick action" | |||
}) | |||
map('n', '<Leader>lf', "<Cmd> lua require('telescope.builtin').find_files()<CR>", { | |||
noremap = true, | |||
desc = "Open File" | |||
}) | |||
map('n', '<Leader>ld', "<Cmd> lua require('telescope.builtin').lsp_definitions()<CR>", { | |||
noremap = true, | |||
desc = "Go to definition" | |||
}) | |||
map('n', '<Leader>lr', "<Cmd> lua require('telescope.builtin').lsp_references()<CR>", { | |||
noremap = true, | |||
desc = "List to references to word under cursor" | |||
}) | |||
map('n', '<Leader>lt', "<Cmd>lua require('telescope.builtin').treesitter()<CR>", { | |||
noremap = true, | |||
desc = "List symbols in workspace with treesitter" | |||
}) | |||
map('n', '<Leader>lw', "<Cmd>lua require('telescope.builtin').diagnostic()<CR>", { | |||
noremap = true, | |||
desc = "List diagnostic items" | |||
}) | |||
map('n', '<Leader><Space>', "<Cmd>lua vim.lsp.buf.code_action()<CR>", { | |||
noremap = true, | |||
desc = "Pick code action" | |||
}) | |||
map("v", "<Leader><Space>", "<Cmd>'<,'>lua vim.lsp.buf.code_action()<CR>", { | |||
noremap = true, | |||
desc = "Pick code action for selection" | |||
}) | |||
map('n', '<Leader>ls', "<Cmd>lua require('telescope.builtin').live_grep()<CR>", { | |||
noremap = true, | |||
desc = "Live search" | |||
}) | |||
-- == Misc Keybinds == | |||
map('n', '<Leader>b', "<Cmd>lua require('telescope.builtin').buffers()<CR>", { | |||
noremap = true, | |||
desc = "List and pick buffers" | |||
}) | |||
map('n', '<Leader>S', "<Cmd>Telescope persisted<CR>", { | |||
noremap = true, | |||
desc = "Select a persisted session" | |||
}) |
@ -0,0 +1,17 @@ | |||
local map = vim.api.nvim_set_keymap | |||
map('n', '<C-.>', "<Cmd>ToggleTerm direction=horizontal<CR>", { | |||
noremap = true, | |||
desc = "Create terminal split" | |||
}) | |||
map('n', '<C-s>', "<Cmd>ToggleTerm direction=float<CR>", { | |||
noremap = true, | |||
desc = "Toggle terminal floating" | |||
}) | |||
local trim_spaces = true | |||
vim.keymap.set("v", "<Leader>s", function() | |||
require("toggleterm").send_lines_to_terminal("visual_selection", trim_spaces, { args = vim.v.count }) | |||
end) |
@ -0,0 +1,57 @@ | |||
local function mergeTables(t1, t2) | |||
for k, v in pairs(t2) do | |||
t1[k] = v | |||
end | |||
return t1 | |||
end | |||
-- === Initialize LSP Servers === | |||
-- For a list of LSP Servers and documentation: | |||
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md | |||
local lspconfig = require'lspconfig' | |||
local capabilities = require('cmp_nvim_lsp').default_capabilities() | |||
local configs = require("config.lsp").lspconfigs | |||
local on_attach = require("config.lsp").lsp_onattach | |||
capabilities.textDocument.completion.completionItem.snippetSupport = true | |||
capabilities.textDocument.foldingRange = { | |||
dynamicRegistration = false, | |||
lineFoldingOnly = true | |||
} | |||
-- LSP diagnostics | |||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { | |||
underline = true, | |||
signs = true, | |||
virtual_text = false, | |||
severity_sort = true, | |||
}) | |||
local signs = { | |||
Error = " ", | |||
Warning = " ", | |||
Hint = " ", | |||
Information = " " | |||
} | |||
for type, icon in pairs(signs) do | |||
local hl = "LspDiagnosticsSign" .. type | |||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) | |||
end | |||
-- LSP diagnostics | |||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { | |||
underline = true, | |||
signs = true, | |||
virtual_text = true, | |||
severity_sort = true, | |||
}) | |||
for k, v in pairs(configs) do | |||
lspconfig[k].setup( | |||
mergeTables(v, { | |||
on_attach = on_attach, | |||
capabilities = capabilities | |||
})) | |||
end |
@ -0,0 +1,276 @@ | |||
return { | |||
{ | |||
"catppuccin/nvim", | |||
name = "catppuccin", | |||
priority = 1000, | |||
opts = require("config.plugin.catppuccin"), | |||
}, | |||
{ | |||
"goolord/alpha-nvim", | |||
cond = vim.g.vscode == nil, | |||
dependencies = { | |||
"nvim-tree/nvim-web-devicons", | |||
"nvim-telescope/telescope.nvim", | |||
"persisted" | |||
}, | |||
event = "VimEnter", | |||
config = require("config.plugin.nvim-alpha"), | |||
}, | |||
{ | |||
"romgrk/barbar.nvim", | |||
dependencies = { | |||
"lewis6991/gitsigns.nvim", -- OPTIONAL: for git status | |||
"nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons | |||
}, | |||
init = function() | |||
vim.g.barbar_auto_setup = false | |||
end, | |||
opts = {}, | |||
version = "^1.0.0", -- optional: only update when a new 1.x version is released | |||
}, | |||
{ | |||
"nvim-lualine/lualine.nvim", | |||
dependencies = { | |||
"catppuccin/nvim", | |||
"nvim-tree/nvim-web-devicons", | |||
'rmagatti/auto-session', | |||
}, | |||
config = require("config.plugin.lualine"), | |||
}, | |||
{ | |||
"utilyre/barbecue.nvim", | |||
name = "barbecue", | |||
version = "*", | |||
dependencies = { | |||
"SmiteshP/nvim-navic", | |||
"nvim-tree/nvim-web-devicons", -- optional dependency | |||
}, | |||
opts = {}, | |||
}, | |||
{ | |||
"lewis6991/gitsigns.nvim", | |||
opts = {}, | |||
}, | |||
{ | |||
"lukas-reineke/headlines.nvim", | |||
dependencies = "nvim-treesitter/nvim-treesitter", | |||
opts = {}, | |||
}, | |||
{ | |||
"ThePrimeagen/harpoon", | |||
branch = "harpoon2", | |||
dependencies = { | |||
"nvim-lua/plenary.nvim", | |||
}, | |||
config = require("config.plugin.harpoon2"), | |||
}, | |||
{ | |||
"nvim-tree/nvim-tree.lua", | |||
version = "*", | |||
lazy = false, | |||
dependencies = { | |||
"romgrk/barbar.nvim", | |||
"nvim-tree/nvim-web-devicons", | |||
}, | |||
config = require("config.plugin.nvim-tree"), | |||
}, | |||
{ | |||
"nvim-neotest/neotest", | |||
dependencies = { | |||
"nvim-lua/plenary.nvim", | |||
"antoinemadec/FixCursorHold.nvim", | |||
"nvim-treesitter/nvim-treesitter", | |||
}, | |||
}, | |||
{ | |||
"folke/which-key.nvim", | |||
event = "VeryLazy", | |||
init = function() | |||
vim.o.timeout = true | |||
vim.o.timeoutlen = 300 | |||
end, | |||
config = function() | |||
local settings = require("config.plugin.whichkey") | |||
require("which-key").setup(settings.opts) | |||
require("which-key").register(settings.register) | |||
end, | |||
}, | |||
{ | |||
"folke/zen-mode.nvim", | |||
opts = {}, | |||
}, | |||
{ | |||
"gauteh/vim-cppman", | |||
}, | |||
{ | |||
"lervag/vimtex", | |||
}, | |||
{ | |||
"christoomey/vim-tmux-navigator", | |||
}, | |||
{ | |||
"echasnovski/mini.nvim", | |||
version = '*', | |||
config = require("config.plugin.mini") | |||
}, | |||
{ | |||
"tpope/vim-surround", | |||
}, | |||
{ | |||
"jose-elias-alvarez/null-ls.nvim", | |||
config = require("config.plugin.null-ls"), | |||
}, | |||
{ | |||
"williamboman/mason.nvim", | |||
config = true, | |||
dependencies = { | |||
"neovim/nvim-lspconfig", | |||
}, | |||
}, | |||
{ | |||
"neovim/nvim-lspconfig", | |||
dependencies = { | |||
"folke/neodev.nvim" | |||
} | |||
}, | |||
{ | |||
"williamboman/mason-lspconfig.nvim", | |||
opts = { | |||
ensure_installed = require("config.lsp").mason_servers | |||
}, | |||
dependencies = { | |||
"folke/neodev.nvim" | |||
} | |||
}, | |||
{ | |||
"nvim-treesitter/nvim-treesitter", | |||
opts = require("config.plugin.treesitter"), | |||
}, | |||
{ | |||
"NeogitOrg/neogit", | |||
dependencies = { | |||
"nvim-lua/plenary.nvim", | |||
"sindrets/diffview.nvim", | |||
"nvim-telescope/telescope.nvim", | |||
}, | |||
config = true, | |||
}, | |||
{ | |||
"nvim-telescope/telescope.nvim", | |||
tag = "0.1.5", | |||
dependencies = { | |||
"nvim-lua/plenary.nvim", | |||
"nvim-telescope/telescope-ui-select.nvim", | |||
}, | |||
config = function() | |||
local telescope = require("telescope") | |||
local config = require("config.plugin.telescope") | |||
for _, ext in ipairs(config.extensions_list) do | |||
telescope.load_extension(ext) | |||
end | |||
telescope.setup(config) | |||
end, | |||
}, | |||
{ | |||
"folke/noice.nvim", | |||
event = "VeryLazy", | |||
opts = require("config.plugin.noice"), | |||
dependencies = { | |||
"MunifTanjim/nui.nvim", | |||
"rcarriga/nvim-notify", | |||
}, | |||
}, | |||
{ | |||
"neomutt/neomutt.vim", | |||
}, | |||
{ | |||
"stevearc/aerial.nvim", | |||
dependencies = { | |||
"nvim-treesitter/nvim-treesitter", | |||
"nvim-tree/nvim-web-devicons", | |||
}, | |||
config = require("config.plugin.aerial") | |||
}, | |||
{ | |||
"dcampos/nvim-snippy", | |||
dependencies = { | |||
"honza/vim-snippets", | |||
}, | |||
opts = {}, | |||
}, | |||
{ | |||
"kevinhwang91/nvim-ufo", | |||
dependencies = { | |||
"kevinhwang91/promise-async", | |||
"neovim/nvim-lspconfig", | |||
}, | |||
opts = require("config.plugin.nvim-ufo"), | |||
}, | |||
{ | |||
"rest-nvim/rest.nvim", | |||
dependencies = { { "nvim-lua/plenary.nvim" } }, | |||
config = function() | |||
require("rest-nvim").setup({}) | |||
end, | |||
}, | |||
{ | |||
"zbirenbaum/copilot.lua", | |||
cmd = "Copilot", | |||
event = "InsertEnter", | |||
opts = {}, | |||
}, | |||
{ | |||
"zbirenbaum/copilot-cmp", | |||
dependencies = { | |||
"zbirenbaum/copilot.lua", | |||
}, | |||
config = true, | |||
}, | |||
{ | |||
"hrsh7th/nvim-cmp", | |||
config = require("config.plugin.nvim-cmp"), | |||
dependencies = { | |||
"onsails/lspkind.nvim", | |||
"hrsh7th/cmp-nvim-lsp", | |||
"hrsh7th/cmp-nvim-lua", | |||
"hrsh7th/cmp-buffer", | |||
"hrsh7th/cmp-path", | |||
"hrsh7th/cmp-cmdline", | |||
"hrsh7th/cmp-nvim-lsp-signature-help", | |||
"dcampos/cmp-snippy", | |||
"micangl/cmp-vimtex", | |||
"dcampos/nvim-snippy", | |||
}, | |||
}, | |||
{ | |||
"lukas-reineke/indent-blankline.nvim", | |||
main = "ibl", | |||
opts = {}, | |||
}, | |||
{ | |||
"akinsho/toggleterm.nvim", | |||
version = "*", | |||
config = true, | |||
}, | |||
{ | |||
"olimorris/persisted.nvim", | |||
config = require("config.plugin.persisted"), | |||
dependencies = { | |||
"romgrk/barbar.nvim" | |||
} | |||
}, | |||
{ | |||
"folke/neodev.nvim", | |||
opts = require("config.plugin.neodev") | |||
}, | |||
{ | |||
"rcarriga/nvim-dap-ui", | |||
dependencies = { | |||
"pocco81/dap-buddy.nvim", | |||
"mfussenegger/nvim-dap", | |||
}, | |||
opts = {} | |||
} | |||
} |
@ -1,36 +0,0 @@ | |||
set showtabline=2 | |||
set guioptions-=e | |||
let g:lightline#bufferline#show_number = 2 | |||
let g:lightline#bufferline#shorten_path = 0 | |||
let g:lightline#bufferline#unnamed = '[No Name]' | |||
let g:lightline#bufferline#enable_nerdfont = 1 | |||
let g:lightline#bufferline#modified = ' *' | |||
let g:lightline#bufferline#read_only = ' ' | |||
let g:lightline#bufferline#enable_devicons = 1 | |||
" Movement bindings | |||
nmap <Leader>1 <Plug>lightline#bufferline#go(1) | |||
nmap <Leader>2 <Plug>lightline#bufferline#go(2) | |||
nmap <Leader>3 <Plug>lightline#bufferline#go(3) | |||
nmap <Leader>4 <Plug>lightline#bufferline#go(4) | |||
nmap <Leader>5 <Plug>lightline#bufferline#go(5) | |||
nmap <Leader>6 <Plug>lightline#bufferline#go(6) | |||
nmap <Leader>7 <Plug>lightline#bufferline#go(7) | |||
nmap <Leader>8 <Plug>lightline#bufferline#go(8) | |||
nmap <Leader>9 <Plug>lightline#bufferline#go(9) | |||
nmap <Leader>0 <Plug>lightline#bufferline#go(10) | |||
" Deletion Bindings | |||
nmap <Leader>c1 <Plug>lightline#bufferline#delete(1) | |||
nmap <Leader>c2 <Plug>lightline#bufferline#delete(2) | |||
nmap <Leader>c3 <Plug>lightline#bufferline#delete(3) | |||
nmap <Leader>c4 <Plug>lightline#bufferline#delete(4) | |||
nmap <Leader>c5 <Plug>lightline#bufferline#delete(5) | |||
nmap <Leader>c6 <Plug>lightline#bufferline#delete(6) | |||
nmap <Leader>c7 <Plug>lightline#bufferline#delete(7) | |||
nmap <Leader>c8 <Plug>lightline#bufferline#delete(8) | |||
nmap <Leader>c9 <Plug>lightline#bufferline#delete(9) | |||
nmap <Leader>c0 <Plug>lightline#bufferline#delete(10) | |||
@ -1,53 +0,0 @@ | |||
let g:lightline = { | |||
\ 'colorscheme': 'material_vim', | |||
\ 'active': { | |||
\ 'right': [ [ 'lineinfo' ], [ 'percent' ], [ 'fileformat', 'fileencoding', 'filetype' ] ], | |||
\ 'left': [ [ 'mode', 'paste' ], [ 'lsp_status' ], [ 'readonly', 'filename' ], [ 'lsp_info', 'lsp_hints', 'lsp_errors', 'lsp_warnings', 'lsp_ok' ] ], | |||
\ }, | |||
\ 'component_function': { }, | |||
\ 'tabline': { | |||
\ 'left': [ ['buffers'] ], | |||
\ 'right': [ ], | |||
\ }, | |||
\ 'component_expand': { | |||
\ 'buffers': 'lightline#bufferline#buffers', | |||
\ }, | |||
\ 'component_type': { | |||
\ 'buffers': 'tabsel', | |||
\ } | |||
\ } | |||
function! WordCount() | |||
let currentmode = mode() | |||
if !exists("g:lastmode_wc") | |||
let g:lastmode_wc = currentmode | |||
endif | |||
" if we modify file, open a new buffer, be in visual ever, or switch modes | |||
" since last run, we recompute. | |||
if &modified || !exists("b:wordcount") || currentmode =~? '\c.*v' || currentmode != g:lastmode_wc | |||
let g:lastmode_wc = currentmode | |||
let l:old_position = getpos('.') | |||
let l:old_status = v:statusmsg | |||
execute "silent normal g\<c-g>" | |||
if v:statusmsg == "--No lines in buffer--" | |||
let b:wordcount = 0 | |||
else | |||
let s:split_wc = split(v:statusmsg) | |||
if index(s:split_wc, "Selected") < 0 | |||
let b:wordcount = str2nr(s:split_wc[11]) | |||
else | |||
let b:wordcount = str2nr(s:split_wc[5]) | |||
endif | |||
let v:statusmsg = l:old_status | |||
endif | |||
call setpos('.', l:old_position) | |||
return b:wordcount | |||
else | |||
return b:wordcount | |||
endif | |||
endfunction | |||
let g:lightline#trailing_whitespace#indicator = '' | |||
call lightline#lsp#register() |
@ -1,9 +0,0 @@ | |||
let g:better_whitespace_enabled=0 | |||
let g:better_whitespace_ctermcolor='LightRed' | |||
let g:better_whitespace_guicolor='LightRed' | |||
let g:better_whitespace_operator='_s' | |||
let g:strip_whitespace_on_save=1 | |||
let g:strip_max_file_size=1000 | |||
let g:strip_whitespace_confirm=0 | |||
let g:better_whitespace_filetypes_blacklist=['md', 'markdown'] |
@ -1,89 +0,0 @@ | |||
call plug#begin('~/.local/share/vim/plugged') | |||
" Look & Feel | |||
Plug 'kaicataldo/material.vim' | |||
Plug 'itchyny/lightline.vim' | |||
Plug 'mengelbrecht/lightline-bufferline' | |||
Plug 'kyazdani42/nvim-tree.lua' | |||
" Addons | |||
Plug 'mhinz/vim-signify' " Signs | |||
Plug 'tpope/vim-surround' " Surround pieces of text with symbols | |||
Plug 'jremmen/vim-ripgrep' " Better Grep | |||
" Plug 'blarghmatey/split-expander' | |||
Plug 'sheerun/vim-polyglot' " Language Packs | |||
" Plug 'neoclide/coc.nvim', {'branch': 'release'} | |||
Plug 'neovim/nvim-lspconfig' " LSP!!! | |||
Plug 'junegunn/goyo.vim' " Center writing | |||
" Autocomplete | |||
Plug 'hrsh7th/cmp-nvim-lsp' | |||
Plug 'hrsh7th/cmp-buffer' | |||
Plug 'hrsh7th/cmp-path' | |||
Plug 'hrsh7th/cmp-cmdline' | |||
Plug 'Dosx001/cmp-commit' | |||
Plug 'hrsh7th/nvim-cmp' | |||
Plug 'hrsh7th/cmp-nvim-lsp-signature-help' | |||
Plug 'neomutt/neomutt.vim' " Neomuttrc syntex highlighting | |||
Plug 'VebbNix/lf-vim' | |||
" Tmux integration | |||
Plug 'benmills/vimux' | |||
Plug 'christoomey/vim-tmux-navigator' | |||
" File system navigation | |||
Plug 'nvim-lua/plenary.nvim' | |||
Plug 'nvim-telescope/telescope.nvim' | |||
Plug 'nvim-telescope/telescope-file-browser.nvim' | |||
Plug 'gnfisher/nvim-telescope-ctags-plus' | |||
Plug 'jreybert/vimagit' | |||
Plug 'ojroques/vim-oscyank' " OCS Yank PLugin for use with Blink Shell | |||
Plug 'folke/which-key.nvim' " Emacs like keybind suggestions | |||
Plug 'ferrine/md-img-paste.vim' | |||
" === Language Servers === | |||
Plug 'mfussenegger/nvim-jdtls' | |||
" ==== Syntax highlighting ==== | |||
Plug 'joelbeedle/pseudo-syntax' " Pseudocode | |||
Plug 'rhysd/vim-wasm' " Web Assembly | |||
Plug 'elzr/vim-json' " JSON | |||
Plug 'tpope/vim-markdown' "Markdown | |||
Plug 'pangloss/vim-javascript' "Javascript | |||
Plug 'leafgarland/typescript-vim' "Typescript | |||
Plug 'vim-scripts/cool.vim' "COOL, Stanford Compiler Course | |||
Plug 'justinmk/vim-syntax-extra' " A bunch of extra languages | |||
Plug 'arrufat/vala.vim' " Vala | |||
Plug 'Shirk/vim-gas' "GAS Assembly | |||
Plug 'nvim-treesitter/nvim-treesitter' | |||
Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons | |||
Plug 'nicwest/vim-http' | |||
" === Snippets === | |||
Plug 'hrsh7th/cmp-vsnip' | |||
Plug 'hrsh7th/vim-vsnip' | |||
Plug 'rafamadriz/friendly-snippets' " Some snippets for ultisnips | |||
Plug 'folke/zen-mode.nvim' | |||
Plug 'goolord/alpha-nvim' " Welcome screen | |||
Plug 'onsails/lspkind.nvim' " Completion icons | |||
" Telescope extensions | |||
Plug 'nvim-telescope/telescope-ui-select.nvim' | |||
Plug 'mickael-menu/zk-nvim' | |||
Plug 'folke/trouble.nvim' | |||
Plug 'josa42/nvim-lightline-lsp' | |||
Plug 'willchao612/vim-diagon' | |||
Plug 'tpope/vim-fugitive' | |||
Plug 'lervag/vimtex' | |||
Plug 'mfussenegger/nvim-dap' | |||
call plug#end() | |||
@ -1,182 +0,0 @@ | |||
" note do not change the order... | |||
" some of them are overridding privous regrex | |||
"this code made with build-in syntax regrex(and key words), and with some custome regrex(and | |||
"key words) | |||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |||
" gruvbox (dark) | |||
"let orange = "#d65d0e" "special color for numbers | |||
"let black = "#282828" | |||
"let red = "#cc241d" | |||
"let green = "#98971a" | |||
"let yellow = "#d79921" | |||
"let blue = "#458588" | |||
"let purple = "#b16286" | |||
"let cyan = "#689d6a" | |||
"let white = "#a89984" | |||
" one dark | |||
let orange = "#d19a66" "special color for numbers | |||
let black = "#282c34" | |||
let red = "#E06C75" | |||
let green = "#98c379" | |||
let yellow = "#E5C07B" | |||
let blue = "#61AFEF" | |||
let purple = "#C678DD" | |||
let cyan = "#56B6C2" | |||
let white = "#ABB2BF" | |||
" you may chage the color according to your will :) | |||
" main color (for left over words) | |||
syn match main "\w" | |||
execute "highlight main ctermfg=4 guifg=".red | |||
" numbers | |||
syn match posNum "\d" | |||
execute "highlight posNum ctermfg=4 guifg=".orange | |||
" method names() | |||
syn match class ".\w*\((\)\@=" | |||
execute "highlight class ctermfg=4 guifg=".blue | |||
"execute "highlight names which contains numbers | |||
syn match main "\v(\a)\w*\d" | |||
execute "highlight main ctermfg=4 guifg=".red | |||
"all regrex works | |||
" /^import (+);$/mg | |||
" import \zs.*\ze | |||
" \v(^import\s+)@<=.*; | |||
" imported packages | |||
syn match importName "\v(^import\s+)@<=.*;" | |||
execute "highlight importName ctermfg=4 guifg=".yellow | |||
" import | |||
syn match importWord "import " | |||
execute "highlight importWord ctermfg=4 guifg=".purple | |||
" package name | |||
syn match packageName "\v(^package\s+)@<=.*;" | |||
execute "highlight packageName ctermfg=4 guifg=".yellow | |||
" package | |||
syn match packageWord "package " | |||
execute "highlight packageWord ctermfg=4 guifg=".purple | |||
"ex: int, double, char | |||
execute "highlight javaType ctermfg=4 guifg=".purple | |||
"ex: static, throws | |||
execute "highlight javaStorageClass ctermfg=4 guifg=".purple | |||
"class name... basically starts with caps letter | |||
syntax match ClassName display '\<\([A-Z][a-z0-9]*\)\+\>' | |||
syntax match ClassName display '\.\@<=\*' | |||
highlight link ClassName Identifier | |||
execute "highlight ClassName ctermfg=4 guifg=".yellow | |||
" Just some special color, why not? | |||
syn match print " System.out." | |||
execute "highlight print ctermfg=4 guifg=".yellow | |||
"objects (ex: String) | |||
execute "highlight Constant ctermfg=4 guifg=".yellow | |||
" class | |||
syn match javaClassDecl2 " class\> " | |||
execute "highlight javaClassDecl2 ctermfg=4 guifg=".purple | |||
" package | |||
execute "highlight javaExternal ctermfg=4 guifg=".purple | |||
"if else switch | |||
execute "highlight javaConditional ctermfg=4 guifg=".purple | |||
"while for do | |||
execute "highlight javaRepeat ctermfg=4 guifg=".purple | |||
"true flase | |||
execute "highlight javaBoolean ctermfg=4 guifg=".orange | |||
" null | |||
syn match null "\v[ =]null[; ]" | |||
execute "highlight null ctermfg=4 guifg=".orange | |||
" this super | |||
execute "highlight javaTypedef ctermfg=4 guifg=".purple | |||
" var new instanceof | |||
execute "highlight javaOperator ctermfg=4 guifg=".purple | |||
" return | |||
execute "highlight javaStatement ctermfg=4 guifg=".purple | |||
" static synchronized transient volatile final strictfp serializable | |||
execute "highlight javaStorageClass ctermfg=4 guifg=".purple | |||
"throw try catch finally | |||
execute "highlight javaExceptions ctermfg=4 guifg=".purple | |||
" assert | |||
execute "highlight javaAssert ctermfg=4 guifg=".purple | |||
" synchronized throws | |||
execute "highlight javaMethodDecl ctermfg=4 guifg=".red | |||
" extends implements interface | |||
execute "highlight javaClassDecl ctermfg=4 guifg=".red | |||
" interface | |||
execute "highlight javaClassDecl ctermfg=4 guifg=".purple | |||
" break continue skipwhite | |||
execute "highlight javaBranch ctermfg=4 guifg=".purple | |||
" public protected private abstract | |||
execute "highlight javaScopeDecl ctermfg=4 guifg=".purple | |||
""""""""""""""""""""""""""""""""""""""' | |||
" java 9... | |||
" module transitive | |||
execute "highlight javaModuleStorageClass ctermfg=4 guifg=".purple | |||
" open requires exports opens uses provides | |||
execute "highlight javaModuleStmt ctermfg=4 guifg=".yellow | |||
" to with | |||
execute "highlight javaModuleExternal ctermfg=4 guifg=".red | |||
""""""""""""""""""""""""""""""""""""""""" | |||
" lambda | |||
execute "highlight javaLambdaDef ctermfg=4 guifg=".cyan | |||
"""""""""""""""""""""""""""""""""""""""""" | |||
" clone equals finalize getClass hashCode | |||
" notify notifyAll toString wait | |||
execute "highlight javaLangObject ctermfg=4 guifg=".yellow | |||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |||