+/config
my dotfiles and nix configuration
git clone https://git.julia.blue/+/config
d8b84e8
main
1require ( "catppuccin" ). setup { 2flavour ="mocha" , 3-- stylua: ignore 4integrations ={ 5fidget =true , hop =true , notify =true , 6treesitter =true , which_key =true , nvim_surround =true 7} , 8color_overrides ={ 9-- mocha = { base = "#000000", mantle = "#000000", crust = "#000000" }, 10} , 11custom_highlights =function ( c ) 12return { 13StatusLine ={ fg =c . base , bg =c . blue , bold =true } , 14StatusLineModified ={ fg =c . base , bg =c . mauve , bold =true } , 15 16SignColumn ={ bg =c . surface0 } , 17GitSignsAdd ={ fg =c . green , bg =c . surface0 } , 18GitSignsChange ={ fg =c . yellow , bg =c . surface0 } , 19GitSignsDelete ={ fg =c . red , bg =c . surface0 } , 20DiagnosticSignError ={ fg =c . red , bg =c . surface0 } , 21DiagnosticSignWarn ={ fg =c . yellow , bg =c . surface0 } , 22DiagnosticSignInfo ={ fg =c . sky , bg =c . surface0 } , 23DiagnosticSignHint ={ fg =c . teal , bg =c . surface0 } , 24DapBreakpoint ={ fg =c . red , bg =c . surface0 } , 25DapBreakpointCondition ={ fg =c . yellow , bg =c . surface0 } , 26DapBreakpointRejected ={ fg =c . mauve , bg =c . surface0 } , 27DapLogPoint ={ fg =c . sky , bg =c . surface0 } , 28DapStopped ={ fg =c . maroon , bg =c . surface0 } , 29 30TrailingWhitespace ={ fg =c . maroon , reverse =true } , 31} 32end , 33} 34 35vim . cmd [[colorscheme catppuccin]] 36 37MyFoldText =function () 38-- stylua: ignore 39return vim . fn . getline ( vim . v . foldstart ) .. " (" 40.. ( vim . v . foldend - vim . v . foldstart ) .. " lines) " 41end 42vim . opt . foldtext ="v:lua.MyFoldText()" 43 44require ( "image" ). setup () 45require ( "colorizer" ). setup { user_default_options ={ names =false } } 46require ( "gitsigns" ). setup { current_line_blame_opts ={ delay =500 } } 47vim . api . nvim_create_user_command ( "Dismiss" , require ( "notify" ). dismiss , {} ) 48local notify =require "notify" 49notify . setup { render ="compact" , background_colour ="#000000" } 50vim . notify =notify 51require ( "fidget" ). setup { notification ={ window ={ winblend =0 } } } 52require ( "dressing" ). setup {} 53 54local pretty =vim . api . nvim_create_augroup ( "pretty" , {} ) 55local autocmd =function ( event , f ) 56vim . api . nvim_create_autocmd ( event , { group =pretty , callback =f } ) 57end 58 59-- highlight on yank 60autocmd ( "TextYankPost" , function () vim . highlight . on_yank { timeout =150 } end ) 61 62-- highlight lsp references 63autocmd ( { "CursorHold" , "CursorHoldI" } , function () 64for _ , c in pairs ( vim . lsp . get_clients ()) do 65if c . supports_method "textDocument/documentHighlight" then 66vim . lsp . buf . document_highlight () 67end 68end 69end ) 70autocmd ( { "CursorMoved" , "CursorMovedI" } , vim . lsp . buf . clear_references ) 71 72-- trim whitespace when saving 73autocmd ( "BufWritePre" , function () 74G . inplace ( function () vim . cmd [[keeppatterns %s_\s\+$__e]] end ) 75end ) 76 77-- highlight trailing whitespace 78local ft_exclude =G . makeset { "lspinfo" , "diff" , "man" , "checkhealth" } 79local buftype_exclude =G . makeset { "terminal" , "help" , "nofile" , "prompt" , "quickfix" } 80local pat ="\\s\\+$" 81autocmd ( { "BufEnter" , "TextChanged" , "BufModifiedSet" } , function () 82if 83not vim . opt . modifiable : get () 84or buftype_exclude [ vim . bo . buftype ] 85or ft_exclude [ vim . bo . filetype ] 86or vim . api . nvim_win_get_config ( 0 ). relative ~= "" 87or G . inplace ( function () return vim . fn . search ( pat ) == 0 end ) 88then 89return 90end 91vim . fn . matchadd ( "TrailingWhitespace" , pat ) 92end )