Use aerial.nvim for the breadcrumbs on winbar
Also: - remove `nvim-navic` from the plugin tree (covered by aerial.nvim now) - add more filetypes to filetype.lua - rework heirline's configuration structure to be cleaner - add some more LSP servers + remove glint
This commit is contained in:
parent
7d48276460
commit
0c9e4d20e0
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021-2023 Hoang Nguyen <folliekazetani@protonmail.com>
|
||||
Copyright (c) 2021-2024 Hoang Nguyen <folliekazetani@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
46
filetype.lua
46
filetype.lua
|
@ -14,42 +14,54 @@ vim.filetype.add {
|
|||
['terraform.tfstate'] = 'json',
|
||||
},
|
||||
extension = {
|
||||
gwl = 'wisp',
|
||||
http = 'http',
|
||||
hurl = 'hurl',
|
||||
j2 = 'jinja',
|
||||
jinja = 'jinja',
|
||||
jinja2 = 'jinja',
|
||||
k = 'kcl',
|
||||
kk = 'koka',
|
||||
mdx = 'markdown.mdx',
|
||||
mmd = 'mermaid',
|
||||
ncl = 'nickel',
|
||||
nft = 'nftables',
|
||||
nu = 'nu',
|
||||
rasi = 'rasi',
|
||||
rasinc = 'rasi',
|
||||
res = 'rescript',
|
||||
resi = 'rescript',
|
||||
river = 'hcl',
|
||||
templ = 'templ',
|
||||
tmpl = 'gohtmltmpl',
|
||||
typ = 'typst',
|
||||
-- Jinja2
|
||||
j2 = 'jinja',
|
||||
jinja = 'jinja',
|
||||
jinja2 = 'jinja',
|
||||
-- Rescript
|
||||
res = 'rescript',
|
||||
resi = 'rescript',
|
||||
w = 'wisp',
|
||||
wisp = 'wisp',
|
||||
},
|
||||
pattern = {
|
||||
['${HOME}/.kube/config'] = 'yaml',
|
||||
-- Ansible
|
||||
['.*/roles/.*/tasks/.*%.ya?ml'] = 'yaml.ansible',
|
||||
['.*/roles/.*/handlers/.*%.ya?ml'] = 'yaml.ansible',
|
||||
['.*/playbooks/.*%.ya?ml'] = 'yaml.ansible',
|
||||
['playbook.ya?ml'] = 'yaml.ansible',
|
||||
['.*/roles/[^/]+/tasks/[^/]+%.ya?ml'] = 'yaml.ansible',
|
||||
['.*/roles/[^/]+/handlers/[^/]+%.ya?ml'] = 'yaml.ansible',
|
||||
['.*/playbooks/[^/]+%.ya?ml'] = 'yaml.ansible',
|
||||
-- Helm chart templates
|
||||
['.*/templates/.+%.ya?ml'] = 'yaml.helm',
|
||||
['.*/templates/.+%.tpl'] = 'yaml.helm',
|
||||
-- Waybar config
|
||||
['${XDG_CONFIG_HOME}/waybar/config'] = 'jsonc',
|
||||
-- Rofi style (not really CSS, but similar)
|
||||
['${XDG_CONFIG_HOME}/rofi/.*%.rasi'] = 'css',
|
||||
['${XDG_CONFIG_HOME}/rofi/.*%.rasinc'] = 'css',
|
||||
['${XDG_CONFIG_HOME}/rofi/themes/.*%.rasi'] = 'css',
|
||||
['${XDG_CONFIG_HOME}/rofi/themes/.*%.rasinc'] = 'css',
|
||||
-- please.build
|
||||
['%.?plzconfig'] = 'gitconfig',
|
||||
['%.plzconfig_[%w_]+'] = 'gitconfig',
|
||||
['%.plzconfig.[%w_%-]+'] = 'gitconfig',
|
||||
-- Fallback logic
|
||||
['.*'] = {
|
||||
priority = -math.huge,
|
||||
function(_, bufnr)
|
||||
local first_line = vim.filetype.getlines(bufnr, 1)
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
if first_line:find('^#!.*[%s/]nft %-f$') then
|
||||
return 'nftables'
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "d30f650b1b1b3b059328230a7ed8edccf6aaa522" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "91b56a811d87b9e7e0600c95f80ff2d08245bf61" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "3748e87a316a68754341cdffcef44fee61dee51c" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "1356b9ef31b985d541d94314f2cf73c61124bf1d" },
|
||||
"better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
|
||||
"carbon-now.nvim": { "branch": "main", "commit": "16e843489ba00493466170919abfe144fc9aa158" },
|
||||
"ccc.nvim": { "branch": "main", "commit": "ec6e23fd2c0bf4ffcf71c1271acdcee6e2c6f49c" },
|
||||
"cmp-async-path": { "branch": "main", "commit": "9d581eec5acf812316913565c135b0d1ee2c9a71" },
|
||||
"cmp-async-path": { "branch": "main", "commit": "89eb42f1f2ba0ee7104ce9438b0b9309afcd2d34" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" },
|
||||
"cmp-fish": { "branch": "main", "commit": "8ae7bfb1b3251d433c4adf4e64396ef929fbd91f" },
|
||||
|
@ -16,37 +16,37 @@
|
|||
"dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
|
||||
"emmylua-nvim": { "branch": "master", "commit": "6526f8b9bc7b5d26c1192f22ca47f4a7e6b91e7f" },
|
||||
"emmylua-nvim": { "branch": "master", "commit": "a5fad5e29440b8e49c65302175464c8339692844" },
|
||||
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
|
||||
"flatten.nvim": { "branch": "main", "commit": "92c59ae6200e6b04aff167577ebb8a9035a6d2b3" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "5cc1f45c6aac699ad008fb85f6ae03236062667d" },
|
||||
"git-conflict.nvim": { "branch": "main", "commit": "4c8e252b87d54d944c1e56bfb477f78b6fdaf661" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
|
||||
"headlines.nvim": { "branch": "master", "commit": "d39c4e6ed8963717bc9b2dc39fada8fe1039e9bf" },
|
||||
"heirline.nvim": { "branch": "master", "commit": "1b6f12e011f225a26aa162905cbf68804479e7e6" },
|
||||
"heirline.nvim": { "branch": "master", "commit": "bc8d90ef33e21624038aed81e416f5689cf3cc85" },
|
||||
"inc-rename.nvim": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" },
|
||||
"iswap.nvim": { "branch": "master", "commit": "0a77d73eb7a0ae408a1d384d61f6251b90c4bd23" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" },
|
||||
"lsp_lines.nvim": { "branch": "main", "commit": "cf2306dd332e34a3e91075b40bdd4f6db824b2ee" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mini.ai": { "branch": "main", "commit": "3ad9d455a91b8bf3c24d4e50518d9a6b9dddb42c" },
|
||||
"mini.align": { "branch": "main", "commit": "20f5a1a93d86a7e82eaca9334212e54058ef3562" },
|
||||
"mini.animate": { "branch": "main", "commit": "6cec625114007527ff8a82316dba858046f9746f" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "020243bfed8c8b941f2c20626faf3ea39c0c0e1b" },
|
||||
"mini.comment": { "branch": "main", "commit": "b0b359ada4293cdcea7ab4072dfd5b031aac3f8e" },
|
||||
"mini.move": { "branch": "main", "commit": "03a16d64e58da0a871de6493c3d8fa1101baef46" },
|
||||
"mini.pairs": { "branch": "main", "commit": "552062017ff207e1f35f7028bfb3f27c7421d22d" },
|
||||
"mini.surround": { "branch": "main", "commit": "5ceb6a12d3761bc719fbdad5432c89333deb1498" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "cfe1920c5dfb0524b3a13e827c35b6eb571143aa" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "ccf3c1c9bf7f4dbd5d26158b8934a6d8ee631ca2" },
|
||||
"mini.ai": { "branch": "main", "commit": "858cee0a97726c7941e3b5ef8d0e1cbefe35890a" },
|
||||
"mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" },
|
||||
"mini.animate": { "branch": "main", "commit": "82519630b2760ffc516ebc387bef632f9c07b9f5" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" },
|
||||
"mini.comment": { "branch": "main", "commit": "68a1e9de2ea47268205503ab1dcd48ff79648251" },
|
||||
"mini.move": { "branch": "main", "commit": "251d541a8ab745e81295a53c128829cb2bff18e3" },
|
||||
"mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" },
|
||||
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
|
||||
"neo-tree.nvim": { "branch": "main", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "660ebf093c63271c546d6c9994d48a17f5beac81" },
|
||||
"neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
|
||||
"neogit": { "branch": "master", "commit": "536b4cfc009fc6d8bd771f010f04d48204533fae" },
|
||||
"neotest": { "branch": "master", "commit": "89a5b1fc22ee5d459262955fe564c3d14e35fd67" },
|
||||
"neotest-go": { "branch": "main", "commit": "17579611af5d47bea5ff4d77e6493a6d647d3a15" },
|
||||
"neotest-jest": { "branch": "main", "commit": "a394106cf053eef86d65ae04c4b93a1a7bd60aef" },
|
||||
"neotest-go": { "branch": "main", "commit": "ba5d536304ed6971f00d16b48ec26997622ffb43" },
|
||||
"neotest-jest": { "branch": "main", "commit": "c2118446d770fedb360a91b1d91a7025db86d4f1" },
|
||||
"neotest-python": { "branch": "master", "commit": "2e83d2bc00acbcc1fd529dbf0a0e677cabfe6b50" },
|
||||
"neotest-vitest": { "branch": "main", "commit": "87e91bfd9419a8c74bf0d105e2ae31b9692daf0b" },
|
||||
"neotest-vitest": { "branch": "main", "commit": "75bb96b8b18adcf5152fdb8a9342373a20a463ce" },
|
||||
"neotest-zig": { "branch": "main", "commit": "742f97f971a39d44b4832b432083608834a0e59c" },
|
||||
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
|
||||
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
|
||||
|
@ -58,17 +58,16 @@
|
|||
"nvim-dap-ui": { "branch": "master", "commit": "d845ebd798ad1cf30aa4abd4c4eff795cdcfdd4f" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "d4542ac257d3c7ee4131350db6179ae6340ce40b" },
|
||||
"nvim-lint": { "branch": "master", "commit": "966ab3dc37eee3e413692264b44a3011b05a6060" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "1bc83418927003552505ec66fa5d6cffae953f6a" },
|
||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "e655c96cf00f7b783871b3787187ed3fa25ff64e" },
|
||||
"nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" },
|
||||
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "6a0785ef64c839d935a2f92e20988e962fb6537e" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "cbf0dfd92f3149a378164ab781d0b0a13da5b04a" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "9c06b115abc57c99cf0aa81dc29490f5001f57a1" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "10d79b5dbbdffc3edf307b189284fb62e2e79a3e" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "f2ef98cd18fca352448756d3feb6e58d82583274" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "dd0b2036c3a27cb6e6486f8bd24188c6ca43af0b" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "313d9e7193354c5de7cdb1724f9e2d3f442780b0" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" },
|
||||
"nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" },
|
||||
"oil.nvim": { "branch": "master", "commit": "bf753c3e3f8736939ad5597f92329dfe7b1df4f5" },
|
||||
"orgmode": { "branch": "master", "commit": "ab045e3084d5987e8939d25d69b09baaf762278c" },
|
||||
|
@ -78,28 +77,28 @@
|
|||
"persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
|
||||
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "ca8d5ee2b4ee1eec491040a7601d366ddc8a2e02" },
|
||||
"rest.nvim": { "branch": "main", "commit": "2d7bd3d398940ce2692941e6cd052c072207b9f9" },
|
||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "586f44d21ef687a4d41b5b24c1566d686ae84250" },
|
||||
"rest.nvim": { "branch": "main", "commit": "9741f827bd88b588e5136d67c7963e1904f8f1f7" },
|
||||
"scope.nvim": { "branch": "main", "commit": "cd27af77ad61a7199af5c28d27013fb956eb0e3e" },
|
||||
"sniprun": { "branch": "master", "commit": "0079f9c4675a6825f84e108bbff866f67dd8762f" },
|
||||
"ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
|
||||
"stickybuf.nvim": { "branch": "master", "commit": "2160fcd536d81f5fa43f7167dba6634e814e3154" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "6dd6522bc1a4cbe5883eb0272f5cc7a54ae3858b" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "26b5e86cb8509a3ca2ebaa652630396c8e3396b2" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope-symbols.nvim": { "branch": "master", "commit": "a6d0127a53d39b9fc2af75bd169d288166118aec" },
|
||||
"telescope-tabs": { "branch": "master", "commit": "c3572358e60817f40f0de31bc01906af0993d4c4" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "236083884cfe6c874e03e6cb4e7cb08809c1333c" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "0f865f17af4f9bc1587a0132414cdfd32d91852e" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "b49df5cdce67a8964d1b027dae94bde212092b51" },
|
||||
"treesj": { "branch": "main", "commit": "bc5176397e225863b24612bb2df1f30b1febdb64" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
|
||||
"treesj": { "branch": "main", "commit": "60e27280030f9cd8dfb6ceb335922c6ff76682cc" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
|
||||
"twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" },
|
||||
"undotree": { "branch": "master", "commit": "7df3be7a261ea31b528aa442b494fcb458f3d968" },
|
||||
"undotree": { "branch": "master", "commit": "9dbbf3b7d19dda0d22ceca461818e4739ad8154d" },
|
||||
"venn.nvim": { "branch": "main", "commit": "e4d68341a73dd56c64955058821a58295fb337b1" },
|
||||
"vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" },
|
||||
"vim-matchup": { "branch": "master", "commit": "7f81ae12542b2a35819f0324895df9bd8626c8ba" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "ab5acd23f39347bab04904df2177e114bffb97a8" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
|
||||
"zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
|
||||
}
|
|
@ -67,9 +67,7 @@ map('n', '[w', diagnostic_goto(false, 'WARN'), { desc = 'Previous warning' })
|
|||
-- toggle LSP settings
|
||||
map('n', '<leader>ud', require('user.plugins.lsp.lspconfig.diagnostic').toggle, { desc = 'Toggle diagnostics' })
|
||||
map('n', '<leader>uv', require('user.plugins.lsp.lspconfig.diagnostic').toggle_virtual_lines, { desc = 'Toggle virtual lines diagnostics' })
|
||||
if vim.lsp.inlay_hint then
|
||||
map('n', '<leader>uy', function() vim.lsp.inlay_hint(0, nil) end, { desc = 'Toggle inlay hints' })
|
||||
end
|
||||
map('n', '<leader>uy', function() vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled()) end, { desc = 'Toggle inlay hints' })
|
||||
|
||||
-- toggle editor settings
|
||||
map('n', '<leader>ur', function() util.toggle('relativenumber', true) end, { desc = 'Toggle relativenumber' })
|
||||
|
|
|
@ -46,7 +46,7 @@ M.icons = {
|
|||
LogPoint = ' ',
|
||||
},
|
||||
kind = {
|
||||
-- aerial.nvim, nvim-navic
|
||||
-- aerial.nvim, neotree
|
||||
File = { icon = '', hl = '@string.special.path' },
|
||||
Module = { icon = '', hl = '@module' },
|
||||
Namespace = { icon = '', hl = '@module' },
|
||||
|
|
|
@ -25,7 +25,7 @@ end
|
|||
dap.adapters.lldb = {
|
||||
name = 'lldb',
|
||||
type = 'executable',
|
||||
command = '/usr/bin/lldb-vscode', -- NOTE: will change to `lldb-dap` in future llvm releases
|
||||
command = '/usr/bin/lldb-vscode', -- TODO: will change to `lldb-dap` in future llvm releases
|
||||
}
|
||||
|
||||
dap.configurations.zig = {
|
||||
|
|
|
@ -44,7 +44,7 @@ return {
|
|||
{ '<BS>', desc = 'Decrement selection', mode = 'x' },
|
||||
},
|
||||
dependencies = {
|
||||
'HiPhish/rainbow-delimiters.nvim',
|
||||
'hiphish/rainbow-delimiters.nvim',
|
||||
{ 'LiadOz/nvim-dap-repl-highlights', config = true },
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
|
|
|
@ -4,7 +4,7 @@ local icons = {}
|
|||
for name, val in pairs(vars.icons.kind) do
|
||||
if val.hl ~= nil then
|
||||
icons[name] = val.icon .. ' '
|
||||
vim.api.nvim_set_hl(0, 'Aerial' .. name .. 'Icon', { link = val.hl })
|
||||
vim.api.nvim_set_hl(0, string.format('Aerial%sIcon', name), { link = val.hl })
|
||||
end
|
||||
end
|
||||
icons['Collapsed'] = '▶'
|
||||
|
@ -24,4 +24,9 @@ return {
|
|||
win_opts = { winblend = 0 },
|
||||
keymaps = { ['q'] = 'actions.close' },
|
||||
},
|
||||
lsp = {
|
||||
priority = {
|
||||
templ = 5, -- put it lower than the default 10
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -17,12 +17,10 @@ return {
|
|||
go = { 'goimports', 'gofumpt' },
|
||||
sh = { 'shfmt' },
|
||||
sql = { 'sql_formatter' },
|
||||
-- yaml = { 'yamlfmt' },
|
||||
-- ['yaml.ansible'] = { 'yamlfmt' },
|
||||
lua = { 'stylua' },
|
||||
c = { 'clang_format' },
|
||||
cpp = { 'clang_format' },
|
||||
-- rego = { 'opa_fmt' },
|
||||
rego = { 'opa_fmt' },
|
||||
-- ['*'] = { 'codespell' },
|
||||
},
|
||||
formatters = {
|
||||
|
|
|
@ -8,12 +8,6 @@ return {
|
|||
'b0o/SchemaStore.nvim',
|
||||
{ 'folke/neoconf.nvim', cmd = 'Neoconf', config = true },
|
||||
{ 'https://git.sr.ht/~whynothugo/lsp_lines.nvim', config = true },
|
||||
{
|
||||
'SmiteshP/nvim-navic',
|
||||
config = function()
|
||||
require('user.plugins.lsp.navic')
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require('user.plugins.lsp.lspconfig')
|
||||
|
|
|
@ -13,18 +13,11 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||
-- Key bindings
|
||||
require('user.plugins.lsp.lspconfig.keymap').on_attach(client, buffer)
|
||||
|
||||
-- Symbol context on winbar
|
||||
if client.supports_method('textDocument/documentSymbol') then
|
||||
require('nvim-navic').attach(client, buffer)
|
||||
end
|
||||
|
||||
-- Inlay hints
|
||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
||||
if vars.lsp_inlay_hints and inlay_hint then
|
||||
if client.supports_method('textDocument/inlayHint') then
|
||||
inlay_hint(buffer, true)
|
||||
end
|
||||
end
|
||||
-- TODO: uncomment when nvim-0.10.0 is out
|
||||
-- if vars.lsp_inlay_hints and client.supports_method('textDocument/inlayHint') then
|
||||
-- vim.lsp.inlay_hint.enable(buffer)
|
||||
-- end
|
||||
|
||||
-- Bulb for code action hint in statusbar
|
||||
if client.supports_method('textDocument/codeAction') then
|
||||
|
@ -61,7 +54,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||
})
|
||||
end
|
||||
|
||||
-- Specific tweaks for some servers
|
||||
-- Prefer hover capability from other LSP servers (pylsp/pyright/pylyzer)
|
||||
if client.name == 'ruff_lsp' then
|
||||
client.server_capabilities.hoverProvider = false
|
||||
end
|
||||
|
|
|
@ -100,17 +100,6 @@ return {
|
|||
|
||||
gleam = {},
|
||||
|
||||
-- this uses a project's local instance of glint-language-server
|
||||
-- Ref: https://typed-ember.gitbook.io/glint/getting-started
|
||||
-- glint = {
|
||||
-- filetypes = {
|
||||
-- 'handlebars',
|
||||
-- 'html.handlebars',
|
||||
-- 'typescript.glimmer',
|
||||
-- 'javascript.glimmer',
|
||||
-- },
|
||||
-- },
|
||||
|
||||
-- NOTE: for Bazel setup (GOPACKAGESDRIVER), use neoconf.nvim
|
||||
-- Ref: https://github.com/bazelbuild/rules_go/wiki/Editor-setup
|
||||
gopls = {
|
||||
|
@ -147,6 +136,7 @@ return {
|
|||
},
|
||||
usePlaceholders = true,
|
||||
staticcheck = true,
|
||||
-- semanticTokens = true,
|
||||
vulncheck = 'Imports',
|
||||
directoryFilters = {
|
||||
'-.git',
|
||||
|
@ -167,6 +157,11 @@ return {
|
|||
|
||||
graphql = { cmd = { servers_path .. '/graphql/node_modules/.bin/graphql-lsp', 'server', '-m', 'stream' } },
|
||||
|
||||
guile_ls = {
|
||||
filetypes = { 'scheme' },
|
||||
root_dir = lsputil.root_pattern('guix.scm', 'manifest.scm', '.guix-channel', '.git'),
|
||||
},
|
||||
|
||||
html = { cmd = { servers_path .. '/vscode/node_modules/.bin/vscode-html-language-server', '--stdio' } },
|
||||
|
||||
jsonls = {
|
||||
|
@ -182,16 +177,18 @@ return {
|
|||
|
||||
jsonnet_ls = {},
|
||||
|
||||
-- ltex = {
|
||||
-- settings = {
|
||||
-- ltex = {
|
||||
-- dictionary = {
|
||||
-- ['en-US'] = read_dict(vim.fn.stdpath('config') .. '/spell/en.utf-8.add'),
|
||||
-- },
|
||||
-- completionEnabled = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
koka = {},
|
||||
|
||||
ltex = {
|
||||
settings = {
|
||||
ltex = {
|
||||
dictionary = {
|
||||
['en-US'] = read_dict(vim.fn.stdpath('config') .. '/spell/en.utf-8.add'),
|
||||
},
|
||||
completionEnabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
lua_ls = {
|
||||
settings = {
|
||||
|
@ -210,12 +207,13 @@ return {
|
|||
|
||||
mdx_analyzer = {
|
||||
cmd = { servers_path .. '/mdx_analyzer/node_modules/.bin/mdx-language-server', '--stdio' },
|
||||
root_dir =lsputil.root_pattern('package.json', 'tsconfig.json'),
|
||||
root_dir = lsputil.root_pattern('package.json', 'tsconfig.json'),
|
||||
},
|
||||
|
||||
nickel_ls = { single_file_support = true },
|
||||
|
||||
nil_ls = {
|
||||
root_dir = lsputil.root_pattern('.git', 'flake.lock'),
|
||||
settings = {
|
||||
['nil'] = {
|
||||
formatting = { command = { 'nixpkgs-fmt' } },
|
||||
|
@ -224,14 +222,7 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
-- nixd = {
|
||||
-- settings = {
|
||||
-- nixd = {
|
||||
-- formatting = { command = "nixpkgs-fmt" },
|
||||
-- options = { enable = true },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
nushell = {},
|
||||
|
||||
-- TODO: implement handlers for LSP extensions
|
||||
-- Ref: https://github.com/ocaml/ocaml-lsp#lsp-extensions
|
||||
|
@ -266,6 +257,7 @@ return {
|
|||
|
||||
ruff_lsp = { cmd = { servers_path .. '/ruff_lsp/bin/ruff-lsp' } },
|
||||
|
||||
-- TODO: look into the maintained version of sqls
|
||||
sqlls = { cmd = { servers_path .. '/sqlls/node_modules/.bin/sql-language-server', 'up', '--method', 'stdio' } },
|
||||
|
||||
svelte = { cmd = { servers_path .. '/svelte/node_modules/.bin/svelteserver', '--stdio' } },
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
local lspkind_icons = require('user.config.vars').icons.kind
|
||||
|
||||
local navic_icons = {}
|
||||
for key, val in pairs(lspkind_icons) do
|
||||
if val.hl ~= nil then
|
||||
navic_icons[key] = val.icon .. ' '
|
||||
vim.api.nvim_set_hl(0, 'NavicIcons' .. key, { link = val.hl })
|
||||
end
|
||||
end
|
||||
|
||||
require('nvim-navic').setup {
|
||||
icons = navic_icons,
|
||||
highlight = true,
|
||||
separator = ' ',
|
||||
depth_limit = 0,
|
||||
depth_limit_indicator = '..',
|
||||
lazy_update_context = true,
|
||||
}
|
|
@ -5,69 +5,70 @@ local misc_utils = require('user.util.misc')
|
|||
local lsp_utils = require('user.util.lsp')
|
||||
local vars = require('user.config.vars')
|
||||
|
||||
M.align = { provider = '%=' }
|
||||
|
||||
M.dummy = { provider = '▊ ', hl = { fg = 'blue' } }
|
||||
|
||||
local vi_mode = {
|
||||
n = { name = 'NORMAL', color = 'green' },
|
||||
no = { name = 'OP', color = 'green' },
|
||||
nov = { name = 'OP(v)', color = 'green' },
|
||||
noV = { name = 'OP(V)', color = 'green' },
|
||||
['no\22'] = { name = 'OP(^V)', color = 'green' },
|
||||
niI = { name = 'NORMAL(I)', color = 'green' },
|
||||
niR = { name = 'NORMAL(R)', color = 'green' },
|
||||
niV = { name = 'NORMAL(V)', color = 'green' },
|
||||
nt = { name = 'NORMAL(T)', color = 'green' },
|
||||
ntT = { name = 'NORMAL(T)', color = 'green' },
|
||||
v = { name = 'VISUAL', color = 'yellow' },
|
||||
vs = { name = 'VISUAL(s)', color = 'yellow' },
|
||||
V = { name = 'V-LINE', color = 'yellow' },
|
||||
Vs = { name = 'V-LINE(s)', color = 'yellow' },
|
||||
['\22'] = { name = 'V-BLOCK', color = 'yellow' },
|
||||
['\22s'] = { name = 'V-BLOCK(s)', color = 'yellow' },
|
||||
s = { name = 'SELECT', color = 'orange' },
|
||||
S = { name = 'S-LINE', color = 'orange' },
|
||||
['\19'] = { name = 'S-BLOCK', color = 'orange' },
|
||||
i = { name = 'INSERT', color = 'blue' },
|
||||
ic = { name = 'INSERT(c)', color = 'blue' },
|
||||
ix = { name = 'INSERT(x)', color = 'blue' },
|
||||
R = { name = 'REPLACE', color = 'red' },
|
||||
Rc = { name = 'REPLACE(c)', color = 'red' },
|
||||
Rx = { name = 'REPLACE(x)', color = 'red' },
|
||||
Rv = { name = 'REPLACE(v)', color = 'red' },
|
||||
Rvc = { name = 'REPLACE(vc)', color = 'red' },
|
||||
Rvx = { name = 'REPLACE(vx)', color = 'red' },
|
||||
c = { name = 'COMMAND', color = 'purple' },
|
||||
cv = { name = 'EX', color = 'purple' },
|
||||
r = { name = 'ENTER', color = 'cyan' },
|
||||
rm = { name = 'MORE', color = 'cyan' },
|
||||
['r?'] = { name = 'CONFIRM', color = 'cyan' },
|
||||
['!'] = { name = 'SHELL', color = 'fg' },
|
||||
t = { name = 'TERM', color = 'fg' },
|
||||
}
|
||||
local get_vi_mode = function(spec)
|
||||
local vals = {}
|
||||
for k, v in pairs(vi_mode) do
|
||||
vals[k] = v[spec]
|
||||
end
|
||||
return vals
|
||||
end
|
||||
|
||||
M.vi_mode = {
|
||||
init = function(self)
|
||||
self.mode = vim.fn.mode(1)
|
||||
self.mode_color = self.mode_colors[self.mode:sub(1, 1)]
|
||||
end,
|
||||
static = {
|
||||
mode_names = get_vi_mode('name'),
|
||||
mode_colors = get_vi_mode('color'),
|
||||
mode_names = {
|
||||
n = 'NORMAL',
|
||||
no = 'OP',
|
||||
nov = 'OP(v)',
|
||||
noV = 'OP(V)',
|
||||
['no\22'] = 'OP(^V)',
|
||||
niI = 'NORMAL(I)',
|
||||
niR = 'NORMAL(R)',
|
||||
niV = 'NORMAL(V)',
|
||||
nt = 'NORMAL(T)',
|
||||
ntT = 'NORMAL(T)',
|
||||
v = 'VISUAL',
|
||||
vs = 'VISUAL(s)',
|
||||
V = 'V-LINE',
|
||||
Vs = 'V-LINE(s)',
|
||||
['\22'] = 'V-BLOCK',
|
||||
['\22s'] = 'V-BLOCK(s)',
|
||||
s = 'SELECT',
|
||||
S = 'S-LINE',
|
||||
['\19'] = 'S-BLOCK',
|
||||
i = 'INSERT',
|
||||
ic = 'INSERT(c)',
|
||||
ix = 'INSERT(x)',
|
||||
R = 'REPLACE',
|
||||
Rc = 'REPLACE(c)',
|
||||
Rx = 'REPLACE(x)',
|
||||
Rv = 'REPLACE(v)',
|
||||
Rvc = 'REPLACE(vc)',
|
||||
Rvx = 'REPLACE(vx)',
|
||||
c = 'COMMAND',
|
||||
cv = 'EX',
|
||||
r = 'ENTER',
|
||||
rm = 'MORE',
|
||||
['r?'] = 'CONFIRM',
|
||||
['!'] = 'SHELL',
|
||||
t = 'TERM',
|
||||
},
|
||||
mode_colors = {
|
||||
n = 'green',
|
||||
v = 'yellow',
|
||||
V = 'yellow',
|
||||
['\22'] = 'yellow',
|
||||
s = 'orange',
|
||||
S = 'orange',
|
||||
['\19'] = 'yellow',
|
||||
i = 'blue',
|
||||
R = 'red',
|
||||
c = 'purple',
|
||||
r = 'cyan',
|
||||
['!'] = 'fg',
|
||||
t = 'fg',
|
||||
},
|
||||
},
|
||||
provider = function(self)
|
||||
return ' ' .. self.mode_names[self.mode] .. ' '
|
||||
end,
|
||||
hl = function(self)
|
||||
local mode = self.mode:sub(1, 1)
|
||||
return { fg = self.mode_colors[mode], bold = true }
|
||||
return { fg = self.mode_color, bold = true }
|
||||
end,
|
||||
update = {
|
||||
'ModeChanged',
|
||||
|
@ -128,40 +129,43 @@ M.file_encoding = {
|
|||
hl = { fg = 'fg' },
|
||||
}
|
||||
|
||||
local file_common = {
|
||||
M.file_info = {
|
||||
init = function(self)
|
||||
self.filename = vim.api.nvim_buf_get_name(0)
|
||||
end,
|
||||
}
|
||||
local file_icon = {
|
||||
init = function(self)
|
||||
local filename = self.filename
|
||||
local extension = vim.fn.fnamemodify(filename, ':e')
|
||||
self.icon, self.icon_color =
|
||||
require('nvim-web-devicons').get_icon_color(filename, extension, { default = true })
|
||||
end,
|
||||
provider = function(self)
|
||||
return self.icon and (self.icon .. ' ')
|
||||
end,
|
||||
hl = function(self)
|
||||
return { fg = self.icon_color and self.icon_color or 'fg' }
|
||||
end,
|
||||
}
|
||||
local file_name = {
|
||||
provider = function(self)
|
||||
if self.filename == '' then
|
||||
return '[No Name]'
|
||||
end
|
||||
return vim.fn.fnamemodify(self.filename, ':p:t')
|
||||
end,
|
||||
hl = function()
|
||||
if vim.bo.modified then
|
||||
return { fg = 'cyan', bold = true }
|
||||
end
|
||||
return { fg = 'blue', bold = true }
|
||||
end,
|
||||
}
|
||||
local file_flags = {
|
||||
{
|
||||
init = function(self)
|
||||
local extension = vim.fn.fnamemodify(self.filename, ':e')
|
||||
self.icon, self.icon_color =
|
||||
require('nvim-web-devicons').get_icon_color(self.filename, extension, { default = true })
|
||||
end,
|
||||
provider = function(self)
|
||||
return self.icon and (self.icon .. ' ')
|
||||
end,
|
||||
hl = function(self)
|
||||
return { fg = self.icon_color and self.icon_color or 'fg' }
|
||||
end,
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
if self.filename == '' then
|
||||
return '[No Name]'
|
||||
end
|
||||
return vim.fn.fnamemodify(self.filename, ':p:t')
|
||||
end,
|
||||
on_click = {
|
||||
callback = function()
|
||||
require('telescope.builtin').find_files()
|
||||
end,
|
||||
name = 'heirline_file_name',
|
||||
},
|
||||
hl = function()
|
||||
if vim.bo.modified then
|
||||
return { fg = 'cyan', bold = true }
|
||||
end
|
||||
return { fg = 'blue', bold = true }
|
||||
end,
|
||||
},
|
||||
{
|
||||
condition = function()
|
||||
return vim.bo.modified
|
||||
|
@ -176,11 +180,11 @@ local file_flags = {
|
|||
provider = ' ',
|
||||
hl = { fg = 'red' },
|
||||
},
|
||||
{ provider = '%<' },
|
||||
}
|
||||
M.file_info = utils.insert(file_common, file_icon, file_name, file_flags, { provider = '%<' })
|
||||
|
||||
M.ruler = {
|
||||
provider = '%7(%l/%3L%):%2c %P',
|
||||
provider = ' %7(%l/%3L%):%2c %P',
|
||||
hl = { fg = 'fg' },
|
||||
}
|
||||
|
||||
|
@ -195,6 +199,14 @@ M.lsp_servers = {
|
|||
|
||||
return ' [' .. table.concat(clients, ', ') .. ']'
|
||||
end,
|
||||
on_click = {
|
||||
callback = function()
|
||||
vim.defer_fn(function()
|
||||
vim.cmd('LspInfo')
|
||||
end, 100)
|
||||
end,
|
||||
name = 'heirline_lsp_servers',
|
||||
},
|
||||
hl = { fg = 'purple' },
|
||||
}
|
||||
|
||||
|
@ -223,17 +235,104 @@ M.linters_formatters = {
|
|||
hl = { fg = 'cyan' },
|
||||
}
|
||||
|
||||
M.navic = {
|
||||
condition = function()
|
||||
if not misc_utils.loaded('nvim-navic') then
|
||||
return false
|
||||
end
|
||||
return require('nvim-navic').is_available()
|
||||
end,
|
||||
provider = function()
|
||||
return require('nvim-navic').get_location()
|
||||
end,
|
||||
M.aerial = {
|
||||
flexible = 3,
|
||||
hl = 'Normal',
|
||||
update = 'CursorMoved',
|
||||
condition = function()
|
||||
return conditions.lsp_attached or misc_utils.loaded('nvim-treesitter')
|
||||
end,
|
||||
static = {
|
||||
encode_pos = function(line, col, winnr)
|
||||
return bit.bor(bit.lshift(line, 16), bit.lshift(col, 6), winnr)
|
||||
end,
|
||||
decode_pos = function(c)
|
||||
return bit.rshift(c, 16), bit.band(bit.rshift(c, 6), 1023), bit.band(c, 63)
|
||||
end,
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local data = require('aerial').get_location(true) or {}
|
||||
local children = {}
|
||||
|
||||
-- create a child for each level
|
||||
for i, d in ipairs(data) do
|
||||
local hlgroup = string.format('Aerial%sIcon', d.kind)
|
||||
local child = {
|
||||
{
|
||||
provider = string.format('%s', d.icon),
|
||||
hl = vim.fn.hlexists(hlgroup) == 1 and hlgroup or nil,
|
||||
},
|
||||
{ provider = string.gsub(d.name, '%%', '%%%%'):gsub('%s*->%s*', '') },
|
||||
on_click = {
|
||||
minwid = self.encode_pos(d.lnum, d.col, self.winnr),
|
||||
callback = function(_, minwid)
|
||||
local lnum, col, winnr = self.decode_pos(minwid)
|
||||
vim.api.nvim_win_set_cursor(vim.fn.win_getid(winnr), { lnum, col })
|
||||
end,
|
||||
name = 'heirline_aerial',
|
||||
},
|
||||
}
|
||||
|
||||
if #data >= 1 and i < #data then
|
||||
table.insert(child, { provider = ' > ', hl = { fg = 'cyan' } })
|
||||
end
|
||||
|
||||
table.insert(children, child)
|
||||
end
|
||||
|
||||
-- instantiate the new child, overwriting the previous one
|
||||
self[1] = self:new(children, 1)
|
||||
end,
|
||||
},
|
||||
{ provider = '' },
|
||||
}
|
||||
|
||||
local function overseer_tasks_for_status(status)
|
||||
return {
|
||||
condition = function(self)
|
||||
return self.tasks[status]
|
||||
end,
|
||||
provider = function(self)
|
||||
return string.format('%s%d', self.symbols[status], #self.tasks[status])
|
||||
end,
|
||||
hl = function(self)
|
||||
return { fg = self.colors[status] }
|
||||
end,
|
||||
}
|
||||
end
|
||||
M.overseer = {
|
||||
condition = function()
|
||||
return misc_utils.loaded('overseer.nvim')
|
||||
end,
|
||||
init = function(self)
|
||||
local tasks = require('overseer.task_list').list_tasks { unique = true }
|
||||
self.tasks = require('overseer.util').tbl_group_by(tasks, 'status')
|
||||
end,
|
||||
static = {
|
||||
symbols = {
|
||||
CANCELED = ' ',
|
||||
FAILURE = ' ',
|
||||
RUNNING = ' ',
|
||||
SUCCESS = ' ',
|
||||
},
|
||||
colors = {
|
||||
CANCELED = 'highlight',
|
||||
FAILURE = 'red',
|
||||
RUNNING = 'yellow',
|
||||
SUCCESS = 'green',
|
||||
},
|
||||
},
|
||||
overseer_tasks_for_status('CANCELED'),
|
||||
overseer_tasks_for_status('RUNNING'),
|
||||
overseer_tasks_for_status('SUCCESS'),
|
||||
overseer_tasks_for_status('FAILURE'),
|
||||
on_click = {
|
||||
callback = function()
|
||||
require('neotest').run.run_last()
|
||||
end,
|
||||
name = 'heirline_overseer',
|
||||
},
|
||||
}
|
||||
|
||||
M.diagnostics = {
|
||||
|
@ -245,27 +344,48 @@ M.diagnostics = {
|
|||
self.hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT })
|
||||
self.infos = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })
|
||||
end,
|
||||
on_click = {
|
||||
callback = function()
|
||||
require('telescope.builtin').diagnostics {
|
||||
layout_strategy = 'center',
|
||||
bufnr = 0,
|
||||
}
|
||||
end,
|
||||
name = 'heirline_diagnostics',
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.errors > 0
|
||||
end,
|
||||
provider = function(self)
|
||||
return self.errors > 0 and (' ' .. vars.icons.notify.error .. ' ' .. self.errors)
|
||||
return ' ' .. vars.icons.notify.error .. ' ' .. self.errors
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiagnosticError').fg },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.warnings > 0
|
||||
end,
|
||||
provider = function(self)
|
||||
return self.warnings > 0 and (' ' .. vars.icons.notify.warn .. ' ' .. self.warnings)
|
||||
return ' ' .. vars.icons.notify.warn .. ' ' .. self.warnings
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiagnosticWarn').fg },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.hints > 0
|
||||
end,
|
||||
provider = function(self)
|
||||
return self.hints > 0 and (' ' .. vars.icons.notify.hint .. ' ' .. self.hints)
|
||||
return ' ' .. vars.icons.notify.hint .. ' ' .. self.hints
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiagnosticHint').fg },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.infos > 0
|
||||
end,
|
||||
provider = function(self)
|
||||
return self.infos > 0 and (' ' .. vars.icons.notify.info .. ' ' .. self.infos)
|
||||
return ' ' .. vars.icons.notify.info .. ' ' .. self.infos
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiagnosticInfo').fg },
|
||||
},
|
||||
|
@ -273,12 +393,20 @@ M.diagnostics = {
|
|||
|
||||
M.code_action = {
|
||||
condition = conditions.lsp_attached,
|
||||
update = { 'CursorMoved', 'LspAttach' },
|
||||
update = { 'CursorMoved' },
|
||||
provider = function()
|
||||
if vim.b.has_code_action_text then
|
||||
if vim.b.has_code_action_text ~= nil then
|
||||
return ' ' .. vim.b.has_code_action_text
|
||||
end
|
||||
end,
|
||||
on_click = {
|
||||
callback = function()
|
||||
vim.defer_fn(function()
|
||||
return vim.lsp.buf.code_action()
|
||||
end, 100)
|
||||
end,
|
||||
name = 'heirline_code_action',
|
||||
},
|
||||
hl = { fg = 'cyan', bold = true },
|
||||
}
|
||||
|
||||
|
@ -286,50 +414,50 @@ M.git = {
|
|||
condition = conditions.is_git_repo,
|
||||
init = function(self)
|
||||
self.status_dict = vim.b.gitsigns_status_dict
|
||||
self.has_changes = self.status_dict.added ~= 0 or self.status_dict.removed ~= 0 or self.status_dict.changed ~= 0
|
||||
end,
|
||||
hl = { fg = 'green', bold = true },
|
||||
{
|
||||
provider = function(self)
|
||||
return ' ' .. self.status_dict.head
|
||||
return ' ' .. (self.status_dict.head == '' and 'main' or self.status_dict.head)
|
||||
end,
|
||||
on_click = {
|
||||
name = 'heirline_git_branch',
|
||||
callback = function()
|
||||
require('telescope.builtin').git_branches()
|
||||
end,
|
||||
},
|
||||
hl = { fg = 'green', bold = true },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.has_changes
|
||||
return self.status_dict.added ~= 0 or self.status_dict.removed ~= 0 or self.status_dict.changed ~= 0
|
||||
end,
|
||||
provider = '(',
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.added or 0
|
||||
return count > 0 and ('+' .. count)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiffAdd').fg },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.removed or 0
|
||||
return count > 0 and ('-' .. count)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiffDelete').fg },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.changed or 0
|
||||
return count > 0 and ('~' .. count)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiffChange').fg },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.has_changes
|
||||
end,
|
||||
provider = ')',
|
||||
{ provider = '(', hl = { fg = 'green', bold = true } },
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.added or 0
|
||||
return count > 0 and ('+' .. count)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiffAdd').fg },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.removed or 0
|
||||
return count > 0 and ('-' .. count)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiffDelete').fg },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.changed or 0
|
||||
return count > 0 and ('~' .. count)
|
||||
end,
|
||||
hl = { fg = utils.get_highlight('DiffChange').fg },
|
||||
},
|
||||
{ provider = ')', hl = { fg = 'green', bold = true } },
|
||||
},
|
||||
}
|
||||
|
||||
M.debugger = {
|
||||
M.dap = {
|
||||
condition = function()
|
||||
if not misc_utils.loaded('nvim-dap') then
|
||||
return false
|
||||
|
@ -337,9 +465,15 @@ M.debugger = {
|
|||
return require('dap').session() ~= nil
|
||||
end,
|
||||
provider = function()
|
||||
return ' ' .. require('dap').status()
|
||||
return ' ' .. require('dap').status()
|
||||
end,
|
||||
hl = { fg = 'purple', bold = true },
|
||||
on_click = {
|
||||
callback = function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
name = 'heirline_dap',
|
||||
},
|
||||
hl = { fg = 'red', bold = true },
|
||||
}
|
||||
|
||||
M.macro = {
|
||||
|
|
|
@ -27,12 +27,7 @@ local excluded_ft = {
|
|||
|
||||
require('heirline').setup {
|
||||
statusline = {
|
||||
hl = function()
|
||||
if conditions.is_active() then
|
||||
return 'StatusLine'
|
||||
end
|
||||
return 'StatusLineNC'
|
||||
end,
|
||||
hl = conditions.is_active() and 'StatusLine' or 'StatusLineNC',
|
||||
fallthrough = false,
|
||||
-- Statusline for special buffers
|
||||
{
|
||||
|
@ -42,47 +37,30 @@ require('heirline').setup {
|
|||
filetype = excluded_ft,
|
||||
}
|
||||
end,
|
||||
{ components.file_info, flexible = 1 },
|
||||
components.align,
|
||||
{ components.file_type, flexible = 3 },
|
||||
},
|
||||
-- Inactive statusline
|
||||
{
|
||||
condition = function()
|
||||
return not conditions.is_active()
|
||||
end,
|
||||
components.dummy,
|
||||
components.file_size,
|
||||
{ components.file_info, flexible = 1 },
|
||||
components.align,
|
||||
{ components.file_format, flexible = 2 },
|
||||
{ components.file_encoding, flexible = 3 },
|
||||
{ components.file_type, flexible = 3 },
|
||||
components.file_info,
|
||||
{ provider = '%=' },
|
||||
components.file_type,
|
||||
},
|
||||
-- Default statusline
|
||||
{
|
||||
components.dummy,
|
||||
{ provider = '▊ ', hl = { fg = 'blue' } },
|
||||
components.vi_mode,
|
||||
components.file_size,
|
||||
{ components.file_info, flexible = 1 },
|
||||
{ components.debugger, flexible = 3 },
|
||||
{ components.code_action, flexible = 2 },
|
||||
{ components.macro, flexible = 2 },
|
||||
components.align,
|
||||
components.file_info,
|
||||
components.dap,
|
||||
components.code_action,
|
||||
components.macro,
|
||||
{ provider = '%=' },
|
||||
components.overseer,
|
||||
components.ruler,
|
||||
{ components.file_format, flexible = 2 },
|
||||
{ components.file_encoding, flexible = 3 },
|
||||
{ components.file_type, flexible = 3 },
|
||||
{ components.git, flexible = 1 },
|
||||
components.file_format,
|
||||
components.file_encoding,
|
||||
components.file_type,
|
||||
components.git,
|
||||
},
|
||||
},
|
||||
winbar = {
|
||||
hl = function()
|
||||
if conditions.is_active() then
|
||||
return 'WinBar'
|
||||
end
|
||||
return 'WinBarNC'
|
||||
end,
|
||||
hl = conditions.is_active() and 'WinBar' or 'WinBarNC',
|
||||
fallthrough = false,
|
||||
-- Inactive winbar
|
||||
{
|
||||
|
@ -90,17 +68,17 @@ require('heirline').setup {
|
|||
return not conditions.is_active()
|
||||
end,
|
||||
components.diagnostics,
|
||||
components.align,
|
||||
{ components.lsp_servers, flexible = 1 },
|
||||
{ components.linters_formatters, flexible = 1 },
|
||||
{ provider = '%=' },
|
||||
components.lsp_servers,
|
||||
components.linters_formatters,
|
||||
},
|
||||
-- Regular winbar
|
||||
{
|
||||
{ components.navic, flexible = 2, { provider = '' } },
|
||||
components.align,
|
||||
components.aerial,
|
||||
{ provider = '%=' },
|
||||
components.diagnostics,
|
||||
{ components.lsp_servers, flexible = 1 },
|
||||
{ components.linters_formatters, flexible = 1 },
|
||||
components.lsp_servers,
|
||||
components.linters_formatters,
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
|
|
|
@ -1,6 +1,15 @@
|
|||
local c = require('user.themes.nord.colors')
|
||||
local util = require('user.util.color')
|
||||
|
||||
local headline_colors = {
|
||||
c.purple,
|
||||
c.blue,
|
||||
c.green,
|
||||
c.yellow,
|
||||
c.orange,
|
||||
c.fg,
|
||||
}
|
||||
|
||||
return {
|
||||
-- nvim-treesitter-context
|
||||
TreesitterContext = { bg = c.grey1 },
|
||||
|
@ -14,9 +23,6 @@ return {
|
|||
CmpItemKind = { fg = c.green, bold = true },
|
||||
CmpItemMenu = { fg = c.blue, bold = true },
|
||||
|
||||
-- tabbyml/tabby
|
||||
TabbyCompletion = { link = 'Comment' },
|
||||
|
||||
-- LuaSnip
|
||||
LuasnipChoiceNodeActive = { fg = c.orange },
|
||||
LuasnipInsertNodeActive = { fg = c.blue },
|
||||
|
@ -96,7 +102,7 @@ return {
|
|||
|
||||
-- nvim-window-picker
|
||||
WindowPickerStatusLine = { fg = c.white2, bg = c.purple, bold = true },
|
||||
WindowPickerStatusLineNC = { fg = c.white2, bg = c.blue, bold = true },
|
||||
WindowPickerStatusLineNC = { link = 'NvimTreeWindowPicker' },
|
||||
|
||||
-- which-key.nvim
|
||||
WhichKey = { fg = c.green, bold = true },
|
||||
|
@ -146,24 +152,23 @@ return {
|
|||
IblScope = { fg = c.grey_bright },
|
||||
|
||||
-- headlines.nvim
|
||||
-- NOTE: keep bg of these in sync with OrgHeadlineLevel{1..6}
|
||||
Headline1 = { bg = util.blend(c.purple, c.black, 0.09), bold = true },
|
||||
Headline2 = { bg = util.blend(c.blue, c.black, 0.09), bold = true },
|
||||
Headline3 = { bg = util.blend(c.green, c.black, 0.09), bold = true },
|
||||
Headline4 = { bg = util.blend(c.yellow, c.black, 0.09), bold = true },
|
||||
Headline5 = { bg = util.blend(c.orange, c.black, 0.09), bold = true },
|
||||
Headline6 = { bg = util.blend(c.fg, c.black, 0.09), bold = true },
|
||||
Headline1 = { bg = util.blend(headline_colors[1], c.black, 0.09), bold = true },
|
||||
Headline2 = { bg = util.blend(headline_colors[2], c.black, 0.09), bold = true },
|
||||
Headline3 = { bg = util.blend(headline_colors[3], c.black, 0.09), bold = true },
|
||||
Headline4 = { bg = util.blend(headline_colors[4], c.black, 0.09), bold = true },
|
||||
Headline5 = { bg = util.blend(headline_colors[5], c.black, 0.09), bold = true },
|
||||
Headline6 = { bg = util.blend(headline_colors[6], c.black, 0.09), bold = true },
|
||||
Quote = { fg = c.grey_bright },
|
||||
CodeBlock = { bg = c.grey1 },
|
||||
Dash = { fg = c.blue, bold = true },
|
||||
|
||||
-- nvim-orgmode
|
||||
OrgHeadlineLevel1 = { fg = c.purple, bold = true },
|
||||
OrgHeadlineLevel2 = { fg = c.blue, bold = true },
|
||||
OrgHeadlineLevel3 = { fg = c.green, bold = true },
|
||||
OrgHeadlineLevel4 = { fg = c.yellow, bold = true },
|
||||
OrgHeadlineLevel5 = { fg = c.orange, bold = true },
|
||||
OrgHeadlineLevel6 = { fg = c.fg, bold = true },
|
||||
OrgHeadlineLevel1 = { fg = headline_colors[1], bold = true },
|
||||
OrgHeadlineLevel2 = { fg = headline_colors[2], bold = true },
|
||||
OrgHeadlineLevel3 = { fg = headline_colors[3], bold = true },
|
||||
OrgHeadlineLevel4 = { fg = headline_colors[4], bold = true },
|
||||
OrgHeadlineLevel5 = { fg = headline_colors[5], bold = true },
|
||||
OrgHeadlineLevel6 = { fg = headline_colors[6], bold = true },
|
||||
OrgTODO = { fg = c.green, bold = true },
|
||||
OrgDONE = { fg = c.purple, bold = true },
|
||||
OrgTSCheckbox = { link = '@markup.list.unchecked' },
|
||||
|
@ -282,10 +287,6 @@ return {
|
|||
FlashMatch = { fg = c.white2, bold = true },
|
||||
FlashLabel = { fg = c.white2, bg = c.red, bold = true },
|
||||
|
||||
-- nvim-navic
|
||||
NavicText = { link = 'Normal' },
|
||||
NavicSeparator = { fg = c.cyan },
|
||||
|
||||
-- nvim-coverage
|
||||
CoverageCovered = { fg = c.green },
|
||||
CoverageUncovered = { fg = c.red },
|
||||
|
|
|
@ -4,7 +4,7 @@ local c = require('user.themes.nord.colors')
|
|||
return {
|
||||
-- Identifiers
|
||||
['@variable'] = { link = 'Variable' },
|
||||
['@variable.builtin'] = { link = 'Variable' },
|
||||
['@variable.builtin'] = { fg = c.blue },
|
||||
['@variable.parameter'] = { fg = c.purple, italic = true },
|
||||
['@variable.member'] = { fg = c.teal },
|
||||
|
||||
|
@ -12,8 +12,8 @@ return {
|
|||
['@constant.builtin'] = { fg = c.teal },
|
||||
['@constant.macro'] = { fg = c.teal },
|
||||
|
||||
['@module'] = { fg = c.white1 },
|
||||
['@module.builtin'] = { fg = c.white1 },
|
||||
['@module'] = { fg = c.fg },
|
||||
['@module.builtin'] = { fg = c.fg, bold = true },
|
||||
['@label'] = { link = 'Label' },
|
||||
|
||||
-- Literals
|
||||
|
|
11
pkgs.yaml
11
pkgs.yaml
|
@ -64,6 +64,17 @@ graphql:
|
|||
<<: *nodejs_lsp
|
||||
pkgs: [graphql-language-service-cli]
|
||||
|
||||
guile_ls:
|
||||
category: [lsp]
|
||||
type: custom
|
||||
script:
|
||||
- |
|
||||
if [ ! -d "$PKG_INSTALL_DIR" ]; then
|
||||
git clone --depth 1 --single-branch https://codeberg.org/rgherdt/scheme-lsp-server.git "$PKG_INSTALL_DIR"
|
||||
fi
|
||||
- *git_checkout
|
||||
- guix package -f guix.scm
|
||||
|
||||
mdx_analyzer:
|
||||
<<: *nodejs_lsp
|
||||
pkgs: ['@mdx-js/language-server']
|
||||
|
|
Loading…
Reference in New Issue