Compare commits

10 Commits

Author SHA1 Message Date
62945314e2 it got merged \o/ 2025-08-10 13:11:22 -04:00
d320577772 I'm not gonna bother 2025-08-10 13:10:05 -04:00
7c96b43098 kitchen sink...
just gonna put the changes that I can remember making here:
 - replace blink with native completion (omnifunc)
 - remove some unneeded plugins
 - add a misc function for making sure complex bindings don't cause
   flickering
 - remove some stale snippets
 - remove folding (I don't find myself folding that often)
2025-08-02 11:25:38 -04:00
27f55ed03c this is a bit unstable but whatever 2025-07-27 14:21:49 -04:00
afdefb7dc3 fix mellow theming 2025-07-14 19:42:40 -04:00
64afe9c9ee revert treesitter back to master branch 2025-07-14 19:42:16 -04:00
cace587a09 more more more 2025-07-13 18:58:27 -04:00
101bc55f15 quick fix goes to a more sane place now 2025-07-11 14:08:53 -04:00
cd26cbb825 small changes...
if you want more look at the changes, there's not that many
2025-06-21 22:49:37 -04:00
7ef68dea92 gotta use new remote 2025-06-13 19:36:07 -04:00
55 changed files with 921 additions and 2276 deletions

View File

@ -1,5 +1,5 @@
local map_local = core.misc.map_local local map_local, lz = core.misc.map_local, core.misc.lz
-- sort #includes <> (very jank) -- sort #includes <> (very jank)
-- TODO: rewrite in a semi-sane way -- TODO: rewrite in a semi-sane way
map_local("n", "cri", "mz/^#include.*<.*>$<CR>ggVGN:sort<CR>`z<cmd>delm z<CR>:nohlsearch<Bar>:echo<CR>") map_local("n", "cri", lz "mz/^#include.*<.*>$<CR>ggVGN:sort<CR>`z<cmd>delm z<CR>:nohlsearch<Bar>:echo<CR>")

View File

@ -1 +1 @@
core.misc.map("n", "q", "<cmd>q<CR>") core.misc.map_local("n", "q", "<cmd>q<CR>")

View File

@ -1,6 +1,3 @@
-- FIXME: the following error is emmitted when starting up jdtls:
-- ERROR No LSP client found that supports vscode.java.resolveMainClass
local map, auto = core.misc.map, core.misc.auto local map, auto = core.misc.map, core.misc.auto
local ok, jdtls = pcall(require, "jdtls") local ok, jdtls = pcall(require, "jdtls")
@ -15,8 +12,8 @@ local java_dap_install = core.mason.get_pkg_path("java-debug-adapter")
-- make sure to check if things with 💀 need updating -- make sure to check if things with 💀 need updating
local config = { local config = {
cmd = { cmd = {
"/usr/lib/jvm/openjdk21/bin/java", -- 💀 "java", -- 💀
"-jar", -- 💀 "-jar",
vim.fn.glob(vim.fs.joinpath(jdtls_install, "plugins/org.eclipse.equinox.launcher_*.jar")), vim.fn.glob(vim.fs.joinpath(jdtls_install, "plugins/org.eclipse.equinox.launcher_*.jar")),
"-configuration", jdtls_install.."config_linux", "-configuration", jdtls_install.."config_linux",
"-data", vim.fn.stdpath("cache").."/nvim-jdtls", "-data", vim.fn.stdpath("cache").."/nvim-jdtls",
@ -73,14 +70,7 @@ local config = {
dap.adapters.java = nil -- remove any old java adapters dap.adapters.java = nil -- remove any old java adapters
jdtls.setup_dap({ hotcodereplace = "auto" }) jdtls.setup_dap({ hotcodereplace = "auto" })
require("jdtls.dap").setup_dap_main_class_configs()
end, end,
-- don"t print out status messages
handlers = {
["language/status"] = function() end
},
init_options = { init_options = {
bundles = { bundles = {
vim.fs.joinpath(java_dap_install, vim.fs.joinpath(java_dap_install,
@ -88,6 +78,10 @@ local config = {
true) true)
) )
} }
},
-- don't print out status messages
handlers = {
["language/status"] = function() end
} }
} }
@ -161,7 +155,6 @@ local function version_check()
return true return true
end end
-- start the jdtls with dap! -- start the jdtls with dap!
if not version_check() then if not version_check() then
return return

View File

@ -2,7 +2,7 @@ local map_local = core.misc.map_local
map_local("n", "h", "-", { noremap = false, remap = true }) -- Go up a directory map_local("n", "h", "-", { noremap = false, remap = true }) -- Go up a directory
map_local("n", "l", "<CR>", { noremap = false, remap = true }) -- Go down a directory / open a file map_local("n", "l", "<CR>", { noremap = false, remap = true }) -- Go down a directory / open a file
map_local("n", ".", "gh", { noremap = false, remap = true }) -- Toggle hidden files map_local("n", "g.", "gh", { noremap = false, remap = true }) -- Toggle hidden files
map_local("n", "P", "<C-w>z", { noremap = false, remap = true }) -- Close preview window map_local("n", "P", "<C-w>z", { noremap = false, remap = true }) -- Close preview window
-- Close netrw only if it isn't the last window -- Close netrw only if it isn't the last window

View File

@ -1,9 +0,0 @@
local map = core.misc.map
return {
on_attach = function(_, bufnr)
-- add some basedpyright specific mappings
local opts = { buffer = bufnr }
map("n", "cri", "<cmd>PyrightOrganizeImports<CR>", opts)
end,
}

View File

@ -1,12 +1,4 @@
local map = core.misc.map
return { return {
on_attach = function(_, bufnr)
-- add some clangd specific mappings
local opts = { buffer = bufnr }
map("n", "<leader>o", "<cmd>ClangdSwitchSourceHeader<CR>", opts)
end,
cmd = { cmd = {
"clangd", "clangd",
"--background-index", "--background-index",
@ -21,7 +13,7 @@ return {
usePlaceholders = true, usePlaceholders = true,
clangdFileStatus = true, clangdFileStatus = true,
fallback_flags = { fallback_flags = {
"-xc" -- makes clangd think we"re using c instead of c++ -- "-xc" -- makes clangd think we"re using c instead of c++
} }
} }
} }

View File

@ -11,14 +11,14 @@ return {
enable = false enable = false
}, },
workspace = { workspace = {
checkThirdParty = true, checkThirdParty = "ApplyInMemory",
library = { library = {
vim.env.VIMRUNTIME vim.env.VIMRUNTIME,
"${3rd}/luv/library"
} }
} }
} }
}, },
root_markers = { ".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml", root_markers = { ".luarc.json", ".luarc.jsonc", ".luacheckrc", ".stylua.toml",
"stylua.toml", "selene.toml", "selene.yml", "README.md" } "stylua.toml", "selene.toml", "selene.yml", "README.md" }
} }

View File

@ -1,5 +1,5 @@
if vim.fn.has("termguicolors") and not os.getenv("TERM") ~= "linux" then if vim.fn.has("termguicolors") and not os.getenv("TERM") ~= "linux" then
vim.cmd("colorscheme mellow") vim.cmd("colo mellow")
else else
vim.cmd("colorscheme default") vim.cmd("colo default")
end end

View File

@ -1,686 +0,0 @@
vim-startuptime -vimpath nvim -count 100:
Extra options: []
Measured: 100 times
Total Average: 144.380620 msec
Total Max: 174.784000 msec
Total Min: 137.569000 msec
AVERAGE MAX MIN
---------------------------------
129.170670 154.969000 123.411000: /home/squibid/.config/nvim/init.lua
12.890310 15.866000 12.461000: require('headlines')
7.751880 13.893000 6.340000: require('neorg.modules.core.completion.module')
6.036340 11.060000 5.441000: require('neorg.modules.core.integrations.telescope.module')
5.710990 12.120000 4.446000: require('treesj')
5.583670 9.049000 3.078000: require('pathlib')
5.517340 11.929000 4.260000: require('treesj.settings')
5.420920 8.867000 2.959000: require('pathlib.posix')
5.347190 8.769000 2.905000: require('pathlib.base')
5.033420 7.179000 4.344000: require('snippets.c')
4.863020 5.906000 4.074000: require('telescope.actions')
4.821470 7.779000 4.361000: require('telescope._extensions.neorg.find_linkable')
4.773650 7.730000 4.318000: require('neorg.telescope_utils')
4.380770 7.633000 2.226000: require('pathlib.utils.watcher')
4.354190 6.453000 3.870000: require('core.snippets.shorthands')
4.217790 7.457000 2.109000: require('nio')
3.915800 4.986000 3.149000: require('cmp')
3.681300 4.563000 3.454000: require('nvim-treesitter')
3.673010 4.757000 3.024000: require('conf.opts')
3.552670 4.559000 2.842000: require('cmp.core')
3.403410 4.259000 3.189000: require('nvim-treesitter.install')
3.278770 4.250000 2.695000: require('core.lsp.functions')
3.123820 4.077000 2.568000: require('vim.lsp')
2.916240 4.233000 2.083000: require('telescope.config')
2.749690 7.714000 0.209000: require('neorg.modules.core.dirman.module')
2.719720 4.105000 2.530000: /home/squibid/.config/nvim/after/plugin/colorscheme.lua
2.636010 4.836000 1.002000: require('nio.uv')
2.264605 6.153000 0.098000: /home/squibid/.local/share/nvim/site/pack/deps/opt/LuaSnip/plugin/luasnip.lua
2.135570 9.144000 0.044000: require('neorg.modules.core.dirman.utils.module')
2.112660 2.993000 1.967000: require('nvim-treesitter.parsers')
2.072940 3.811000 1.856000: require('telescope.pickers')
2.044980 4.082000 1.147000: require('leetcode.command')
2.036605 4.949000 0.013000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-treesitter/plugin/nvim-treesitter.lua
2.002450 2.983000 1.705000: require('luasnip')
1.856050 2.291000 1.754000: reading ShaDa
1.849890 2.930000 1.582000: require('luasnip.extras.treesitter_postfix')
1.815740 2.975000 1.321000: require('oil.actions')
1.784180 3.307000 1.678000: require('mason-registry.sources.github')
1.706120 2.466000 1.316000: require('vim.filetype')
1.689720 2.871000 1.396000: require('neorg')
1.641400 2.511000 1.243000: require('vim._init_packages')
1.608390 2.496000 1.452000: nvim_exec2() called at /home/squibid/.config/nvim/after/plugin/colorscheme.lua:0
1.576020 3.313000 1.359000: require('treesj.langs')
1.483850 3.010000 1.318000: require('telescope.previewers')
1.471520 2.320000 1.258000: require('harpoon')
1.407890 2.307000 1.220000: require('luasnip.nodes.snippet')
1.380020 2.569000 1.110000: require('neorg.core')
1.360060 1.717000 1.287000: require('luasnip.loaders.from_vscode')
1.332500 1.870000 0.868000: require('snippets.java')
1.325500 2.360000 0.913000: require('telescope.sorters')
1.281050 2.458000 1.213000: require('mason-registry.sources.util')
1.234380 2.150000 1.110000: require('fidget')
1.196200 1.524000 1.137000: require('vim.treesitter')
1.192760 2.665000 0.809000: require('nui.utils.autocmd')
1.092560 2.162000 0.974000: require('telescope.finders')
1.075350 1.957000 0.820000: require('vim._editor')
1.065820 1.861000 0.866000: require('cmp.view')
1.057940 1.654000 0.792000: require('vim._defaults')
1.031440 1.528000 0.990000: loading rtp plugins
1.008240 1.302000 0.961000: require('vim.treesitter.languagetree')
1.002450 2.050000 0.887000: require('telescope.previewers.buffer_previewer')
0.970120 2.414000 0.637000: require('nui.utils.buf_storage')
0.953090 1.720000 0.896000: require('mason-core.installer.registry')
0.920170 2.354000 0.591000: require('nui.utils')
0.915700 2.416000 0.684000: require('dap')
0.911030 1.815000 0.821000: require('fidget.progress')
0.907280 1.993000 0.726000: require('neorg.core.modules')
0.904650 1.667000 0.620000: require('nvim-ts-autotag')
0.900400 1.747000 0.803000: /home/squibid/.local/share/nvim/site/pack/deps/opt/mellow.nvim/colors/mellow.vim
0.881180 1.128000 0.804000: require('vim.diagnostic')
0.874900 1.211000 0.743000: require('vim.lsp.util')
0.836730 1.348000 0.659000: require('snippets.tex')
0.820980 0.981000 0.662000: require('cmp.source')
0.811710 1.086000 0.739000: require('colorizer')
0.794280 1.032000 0.754000: require('luasnip.util.parser')
0.794230 0.974000 0.726000: require('fidget.notification')
0.780010 1.601000 0.546000: require('telescope.utils')
0.745350 1.485000 0.668000: require('nvim-treesitter.info')
0.709760 1.418000 0.648000: require('plenary.async')
0.704610 1.526000 0.608000: require('Comment.api')
0.692370 1.027000 0.511000: require('dep')
0.690380 1.361000 0.429000: require('nvim-ts-autotag.internal')
0.672970 1.462000 0.563000: require('harpoon.data')
0.672400 1.731000 0.578000: require('neorg.modules.core.concealer.module')
0.668760 1.489000 0.469000: require('leetcode')
0.667590 1.305000 0.458000: require('oil')
0.657210 1.400000 0.590000: require('nvim-treesitter.configs')
0.656470 1.325000 0.492000: require('neorg.core.utils')
0.647370 1.406000 0.478000: require('oil.util')
0.643150 1.524000 0.597000: require('fidget.progress.lsp')
0.642500 0.832000 0.583000: require('gitsigns')
0.631140 0.746000 0.509000: require('cmp.entry')
0.623440 1.027000 0.578000: require('mason')
0.619960 0.964000 0.583000: require('mason-core.installer.registry.schemas')
0.618810 0.872000 0.526000: require('luasnip.loaders')
0.615590 1.598000 0.492000: require('neorg.modules.core.tempus.module')
0.611610 1.395000 0.488000: require('cmp.utils.async')
0.611580 1.400000 0.510000: require('plenary.path')
0.593090 0.807000 0.522000: require('todo-comments')
0.575730 1.230000 0.508000: require('telescope.make_entry')
0.574340 0.678000 0.542000: require('mason-core.installer.managers.std')
0.559130 1.413000 0.510000: require('lspconfig')
0.551550 1.412000 0.509000: require('vim.lsp.handlers')
0.539370 0.699000 0.478000: require('dap.repl')
0.537050 0.716000 0.506000: require('vim.treesitter.query')
0.532820 1.014000 0.441000: require('mason-registry')
0.523700 1.178000 0.383000: require('neorg.modules.core.ui.module')
0.520580 0.899000 0.327000: require('vim.lsp.protocol')
0.517080 0.851000 0.400000: require('luasnip.config')
0.497290 1.229000 0.417000: require('neorg.modules.core.ui.calendar.views.monthly.module')
0.491310 0.601000 0.466000: require('luasnip.util.parser.ast_parser')
0.478880 1.713000 0.016000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-ts-autotag/plugin/nvim-ts-autotag.lua
0.469290 1.385000 0.356000: require('neogen')
0.465790 1.699000 0.043000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-cmp/plugin/cmp.lua
0.465570 0.604000 0.341000: require('vim.shared')
0.465020 1.230000 0.371000: require('cmp.config')
0.460660 0.547000 0.433000: require('mason-core.installer')
0.458220 1.223000 0.406000: require('nvim-treesitter.query')
0.444530 0.565000 0.421000: require('luasnip.loaders.from_lua')
0.440785 1.634000 0.047000: /home/squibid/.local/share/nvim/site/pack/deps/opt/Comment.nvim/plugin/Comment.lua
0.438070 1.277000 0.192000: require('snippets.make')
0.431750 0.803000 0.385000: require('telescope.actions.layout')
0.418390 0.689000 0.345000: require('nyooom')
0.416160 0.651000 0.330000: require('plenary.popup')
0.413120 1.268000 0.287000: require('luasnip.util.environ')
0.405490 1.187000 0.364000: require('cmp_nvim_lsp')
0.402540 0.507000 0.355000: require('lspconfig.util')
0.400330 0.518000 0.387000: /usr/share/nvim/runtime/plugin/matchit.vim
0.397180 0.813000 0.303000: require('neorg.modules.core.integrations.treesitter.module')
0.396580 1.116000 0.293000: require('vim.lsp.rpc')
0.391370 0.491000 0.374000: loading after plugins
0.390090 1.147000 0.359000: require('mellow')
0.386650 1.225000 0.224000: require('leetcode.config')
0.376050 1.087000 0.294000: require('vim.re')
0.372040 0.638000 0.336000: require('plenary.scandir')
0.368370 0.846000 0.287000: require('neorg.modules.core.esupports.hop.module')
0.364860 0.723000 0.329000: require('oil-git-status')
0.358670 0.857000 0.290000: require('treesj.langs.javascript')
0.356240 0.668000 0.318000: require('telescope.pickers.layout_strategies')
0.355440 0.738000 0.224000: require('nio.lsp')
0.344860 0.704000 0.307000: require('telescope.previewers.term_previewer')
0.343640 0.737000 0.221000: require('nio.ui')
0.337520 0.419000 0.322000: require('luasnip.loaders.from_snipmate')
0.333470 1.049000 0.294000: require('plenary.async.tests')
0.330750 0.669000 0.298000: require('mason-core.platform')
0.328140 0.484000 0.309000: require('lsp_lines')
0.325760 0.468000 0.257000: require('vim.lsp.log')
0.324620 1.025000 0.235000: require('plenary.job')
0.315990 0.524000 0.281000: require('mason-core.fetch')
0.313600 1.125000 0.253000: require('Comment.utils')
0.313080 0.916000 0.187000: require('nvim-ts-autotag.config.plugin')
0.308130 1.170000 0.186000: require('luasnip.util._builtin_vars')
0.307790 0.382000 0.285000: require('fidget.notification.model')
0.305460 0.480000 0.282000: require('plenary.async.async')
0.303080 0.943000 0.279000: require('mason-core.package')
0.299810 0.416000 0.216000: init lua interpreter
0.296330 1.079000 0.272000: /usr/share/nvim/runtime/filetype.lua
0.295040 0.445000 0.197000: require('vim._options')
0.291240 0.522000 0.136000: require('snippets.norg')
0.290500 0.547000 0.264000: require('mason.api.command')
0.288690 0.544000 0.254000: require('telescope.finders.async_oneshot_finder')
0.287905 0.625000 0.070000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-lspconfig/plugin/lspconfig.lua
0.287280 0.715000 0.228000: require('neorg.modules.core.qol.toc.module')
0.285650 0.441000 0.226000: require('vim.lsp._changetracking')
0.283750 0.981000 0.247000: require('plenary.async.util')
0.278980 1.041000 0.231000: require('lua-utils')
0.278760 0.666000 0.124000: require('snippets.openscad')
0.278420 0.345000 0.259000: require('vim.lsp.completion')
0.275980 0.362000 0.220000: require('cmp.view.custom_entries_view')
0.272330 0.743000 0.238000: require('neorg.modules.core.export.markdown.module')
0.270190 0.374000 0.222000: require('cmp.types')
0.268910 0.347000 0.254000: require('luasnip.util.parser.ast_utils')
0.268770 0.331000 0.254000: require('cmp.utils.api')
0.268160 0.851000 0.145000: require('neorg.modules.core.autocommands.module')
0.266450 0.392000 0.225000: require('luasnip.nodes.util.trig_engines')
0.265550 0.418000 0.186000: inits 1
0.264490 0.353000 0.237000: require('dap.ui')
0.262080 0.374000 0.213000: require('cmp.view.docs_view')
0.261610 1.063000 0.161000: require('conf.binds')
0.259520 1.074000 0.219000: require('luasnip.extras._treesitter')
0.253560 0.368000 0.190000: require('core.misc')
0.252560 0.307000 0.237000: /home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-buffer/after/plugin/cmp_buffer.lua
0.250170 0.319000 0.237000: /usr/share/nvim/runtime/plugin/fzf.vim
0.249520 1.036000 0.230000: nvim_exec2() called at /usr/share/nvim/runtime/filetype.lua:0
0.248350 0.502000 0.183000: require('telescope.actions.set')
0.248200 0.385000 0.177000: require('telescope.log')
0.247880 0.308000 0.231000: require('telescope')
0.246820 0.352000 0.175000: sourcing vimrc file(s)
0.246150 0.397000 0.185000: require('pathlib.utils')
0.240050 0.314000 0.216000: require('nvim-treesitter.tsrange')
0.239730 0.394000 0.208000: require('mason-core.managers.powershell')
0.239110 0.309000 0.199000: require('luasnip.util.jsonc')
0.235180 0.556000 0.200000: require('oil.fs')
0.234770 0.302000 0.217000: require('vim.iter')
0.233840 0.311000 0.198000: require('todo-comments.jump')
0.233720 0.287000 0.223000: require('cmp_buffer')
0.230720 0.572000 0.171000: require('neorg.modules.core.journal.module')
0.230310 0.298000 0.172000: require('cmp.utils.snippet')
0.229900 0.433000 0.202000: require('vim.deprecated.health')
0.229210 5.677000 0.147000: require('neorg.modules.core.tangle.module')
0.228340 0.308000 0.201000: require('lspconfig.configs')
0.226710 0.346000 0.198000: require('luasnip.nodes.util')
0.224430 0.285000 0.185000: require('cmp.utils.feedkeys')
0.222960 0.623000 0.155000: require('neorg.modules.core.highlights.module')
0.222670 0.468000 0.192000: require('telescope._')
0.221340 0.321000 0.196000: require('luasnip.nodes.node')
0.219750 0.714000 0.006000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nyooom/plugin/nyooom.lua
0.218470 0.283000 0.201000: require('mason-core.installer.context')
0.217820 0.298000 0.201000: require('mellow.colors')
0.216890 0.310000 0.175000: require('cmp.types.lsp')
0.216840 0.275000 0.179000: require('vim.fs')
0.216260 0.266000 0.207000: require('cmp_buffer.source')
0.216060 0.536000 0.164000: require('treesj.langs.utils')
0.213770 0.323000 0.178000: require('luasnip.loaders.fs_watchers')
0.212320 0.325000 0.158000: init highlight
0.208980 0.339000 0.175000: require('luasnip.util.jsregexp')
0.207530 0.929000 0.151000: require('neorg.modules.core.ui.selection_popup.module')
0.206480 0.448000 0.166000: require('cmp.config.default')
0.206440 0.381000 0.189000: require('telescope._extensions.fzf')
0.203830 0.434000 0.144000: require('luasnip.session')
0.201750 0.256000 0.168000: require('harpoon.ui')
0.201560 0.469000 0.122000: require('luasnip.extras.fmt')
0.201490 0.246000 0.187000: require('luasnip.util.parser.neovim_parser')
0.201090 0.290000 0.150000: require('vim.inspect')
0.198040 0.872000 0.069000: require('leetcode.logger')
0.197790 0.481000 0.138000: require('neorg.modules.core.esupports.metagen.module')
0.197100 1.016000 0.119000: require('luasnip.nodes.insertNode')
0.195580 0.490000 0.153000: require('neorg.modules.core.neorgcmd.module')
0.194220 0.418000 0.173000: require('telescope.entry_manager')
0.193970 0.266000 0.166000: require('todo-comments.highlight')
0.193490 0.400000 0.124000: require('nio.logger')
0.192330 0.307000 0.133000: require('plenary.log')
0.192030 0.879000 0.159000: require('luasnip.session.snippet_collection')
0.191690 0.722000 0.171000: require('mason-core.fs')
0.191510 0.284000 0.153000: require('treesj.langs.ruby')
0.190550 0.255000 0.140000: require('gitsigns.highlight')
0.189900 0.926000 0.174000: /usr/share/nvim/runtime/syntax/syntax.vim
0.186950 0.238000 0.173000: require('fidget.commands')
0.185590 0.272000 0.159000: require('todo-comments.config')
0.184920 0.271000 0.155000: require('luasnip.loaders.util')
0.184230 0.365000 0.139000: require('nio.file')
0.184070 0.242000 0.159000: require('gitsigns.config')
0.183020 0.419000 0.160000: require('luasnip.util.util')
0.182435 0.528000 0.002000: /home/squibid/.local/share/nvim/site/pack/deps/opt/lsp_lines/plugin/lsplines.vim
0.181500 0.586000 0.166000: require('mason-core.installer.registry.link')
0.181460 0.365000 0.159000: require('vim.health')
0.180860 0.246000 0.149000: require('lspconfig.configs.texlab')
0.180230 0.317000 0.162000: require('plenary.async.control')
0.179270 0.295000 0.138000: require('vim.ui')
0.176270 0.266000 0.143000: require('colorizer/trie')
0.176010 0.267000 0.145000: require('cmp.utils.window')
0.175550 0.405000 0.121000: require('luasnip.default_config')
0.173440 0.223000 0.142000: require('cmp.utils.keymap')
0.172560 0.274000 0.159000: require('plenary.vararg')
0.171590 0.685000 0.131000: require('mason-core.EventEmitter')
0.171280 0.468000 0.137000: require('luasnip.nodes.choiceNode')
0.171090 0.631000 0.155000: require('mason-core.purl')
0.169880 0.911000 0.135000: require('telescope.mappings')
0.168790 0.455000 0.149000: require('telescope._extensions.neorg.search_headings')
0.167290 0.222000 0.150000: require('nvim-treesitter.ts_utils')
0.166970 0.409000 0.136000: require('neorg.modules.core.qol.todo_items.module')
0.159690 0.782000 0.101000: require('nvim-ts-autotag.config.ft')
0.159090 0.304000 0.142000: require('neorg.modules.core.summary.module')
0.158750 0.226000 0.133000: require('vim.version')
0.158750 0.279000 0.128000: require('cmp.utils.str')
0.157870 0.399000 0.126000: require('neorg.modules.core.promo.module')
0.157180 0.196000 0.136000: require('nvim-treesitter.indent')
0.157130 0.921000 0.122000: require('cmp.view.wildmenu_entries_view')
0.156800 0.940000 0.132000: require('neorg.modules.core.export.module')
0.156400 0.300000 0.123000: require('telescope.pickers.entry_display')
0.155070 0.962000 0.115000: require('Comment.ft')
0.154010 0.377000 0.075000: require('luasnip.extras')
0.151900 0.188000 0.144000: require('cmp_buffer.buffer')
0.151530 0.214000 0.137000: /home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-async-path/after/plugin/cmp_async_path.lua
0.151420 1.029000 0.104000: require('neorg.modules.core.esupports.indent.module')
0.150360 0.484000 0.097000: require('neorg.modules.core.keybinds.module')
0.149480 0.248000 0.102000: require('nio.tasks')
0.149100 0.238000 0.118000: require('plenary.window.border')
0.147310 0.280000 0.126000: require('neorg.modules.core.queries.native.module')
0.146320 0.291000 0.118000: require('luasnip.nodes.dynamicNode')
0.145410 0.186000 0.131000: require('gitsigns.async')
0.144720 0.193000 0.122000: require('harpoon.list')
0.141770 0.196000 0.120000: require('mason-lspconfig.api.command')
0.140560 0.175000 0.135000: require('luasnip.loaders.snippet_cache')
0.140090 0.301000 0.125000: require('telescope.previewers.utils')
0.137730 0.885000 0.110000: require('telescope._extensions.neorg.find_aof_tasks')
0.135280 0.298000 0.091000: require('nio.control')
0.135160 0.183000 0.121000: require('lspconfig.manager')
0.134390 0.162000 0.125000: require('luasnip.util.directed_graph')
0.134170 0.949000 0.107000: require('plenary.bit')
0.134040 0.363000 0.108000: require('cmp.config.compare')
0.133330 0.941000 0.103000: require('dap.utils')
0.132560 0.201000 0.118000: require('fidget.notification.window')
0.131330 0.163000 0.122000: require('cmp_async_path')
0.130500 0.221000 0.119000: require('plenary.vararg.rotate')
0.130360 0.174000 0.109000: require('fidget.progress.display')
0.130190 0.198000 0.099000: require('vim.lsp.sync')
0.129370 0.649000 0.096000: require('mason-core.log')
0.129230 0.169000 0.114000: require('nvim-treesitter.shell_command_selectors')
0.129200 0.193000 0.117000: /home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-nvim-lsp-signature-help/after/plugin/cmp_nvim_lsp_signature_help.lua
0.128860 0.820000 0.092000: require('oil.config')
0.128060 0.702000 0.038000: require('leetcode.translator')
0.127700 0.188000 0.107000: require('plenary.strings')
0.123255 0.289000 0.069000: /home/squibid/.local/share/nvim/site/pack/deps/opt/telescope.nvim/plugin/telescope.lua
0.122820 0.248000 0.095000: require('neorg.modules.core.looking-glass.module')
0.122470 0.319000 0.105000: require('telescope._extensions.neorg.find_aof_project_tasks')
0.122270 0.265000 0.099000: require('luasnip-jsregexp')
0.121780 1.002000 0.081000: require('pathlib.const')
0.121250 0.250000 0.088000: require('nio.streams')
0.120680 0.155000 0.103000: require('dap.breakpoints')
0.119850 0.234000 0.081000: require('conf.context')
0.119330 0.305000 0.093000: require('neorg.modules.core.presenter.module')
0.118930 0.154000 0.091000: require('mason-lspconfig.mappings.server')
0.118860 0.202000 0.111000: require('mason-core.process')
0.118370 0.733000 0.073000: require('nvim-ts-autotag.utils')
0.118320 0.273000 0.103000: require('telescope._extensions.neorg.insert_link')
0.116230 0.150000 0.097000: require('cmp.matcher')
0.115490 0.257000 0.100000: require('telescope._extensions.neorg.find_context_tasks')
0.115310 0.274000 0.097000: require('telescope.builtin')
0.115170 0.205000 0.096000: require('luasnip.nodes.restoreNode')
0.114930 0.239000 0.074000: require('neogen.mark')
0.113840 0.248000 0.082000: require('client')
0.110540 0.146000 0.094000: require('cmp.utils.misc')
0.108300 0.146000 0.089000: require('mason-lspconfig')
0.108080 0.166000 0.101000: require('cmp_nvim_lsp_signature_help')
0.105870 0.901000 0.068000: nvim_exec2()
0.104420 0.140000 0.096000: require('fidget.logger')
0.104410 0.173000 0.077000: opening buffers
0.103880 0.177000 0.085000: require('luasnip.util.path')
0.103330 0.342000 0.081000: require('vim.lsp._transport')
0.103170 0.145000 0.088000: require('colorizer/nvim')
0.103110 0.167000 0.079000: require('dep.log')
0.101590 0.194000 0.075000: require('lspconfig.configs.omnisharp')
0.101080 0.136000 0.091000: require('fidget.notification.view')
0.100790 0.131000 0.081000: require('cmp.view.native_entries_view')
0.099620 0.144000 0.095000: require('luasnip.util.parser.neovim_ast')
0.099170 0.170000 0.089000: require('telescope.debounce')
0.099030 0.181000 0.090000: require('mason-core.functional.list')
0.097830 0.854000 0.074000: require('fidget.integration')
0.097170 0.974000 0.077000: require('telescope._extensions.neorg.find_project_tasks')
0.097140 0.127000 0.076000: require('cmp.config.mapping')
0.097010 0.870000 0.080000: require('telescope._extensions.neorg.backlinks.file_backlinks')
0.094150 0.208000 0.084000: require('telescope.algos.linked_list')
0.093850 0.129000 0.080000: require('lspconfig.configs.clangd')
0.093200 0.168000 0.060000: event init
0.092890 0.181000 0.083000: require('lsp_lines.render')
0.092540 0.244000 0.073000: require('neorg.modules.core.ui.calendar.module')
0.091780 0.140000 0.083000: require('fzf_lib')
0.091580 0.121000 0.074000: require('cmp.view.ghost_text_view')
0.091130 0.176000 0.072000: require('telescope.actions.mt')
0.091120 0.194000 0.075000: require('neorg.modules.core.todo-introspector.module')
0.091100 0.177000 0.065000: require('mason-core.spawn')
0.090770 0.120000 0.074000: require('neorg.core.log')
0.090460 0.131000 0.074000: require('harpoon.config')
0.090200 0.782000 0.068000: require('cmp_nvim_lsp.source')
0.090180 0.163000 0.065000: require('nio.tests')
0.089760 0.247000 0.083000: require('mason-core.async')
0.088870 0.192000 0.079000: require('telescope.pickers.highlights')
0.088160 0.172000 0.071000: require('Comment.opfunc')
0.088100 0.114000 0.083000: /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
0.087690 0.167000 0.066000: require('luasnip.util.ext_opts')
0.087270 0.188000 0.068000: require('telescope.config.resolve')
0.087110 0.121000 0.078000: require('gitsigns.debug.log')
0.086360 0.209000 0.078000: require('telescope._extensions.neorg.insert_file_link')
0.085930 0.221000 0.062000: require('nio.process')
0.084930 0.118000 0.070000: require('conf.plugins.oil')
0.084700 0.112000 0.079000: require('luasnip.nodes.snippetProxy')
0.083640 0.114000 0.078000: require('cmp-under-comparator')
0.083520 0.125000 0.079000: /usr/share/nvim/runtime/plugin/gzip.vim
0.082380 0.162000 0.058000: require('pathlib.utils.nuv')
0.082030 0.141000 0.068000: require('conf.plugins.jdtls')
0.081140 0.185000 0.068000: require('mason-core.functional')
0.081070 0.189000 0.063000: require('dep.proc')
0.080340 0.151000 0.072000: require('nvim-treesitter.utils')
0.080040 0.118000 0.064000: require('cmp.context')
0.079000 0.125000 0.072000: require('vim.treesitter._range')
0.078948 6.408000 0.000000: nvim_exec2() called at /home/squibid/.config/nvim/init.lua:0
0.078460 0.118000 0.069000: require('luasnip.util.mark')
0.077670 0.199000 0.068000: require('telescope.themes')
0.077290 0.130000 0.064000: require('luasnip.nodes.functionNode')
0.077180 0.112000 0.069000: /home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-luasnip-choice/after/plugin/cmp_luasnip_choice.lua
0.077030 0.483000 0.047000: require('treesj.langs.typescript')
0.076940 0.111000 0.061000: require('core.folding')
0.076610 0.136000 0.071000: require('vim.treesitter.language')
0.075690 0.190000 0.052000: require('server')
0.075270 0.935000 0.035000: require('leetcode.config.langs')
0.074710 0.105000 0.064000: require('lspconfig.configs.basedpyright')
0.074110 0.122000 0.055000: require('cmp.utils.char')
0.073890 0.111000 0.064000: require('mason-lspconfig.lspconfig_hook')
0.073600 0.136000 0.066000: require('telescope._extensions.neorg.switch_workspace')
0.073060 0.115000 0.056000: require('treesj.langs.python')
0.072980 0.125000 0.066000: require('mason-core.functional.function')
0.072110 0.105000 0.059000: require('harpoon.buffer')
0.070740 0.189000 0.050000: require('neorg.modules.core.itero.module')
0.070580 0.230000 0.063000: require('telescope.previewers.previewer')
0.070580 0.087000 0.068000: require('luasnip.nodes.duplicate')
0.070480 0.149000 0.041000: require('snippets.php')
0.070350 0.136000 0.048000: require('treesj.langs.rust')
0.069490 0.101000 0.064000: require('fidget.spinner')
0.069430 0.122000 0.051000: require('pathlib.utils.lists')
0.069150 0.118000 0.056000: require('luasnip.util.log')
0.068550 0.168000 0.056000: require('neorg.modules.core.integrations.nvim-cmp.module')
0.068230 0.321000 0.054000: require('luasnip.util.select')
0.067850 0.105000 0.062000: require('plenary.async.structs')
0.067610 0.101000 0.060000: require('fidget.poll')
0.067560 0.093000 0.062000: require('lspconfig.async')
0.067300 0.096000 0.065000: require('luasnip.util.functions')
0.067140 0.114000 0.060000: require('mellow.config')
0.067070 0.130000 0.050000: require('lspconfig.configs.lua_ls')
0.066920 0.080000 0.062000: require('mason-core.installer.linker')
0.066870 0.117000 0.060000: require('nvim-treesitter.query_predicates')
0.066760 0.109000 0.055000: require('treesj.langs.elixir')
0.065750 0.102000 0.054000: require('cmp.utils.autocmd')
0.065510 0.182000 0.051000: require('conf.plugins.cmp')
0.064440 0.101000 0.052000: require('harpoon.logger')
0.064210 0.082000 0.062000: require('luasnip.session.enqueueable_operations')
0.064130 0.154000 0.040000: require('conf.autos')
0.063920 0.119000 0.058000: require('plenary.class')
0.063870 0.186000 0.052000: require('oil.log')
0.063320 0.109000 0.058000: require('mason-core.result')
0.063130 0.125000 0.056000: require('telescope._extensions.neorg.find_norg_files')
0.062530 0.131000 0.046000: require('telescope.actions.utils')
0.061890 0.173000 0.040000: early init
0.061830 0.242000 0.050000: require('luasnip.nodes.multiSnippet')
0.061250 0.114000 0.055000: require('telescope.finders.async_job_finder')
0.061220 0.140000 0.055000: require('telescope.pickers.layout')
0.060290 0.121000 0.048000: require('lspconfig.configs.ts_ls')
0.060290 0.332000 0.045000: require('lspconfig.configs.cssls')
0.059610 0.124000 0.044000: require('telescope.pickers.scroller')
0.059530 0.078000 0.057000: /usr/share/nvim/runtime/plugin/matchparen.vim
0.059110 0.392000 0.050000: require('mason-core.installer.registry.expr')
0.059020 0.739000 0.034000: require('neogen.utilities.helpers')
0.058980 0.133000 0.054000: require('mason-registry.sources')
0.058970 0.084000 0.056000: /usr/share/nvim/runtime/plugin/rplugin.vim
0.058930 0.148000 0.046000: require('neorg.modules.core.pivot.module')
0.058680 0.132000 0.042000: require('pathlib.utils.paths')
0.058360 0.086000 0.051000: require('lspconfig.configs.gopls')
0.058280 0.089000 0.053000: require('mason-core.receipt')
0.058130 0.148000 0.051000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-dap/plugin/dap.lua
0.057960 0.238000 0.047000: require('luasnip.extras.postfix')
0.057800 0.148000 0.023000: require('conf.plugins.treesitter')
0.057440 0.109000 0.049000: require('luasnip.util.str')
0.056990 0.081000 0.053000: require('vim.func._memoize')
0.056980 0.084000 0.053000: require('mason-core.async.control')
0.056630 0.104000 0.045000: require('conf.plugins.neorg')
0.056350 0.071000 0.054000: /usr/share/nvim/runtime/plugin/zipPlugin.vim
0.055940 0.085000 0.047000: require('lspconfig.configs.arduino_language_server')
0.055890 0.172000 0.039000: require('neorg.modules.core.storage.module')
0.055840 0.141000 0.043000: require('neorg.modules.core.clipboard.module')
0.055510 0.105000 0.037000: BufEnter autocommands
0.055210 0.097000 0.046000: require('lspconfig.configs.html')
0.055170 0.090000 0.045000: require('lspconfig.configs.zls')
0.055100 0.091000 0.048000: require('telescope.finders.async_static_finder')
0.055060 0.159000 0.043000: require('conf.plugins.mason-lspconfig')
0.054760 0.157000 0.037000: require('conf.plugins.telescope')
0.053550 0.126000 0.048000: require('telescope.pickers.multi')
0.053060 0.535000 0.039000: require('mason-core.optional')
0.053010 0.082000 0.049000: require('plenary.tbl')
0.052970 0.136000 0.037000: require('neorg.modules.core.ui.text_popup.module')
0.052960 0.084000 0.043000: require('neorg.core.config')
0.052020 0.526000 0.042000: require('telescope._extensions.neorg.backlinks.common')
0.051580 0.103000 0.041000: require('lspconfig.configs.mesonlsp')
0.051550 0.088000 0.045000: require('lspconfig.configs.bashls')
0.051170 0.145000 0.038000: require('pathlib.utils.errors')
0.051100 0.083000 0.047000: require('fidget.spinner.patterns')
0.051030 0.089000 0.044000: require('luasnip.util.pattern_tokenizer')
0.050930 0.092000 0.042000: require('Comment.extra')
0.050630 0.105000 0.034000: require('leetcode.config.template')
0.050430 0.585000 0.024000: require('leetcode.command.arguments')
0.049920 0.131000 0.039000: require('conf.plugins.gitsigns')
0.049640 0.076000 0.043000: require('todo-comments.util')
0.049380 0.084000 0.042000: require('lspconfig.configs.fortls')
0.049060 0.121000 0.044000: require('mason-core.functional.string')
0.048810 0.114000 0.042000: require('lspconfig.configs.phpactor')
0.048220 0.102000 0.043000: require('telescope._extensions.neorg.backlinks.header_backlinks')
0.048140 0.940000 0.022000: require('neorg.modules.core.links.module')
0.047980 0.066000 0.044000: require('cmp_luasnip_choice')
0.047350 0.068000 0.044000: loading packages
0.047300 0.074000 0.041000: require('lspconfig.configs.rnix')
0.046910 0.736000 0.017000: require('leetcode.config.imports')
0.046590 0.072000 0.040000: require('treesj.utils')
0.046220 0.074000 0.043000: require('plenary.errors')
0.046020 0.102000 0.034000: require('luasnip.nodes.textNode')
0.045910 0.071000 0.042000: require('fidget.progress.handle')
0.045880 0.059000 0.039000: require('lspconfig.configs.asm_lsp')
0.045360 0.091000 0.035000: require('treesj.langs.julia')
0.045295 0.118000 0.004000: /home/squibid/.local/share/nvim/site/pack/deps/opt/undotree/plugin/undotree.vim
0.045050 0.068000 0.040000: require('telescope._extensions.neorg')
0.045010 0.062000 0.040000: require('lspconfig.configs.openscad_lsp')
0.044820 0.070000 0.036000: require('plenary.functional')
0.044090 0.169000 0.036000: require('fidget.integration.xcodebuild-nvim')
0.044010 0.070000 0.042000: /usr/share/nvim/runtime/plugin/tarPlugin.vim
0.043780 0.069000 0.035000: require('Comment')
0.042870 0.097000 0.027000: require('nvim-ts-autotag.config.init')
0.042300 0.077000 0.028000: require('luasnip.extras.conditions.expand')
0.042250 0.110000 0.031000: require('luasnip.extras.filetype_functions')
0.042030 0.102000 0.038000: require('mason-core.functional.table')
0.041920 0.103000 0.031000: require('treesj.langs.cpp')
0.041270 0.067000 0.038000: require('mason-core.installer.registry.util')
0.040200 0.065000 0.037000: /usr/share/nvim/runtime/syntax/synload.vim
0.040150 0.095000 0.033000: require('mason.settings')
0.040070 0.161000 0.027000: require('treesj.langs.perl')
0.039770 0.062000 0.032000: require('pathlib.utils.tables')
0.039310 0.062000 0.029000: require('vim.keymap')
0.039310 0.064000 0.031000: require('conf.plugins.luasnip')
0.039180 0.118000 0.029000: require('conf.plugins.dap')
0.038870 0.067000 0.031000: require('harpoon.extensions')
0.038730 0.154000 0.026000: require('neorg.modules.core.neorgcmd.commands.return.module')
0.038570 0.099000 0.028000: require('treesj.langs.go')
0.037930 0.055000 0.033000: require('gitsigns.debounce')
0.037790 0.057000 0.024000: locale set
0.036770 0.099000 0.024000: require('neogen.config')
0.036420 0.100000 0.030000: require('telescope._extensions')
0.036250 0.083000 0.025000: require('treesj.langs.php')
0.036030 0.062000 0.029000: require('luasnip.loaders.data')
0.035940 0.066000 0.033000: /usr/share/nvim/runtime/plugin/osc52.lua
0.035620 0.086000 0.023000: require('leetcode.config.stats')
0.035390 0.058000 0.032000: require('mason-core.providers')
0.035250 0.065000 0.031000: require('mason-core.path')
0.035220 0.822000 0.024000: require('nvim-treesitter.caching')
0.034700 0.071000 0.032000: require('vim.func')
0.034380 0.057000 0.032000: /usr/share/nvim/runtime/plugin/man.lua
0.034110 0.056000 0.026000: require('nvim-treesitter.highlight')
0.033610 0.555000 0.024000: require('fidget.integration.nvim-tree')
0.033120 0.055000 0.031000: require('fidget.options')
0.032650 0.064000 0.027000: require('treesj.langs.yaml')
0.032160 0.059000 0.025000: require('luasnip.util.extend_decorator')
0.032100 0.074000 0.023000: require('telescope.actions.state')
0.032090 0.094000 0.024000: require('treesj.langs.zig')
0.031990 0.053000 0.026000: require('Comment.config')
0.031730 0.049000 0.021000: expanding arguments
0.031340 0.409000 0.022000: require('plenary.compat')
0.031200 0.090000 0.024000: require('treesj.langs.nix')
0.030880 0.051000 0.023000: /usr/share/nvim/runtime/ftplugin.vim
0.030560 0.467000 0.022000: require('luasnip.util.auto_table')
0.030470 0.063000 0.022000: require('neorg.modules.core.clipboard.code-blocks.module')
0.030140 0.067000 0.024000: require('luasnip.extras.conditions')
0.029710 0.055000 0.025000: require('luasnip.util.dict')
0.029470 0.053000 0.021000: init first window
0.029330 0.085000 0.022000: require('treesj.langs.bash')
0.029330 0.063000 0.023000: require('conf.plugins.mellow')
0.028960 0.082000 0.020000: require('treesj.langs.starlark')
0.028620 0.048000 0.026000: require('cmp_buffer.timer')
0.028590 0.099000 0.020000: require('treesj.langs.r')
0.028570 0.067000 0.019000: require('telescope.state')
0.028510 0.044000 0.025000: require('mason-core.functional.type')
0.028500 0.082000 0.017000: require('leetcode.config.icons')
0.028490 0.083000 0.019000: require('treesj.langs.kotlin')
0.028140 0.066000 0.025000: require('nvim-treesitter.statusline')
0.028010 0.049000 0.021000: require('conf.plugins.harpoon')
0.027510 0.063000 0.023000: require('mason-core.functional.number')
0.027360 0.062000 0.021000: require('cmp.types.cmp')
0.027330 0.041000 0.024000: require('nvim-treesitter.compat')
0.027330 0.046000 0.023000: require('mason-core.functional.logic')
0.027240 0.582000 0.015000: require('leetcode.config.sessions')
0.027050 0.053000 0.022000: require('cmp.utils.highlight')
0.026790 0.301000 0.019000: require('neorg.core.callbacks')
0.026760 0.075000 0.016000: require('treesj.langs.html')
0.026350 0.104000 0.020000: require('treesj.langs.lua')
0.026150 0.051000 0.021000: require('cmp.utils.cache')
0.025850 0.052000 0.022000: require('cmp.utils.event')
0.025090 0.032000 0.024000: /usr/share/nvim/runtime/plugin/shada.vim
0.024860 0.074000 0.019000: require('oil.ringbuf')
0.024495 0.064000 0.007000: /home/squibid/.local/share/nvim/site/pack/deps/opt/instant.nvim/plugin/instant.vim
0.024390 0.109000 0.018000: require('treesj.langs.java')
0.024020 0.058000 0.021000: /usr/share/nvim/runtime/plugin/editorconfig.lua
0.023780 0.068000 0.016000: require('util.helpers')
0.023700 0.036000 0.021000: require('plenary.popup.utils')
0.023660 0.042000 0.021000: require('telescope.pickers.window')
0.023630 0.082000 0.017000: require('treesj.langs.c')
0.023470 0.187000 0.016000: require('neorg.modules.core.defaults.module')
0.022810 0.084000 0.016000: require('conf.plugins.todo-comments')
0.022540 0.053000 0.019000: require('treesj.langs.default_preset')
0.022250 0.052000 0.015000: require('cmp.config.sources')
0.021970 0.056000 0.017000: require('telescope.from_entry')
0.021940 0.046000 0.019000: require('mason-core.functional.relation')
0.021910 0.046000 0.016000: require('conf.plugins.mini-clue')
0.021900 0.045000 0.018000: require('luasnip.session.snippet_collection.source')
0.021840 0.052000 0.020000: require('plenary.window')
0.021690 0.547000 0.010000: require('leetcode.config.hooks')
0.021610 0.059000 0.016000: require('conf.plugins.fidget')
0.021190 0.048000 0.018000: require('oil-git-status.system')
0.021090 0.052000 0.017000: require('cmp.utils.pattern')
0.020370 0.044000 0.017000: require('treesj.langs.sql')
0.020330 0.045000 0.016000: require('treesj.langs.css')
0.020320 0.056000 0.014000: require('conf.plugins.mason')
0.020110 0.051000 0.016000: require('neorg.modules.core.integrations.zen_mode.module')
0.020060 0.027000 0.017000: require('harpoon.utils')
0.019830 0.070000 0.015000: require('treesj.langs.dart')
0.019730 0.286000 0.014000: require('luasnip.util.table')
0.019440 0.076000 0.015000: require('neorg.modules.core.concealer.preset_varied.module')
0.019440 0.049000 0.014000: require('luasnip.util.events')
0.019400 0.047000 0.014000: require('luasnip.util.types')
0.018880 0.033000 0.015000: require('cmp.config.window')
0.018070 0.033000 0.011000: /usr/share/nvim/runtime/indent.vim
0.018060 0.076000 0.013000: require('telescope.deprecated')
0.017940 0.040000 0.015000: require('cmp.utils.buffer')
0.017550 0.075000 0.014000: require('neorg.modules.core.concealer.preset_diamond.module')
0.017430 0.025000 0.015000: require('treesj.langs.haskell')
0.017380 0.036000 0.014000: require('nvim-ts-autotag._log')
0.017310 0.037000 0.013000: require('conf.plugins.dressing')
0.017160 0.029000 0.014000: require('vim.F')
0.016680 0.030000 0.015000: /usr/share/nvim/runtime/plugin/tohtml.lua
0.016350 0.042000 0.013000: require('cmp.utils.debug')
0.016280 0.067000 0.012000: require('treesj.langs.json')
0.016270 0.111000 0.008000: require('conf.plugins.ts-autotag')
0.016260 0.051000 0.014000: require('cmp.utils.options')
0.015980 0.047000 0.014000: /home/squibid/.local/share/nvim/site/pack/deps/opt/vimtex/ftdetect/cls.vim
0.015960 0.103000 0.010000: require('conf.plugins.treesj')
0.015940 0.087000 0.008000: require('conf.plugins.undotree')
0.015940 0.044000 0.009000: require('core.snippets.functions')
0.015800 0.029000 0.013000: require('luasnip.util.time')
0.015590 0.031000 0.013000: require('neorg.modules.core.concealer.preset_basic.module')
0.015430 0.026000 0.014000: require('mason-core.functional.data')
0.015180 0.026000 0.011000: require('luasnip.util.lazy_table')
0.015090 0.030000 0.012000: require('luasnip.extras.conditions.show')
0.014870 0.039000 0.013000: require('lsp_lines.config')
0.014450 0.021000 0.013000: require('mason-lspconfig.settings')
0.014320 0.043000 0.013000: require('mason-core.async.uv')
0.014180 0.025000 0.010000: require('conf.plugins.headlines')
0.014130 0.053000 0.011000: require('luasnip.nodes.key_indexer')
0.014075 0.038000 0.012000: /home/squibid/.local/share/nvim/site/pack/deps/opt/plenary.nvim/plugin/plenary.vim
0.013590 0.034000 0.009000: require('conf.plugins.nvim-colorizer')
0.013590 0.114000 0.009000: inits 2
0.013330 0.026000 0.008000: require('mason-lspconfig.server_config_extensions')
0.013180 0.041000 0.009000: require('conf.plugins.neogen')
0.013020 0.048000 0.009000: require('conf.plugins.project')
0.012830 0.030000 0.010000: /home/squibid/.local/share/nvim/site/pack/deps/opt/LuaSnip/plugin/luasnip.vim
0.012775 0.044000 0.003000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-jdtls/plugin/nvim_jdtls.vim
0.012580 0.032000 0.009000: require('conf.plugins.leetcode')
0.012380 0.054000 0.010000: require('treesj.langs.tsx')
0.012135 0.043000 0.006000: /home/squibid/.local/share/nvim/site/pack/deps/opt/vimtex/plugin/vimtex.vim
0.011910 0.038000 0.010000: /home/squibid/.local/share/nvim/site/pack/deps/opt/todo-comments.nvim/plugin/todo.vim
0.011770 0.036000 0.009000: require('oil.constants')
0.011710 0.084000 0.006000: require('conf.plugins.vimtex')
0.011620 0.034000 0.009000: require('mason-lspconfig.notify')
0.011580 0.038000 0.008000: require('util.connection')
0.011470 0.035000 0.007000: require('conf.plugins.comment')
0.011410 0.028000 0.010000: --- NVIM STARTED ---
0.011390 0.018000 0.010000: require('mason.version')
0.011260 0.038000 0.009000: require('treesj.langs.vue')
0.011180 0.035000 0.009000: require('treesj.langs.php_only')
0.011130 0.043000 0.008000: require('treesj.langs.toml')
0.010650 0.032000 0.008000: /home/squibid/.local/share/nvim/site/pack/deps/opt/helpful.vim/plugin/helpful.vim
0.010640 0.015000 0.009000: require('harpoon.autocmd')
0.010380 0.019000 0.007000: require('ffi')
0.010330 0.024000 0.007000: require('conf.plugins.lsp_lines')
0.010180 0.029000 0.006000: /home/squibid/.local/share/nvim/site/pack/deps/opt/zen-mode.nvim/plugin/zen-mode.vim
0.009980 0.030000 0.003000: /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-colorizer.lua/plugin/colorizer.vim
0.009800 0.030000 0.008000: require('treesj.langs.pug')
0.009690 0.033000 0.009000: /home/squibid/.local/share/nvim/site/pack/deps/opt/vimtex/ftdetect/tex.vim
0.009630 0.023000 0.008000: /home/squibid/.local/share/nvim/site/pack/deps/opt/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua
0.009620 0.028000 0.008000: require('treesj.langs.scss')
0.009520 0.027000 0.006000: require('conf.plugins.nyooom')
0.009430 0.038000 0.007000: require('cmp.types.vim')
0.009360 0.013000 0.008000: /home/squibid/.local/share/nvim/site/pack/deps/opt/vimtex/ftdetect/tikz.vim
0.009250 0.033000 0.008000: require('treesj.langs.jsonc')
0.008940 0.013000 0.007000: require('treesj.langs.svelte')
0.008480 0.040000 0.007000: require('treesj.langs.json5')
0.008380 0.015000 0.005000: clear screen
0.008310 0.027000 0.006000: require('conf.plugins.instant')
0.007290 0.017000 0.005000: require('conf.plugins.helpful')
0.007070 0.012000 0.006000: /usr/share/nvim/runtime/plugin/tutor.vim
0.006880 0.165000 0.004000: require('jsregexp.core')
0.006450 0.008000 0.006000: /usr/share/nvim/runtime/plugin/spellfile.vim
0.006130 0.012000 0.006000: inits 3
0.005720 0.013000 0.003000: window checked
0.004060 0.008000 0.003000: /usr/share/nvim/runtime/plugin/netrwPlugin.vim
0.003230 0.006000 0.002000: init default mappings & autocommands
0.003130 0.007000 0.003000: nvim_exec2() called at /home/squibid/.local/share/nvim/site/pack/deps/opt/nvim-cmp/plugin/cmp.lua:0
0.002690 0.011000 0.002000: parsing arguments
0.002330 0.006000 0.002000: /home/squibid/.local/share/nvim/rplugin.vim
0.001490 0.002000 0.001000: editing files in windows
0.000999 0.026000 0.000000: nvim_exec2() called at ColorScheme Autocommands for "*":0
0.000310 0.001000 0.000000: --- NVIM STARTING ---

View File

@ -1,3 +0,0 @@
# TODO:
# add something to check if we need to run bear again to update
# clangd build options

View File

@ -1,6 +1,4 @@
-- TODO: after switching to dep with lazy loading check out vim-startuptime -- load core utilities
-- again
_G.core = require("core") _G.core = require("core")
-- enable performance stuff -- enable performance stuff
@ -9,35 +7,27 @@ vim.loader.enable()
-- load user config -- load user config
require("conf") require("conf")
-- setup lsp stuff
core.lsp.setup()
-- bootstrap plugin manager -- bootstrap plugin manager
local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep" local path = vim.fn.stdpath("data").."/site/pack/deps/opt/dep"
if vim.fn.empty(vim.fn.glob(path)) > 0 then if not vim.uv.fs_stat(path) then
vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/dep", vim.fn.system({ "git", "clone", "--depth=1", "https://git.squi.bid/squibid/dep",
path }) "--branch=lazy", path })
end end
vim.opt.rtp:prepend(path)
vim.cmd("packadd dep") vim.cmd("packadd dep")
_G.dep_short = require("dep.lazy.loader.short")
-- load plugins -- load plugins
require("dep") { require("dep") {
{ "squibid/dep", { "squibid/dep",
url = "https://git.squi.bid/dep", url = "https://git.squi.bid/squibid/dep",
branch = "dev" branch = "lazy"
}, },
load = function() modules = {
-- aquire all plugin specs prefix = "conf.plugins"
local plugs = {} }
for _, file in ipairs(vim.api.nvim_get_runtime_file(
"lua/conf/plugins/*.lua", true)) do
local ret = require("conf.plugins."..file:gsub("^.*/", ""):gsub("%.lua$",
""))
if type(ret) ~= "boolean" then
plugs[#plugs + 1] = ret
end
end
return plugs
end
} }

View File

@ -1,6 +1,6 @@
local auto, augroup = core.misc.auto, core.misc.augroup local auto, augroup = core.misc.auto, core.misc.augroup
-- auto commands which interact with bufferes without modifying them -- auto commands which interact with buffers without modifying them
local bufcheck = augroup("bufcheck") local bufcheck = augroup("bufcheck")
-- auto commands which modify things on the filesystem -- auto commands which modify things on the filesystem
local fsmod = augroup("fsmod") local fsmod = augroup("fsmod")
@ -11,14 +11,6 @@ auto("FocusGained", {
command = "checktime" command = "checktime"
}) })
auto("TextYankPost", {
group = bufcheck,
desc = "Highlight on yank.",
callback = function()
vim.highlight.on_yank { timeout = 250 }
end
})
auto("BufRead", { auto("BufRead", {
group = bufcheck, group = bufcheck,
desc = "Return to the last place the buffer was closed in.", desc = "Return to the last place the buffer was closed in.",
@ -38,14 +30,4 @@ auto("BufWritePre", {
end end
}) })
auto("BufWritePre", {
group = fsmod,
desc = "Basically mkdir -p.",
callback = function(ctx)
if ctx.match:match("^%w%w+://") then return end
local dir = vim.fn.fnamemodify(ctx.file, ":p:h")
vim.fn.mkdir(dir, "p")
end
})
core.color.setup_termbg_sync() core.color.setup_termbg_sync()

View File

@ -1,64 +1,65 @@
local map = core.misc.map local map, lz = core.misc.map, core.misc.lz
--- feed keys as userinput
---@param keys string keys
local function feedkeys(keys)
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(keys, true, false, true),
"n", true)
end
-- vim binds -- vim binds
vim.g.mapleader = " " -- set leader key vim.g.mapleader = " " -- set leader key
map("x", "<leader>p", [["_dP]], { desc = "Greatest remap of all time." }) map("x", "<leader>p", [["_dP]], { desc = "Greatest remap of all time." })
map("n", "<esc>", ":nohlsearch<Bar>:echo<CR>", { desc = "Clear search." }) map("n", "<esc>", "<cmd>noh<Bar>:ec<CR>", { desc = "Clear search." })
-- move selected text up/down map("n", "<leader>a", lz "<cmd>e #<CR>zz", { desc = "swap to alt file" })
map("v", "<S-k>", ":m '<-2<CR>gv=gv", { desc = "Move selected text up." })
map("v", "<S-j>", ":m '>+1<CR>gv=gv", { desc = "Move selected text down." })
-- the cursor STAYS IN THE MIDDLE -- the cursor STAYS IN THE MIDDLE
map("n", "<S-j>", "mzJ`z<cmd>delm z<CR>") -- when combining lines map("n", "<S-j>", lz "mzJ`z<cmd>delm z<CR>") -- when combining lines
map("n", "n", "nzzzv") -- when searching map("n", "n", lz "nzzzv") -- when searching
map("n", "N", "Nzzzv") map("n", "N", lz "Nzzzv")
map("n", "<C-d>", "<C-d>zzzv") -- half page jumping map("n", "<C-d>", lz "<C-d>zz") -- half page jumping
map("n", "<C-u>", "<C-u>zzzv") map("n", "<C-u>", lz "<C-u>zz")
map("n", "<C-o>", lz "<C-o>zz") -- jump history
map("n", "<C-i>", lz "<C-i>zz")
map({ "n", "i" }, "<C-c>", "<Esc>") -- trigger completion menu
-- (stolen from https://gist.github.com/MariaSolOs/2e44a86f569323c478e5a078d0cf98cc)
map("n", "<leader>x", function() -- execute order 111 map("i", "<C-n>", function()
local fn = vim.fn.expand("%:p") -- if the completion menu is already visible just go to the next item
if vim.fn.getftype(fn) == "file" then if vim.fn.pumvisible() ~= 0 then
local perm = vim.fn.getfperm(fn) feedkeys("<C-n>")
if string.match(perm, "x", 3) then
vim.notify("Removed executable flags")
vim.fn.setfperm(fn, string.sub(fn, 1, 2).."-"..string.sub(fn, 4, 5).."-"
..string.sub(fn, 7, 8).."-")
else else
vim.notify("Add executable flags") if #vim.lsp.get_clients({ bufnr = 0 }) > 0 then
vim.fn.setfperm(fn, string.sub(fn, 1, 2).."x"..string.sub(fn, 4, 5).."x" vim.lsp.completion.get()
..string.sub(fn, 7, 8).."x")
end
else else
vim.notify("File doesn't exist") if vim.bo.omnifunc == "" then
feedkeys("<C-x><C-n>")
else
feedkeys("<C-x><C-o>")
end end
end, { desc = "toggle executable flag of the file" })
-- good spell suggestion ui
-- (stolen from https://github.com/neovim/neovim/pull/25833)
vim.keymap.set("n", "z=", function()
local spell_on_choice = vim.schedule_wrap(function(_, idx)
if type(idx) == "number" then
vim.cmd("normal! "..idx.."z=")
end end
end)
if vim.v.count > 0 then
spell_on_choice(nil, vim.v.count)
return
end end
local cword = vim.fn.expand("<cword>") end, { desc = "Trigger/select next completion" })
local prompt = "Change "..vim.inspect(cword).." to:" map("i", "<C-s>", "<C-x><C-s>", { desc = "Trigger spell completion" })
vim.ui.select(vim.fn.spellsuggest(cword, vim.o.lines), { prompt = prompt }, map("n", "<C-s>", lz "<cmd>se spell<CR>ea<C-x><C-s><cmd>se nospell<CR>", { desc = "Trigger spell completion" })
spell_on_choice)
end, { desc = "Shows spelling suggestions" })
-- quickfix -- quickfix
map("n", "<M-j>", "<cmd>cnext<CR>") map("n", "<M-j>", "<cmd>cnext<CR>", { desc = "qf next" })
map("n", "<M-k>", "<cmd>cprev<CR>") map("n", "<M-k>", "<cmd>cprev<CR>", { desc = "qf prev" })
map("n", "<M-c>", "<cmd>cclose<CR>") map("n", "<M-c>", "<cmd>cclose<CR>", { desc = "qf close" })
map("n", "<M-x>", "<cmd>cope<CR>", { desc = "qf open" })
-- man pages -- man pages
map("n", "<C-k>", "<cmd>Man<CR>") map("n", "<C-k>", "<cmd>Man<CR>")
-- okay this is gonna sound crazy, but I like emacs binds for editing when I'm
-- stuck without modal editing like in command mode.
map("c", "<C-a>", function() feedkeys("<Home>") end)
map("c", "<C-e>", function() feedkeys("<End>") end)
map("c", "<C-d>", function() feedkeys("<Del>") end)
-- execute line/block
map("n", "<leader>x", ":.lua<CR>")
map("x", "<leader>x", ":lua<CR>")

View File

@ -1,94 +1,49 @@
local auto = core.misc.auto -- make .h files default to c code
vim.filetype.add({ extension = { h = "c", }, })
-- color stuff
if vim.fn.has("termguicolors") then
vim.opt.termguicolors = true
end
-- numbers -- numbers
vim.opt.number = true vim.o.nu = true
vim.opt.relativenumber = true vim.o.rnu = true
-- buffer -- buffer
vim.opt.scrolloff = 5 vim.o.lbr = true -- fix where line is wraped
vim.opt.wrap = true -- wraping lines vim.o.cul = true
vim.opt.linebreak = true -- fix where line is wraped vim.o.cc = "80"
vim.opt.cursorline = true
vim.opt.colorcolumn = { 80 }
-- indents + tabs -- indents + tabs
local tabwidth = 2 local tabwidth = 2
vim.opt.expandtab = true vim.o.ts = tabwidth
vim.opt.smarttab = true vim.o.sw = tabwidth
vim.opt.cindent = true vim.o.sts = -1
vim.opt.autoindent = true
vim.opt.tabstop = tabwidth
vim.opt.shiftwidth = tabwidth
vim.opt.softtabstop = tabwidth
-- Schedule the setting after `UiEnter` because it can increase startup-time. -- Schedule the setting after `UiEnter` because it can increase startup-time.
-- (yoinked from kickstart.nvim) -- (yoinked from kickstart.nvim)
vim.schedule(function() vim.schedule(function()
vim.opt.clipboard = "unnamedplus" -- system clipboard vim.o.cb = "unnamedplus" -- system clipboard
end) end)
vim.opt.updatetime = 200
-- file saving -- file saving
vim.opt.swapfile = false vim.o.swf = false
vim.opt.undofile = true vim.o.udf = true
vim.opt.confirm = true
-- searching -- searching
vim.opt.ignorecase = true vim.o.ic = true
vim.opt.smartcase = true
vim.opt.wrapscan = true -- make windows look nice
vim.opt.showmatch = true vim.o.winborder = "solid"
vim.opt.incsearch = true
-- wild menus -- wild menus
vim.opt.wildoptions = "pum" vim.o.ph = 20
vim.opt.pumblend = 3 vim.o.wic = true
vim.opt.pumheight = 20 vim.o.wop = "fuzzy,pum,tagfile"
vim.opt.wildignorecase = true -- completion
vim.opt.wildignore = "*.o" vim.o.cot = "menu,menuone,noinsert,fuzzy,popup"
vim.o.cia = "kind,abbr,menu"
-- netrw -- waiting for https://github.com/neovim/neovim/pull/25541 to land
vim.g.netrw_banner = 0 -- vim.o.completepopup = "border:"..vim.o.winborder
vim.g.netrw_winsize = 30
vim.g.netrw_liststyle = 1
vim.g.netrw_sizestyle = "H"
vim.g.netrw_hide = 1
-- border (this doesn't actually do anything within vim, I"m just setting it
-- here so it"s easy to find)
vim.g.border_style = "solid"
do -- folding
auto("FileType", {
callback = function()
-- use treesitter for folding
if require("nvim-treesitter.parsers").has_parser() then
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
else
vim.opt.foldmethod = "syntax"
end
end
})
vim.opt.foldlevelstart = 99
vim.opt.foldlevel = 99
vim.opt.foldenable = true
vim.o.fillchars = "fold: "
vim.opt.foldtext = "v:lua.core.folding()"
end
do -- statusline do -- statusline
local last_bufnr, i = 1, 1
--- status line
---@return string out formatted status line ---@return string out formatted status line
function _G.Status() function _G.Status()
--- get the percentage through the file --- get the percentage through the file
@ -111,61 +66,10 @@ do -- statusline
return percent.."%%" return percent.."%%"
end end
--- get the number of lsp servers -- this is my statusline:
---@return string out the formatted number of servers --
local function lsp_servers() -- opts.lua [+] λ1 163,61-60 88%
local out, nclients, hi --
local hi_groups = { "@boolean", "@constant", "@keyword", "@number" }
-- get the number of clients
nclients = #vim.lsp.get_clients({ bufnr = 0 })
-- set the client display
out = "λ"..nclients
if nclients > 0 then
local bufnr = vim.api.nvim_win_get_buf(0)
if bufnr ~= last_bufnr then
last_bufnr = bufnr
i = i + 1
if i > #hi_groups then
i = 1
end
end
hi = "%#"..hi_groups[i].."#"
out = hi..out.."%#StatusLine#"
end
return out
end
--- get git status information
---@return string out git status information or nothing
local function gitsigns()
local reset = "%#StatusLine#"
local hl = reset
local lil_guy = "o/"
---@type table
local status = vim.b.gitsigns_status_dict
if not status then
return ""
end
if status.removed and status.removed > 0 then
hl = "%#GitSignsDelete#"
lil_guy = "<o>"
elseif status.changed and status.changed > 0 then
hl = "%#GitSignsChange#"
lil_guy = "o7"
elseif status.added and status.added > 0 then
hl = "%#GitSignsAdd#"
lil_guy = "\\o/"
end
return hl..lil_guy..reset
end
return table.concat { return table.concat {
"%t", -- file name "%t", -- file name
" %h", -- help buffer tag " %h", -- help buffer tag
@ -173,10 +77,8 @@ do -- statusline
"%r", -- readonly flag "%r", -- readonly flag
"%=", -- seperate left and right side "%=", -- seperate left and right side
-- print out git status information in the form of a lil guy
gitsigns(), " ",
-- print out the number of lsp clients attached with nice colors :) -- print out the number of lsp clients attached with nice colors :)
lsp_servers(), " ", "λ"..#vim.lsp.get_clients({ bufnr = 0 }), " ",
"%<", -- we can start truncating here (I want to keep the file name) "%<", -- we can start truncating here (I want to keep the file name)
"%l,%c%V", -- line, column-virtual column "%l,%c%V", -- line, column-virtual column
@ -184,6 +86,6 @@ do -- statusline
" "..percentage() -- percentage through the buffer " "..percentage() -- percentage through the buffer
} }
end end
vim.opt.statusline = "%!v:lua.Status()" vim.o.stl = "%!v:lua.Status()"
vim.opt.laststatus = 3 vim.o.ls = 3
end end

View File

@ -1,125 +0,0 @@
return { "Saghen/blink.cmp",
branch = "v1.2.0",
requires = {
"xzbdmw/colorful-menu.nvim",
"L3MON4D3/LuaSnip"
},
function()
local colormenu = require("colorful-menu")
require("blink.cmp").setup {
keymap = {
preset = "none", -- I don't like the default documentation scroll binds
["<C-y>"] = { "select_and_accept" },
["<C-n>"] = { "select_next", "fallback_to_mappings" },
["<C-p>"] = { "select_prev", "fallback_to_mappings" },
["<C-u>"] = { "scroll_documentation_up", "fallback" },
["<C-d>"] = { "scroll_documentation_down", "fallback" }
},
completion = {
menu = {
scrollbar = false,
border = vim.g.border_style,
draw = {
columns = {
{ "kind_icon" },
{ "label", "label_description", gap = 1 },
{ "kind" }
},
-- blink.cmp should not take this much damn work to make it look
-- semi-decent
components = {
-- we replace the kind icon with the an icon for the source
kind_icon = {
text = function(ctx)
local menu_icon = {
"?", -- fallback
lsp = "λ",
snippets = "%",
buffer = "@",
path = "#",
cmdline = "$"
}
local icon = menu_icon[ctx.source_id]
if icon == nil then
icon = menu_icon[1]
end
return icon
end,
highlight = function(_)
return { { group = "CmpItemMenu" } }
end
},
label = {
text = function(ctx)
return colormenu.blink_components_text(ctx)
end,
highlight = function(ctx)
return colormenu.blink_components_highlight(ctx)
end
},
kind = {
-- these highlights are technically for nvim-cmp, but they're
-- built into my colorscheme so I don"t mind using them here
highlight = function(ctx)
return {
{ group = "CmpItemKind"..ctx.kind, priority = 20000 }
}
end
}
}
}
},
ghost_text = {
enabled = true
},
-- documentation should show up immediately
documentation = {
auto_show = true,
auto_show_delay_ms = 0,
window = {
border = vim.g.border_style
}
}
},
-- I like the default command line completion
cmdline = {
enabled = false
},
-- signature support is necessary
signature = {
enabled = true,
window = {
border = vim.g.border_style
}
},
-- TODO: find a way to make my fancy luasnip snippets with multiple
-- triggers not look stupid e.g. "fn\|main" for a function that could
-- be triggered by fn or main
snippets = {
preset = "luasnip"
},
sources = {
default = { "lsp", "path", "snippets", "buffer" }
},
fuzzy = {
implementation = "prefer_rust_with_warning",
sorts = {
"score",
"sort_text"
}
}
}
end
}

View File

@ -1,7 +0,0 @@
return { "numToStr/Comment.nvim",
function()
require("Comment").setup {
ignore = "^$"
}
end
}

View File

@ -1,7 +0,0 @@
return { "mfussenegger/nvim-dap-python",
requires = "mfussenegger/nvim-dap",
function()
local debugpy = core.mason.get_pkg_path("debugpy", "/venv/bin/python3")
require("dap-python").setup(debugpy)
end
}

View File

@ -1,27 +0,0 @@
return { "theHamsta/nvim-dap-virtual-text",
requires = {
"nvim-treesitter/nvim-treesitter",
"mfussenegger/nvim-dap"
},
function()
require("nvim-dap-virtual-text").setup {
virt_text_pos = vim.fn.has("nvim-0.10") == 1 and "inline" or "eol",
--- A callback that determines how a variable is displayed or whether it should be omitted
--- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
--- @param buf number
--- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
--- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
--- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
--- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
display_callback = function(variable, buf, stackframe, node, options)
-- by default, strip out new line characters
if options.virt_text_pos == "inline" then
return " = "..variable.value:gsub("%s+", " ")
else
return variable.name.." = "..variable.value:gsub("%s+", " ")
end
end
}
end
}

View File

@ -4,16 +4,19 @@ local keymap_restore = {}
--- make the default hover binding work for nvim-dap instead of lsp --- make the default hover binding work for nvim-dap instead of lsp
local function set_hover_bind() local function set_hover_bind()
for _, buf in pairs(vim.api.nvim_list_bufs()) do for _, buf in pairs(vim.api.nvim_list_bufs()) do
local keymaps = vim.api.nvim_buf_get_keymap(buf, 'n') local keymaps = vim.api.nvim_buf_get_keymap(buf, "n")
for _, keymap in pairs(keymaps) do for _, keymap in pairs(keymaps) do
if keymap.lhs == "K" then if keymap.lhs == "K" then
table.insert(keymap_restore, keymap) table.insert(keymap_restore, keymap)
vim.api.nvim_buf_del_keymap(buf, 'n', 'K') vim.api.nvim_buf_del_keymap(buf, "n", "K")
end end
end end
end end
vim.keymap.set('n', 'K', require("dap.ui.widgets").hover, map("n", "K", function()
{ silent = true }) require("dap.ui.widgets").hover(nil, {
border = vim.g.border_style
})
end, { silent = true })
end end
--- revert the hover bind back to whatever it was --- revert the hover bind back to whatever it was
@ -30,14 +33,25 @@ local function unset_hover_bind()
keymap_restore = {} keymap_restore = {}
end end
return { "mfussenegger/nvim-dap", return {
requires = { { "mfussenegger/nvim-dap",
reqs = {
"mason-org/mason.nvim", "mason-org/mason.nvim",
"nvim-telescope/telescope.nvim" "nvim-telescope/telescope.nvim"
}, },
disable = not vim.fn.has("nvim-0.9.5"), deps = "theHamsta/nvim-dap-virtual-text",
branch = "0.10.0", branch = "0.10.0",
function() lazy = function(load)
load:keymap("n", "<leader>ec")
load:keymap("n", "<leader>el")
load:keymap("n", "<leader>et")
load:keymap("n", "<leader>eb")
load:keymap("n", "<leader>e]")
load:keymap("n", "<leader>e[")
load:keymap("n", "<leader>er")
load:keymap("n", "<leader>eR")
end,
load = function()
local dap = require("dap") local dap = require("dap")
-- define codelldb -- define codelldb
@ -53,7 +67,7 @@ return { "mfussenegger/nvim-dap",
type = "codelldb", type = "codelldb",
request = "launch", request = "launch",
program = function() program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd()..'/', 'file') return vim.fn.input("Path to executable: ", vim.fn.getcwd().."/", "file")
end, end,
cwd = "${workspaceFolder}", cwd = "${workspaceFolder}",
@ -82,7 +96,46 @@ return { "mfussenegger/nvim-dap",
map("n", "<leader>eR", dap.restart, { desc = "dap restart" }) map("n", "<leader>eR", dap.restart, { desc = "dap restart" })
-- events -- events
dap.listeners.after['event_initialized']['me'] = set_hover_bind dap.listeners.after["event_initialized"]["me"] = set_hover_bind
dap.listeners.after['event_terminated']['me'] = unset_hover_bind dap.listeners.after["event_terminated"]["me"] = unset_hover_bind
end end
},
{ "theHamsta/nvim-dap-virtual-text",
reqs = {
"nvim-treesitter/nvim-treesitter",
"mfussenegger/nvim-dap"
},
lazy = dep_short.cmd("DapVirtualTextToggle"),
load = function()
require("nvim-dap-virtual-text").setup {
virt_text_pos = vim.fn.has("nvim-0.10") == 1 and "inline" or "eol",
--- A callback that determines how a variable is displayed or whether it should be omitted
--- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
--- @param buf number
--- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
--- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
--- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
--- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
display_callback = function(variable, buf, stackframe, node, options)
-- by default, strip out new line characters
if options.virt_text_pos == "inline" then
return " = "..variable.value:gsub("%s+", " ")
else
return variable.name.." = "..variable.value:gsub("%s+", " ")
end
end
}
end
},
{ "mfussenegger/nvim-dap-python",
reqs = "mfussenegger/nvim-dap",
lazy = dep_short.ft("python"),
load = function()
local debugpy = core.mason.get_pkg_path("debugpy", "/venv/bin/python3")
require("dap-python").setup(debugpy)
end
}
} }

View File

@ -1,36 +0,0 @@
return { "j-hui/fidget.nvim",
disable = not vim.fn.has("nvim-0.9.0"),
branch = "v1.5.0",
function()
local notification_defaults = require("fidget.notification").default_config
notification_defaults["icon"] = ""
require("fidget").setup {
progress = {
display = {
progress_icon = {
pattern = "line",
period = 1
},
done_icon = ":)"
}
},
notification = {
filter = vim.log.levels.DEBUG,
override_vim_notify = true,
configs = {
default = notification_defaults
},
view = {
icon_separator = " ",
group_separator = "---",
group_separator_hl = "Comment"
},
window = {
zindex = 44,
relative = "editor"
}
}
}
end
}

View File

@ -1,77 +0,0 @@
local map = core.misc.map
return { "lewis6991/gitsigns.nvim",
disable = not vim.fn.has("nvim-0.9.0"),
function()
local gs = require("gitsigns")
gs.setup {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "-" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" }
},
signcolumn = true,
numhl = false,
linehl = false,
word_diff = false,
watch_gitdir = {
interval = 1000,
follow_files = true
},
attach_to_untracked = true,
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
preview_config = { border = vim.g.border_style },
on_attach = function(bufnr)
local opts = { buffer = bufnr }
-- Navigation
map("n", "]c", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function() gs.next_hunk() end)
return "<Ignore>"
end, { expr = true, buffer = bufnr })
map("n", "[c", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function() gs.prev_hunk() end)
return "<Ignore>"
end, { expr = true, buffer = bufnr })
-- Actions
map("n", "<leader>hs", gs.stage_hunk, opts)
map("n", "<leader>hr", gs.reset_hunk, opts)
map("v", "<leader>hs", function()
gs.stage_hunk { vim.fn.line("."), vim.fn.line("v") }
end, opts)
map("v", "<leader>hr", function()
gs.reset_hunk { vim.fn.line("."), vim.fn.line("v") }
end, opts)
map("n", "<leader>hS", gs.stage_buffer, opts)
map("n", "<leader>hu", gs.undo_stage_hunk, opts)
map("n", "<leader>hR", gs.reset_buffer, opts)
map("n", "<leader>hp", gs.preview_hunk, opts)
map("n", "<leader>hb", function() gs.blame_line { full=true } end, opts)
map("n", "<leader>tb", gs.toggle_current_line_blame, opts)
map("n", "<leader>hd", gs.diffthis, opts)
map("n", "<leader>hD", function() gs.diffthis("~") end, opts)
map("n", "<leader>td", gs.toggle_deleted, opts)
-- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", opts)
end
}
end
}

View File

@ -1,32 +0,0 @@
-- TODO: might end up writing my own because I like harpoon, but I hate that it
-- doesn't work properly without being pinned to a specific commit
local map = core.misc.map
return { "ThePrimeagen/harpoon",
disable = not vim.fn.has("nvim-0.8.0"),
commit = "e76cb03",
branch = "harpoon2",
requires = "nvim-lua/plenary.nvim",
function()
local harpoon = require("harpoon")
harpoon:setup()
map("n", "<leader>a", function()
harpoon:list():add()
vim.notify("added "..vim.fn.expand("%:t").." to quickmarks")
end, { desc = "add current file to quickmarks" })
map("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
map("n", "<C-h>", function() harpoon:list():select(1) end)
map("n", "<C-t>", function() harpoon:list():select(2) end)
map("n", "<C-n>", function() harpoon:list():select(3) end)
map("n", "<C-c>", function() harpoon:list():select(4) end)
-- Toggle previous & next buffers stored within Harpoon list
map("n", "<C-S-P>", function() harpoon:list():prev() end)
map("n", "<C-S-N>", function() harpoon:list():next() end)
end
}

View File

@ -1 +0,0 @@
return { "tweekmonster/helpful.vim" }

View File

@ -1,5 +0,0 @@
return { "jbyuki/instant.nvim",
function()
vim.g.instant_username = "squibid"
end
}

View File

@ -1,4 +0,0 @@
return { "mfussenegger/nvim-jdtls",
disable = not vim.fn.has("nvim-0.6.0"),
requires = "mfussenegger/nvim-dap"
}

54
lua/conf/plugins/lsp.lua Normal file
View File

@ -0,0 +1,54 @@
local nonels_augroup = core.misc.augroup("nullls formatting")
return {
{ "mason-org/mason.nvim",
reqs = "neovim/nvim-lspconfig",
load = function()
require("mason").setup {
ui = {
-- not sure why these are nerdfont icons by default
icons = {
package_installed = "+",
package_pending = "?",
package_uninstalled = "x"
}
}
}
core.mason.ensure_installed()
end
},
{ "mfussenegger/nvim-jdtls",
reqs = "mfussenegger/nvim-dap"
},
{ "nvimtools/none-ls.nvim",
lazy = dep_short.ft("python"),
load = function()
local null_ls = require("null-ls")
null_ls.setup {
sources = {
null_ls.builtins.formatting.black
},
on_attach = function(client, bufnr)
if client:supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({
group = nonels_augroup,
buffer = bufnr
})
core.misc.auto("BufWritePre", {
group = nonels_augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ bufnr = bufnr })
end
})
end
end
}
end
}
}

View File

@ -1,28 +0,0 @@
return { "neovim/nvim-lspconfig",
disable = not vim.fn.has("nvim-0.10.0"),
requires = {
"mason-org/mason.nvim",
"mason-org/mason-lspconfig.nvim"
},
function()
core.lsp.setup()
require("mason-lspconfig").setup {
ensure_added = {
"clangd",
"mesonlsp",
"bashls",
"jdtls",
"lua_ls",
"stylua",
-- python
"basedpyright",
"mypy",
"black",
"debugpy"
}
}
end
}

View File

@ -1,74 +1,49 @@
local map, auto = core.misc.map, core.misc.auto local map = core.misc.map
return { "L3MON4D3/LuaSnip", return { "L3MON4D3/LuaSnip",
branch = "v2.4.0", branch = "v2.*",
disable = not vim.fn.has("nvim-0.7.0"),
config = function() config = function()
vim.cmd("make install_jsregexp") vim.cmd("make install_jsregexp")
end, end,
function() lazy = function(load)
local luasnip = require("luasnip") load:keymap({"i", "s"}, "<c-a>")
local types = require("luasnip.util.types") load:keymap({"i", "s"}, "<c-e>")
load:keymap({"i", "s"}, "<c-j>")
load:keymap({"i", "s"}, "<c-k>")
load:auto("InsertEnter")
end,
load = function()
local ls = require("luasnip")
luasnip.config.set_config { -- replace the builtin snippet handler with luasnip so I get all my fancy
history = true, -- return back into snippet -- stuff
enable_autosnippets = true, vim.snippet.expand = ls.lsp_expand
-- update on text insert and cursor hold ls.config.setup {
updateevents = { "TextChanged", "TextChangedI", "CursorHold" }, keep_roots = true,
ext_opts = { link_roots = true,
[types.choiceNode] = { link_children = true,
active = { exit_roots = not true
virt_text = {{ "", "@boolean" }}
}
},
[types.insertNode] = {
active = {
virt_text = {{ "", "@constant" }}
}
}
}
} }
map({"i", "s"}, "<c-a>", function() map({"i", "s"}, "<C-e>", ls.expand)
if luasnip.choice_active() then map({"i", "s"}, "<C-j>", function() ls.jump(1) end)
luasnip.change_choice(1) map({"i", "s"}, "<C-k>", function() ls.jump(-1) end)
map({"i", "s"}, "<C-a>", function()
if ls.choice_active() then
ls.change_choice(1)
end end
end) end)
map({"i", "s"}, "<c-e>", function() -- collect all snippets and add them
if luasnip.expandable() then
luasnip.expand()
end
end)
map({"i", "s"}, "<C-j>", function()
if luasnip.jumpable(1) then
luasnip.jump(1)
end
end)
map({"i", "s"}, "<C-k>", function()
if luasnip.jumpable(-1) then
luasnip.jump(-1)
end
end)
-- collect all snippets and add them when in the correct file type
for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua", for _, file in ipairs(vim.api.nvim_get_runtime_file("lua/snippets/*.lua",
true)) do true)) do
local fn = file:gsub("^.*/", ""):gsub("%.lua$", "") local fn = file:gsub("^.*/", ""):gsub("%.lua$", "")
auto("FileType", {
pattern = fn,
once = true,
callback = function()
local ret = require("snippets."..fn) local ret = require("snippets."..fn)
if type(ret) ~= "boolean" then if type(ret) ~= "boolean" then
luasnip.add_snippets(fn, ret, { key = fn }) ls.add_snippets(fn, ret, { key = fn })
end end
end end
})
end
end end
} }

View File

@ -1,31 +0,0 @@
return { "mason-org/mason.nvim",
disable = not vim.fn.has("nvim-0.7.0"),
function()
local mason = require("mason")
mason.setup {
ui = {
border = vim.g.border_style,
width = 0.8,
height = 0.9,
icons = {
package_installed = "+",
package_pending = "?",
package_uninstalled = "x"
}
},
keymaps = {
toggle_package_expand = "<CR>",
install_package = "i",
update_package = "u",
check_package_version = "c",
update_all_packages = "U",
check_outdated_packages = "C",
uninstall_package = "r",
cancel_installation = "<C-c>",
apply_language_filter = "<C-f>"
}
}
end
}

View File

@ -1,29 +1,40 @@
return { "mellow-theme/mellow.nvim", return { "mellow-theme/mellow.nvim",
disable = not vim.fn.has("nvim-0.8.0"), reqs = "nvim-treesitter/nvim-treesitter",
requires = "nvim-treesitter/nvim-treesitter", load = function()
function()
vim.g.mellow_variant = "dark" vim.g.mellow_variant = "dark"
local c = require("mellow.colors")[vim.g.mellow_variant] local c = require("mellow.colors")[vim.g.mellow_variant]
if vim.g.mellow_variant == "dark" then
vim.g.mellow_highlight_overrides = { vim.g.mellow_highlight_overrides = {
-- stop inactive windows from having a darker bg -- stop inactive windows from having a darker bg
["NormalNC"] = { link = "Normal" }, ["NormalNC"] = { link = "Normal" },
-- revert change with statusline coloring
["StatusLine"] = { fg = c.white, bg = c.gray01 },
["StatusLineNC"] = { fg = c.bg_dark },
-- make splits look cleaner
["WinSeparator"] = { fg = c.gray01 },
-- make floats darker -- make floats darker
["NormalFloat"] = { fg = c.fg, bg = "#111111" }, ["NormalFloat"] = { fg = c.fg, bg = "#111111" },
["FloatBorder"] = { link = "NormalFloat" }, ["FloatBorder"] = { link = "NormalFloat" },
-- Make pmenu look good
["Pmenu"] = { link = "NormalFloat" },
["PmenuSel"] = { link = "Normal" },
["PmenuKind"] = { link = "@constant" },
["PmenuKindSel"] = {
fg = core.color.copyhl("Comment").fg,
bold = true
},
-- make diagnostics have an undercurl -- make diagnostics have an undercurl
["DiagnosticUnderlineError"] = { fg = c.red, undercurl = true }, ["DiagnosticUnderlineError"] = { fg = c.red, undercurl = true },
["DiagnosticUnderlineWarn"] = { fg = c.yellow, undercurl = true }, ["DiagnosticUnderlineWarn"] = { fg = c.yellow, undercurl = true },
["DiagnosticUnderlineInfo"] = { fg = c.blue, undercurl = true }, ["DiagnosticUnderlineInfo"] = { fg = c.blue, undercurl = true },
["DiagnosticUnderlineHint"] = { fg = c.cyan, undercurl = true }, ["DiagnosticUnderlineHint"] = { fg = c.cyan, undercurl = true },
["DiagnosticHint"] = { fg = c.cyan }, -- revert
-- make blink actually look nice
["BlinkCmpMenu"] = { link = "NormalFloat" },
["BlinkCmpMenuBorder"] = { link = "BlinkCmpMenu" },
["BlinkCmpMenuSelection"] = { bg = c.gray01 },
["BlinkCmpLabelDeprecated"] = { link = "CmpItemAbbrDeprecated" },
-- telescope styling so I can see when coding outside (real) -- telescope styling so I can see when coding outside (real)
["TelescopeResultsNormal"] = { bg = c.bg_dark }, ["TelescopeResultsNormal"] = { bg = c.bg_dark },
@ -36,4 +47,5 @@ return { "mellow-theme/mellow.nvim",
["TelescopePreviewBorder"] = { link = "TelescopePreviewNormal" } ["TelescopePreviewBorder"] = { link = "TelescopePreviewNormal" }
} }
end end
end
} }

View File

@ -1,11 +1,12 @@
local map = core.misc.map local map = core.misc.map
return { "danymat/neogen", return { "danymat/neogen",
requires = { reqs = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"L3MON4D3/LuaSnip" "L3MON4D3/LuaSnip"
}, },
function() lazy = dep_short.keymap("n", "<leader>d"),
load = function()
local neogen = require("neogen") local neogen = require("neogen")
neogen.setup { neogen.setup {
enabled = true, enabled = true,

View File

@ -1,31 +0,0 @@
local augroup = core.misc.augroup("nullls formatting")
return { "nvimtools/none-ls.nvim",
function()
local null_ls = require("null-ls")
null_ls.setup {
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.mypy
},
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({
group = augroup,
buffer = bufnr
})
core.misc.auto("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ bufnr = bufnr })
end
})
end
end
}
end
}

View File

@ -1,9 +0,0 @@
return { "norcalli/nvim-colorizer.lua",
disable = not vim.fn.has("nvim-0.4.0") and not vim.fn.has("termguicolors"),
function()
require("colorizer").setup(nil, {
names = false,
css = true
})
end
}

View File

@ -1,51 +1,5 @@
local map = core.misc.map local map = core.misc.map
-- helper function to parse output
local function parse_output(proc)
local result = proc:wait()
local ret = {}
if result.code == 0 then
for line in vim.gsplit(result.stdout, "\n", {
plain = true, trimempty = true }) do
-- Remove trailing slash
line = line:gsub("/$", "")
ret[line] = true
end
end
return ret
end
-- build git status cache
local function new_git_status()
return setmetatable({}, {
__index = function(self, key)
local ignore_proc = vim.system(
{ "git", "ls-files", "--ignored", "--exclude-standard", "--others",
"--directory" },
{
cwd = key,
text = true,
}
)
local tracked_proc = vim.system({ "git", "ls-tree", "HEAD",
"--name-only" },
{
cwd = key,
text = true,
}
)
local ret = {
ignored = parse_output(ignore_proc),
tracked = parse_output(tracked_proc),
}
rawset(self, key, ret)
return ret
end,
})
end
local git_status = new_git_status()
local permission_hlgroups = { local permission_hlgroups = {
["-"] = "NonText", ["-"] = "NonText",
["r"] = "DiagnosticSignWarn", ["r"] = "DiagnosticSignWarn",
@ -54,36 +8,8 @@ local permission_hlgroups = {
} }
return { "stevearc/oil.nvim", return { "stevearc/oil.nvim",
disable = not vim.fn.has("nvim-0.8.0"), lazy = dep_short.keymap("n", "-"),
deps = { load = function()
{ "refractalize/oil-git-status.nvim",
function()
require("oil-git-status").setup {
symbols = { -- customize the symbols that appear in the git status columns
index = {
["A"] = "+",
["D"] = "-",
["M"] = "~",
},
working_tree = {
["A"] = "+",
["D"] = "-",
["M"] = "~",
}
}
}
end
}
},
function()
-- Clear git status cache on refresh
local refresh = require("oil.actions").refresh
local orig_refresh = refresh.callback
refresh.callback = function(...)
git_status = new_git_status()
orig_refresh(...)
end
require("oil").setup { require("oil").setup {
-- ID is automatically added at the beginning, and name at the end -- ID is automatically added at the beginning, and name at the end
-- See :help oil-columns -- See :help oil-columns
@ -102,135 +28,11 @@ return { "stevearc/oil.nvim",
{ "size", highlight = "@number" } { "size", highlight = "@number" }
}, },
-- Window-local options to use for oil buffers -- fix the damn border
win_options = { confirmation = { border = vim.o.winborder },
number = false, progress = { border = vim.o.winborder },
relativenumber = false, ssh = { border = vim.o.winborder },
wrap = false, keymaps_help = { border = vim.o.winborder }
signcolumn = "yes:2",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "nvic"
},
-- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
delete_to_trash = false,
-- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
skip_confirm_for_simple_edits = false,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
-- (:help prompt_save_on_select_new_entry)
prompt_save_on_select_new_entry = true,
-- Oil will automatically delete hidden buffers after this delay
-- You can set the delay to false to disable cleanup entirely
-- Note that the cleanup process only starts when none of the oil buffers are currently displayed
cleanup_delay_ms = 2000,
lsp_file_methods = {
-- Enable or disable LSP file operations
enabled = true,
-- Time to wait for LSP file operations to complete before skipping
timeout_ms = 1000,
-- Set to true to autosave buffers that are updated with LSP willRenameFiles
-- Set to "unmodified" to only save unmodified buffers
autosave_changes = "unmodified"
},
-- Constrain the cursor to the editable parts of the oil buffer
-- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = "editable",
-- Set to true to watch the filesystem for changes and reload oil
watch_for_changes = false,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["g?"] = { "actions.show_help", mode = "n" },
["<C-l>"] = "actions.refresh",
["<CR>"] = "actions.select",
["-"] = { "actions.parent", mode = "n" },
["_"] = { "actions.open_cwd", mode = "n" },
["`"] = { "actions.cd", mode = "n" },
["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },
["gs"] = { "actions.change_sort", mode = "n" },
["gx"] = "actions.open_external",
["g."] = { "actions.toggle_hidden", mode = "n" },
["g\\"] = { "actions.toggle_trash", mode = "n" }
},
view_options = {
-- Show files and directories that start with "."
show_hidden = false,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
local dir = require("oil").get_current_dir(bufnr)
local is_dotfile = vim.startswith(name, ".") and name ~= ".."
-- if no local directory (e.g. for ssh connections), just hide dotfiles
if not dir then
return is_dotfile
end
-- dotfiles are considered hidden unless tracked
if is_dotfile then
return not git_status[dir].tracked[name]
end
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
-- Sort file names with numbers in a more intuitive order for humans.
-- Can be "fast", true, or false. "fast" will turn it off for large directories.
natural_order = "fast",
-- Sort file and directory names case insensitive
case_insensitive = false,
sort = {
-- sort order can be "asc" or "desc"
-- see :help oil-columns to see which columns are sortable
{ "type", "asc" },
{ "name", "asc" },
},
-- Customize the highlight group for the file name
highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan)
return nil
end,
},
-- Configuration for the floating window in oil.open_float
float = {
border = vim.g.border_style
},
-- Configuration for the floating action confirmation window
confirmation = {
border = vim.g.border_style
},
-- Configuration for the floating progress window
progress = {
border = vim.g.border_style
},
-- Configuration for the floating SSH window
ssh = {
border = vim.g.border_style
},
-- Configuration for the floating keymaps help window
keymaps_help = {
border = vim.g.border_style
}
} }
map("n", "-", "<cmd>Oil<CR>") map("n", "-", "<cmd>Oil<CR>")

View File

@ -1,9 +0,0 @@
return { "ThePrimeagen/refactoring.nvim",
requires = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter"
},
function()
require('refactoring').setup {}
end
}

View File

@ -1,29 +0,0 @@
return { "nvzone/showkeys",
function()
require("showkeys").setup {
position = "top-right",
winopts = {
border = vim.g.border_style,
},
-- change the way it looks
winhl = "NormalFloat:Comment,NormalFloat:NormalFloat",
maxkeys = 3,
-- change the way keys are displayed
keyformat = {
["<BS>"] = "<BS>",
["<CR>"] = "<CR>",
["<Space>"] = "<Space>",
["<Up>"] = "<Up>",
["<Down>"] = "<Down>",
["<Left>"] = "<Left>",
["<Right>"] = "<Right>",
["<PageUp>"] = "<PageUp>",
["<PageDown>"] = "<PageDown>",
["<M>"] = "Alt",
["<C>"] = "Ctrl",
}
}
end
}

View File

@ -21,8 +21,7 @@ local function telebuilt_picker(fn)
end end
return { "nvim-telescope/telescope.nvim", return { "nvim-telescope/telescope.nvim",
disable = not vim.fn.has("nvim-0.9.0"), reqs = {
requires = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
{ "nvim-telescope/telescope-fzf-native.nvim", { "nvim-telescope/telescope-fzf-native.nvim",
config = function() config = function()
@ -32,38 +31,98 @@ return { "nvim-telescope/telescope.nvim",
"nvim-telescope/telescope-ui-select.nvim" "nvim-telescope/telescope-ui-select.nvim"
}, },
function() lazy = function(load)
load:cmd("Telescope")
load:keymap("n", "<leader>f")
load:keymap("n", "<leader>s")
load:keymap("n", "<leader>i")
load:keymap("n", "<leader>tc")
load:keymap("n", "<leader>tp")
end,
load = function()
local telescope = require("telescope") local telescope = require("telescope")
local actions = require("telescope.actions") local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local function send_limited_to_qflist_and_open(prompt_bufnr)
local picker = action_state.get_current_picker(prompt_bufnr)
local entries = {}
local max_items = 100
local count = 0
for entry in picker.manager:iter() do
if count >= max_items then
break
end
local filename = entry.path or entry.filename or entry.value
local text = entry.text or entry.value
if not text then
if type(entry.value) == "table" then
text = entry.value.text
else
text = entry.value
end
end
local pattern
if not entry.lnum then
if type(entry.display) == "string" then
pattern = entry.display
elseif type(entry.ordinal) == "string" then
pattern = entry.ordinal
elseif type(text) == "string" then
pattern = text
else
entry.lnum = 1
end
end
if filename then
table.insert(entries, {
filename = filename,
text = text,
lnum = entry.lnum,
col = entry.col,
-- we try and put a pattern in based on the info we receive from
-- telescope so that the qf list takes us to the correct place
pattern = pattern
})
count = count + 1
end
end
if #entries > 0 then
-- make sure errors get suppressed. I don't care
pcall(vim.fn.setqflist, {}, " ", {
title = "Telescope Limited Results",
items = entries
})
end
actions.select_default(prompt_bufnr)
end
telescope.setup { telescope.setup {
defaults = { defaults = {
borderchars = { layout_strategy = "bottom_pane",
prompt = { " ", " ", " ", " ", " ", " ", " ", " " }, borderchars = { " ", " ", " ", " ", " ", " ", " ", " " },
results = { " ", " ", " ", " ", " ", " ", " ", " " },
preview = { " ", " ", " ", " ", " ", " ", " ", " " },
},
winblend = 0,
layout_strategy = "horizontal",
sorting_strategy = "descending",
scroll_strategy = "limit",
layout_config = {
horizontal = {
height = 20,
prompt_position = "bottom",
anchor = "N",
}
},
mappings = { mappings = {
i = { i = {
["<esc>"] = actions.close, ["<esc>"] = actions.close,
["<C-j>"] = actions.move_selection_next, ["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous, ["<C-k>"] = actions.move_selection_previous,
["<C-u>"] = actions.preview_scrolling_up, ["<CR>"] = send_limited_to_qflist_and_open,
["<C-d>"] = actions.preview_scrolling_down,
} }
} }
}, },
pickers = {
colorscheme = {
enable_preview = true
}
},
extensions = { extensions = {
fzf = {} fzf = {}
} }
@ -78,14 +137,10 @@ return { "nvim-telescope/telescope.nvim",
map("n", "<leader>f", telebuilt_picker(telebuilt.find_files), { map("n", "<leader>f", telebuilt_picker(telebuilt.find_files), {
desc = "Find files." desc = "Find files."
}) })
map("n", "<leader>o", telebuilt.oldfiles, { desc = "Find old." })
map("n", "<leader>s", telebuilt_picker(telebuilt.live_grep), { map("n", "<leader>s", telebuilt_picker(telebuilt.live_grep), {
desc = "Find strings." desc = "Find strings."
}) })
map("n", "<leader>i", telebuilt.help_tags, { desc = "find help tags." }) map("n", "<leader>i", telebuilt.help_tags, { desc = "find help tags." })
map("n", "<leader>l", telebuilt.lsp_document_symbols, {
desc = "Find symbols."
})
-- find over specific directories -- find over specific directories
map("n", "<leader>tc", function() map("n", "<leader>tc", function()
@ -97,11 +152,6 @@ return { "nvim-telescope/telescope.nvim",
} }
end, { desc = "find files in plugin directory" }) end, { desc = "find files in plugin directory" })
-- enable previewing in the default colorscheme switcher map("n", "<leader>tt", "<cmd>Telescope<CR>")
telebuilt.colorscheme = function()
require("telescope.builtin.__internal").colorscheme {
enable_preview = true
}
end
end end
} }

View File

@ -1,40 +0,0 @@
-- TODO: gotta rewrite this cause it's actual dogshit, and I don't want to deal
-- with nerd fonts or folke anymore also add support for TODO(name):
return { "folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
disable = not vim.fn.has("nvim-0.8.0"),
function()
require("todo-comments").setup {
keywords = {
FIX = {
icon = "# ",
alt = { "FIXME", "BUG" },
},
HACK = {
icon = "* ",
color = "warning",
},
WARN = {
icon = "! ",
color = "warning",
alt = { "WARNING", "XXX" },
},
NOTE = {
icon = "i ",
color = "hint",
alt = { "INFO", "TODO" },
},
PERF = {
icon = "@ ",
alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" },
},
TEST = {
icon = "@ ",
color = "test",
alt = { "TESTING", "PASSED", "FAILED" },
},
},
}
end
}

View File

@ -1,10 +0,0 @@
return { "nvim-treesitter/nvim-treesitter-context",
requires = "nvim-treesitter/nvim-treesitter",
function()
require("treesitter-context").setup {
max_lines = 2,
line_numbers = true,
trim_scope = 'inner'
}
end
}

View File

@ -1,9 +1,11 @@
return { "nvim-treesitter/nvim-treesitter", local map = core.misc.map
disable = not vim.fn.has("nvim-0.10.0"),
return {
{ "nvim-treesitter/nvim-treesitter",
config = function() config = function()
vim.cmd("TSUpdate") vim.cmd("TSUpdate")
end, end,
function() load = function()
require("nvim-treesitter.configs").setup { require("nvim-treesitter.configs").setup {
-- good default parsers -- good default parsers
ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown", ensure_installed = { "c", "lua", "vim", "vimdoc", "markdown",
@ -47,4 +49,32 @@ return { "nvim-treesitter/nvim-treesitter",
} }
} }
end end
},
{ "Wansmer/treesj",
disable = not vim.fn.has("nvim-0.9.0"),
reqs = "nvim-treesitter/nvim-treesitter",
lazy = function(load)
load:keymap("n", "<leader>j")
load:cmd("TSJToggle")
load:cmd("TSJSplit")
load:cmd("TSJJoin")
end,
load = function()
require("treesj").setup {
use_default_keymaps = false,
}
map("n", "<leader>j", require("treesj").toggle, { desc = "fold code" })
end
},
{ "windwp/nvim-ts-autotag",
reqs = "nvim-treesitter/nvim-treesitter",
disable = true,
-- lazy = dep_short.auto({ "BufReadPre", "BufNewFile" }),
load = function()
require("nvim-ts-autotag").setup {}
end
}
} }

View File

@ -1,13 +0,0 @@
local map = core.misc.map
return { "Wansmer/treesj",
disable = not vim.fn.has("nvim-0.9.0"),
requires = "nvim-treesitter/nvim-treesitter",
function()
require("treesj").setup {
use_default_keymaps = false
}
map("n", "<leader>j", require("treesj").toggle, { desc = "fold code" })
end
}

View File

@ -1,8 +0,0 @@
return { "windwp/nvim-ts-autotag",
requires = "nvim-treesitter/nvim-treesitter",
disable = not vim.fn.has("nvim-0.9.5"),
function()
require("nvim-ts-autotag").setup {}
end
}

View File

@ -1,11 +0,0 @@
local map = core.misc.map
return { "mbbill/undotree",
function()
if vim.g.loaded_undotree then
vim.g.undotree_DiffAutoOpen = 0
end
map("n", "<leader>u", "<cmd>UndotreeToggle<CR>")
end
}

View File

@ -29,24 +29,6 @@ function M.copyhl(hlgroup, namespace)
return res return res
end end
--- Taken from https://github.com/rachartier/tiny-inline-diagnostic.nvim
---@param hex string
---@return table rgb
function M.hex_to_rgb(hex)
if hex == nil or hex == 'None' then
return {0, 0, 0}
end
hex = hex:gsub('#', '')
hex = string.lower(hex)
return {
tonumber(hex:sub(1, 2), 16),
tonumber(hex:sub(3, 4), 16),
tonumber(hex:sub(5, 6), 16)
}
end
-- Source: 'runtime/lua/vim/_defaults.lua' in Neovim source -- Source: 'runtime/lua/vim/_defaults.lua' in Neovim source
local function parse_osc11(x) local function parse_osc11(x)
local r, g, b = x:match('^\027%]11;rgb:(%x+)/(%x+)/(%x+)$') local r, g, b = x:match('^\027%]11;rgb:(%x+)/(%x+)/(%x+)$')

View File

@ -1,120 +0,0 @@
--- Stolen from: https://github.com/Wansmer/nvim-config/blob/main/lua/modules/foldtext.lua
--- modified for my use
---
---@module Foldtext
---Based on https://www.reddit.com/r/neovim/comments/16sqyjz/finally_we_can_have_highlighted_folds/
---Updated with vim.treesitter._fold.foldtext()
local function parse_line(linenr)
local bufnr = vim.api.nvim_get_current_buf()
local line = vim.api.nvim_buf_get_lines(bufnr, linenr - 1, linenr, false)[1]
if not line then
return nil
end
local ok, parser = pcall(vim.treesitter.get_parser, bufnr)
if not ok then
return nil
end
local query = vim.treesitter.query.get(parser:lang(), "highlights")
if not query then
return nil
end
local tree = parser:parse({ linenr - 1, linenr })[1]
local result = {}
local line_pos = 0
for id, node, metadata in query:iter_captures(tree:root(), 0, linenr - 1, linenr) do
local name = query.captures[id]
local start_row, start_col, end_row, end_col = node:range()
local priority = tonumber(metadata.priority or vim.highlight.priorities.treesitter)
if start_row == linenr - 1 and end_row == linenr - 1 then
-- check for characters ignored by treesitter
if start_col > line_pos then
table.insert(result, {
line:sub(line_pos + 1, start_col),
{ { "Folded", priority } },
range = { line_pos, start_col },
})
end
line_pos = end_col
local text = line:sub(start_col + 1, end_col)
table.insert(result, { text, { { "@" .. name, priority } }, range = { start_col, end_col } })
end
end
local i = 1
while i <= #result do
-- find first capture that is not in current range and apply highlights on the way
local j = i + 1
while j <= #result and result[j].range[1] >= result[i].range[1] and result[j].range[2] <= result[i].range[2] do
for k, v in ipairs(result[i][2]) do
if not vim.tbl_contains(result[j][2], v) then
table.insert(result[j][2], k, v)
end
end
j = j + 1
end
-- remove the parent capture if it is split into children
if j > i + 1 then
table.remove(result, i)
else
-- highlights need to be sorted by priority, on equal prio, the deeper nested capture (earlier
-- in list) should be considered higher prio
if #result[i][2] > 1 then
table.sort(result[i][2], function(a, b)
return a[2] < b[2]
end)
end
result[i][2] = vim.tbl_map(function(tbl)
return tbl[1]
end, result[i][2])
result[i] = { result[i][1], result[i][2] }
i = i + 1
end
end
return result
end
--- create a string of highlighted text for folds
---@return table|string
local function HighlightedFoldtext()
local result = parse_line(vim.v.foldstart)
if not result then
return vim.fn.foldtext()
end
table.insert(result, {
" ... ",
"LspCodeLens",
})
local result2 = parse_line(vim.v.foldend)
if result2 then
local first = result2[1]
result2[1] = { vim.trim(first[1]), first[2] }
for _, item in ipairs(result2) do
table.insert(result, item)
end
end
table.insert(result, {
" "..(vim.v.foldend - vim.v.foldstart + 1).." Lines Folded ",
"LspCodeLens",
})
return result
end
return HighlightedFoldtext

View File

@ -29,13 +29,51 @@ end
local M = { local M = {
misc = require("core.misc"), misc = require("core.misc"),
folding = require("core.folding"),
lsp = require("core.lsp"), lsp = require("core.lsp"),
color = require("core.color"), color = require("core.color"),
snippets = vim.fs.joinpath(vim.fn.stdpath("config"), "lua/core/snippets.lua"), snippets = vim.fs.joinpath(vim.fn.stdpath("config"), "lua/core/snippets.lua"),
} }
M.mason = { M.mason = {
packages = {
formatters = { "black" },
daps = { "debugpy" },
lsps = {
"clangd",
"mesonlsp",
"bashls",
"lua_ls",
"jdtls",
"basedpyright"
}
},
--- Attempt to install all desired packages. This only really works on first
--- install as mason seems to not remove the paths of the things we uninstall
--- and instead just removes the code, leaving behind it's metadata.
ensure_installed = function()
local to_install = {}
for _, type in pairs(M.mason.packages) do
for _, pkg in ipairs(type) do
-- HACK: some servers don't have the same name in mason as they do in
-- the vim lsp, we use the vim lsp names, and therefore need to
-- convert them in here when they're incorrect for mason
if pkg == "bashls" then pkg = "bash-language-server"
elseif pkg == "lua_ls" then pkg = "lua-language-server"
end
if vim.fn.isdirectory(M.mason.get_pkg_path(pkg)) == 0 then
table.insert(to_install, pkg)
end
end
end
if #to_install > 0 then
vim.cmd.MasonInstall(to_install)
end
end,
--- Gets a path to a package in the Mason registry. --- Gets a path to a package in the Mason registry.
--- Prefer this to `get_package`, since the package might not always be --- Prefer this to `get_package`, since the package might not always be
--- available yet and trigger errors. --- available yet and trigger errors.

View File

@ -1,84 +0,0 @@
---@diagnostic disable: param-type-mismatch
local misc = require("core.misc")
local map, auto = misc.map, misc.auto
local popup_opts, hover_opts, signature_opts, list_opts, location_opts
-- TODO: find a way to make the qflist current item be the one closest to the
-- cursor whenever we open it
local function on_list(opts)
vim.fn.setqflist({}, "r", opts)
if #opts.items > 1 then
vim.cmd.copen()
end
vim.cmd(".cc! 1")
end
-- disable the default keybinds (they're bad)
for _, bind in ipairs({ "grn", "gra", "gri", "grr" }) do
pcall(vim.keymap.del, "n", bind)
end
local M = {}
--- setup vim lsp options
function M.setup()
-- options for different lsp functions
popup_opts = { border = vim.g.border_style }
hover_opts = vim.tbl_deep_extend("force", popup_opts, {})
signature_opts = vim.tbl_deep_extend("force", popup_opts, {})
list_opts = { on_list = on_list }
location_opts = vim.tbl_deep_extend("force", list_opts, {})
-- confgiure lsp
vim.diagnostic.config {
virtual_text = false,
virtual_lines = {
current_line = true
},
update_in_insert = false,
underline = true,
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "x",
[vim.diagnostic.severity.WARN] = "!",
[vim.diagnostic.severity.INFO] = "i",
[vim.diagnostic.severity.HINT] = "h"
}
}
}
-- set default capabilities and attach function
vim.lsp.config['*'] = {
capabilities = vim.lsp.protocol.make_client_capabilities()
}
-- make my attach function always run
auto("LspAttach", {
callback = function(event)
local opts = { buffer = event.buf, nowait = true }
-- LSP actions
map("n", "K", function() vim.lsp.buf.hover(hover_opts) end, opts)
map("n", "gd", function() vim.lsp.buf.definition(location_opts) end, opts)
map("n", "gD", function() vim.lsp.buf.declaration(location_opts) end, opts)
map("n", "gi", function() vim.lsp.buf.implementation(location_opts) end, opts)
map("n", "gy", function() vim.lsp.buf.type_definition(location_opts) end, opts)
map("n", "gr", function() vim.lsp.buf.references(nil, list_opts) end, opts)
map("n", "<S-Tab>", function() vim.lsp.buf.signature_help(signature_opts) end, opts)
map("n", { "<leader>r", "<F2>" }, vim.lsp.buf.rename, opts)
map("n", { "gA", "<F4>" }, vim.lsp.buf.code_action, opts)
-- Diagnostics
map("n", "[d", function()
vim.diagnostic.jump({ count = -1 })
end, opts)
map("n", "]d", function()
vim.diagnostic.jump({ count = 1 })
end, opts)
end
})
end
return M

66
lua/core/lsp/binds.lua Normal file
View File

@ -0,0 +1,66 @@
local misc = require("core.misc")
local map, auto = misc.map, misc.auto
local function on_list(opts)
vim.fn.setqflist({}, "r", opts)
if #opts.items > 1 then
vim.cmd.copen()
-- get to the closest reference to the cursor (likely the one gr or gd was
-- called on)
local closest, distance = 1, false
for i, item in ipairs(opts.items) do
if item.filename and vim.fn.expand("%:p") == item.filename then
local lnum = vim.api.nvim_win_get_cursor(0)[1]
if item.lnum then
local new_distance = math.abs(lnum - item.lnum)
if not distance or new_distance < distance then
distance = new_distance
closest = i
end
end
end
vim.cmd(".cc! "..closest)
end
else
vim.cmd(".cc! 1")
end
end
-- disable the default keybinds (they're bad)
for _, bind in ipairs({ "grn", "gra", "gri", "grr" }) do
pcall(vim.keymap.del, "n", bind)
end
local group = misc.augroup("lsp.bind")
auto("LspAttach", {
group = group,
callback = function(ctx)
local list_opts = { on_list = on_list }
local opts = { buffer = ctx.buf, nowait = true }
-- LSP actions
map("n", "K", vim.lsp.buf.hover, opts)
map("n", "gd", function() vim.lsp.buf.definition(list_opts) end, opts)
map("n", "gD", function() vim.lsp.buf.declaration(list_opts) end, opts)
map("n", "gi", function() vim.lsp.buf.implementation(list_opts) end, opts)
map("n", "gy", function() vim.lsp.buf.type_definition(list_opts) end, opts)
map("n", "gr", function() vim.lsp.buf.references(nil, list_opts) end, opts)
map("n", "<S-Tab>", vim.lsp.buf.signature_help, opts)
map("n", "<leader>r", vim.lsp.buf.rename, opts)
map("n", "gA", vim.lsp.buf.code_action, opts)
-- Diagnostics
map("n", "[d", function()
vim.diagnostic.jump({ count = -1 })
end, opts)
map("n", "]d", function()
vim.diagnostic.jump({ count = 1 })
end, opts)
map("n", "gb", vim.diagnostic.setqflist, opts)
-- formatting
map("n", "<leader>c", vim.lsp.buf.format)
end
})

188
lua/core/lsp/completion.lua Normal file
View File

@ -0,0 +1,188 @@
-- My neovim autocomplete setup.
-- partially stolen from https://github.com/glepnir/nvim
--
-- To make this work nicely you're gonna want a solid snippet setup, for me this
-- is luasnip. If you too would like to use luasnip just set vim.snippet.expand
-- to luasnip.lsp_expand
--- add char to list of triggerable chars
---@param list table list of chars
---@param char number|string char to add
local function add_to_client(list, char)
local c
if type(char) == "string" then
c = char
elseif type(char) == "number" then
c = string.char(char)
end
if not table.contains(list, c) then
table.insert(list, c)
end
end
-- make sure we can add autos
local misc = require("core.misc")
local auto = misc.auto
local completion_group = misc.augroup("lsp.completion")
-- Configure the lsp completion menu. In addition to setting up lsp completion
-- this also styles it to look nice.
auto("LspAttach", {
group = completion_group,
callback = function(ctx)
local client = vim.lsp.get_client_by_id(ctx.data.client_id)
if not client or not client:supports_method("textDocument/completion") then
return
end
-- Make completion menu appear whenever you type something.
local c = client.server_capabilities.completionProvider.triggerCharacters
if c then
for i = 32, 126 do
add_to_client(c, string.char(i))
end
end
vim.lsp.completion.enable(true, client.id, ctx.buf, {
autotrigger = true,
convert = function(item)
local kind = vim.lsp.protocol.CompletionItemKind[item.kind] or 'u'
return {
-- in the future if we ever get the ability to highlight specific
-- entries in the pummenu I'd like to add treesitter highlighting to
-- the entries
abbr = item.label:gsub('%b()', ''),
kind = kind:sub(1, 1):lower(),
menu = ''
}
end
})
end
})
-- attempt to style the completion documentation popup
auto("CompleteChanged", {
group = completion_group,
callback = function()
local info = vim.fn.complete_info({ "selected" })
if info.preview_bufnr and vim.bo[info.preview_bufnr].filetype == "" then
vim.bo[info.preview_bufnr].filetype = "markdown"
vim.wo[info.preview_winid].conceallevel = 2
vim.wo[info.preview_winid].concealcursor = "niv"
end
end
})
-- Add snippet support to lsp clients who don't do it for us. Currently this
-- only supports function calls.
--
-- there's a very good chance this will give us problems for languages who do
-- not follow the c-style function call style. I've only gotten this working in
-- lua thus far.
auto("CompleteDonePre", {
group = completion_group,
callback = function()
local item = vim.tbl_get(
vim.v.completed_item,
"user_data",
"nvim",
"lsp",
"completion_item"
)
if not item then
return
end
-- if the item isn't a snippet then we might want to create a snippet
if item.label and item.kind and item.insertTextFormat then
if item.insertTextFormat ~= 2 and item.kind == 3 then
local n_complete_item = vim.v.completed_item
-- attempt to modify the function args to create a snippet
local paren1 = string.find(item.label, "%(")
if not paren1 then
return
end
-- try and create a snippet from a function call
local i = 1
local text = ""
local l_paren = paren1
local next, is_paren
while not is_paren do
-- find the next token
next = string.find(item.label, "%,", l_paren + 1)
if not next then
next = string.find(item.label, "%)", l_paren + 1)
if not next then
return
end
is_paren = true
end
-- concat text
if text == "" then
-- start the snippet
text = string.sub(item.label, 0, l_paren).."${"..i..":"
else
-- continue the snippet
text = text.."}, ".."${"..i..":"
end
do -- add the content of the argument to the snippet
-- we need to account for cases in which the developer uses spaces
-- between their commas and code
local is_space = string.sub(item.label, l_paren + 1, l_paren + 1)
local plus = is_space == " " and 2 or 1
text = text..string.sub(item.label, l_paren + plus, next - 1)
end
-- increment
l_paren = next
i = i + 1
end
-- end the snippet
text = text.."})"
n_complete_item.user_data.nvim.lsp.completion_item.insertText = text
n_complete_item.user_data.nvim.lsp.completion_item.insertTextFormat = 2
n_complete_item.user_data.nvim.lsp.completion_item.kind = 3
vim.v.completed_item = n_complete_item
end
end
end
})
-- show the signature help when inside a function call
auto("CompleteDone", {
group = completion_group,
callback = function(ctx)
-- make sure there's an lsp client, and make sure the lsp client supports
-- textDocument/signatureHelp
local client = vim.lsp.get_clients({ bufnr = ctx.buf })[1]
if not client or not client:supports_method("textDocument/signatureHelp") then
return
end
-- show the signature help
local item = vim.tbl_get(
vim.v.completed_item,
"user_data",
"nvim",
"lsp",
"completion_item"
)
if not item then
return
end
-- show signature help when the completion is a function
if item.kind == 3 and (item.textEdit ~= nil or item.insertText ~= nil) then
-- for some reason calling vim.schedule didn't work for me
vim.defer_fn(vim.lsp.buf.signature_help, 100)
end
end,
desc = "Auto show signature help when completion is done"
})

34
lua/core/lsp/init.lua Normal file
View File

@ -0,0 +1,34 @@
local M = {}
--- setup vim lsp options
function M.setup()
-- ensure the severs are setup
require("core.lsp.servers")
-- confgiure lsp
vim.diagnostic.config {
virtual_lines = {
current_line = true
},
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "x",
[vim.diagnostic.severity.WARN] = "!",
[vim.diagnostic.severity.INFO] = "i",
[vim.diagnostic.severity.HINT] = "h"
}
}
}
-- set default capabilities and attach function
vim.lsp.config['*'] = {
capabilities = vim.lsp.protocol.make_client_capabilities()
}
require("core.lsp.binds")
require("core.lsp.completion")
require("core.lsp.wtf")
end
return M

11
lua/core/lsp/servers.lua Normal file
View File

@ -0,0 +1,11 @@
local servers = require("core").mason.packages.lsps
-- enable the servers I want
for _, server in ipairs(servers) do
-- skip jdtls, we start this on our own
if servers == "jdtls" then
goto continue
end
vim.lsp.enable(server)
::continue::
end

29
lua/core/lsp/wtf.lua Normal file
View File

@ -0,0 +1,29 @@
-- wtf why does the language server protocol have these features?
-- partially stolen from https://github.com/glepnir/nvim
local misc = require("core.misc")
local auto = misc.auto
local wtf_group = misc.augroup("lsp.wtf")
auto('LspAttach', {
group = wtf_group,
callback = function(ctx)
local client = vim.lsp.get_client_by_id(ctx.data.client_id)
if not client then
return
end
-- highlight color codes via lsp (supported by cssls)
-- #ff0000
if client:supports_method('textDocument/documentColor') then
vim.lsp.document_color.enable(true, ctx.buf)
end
-- enable linked editing this allows lsps to modify things like html tags
-- for example when you change <p> to <a> </p> will be changed by the lsp
-- to </a>
if client:supports_method('textDocument/linkedEditingRange') then
vim.lsp.linked_editing_range.enable(true, { client_id = client.id })
end
end
})

View File

@ -3,20 +3,9 @@ local M = {}
--- vim.notify title --- vim.notify title
M.appid = "Nvim Config" M.appid = "Nvim Config"
--- loop through files in directory
---@param path string absolute path of directory to be looped through
---@param body function function to use on every recursion of the loop
---@param ext string? desired file extension of files to be returned from directory
function M.loopf(path, body, ext)
ext = ext and [[v:val =~ '\.]]..ext..[[$']] or nil
for _, file in ipairs(vim.fn.readdir(path, ext)) do
body(file)
end
end
--- extend vim.kemap.set --- extend vim.kemap.set
---@param mode string|table mode for the keymap ---@param mode string|table mode for the keymap
---@param bind string|table keymap ---@param bind string keymap
---@param cmd function|string command to run ---@param cmd function|string command to run
---@param opts vim.keymap.set.Opts? keymap options ---@param opts vim.keymap.set.Opts? keymap options
function M.map(mode, bind, cmd, opts) function M.map(mode, bind, cmd, opts)
@ -35,19 +24,12 @@ function M.map(mode, bind, cmd, opts)
end end
end end
-- define the keybinds
if type(bind) == "table" then
for i in pairs(bind) do
vim.keymap.set(mode, bind[i], cmd, opts)
end
elseif type(bind) == "string" then
vim.keymap.set(mode, bind, cmd, opts) vim.keymap.set(mode, bind, cmd, opts)
end
end end
--- a small map wrapper to easily create local buffer mappings --- a small map wrapper to easily create local buffer mappings
---@param mode string|table mode for the keymap ---@param mode string|table mode for the keymap
---@param bind string|table keymap ---@param bind string keymap
---@param cmd function|string command to run ---@param cmd function|string command to run
---@param opts table? keymap options ---@param opts table? keymap options
function M.map_local(mode, bind, cmd, opts) function M.map_local(mode, bind, cmd, opts)
@ -56,100 +38,25 @@ function M.map_local(mode, bind, cmd, opts)
M.map(mode, bind, cmd, opts) M.map(mode, bind, cmd, opts)
end end
--- extend vim.api.nvim_create_autocmd --- shorten vim.api.nvim_create_autocmd call
---@param event string|table event or events M.auto = vim.api.nvim_create_autocmd
---@param opts vim.api.keyset.create_autocmd options
function M.auto(event, opts)
vim.api.nvim_create_autocmd(event, opts)
end
--- extend auto group --- extend auto group
---@param name string name of the autogroup ---@param name string name of the autogroup
---@param opts table? table of options ---@param opts table? table of options
---@return integer
function M.augroup(name, opts) function M.augroup(name, opts)
opts = opts or {} opts = opts or {}
vim.api.nvim_create_augroup(name, opts) return vim.api.nvim_create_augroup(name, opts)
end end
--- extend vim.api.nvim_set_hl --- Make an action lazy. This is mostly useful for keybinds which do a lot and
---@param group string|table highlight group --- you want to make sure the screen doesn't flash
---@param opts table highlight options ---@param txt string the action
---@param namespace? number highlight space ---@return string lazified
function M.highlight(group, opts, namespace) ---@nodiscard
namespace = namespace or 0 function M.lz(txt)
return "<cmd>se lz<CR>"..txt.."<cmd>se lz!<CR>"
if type(group) == "table" then
for i in pairs(group) do
vim.api.nvim_set_hl(namespace, group[i], opts)
end
elseif type(group) == "string" then
vim.api.nvim_set_hl(namespace, group, opts)
end
end
--- highlight something with some highlight group for a certain amount of time
--- example:
--- ```lua
--- {
--- -- highlight group to use
--- hl = "IncSearch",
---
--- -- # of ms to stay highlighted for
--- timeout = 250,
---
--- -- line to highlight
--- line = vim.api.nvim_win_get_cursor(0)[1],
---
--- -- range to highlight if this is used line will be ignored
--- range = {
--- { 0, 0 },
--- { 0, 0 }
--- }
--- }
--- ```
--- opts is optional and if empty will simply highlight the current line for
--- 250ms using IncSearch as the highlight group
---@param opts table? options
function M.timeout_highlight(opts)
opts = opts or {}
opts.hl = opts.hl or "IncSearch"
opts.timeout = opts.timeout or 250
if type(opts.range) ~= "table" or type(opts.range[1]) ~= "table" or
type(opts.range[2]) ~= "table" then
local curline = opts.line or vim.api.nvim_win_get_cursor(0)[1]
opts.range = {
{ curline - 1, 0 },
{ curline, 0 }
}
end
local namespaceid = vim.api.nvim_create_namespace("timeout_highlight")
-- timer code was happily stolen from neovim/runtime/lua/vim/highlight.lua :)
local timer, timer_cancel
if not vim.fn.has("nvim-0.11") then
if timer then
timer:close()
assert(timer_cancel)
timer_cancel()
end
end
-- set the highlight
vim.highlight.range(0, namespaceid, opts.hl, opts.range[1], opts.range[2], {
opts.timeout,
})
if not vim.fn.has("nvim-0.11") then
timer_cancel = function()
timer = nil
timer_cancel = nil
pcall(vim.api.nvim_buf_clear_namespace, 0, namespaceid, 0, -1)
pcall(vim.api.nvim_win_remove_ns, 0, namespaceid)
end
timer = vim.defer_fn(timer_cancel, opts.timeout)
end
end end
return M return M

19
lua/snippets/lua.lua Normal file
View File

@ -0,0 +1,19 @@
dofile(core.snippets)
return {
-- print inspect text
s("inspect", {
t("print(vim.inspect("),
i(0),
t("))")
}),
-- print inspect text
s("M", {
i(1, "M");
t({ " = {}", "" }),
i(0),
t({ "", "return " }),
r(1)
})
}

View File

@ -1,24 +0,0 @@
dofile(core.snippets)
return {
-- header level 1, usually this has the same name as the file
s("h1", {
t("* "),
c(1, {
f(file_name, {}),
i(1, "header")
})
}),
-- link snippet
s("link", {
t("{"),
c(1, {
sn(nil, { t({":$/"}), i(1, "path to file"), t(":") }),
i(1, "https://example.com")
}),
t("}["),
i(2, "description"),
t("]")
})
}