repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: faster startuptime

d585d199ecaa90f9490dc96ce94baee7d7f93221

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (8)

neovim/init.lua

Modified
11 11 -- Setup debug mode
12 12 vim.g.bugabinga_debug_mode = true
13 +-- start `profiler.nvim` with `NVIM_PROFILE=1 nvim ...`
14 +-- or `NVIM_PROFILE=start nvim ...`
15 +-- then hit <F12> to save profile.
16 +-- inspect profile on https://ui.perfetto.dev
17 +require 'bugabinga.profile'
14 -local start_time = vim.uv.hrtime()
19 +local start_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field
15 20 local auto = require 'std.auto'
16 21 auto 'measure_startup_time' {
17 22 events = 'VimEnter',
18 23 description = 'Measure startup time of neovim.',
19 24 once = true,
20 - command = function()
21 - local end_time = vim.uv.hrtime()
25 + command = function ()
26 + local end_time = vim.uv.hrtime() ---@diagnostic disable-line: undefined-field
22 27 local time_elapsed = end_time - start_time
23 - vim.notify(string.format('Neovim started in (%d ms).', time_elapsed / 1e6),
24 - vim.log.levels.INFO)
28 + vim.notify( string.format( 'Neovim started in (%d ms).', time_elapsed / 1e6 ),
29 + vim.log.levels.INFO )
25 30 end,
30 35 require 'patches'
37 +--[[ MY STUFF ]] --
32 38 require 'bugabinga.options'
33 39 require 'bugabinga.sessions'
34 40 require 'bugabinga.treesitter'
35 41 require 'bugabinga.bigfile'
36 -require 'bugabinga.neovim_devel'
37 -require 'bugabinga.lsp'
38 42 require 'bugabinga.editorconfig'
39 43 require 'bugabinga.save_actions'
40 -require 'bugabinga.diagnostic'
41 -require 'bugabinga.in_and_out'
42 -require 'bugabinga.mkdir'
44 +vim.schedule( function ()
45 + require 'bugabinga.in_and_out'
46 + require 'bugabinga.mkdir'
47 + require 'bugabinga.diagnostic'
48 + -- FIXME why does LSP not start, when scheduled?
49 + require 'bugabinga.lsp'
50 +end )
52 +--[[ PLUGINS ]] --
53 +require 'bugabinga.neovim_devel'
44 54 require 'bugabinga.file_explorer'
45 55 require 'bugabinga.virtual_column'
46 56 require 'bugabinga.align'
52 62 require 'bugabinga.format'
53 63 require 'bugabinga.jump2d'
54 64 require 'bugabinga.lint'
65 +require 'bugabinga.search_and_replace'
55 66 require 'bugabinga.move'
56 67 require 'bugabinga.navigation'
57 68 require 'bugabinga.notifications'

neovim/lua/bugabinga/incubator.lua

Modified
14 14 --- does not yet restore well with session
15 15 --- cannot navigate with C-w inside the DocsView
16 16 --- it has a manual update mode, but which key to bind it to?
17 -puk.defer 'docs-view' (function(docsview)
17 +puk.defer 'docs-view' ( function ( docsview )
18 18 docsview.setup {
19 19 position = 'right',
20 20 width = 42,
24 24 keys = '<leader>tk',
25 25 command = '<cmd>DocsViewToggle<cr>',
27 -end)
27 +end )
28 28 -------------------------------------------------------------------------------
29 29 --- this is pretty great! i just need better binds and tell which key about them
30 -puk.defer 'rulebook' (function(rulebook)
31 - rulebook.setup ()
30 +puk.defer 'rulebook' ( function ( rulebook )
31 + rulebook.setup()
32 32 map.normal {
33 33 description = 'ignore rule',
34 34 category = 'lint',
53 53 keys = '<leader>rf',
54 54 command = rulebook.suppressFormatter,
56 -end)
56 +end )
57 57 -------------------------------------------------------------------------------
58 58 --- this plugin has some sick visual text formatting chops. check them out some time.
59 -puk.defer 'symbol-usage'(function(symbolusage)
59 +puk.defer 'symbol-usage' ( function ( symbolusage )
60 60 symbolusage.setup {
61 61 hi = { link = 'LineNr' },
62 62 vt_position = 'end_of_line',
67 67 log = { enabled = dbg.get() },
69 -end)
69 +end )
70 70 -------------------------------------------------------------------------------
71 71 --- Pretty NICE!
72 72 --- fix highlights to match nugu.
73 -puk.defer 'glance' (function(glance)
73 +puk.defer 'glance' ( function ( glance )
74 74 glance.setup()
75 75 map.normal {
76 76 description = 'peek definitions',
95 95 keys = '<Leader>lpi',
96 96 command = '<cmd>Glance implementations<cr>',
98 -end)
98 +end )
99 +-------------------------------------------------------------------------------
100 +puk.defer 'tiny-inline-diagnostic' ( function ( tiny )
101 + tiny.setup {
102 + options = {
103 + -- Show the source of the diagnostic.
104 + show_source = true,
106 + -- Use your defined signs in the diagnostic config table.
107 + use_icons_from_diagnostic = true,
108 + },
110 +end )
99 111 -------------------------------------------------------------------------------

neovim/lua/bugabinga/patterns.lua

Modified
1 1 local puk = require 'std.puk'
3 -puk.defer 'mini.hipatterns' (function(patterns)
3 +puk.defer 'mini.hipatterns' ( function ( patterns )
4 4 patterns.setup {
5 5 highlighters = {
6 6 -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
12 12 -- Highlight hex color strings (`#rrggbb`) using that color
13 13 hex_color = patterns.gen_highlighter.hex_color(),
15 - -- Delays (in ms) defining asynchronous highlighting process
15 + -- Delays (in milliseconds) defining asynchronous highlighting process
16 16 delay = {
17 17 -- How much to wait for update after every text change
18 18 text_change = 690,
21 21 scroll = 420,
24 -end)
24 +end )

neovim/lua/bugabinga/profile.lua

Added
new file mode 100644
1 +--- Starts `profile.nvim`, if special `NVIM_PROFILE` environment variable is set.
2 +--- This file intentionally does not import any other Lua files, in order to not
3 +--- skew the later profiling results with cached modules.
5 +local should_profile = os.getenv 'NVIM_PROFILE'
6 +if should_profile then
7 + vim.cmd.packadd 'profile'
8 + require 'profile'.instrument_autocmds()
9 + if should_profile:lower():match '^start' then
10 + require 'profile'.start '*'
11 + else
12 + require 'profile'.instrument '*'
13 + end
14 +end
16 +local function toggle_profile()
17 + local prof = require 'profile'
18 + if prof.is_recording() then
19 + prof.stop()
20 + vim.ui.input( { prompt = 'Save profile to:', completion = 'file', default = 'profile.json' }, function ( filename )
21 + if filename then
22 + prof.export( filename )
23 + vim.notify( string.format( 'Wrote %s', filename ) )
24 + end
25 + end )
26 + else
27 + prof.start '*'
28 + end
29 +end
30 +vim.keymap.set( '', '<F12>', toggle_profile )

neovim/lua/bugabinga/search_and_replace.lua

Added
new file mode 100644
1 +local puk = require 'std.puk'
2 +local map = require 'std.map'
4 +puk.defer 'grug-far' ( function ( grug )
5 + grug.setup {}
7 + map.normal {
8 + description = 'search and replace current word',
9 + category = 'find',
10 + keys = '<F4>',
11 + command = function () grug.open { prefills = { search = vim.fn.expand '<cword>' } } end,
12 + }
13 +end )
15 +-- TODO: check grug-far README for binding in oil.nvim

neovim/lua/bugabinga/splitjoin.lua

Modified
1 1 local puk = require 'std.puk'
2 2 local map = require 'std.map'
3 -local auto = require 'std.auto'
3 +puk.defer 'mini.splitjoin' ( function ( splitjoin )
4 + splitjoin.setup()
5 -local treesj = puk 'treesj'
6 -local splitjoin = puk 'mini.splitjoin'
8 -treesj.setup {
9 - use_default_keymaps = false,
10 - max_join_length = 360,
11 -}
12 -splitjoin.setup()
14 -map.normal {
15 - description = 'Toggle Tree Join/Split',
16 - category = 'editing',
17 - keys = '<c-j>',
18 - command = function()
19 - local langs = require 'treesj.langs'['presets']
20 - if langs[vim.bo.filetype] then
21 - treesj.toggle { split = { recursive = false } }
22 - else
6 + map.normal {
7 + description = 'Toggle Tree Join/Split',
8 + category = 'editing',
9 + keys = '<c-j>',
10 + command = function ()
23 11 splitjoin.toggle()
24 - end
25 - end,
26 -}
12 + end,
13 + }
14 +end )

neovim/puk.plugins.nuon

Modified
12 12 github,
13 13 neovim/nvim-lspconfig,
14 14 master,
15 - "47f236c058f0511702286a21ba53bbf42abbd8a8",
15 + "040001d85e9190a904d0e35ef5774633e14d8475",
20 20 github,
21 21 nvim-treesitter/nvim-treesitter,
22 22 main,
23 - "75904bdff7da13cb54e05f53f25f25a924fe28a6",
23 + "df8f45c4878ce9c1fc9e2a473f790e111a160a4f",
25 25 nvim,
26 26 --headless,
52 52 github,
53 53 "stevearc/oil.nvim",
54 54 master,
55 - "9a59256c8e88b29d2150e99b5960b2f111e51f75",
55 + "dba037598843973b8c54bc5ce0318db4a0da439d",
60 60 github,
61 61 "Saghen/blink.cmp",
62 62 main,
63 - "765ee4cfb6d71e9d88a27f64f406251f3aa85fac",
63 + "07665c3caeba0acb9731a4d7135b92fb2e3e1a88",
65 65 cargo,
66 66 build,
88 88 github,
89 89 "stevearc/conform.nvim",
90 90 master,
91 - "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8",
91 + "f4e8837878fc5712d053ba3091a73d27d96a09e2",
96 96 github,
97 97 "j-hui/fidget.nvim",
98 98 main,
99 - "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f",
99 + "9238947645ce17d96f30842e61ba81147185b657",
144 144 github,
145 145 "echasnovski/mini.align",
147 - "26111a737494bc39576ad67b52bbc2638ca23553",
147 + "acf1ad6031e49553ed887a2a5e3603211346f1de",
168 168 github,
169 169 "echasnovski/mini.jump2d",
171 - "b0963aa2ec80b4b1ed1c7f93d9c969bb3f4b65b6",
171 + "88077058297e80f1c76a18ed801ae9d7064187c6",
200 200 github,
201 201 "echasnovski/mini.icons",
203 - "54686be7d58807906cb2c8c2216e0bf9c044f19a",
203 + "44c0160526f7ae17ca8e8eab9ab235d047fcf7a6",
224 224 github,
225 225 mfussenegger/nvim-lint,
226 226 master,
227 - "6b46370d02cd001509a765591a3ffc481b538794",
228 - null
229 - ],
230 - [
231 - treesj,
232 - github,
233 - Wansmer/treesj,
234 - main,
235 - "03415ac60791d48e120a80d37e080744faf3ac15",
227 + "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55",
264 256 github,
265 257 amrbashir/nvim-docs-view,
266 258 master,
267 - "365593534e0acd762bfddce6e8313315ffa4fa36",
259 + "1b97f8f954d74c46061bf289b6cea9232484c12c",
272 264 github,
273 265 chrisgrieser/nvim-rulebook,
275 - "e57a154b316a986a10d98f14acb2f822d0153029",
267 + "7325802d4cfdcfd55a51c165290779bc835a0cd3",
299 291 "1518752906ba3fac0060d9efab6e4d3ec15d4b5a",
293 + ],
295 + profile,
296 + github,
297 + "stevearc/profile.nvim",
298 + master,
299 + "d57df512bdade4c7a04a1bb6c89c8b54c5dce52a",
300 + null
301 + ],
303 + tiny-inline-diagnostic,
304 + github,
305 + "rachartier/tiny-inline-diagnostic.nvim",
306 + main,
307 + "66d9166520a0cb3392a5ef68946fd3980d57383f",
308 + null
309 + ],
311 + grug-far,
312 + github,
313 + "MagicDuck/grug-far.nvim",
314 + main,
315 + "11d0fbd6fff6f4e394af95319deeaab4ef88ce97",
316 + null

nushell/completions/jj-completions.nu

Modified
35 35 --help(-h) # Print help (see more with '--help')
38 + # Move changes from a revision into the stack of mutable revisions
39 + export extern "jj absorb" [
40 + --from(-f): string # Source revision to absorb from
41 + --into(-t): string # Destination revisions to absorb into
42 + --to: string # Destination revisions to absorb into
43 + ...paths: string # Move only changes to these paths (instead of all paths)
44 + --repository(-R): string # Path to repository to operate on
45 + --ignore-working-copy # Don't snapshot the working copy, and don't update it
46 + --ignore-immutable # Allow rewriting immutable commits
47 + --at-operation: string # Operation to load the repo at
48 + --at-op: string # Operation to load the repo at
49 + --debug # Enable debug logging
50 + --color: string # When to colorize output (always, never, debug, auto)
51 + --quiet # Silence non-primary command output
52 + --no-pager # Disable the pager
53 + --config-toml: string # Additional configuration options (can be repeated)
54 + --help(-h) # Print help (see more with '--help')
55 + ]
38 57 # Apply the reverse of a revision on top of another revision
39 58 export extern "jj backout" [
40 59 --revisions(-r): string # The revision(s) to apply the reverse of
52 71 --help(-h) # Print help (see more with '--help')
55 - # Manage bookmarks
74 + # Manage bookmarks [default alias: b]
56 75 export extern "jj bookmark" [
57 76 --repository(-R): string # Path to repository to operate on
58 77 --ignore-working-copy # Don't snapshot the working copy, and don't update it
226 245 --help(-h) # Print help (see more with '--help')
229 - # Manage bookmarks
248 + # Manage bookmarks [default alias: b]
230 249 export extern "jj branch" [
231 250 --repository(-R): string # Path to repository to operate on
232 251 --ignore-working-copy # Don't snapshot the working copy, and don't update it
417 436 --help(-h) # Print help (see more with '--help')
420 - # Create a new, empty change and edit it in the working copy (DEPRECATED, use `jj new`)
421 - export extern "jj checkout" [
422 - revision: string # The revision to update to
423 - -r # Ignored (but lets you pass `-r` for consistency with other commands)
424 - --message(-m): string # The change description to use
425 - --repository(-R): string # Path to repository to operate on
426 - --ignore-working-copy # Don't snapshot the working copy, and don't update it
427 - --ignore-immutable # Allow rewriting immutable commits
428 - --at-operation: string # Operation to load the repo at
429 - --at-op: string # Operation to load the repo at
430 - --debug # Enable debug logging
431 - --color: string # When to colorize output (always, never, debug, auto)
432 - --quiet # Silence non-primary command output
433 - --no-pager # Disable the pager
434 - --config-toml: string # Additional configuration options (can be repeated)
435 - --help(-h) # Print help (see more with '--help')
438 439 def "nu-complete jj chmod mode" [] {
439 440 [ "n" "x" ]
891 892 # Compare file contents between two revisions
892 893 export extern "jj diff" [
893 894 --revision(-r): string # Show changes in this revision, compared to its parent(s)
894 - --from: string # Show changes from this revision
895 - --to: string # Show changes to this revision
895 + --from(-f): string # Show changes from this revision
896 + --to(-t): string # Show changes to this revision
896 897 ...paths: string # Restrict the diff to these paths
897 898 --summary(-s) # For each path, show only whether it was modified, added, or deleted
898 899 --stat # Show a histogram of the changes
920 921 # Touch up the content changes in a revision with a diff editor
921 922 export extern "jj diffedit" [
922 923 --revision(-r): string # The revision to touch up
923 - --from: string # Show changes from this revision
924 - --to: string # Edit changes in this revision
924 + --from(-f): string # Show changes from this revision
925 + --to(-t): string # Edit changes in this revision
925 926 --tool: string # Specify diff editor to be used
926 927 --restore-descendants # Preserve the content (not the diff) when rebasing descendants
927 928 --repository(-R): string # Path to repository to operate on
937 938 --help(-h) # Print help (see more with '--help')
940 - # Create a new change with the same content as an existing one
941 + # Create new changes with the same content as existing ones
941 942 export extern "jj duplicate" [
942 - ...revisions: string # The revision(s) to duplicate
943 - -r # Ignored (but lets you pass `-r` for consistency with other commands)
943 + ...revisions_pos: string # The revision(s) to duplicate (default: @)
944 + -r: string
945 + --destination(-d): string # The revision(s) to duplicate onto (can be repeated to create a merge commit)
946 + --insert-after(-A): string # The revision(s) to insert after (can be repeated to create a merge commit)
947 + --after: string # The revision(s) to insert after (can be repeated to create a merge commit)
948 + --insert-before(-B): string # The revision(s) to insert before (can be repeated to create a merge commit)
949 + --before: string # The revision(s) to insert before (can be repeated to create a merge commit)
944 950 --repository(-R): string # Path to repository to operate on
945 951 --ignore-working-copy # Don't snapshot the working copy, and don't update it
946 952 --ignore-immutable # Allow rewriting immutable commits
1262 1268 export extern "jj git push" [
1263 1269 --remote: string # The remote to push to (only named remotes are supported)
1264 1270 --bookmark(-b): string # Push only this bookmark, or bookmarks matching a pattern (can be repeated)
1265 - --all # Push all bookmarks (including deleted bookmarks)
1271 + --all # Push all bookmarks (including new and deleted bookmarks)
1266 1272 --tracked # Push all tracked bookmarks (including deleted bookmarks)
1267 1273 --deleted # Push all deleted bookmarks
1274 + --allow-new(-N) # Allow pushing new bookmarks
1268 1275 --allow-empty-description # Allow pushing commits with empty descriptions
1269 1276 --allow-private # Allow pushing commits that are private
1270 1277 --revisions(-r): string # Push bookmarks pointing to these commits (can be repeated)
1453 1460 # Compare the changes of two commits
1454 1461 export extern "jj interdiff" [
1455 - --from: string # Show changes from this revision
1456 - --to: string # Show changes to this revision
1462 + --from(-f): string # Show changes from this revision
1463 + --to(-t): string # Show changes to this revision
1457 1464 ...paths: string # Restrict the diff to these paths
1458 1465 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1459 1466 --stat # Show a histogram of the changes
1511 1518 --help(-h) # Print help (see more with '--help')
1514 - # Merge work from multiple bookmarks (DEPRECATED, use `jj new`)
1515 - export extern "jj merge" [
1516 - ...revisions: string # Parent(s) of the new change
1517 - -d # Ignored (but lets you pass `-d`/`-r` for consistency with other commands)
1518 - --message(-m): string # The change description to use
1519 - --no-edit # Do not edit the newly created change
1520 - --edit # No-op flag to pair with --no-edit
1521 - --insert-after(-A): string # Insert the new change after the given commit(s)
1522 - --after: string # Insert the new change after the given commit(s)
1523 - --insert-before(-B): string # Insert the new change before the given commit(s)
1524 - --before: string # Insert the new change before the given commit(s)
1525 - --repository(-R): string # Path to repository to operate on
1526 - --ignore-working-copy # Don't snapshot the working copy, and don't update it
1527 - --ignore-immutable # Allow rewriting immutable commits
1528 - --at-operation: string # Operation to load the repo at
1529 - --at-op: string # Operation to load the repo at
1530 - --debug # Enable debug logging
1531 - --color: string # When to colorize output (always, never, debug, auto)
1532 - --quiet # Silence non-primary command output
1533 - --no-pager # Disable the pager
1534 - --config-toml: string # Additional configuration options (can be repeated)
1535 - --help(-h) # Print help (see more with '--help')
1538 - # Move changes from one revision into another (DEPRECATED, use `jj squash`)
1539 - export extern "jj move" [
1540 - --from(-f): string # Move part of this change into the destination
1541 - --to(-t): string # Move part of the source into this change
1542 - --interactive(-i) # Interactively choose which parts to move
1543 - --tool: string # Specify diff editor to be used (implies --interactive)
1544 - ...paths: string # Move only changes to these paths (instead of all paths)
1545 - --repository(-R): string # Path to repository to operate on
1546 - --ignore-working-copy # Don't snapshot the working copy, and don't update it
1547 - --ignore-immutable # Allow rewriting immutable commits
1548 - --at-operation: string # Operation to load the repo at
1549 - --at-op: string # Operation to load the repo at
1550 - --debug # Enable debug logging
1551 - --color: string # When to colorize output (always, never, debug, auto)
1552 - --quiet # Silence non-primary command output
1553 - --no-pager # Disable the pager
1554 - --config-toml: string # Additional configuration options (can be repeated)
1555 - --help(-h) # Print help (see more with '--help')
1558 1521 # Create a new, empty change and (by default) edit it in the working copy
1559 1522 export extern "jj new" [
1560 1523 ...revisions: string # Parent(s) of the new change
1633 1596 export extern "jj operation diff" [
1634 1597 --operation: string # Show repository changes in this operation, compared to its parent
1635 1598 --op: string # Show repository changes in this operation, compared to its parent
1636 - --from: string # Show repository changes from this operation
1637 - --to: string # Show repository changes to this operation
1599 + --from(-f): string # Show repository changes from this operation
1600 + --to(-t): string # Show repository changes to this operation
1638 1601 --no-graph # Don't show the graph, show a flat list of modified changes
1639 1602 --patch(-p) # Show patch of modifications to changes
1640 1603 --summary(-s) # For each path, show only whether it was modified, added, or deleted
1843 1806 # Restore paths from another revision
1844 1807 export extern "jj restore" [
1845 1808 ...paths: string # Restore only these paths (instead of all paths)
1846 - --from: string # Revision to restore from (source)
1847 - --to: string # Revision to restore into (destination)
1809 + --from(-f): string # Revision to restore from (source)
1810 + --to(-t): string # Revision to restore into (destination)
1848 1811 --changes-in(-c): string # Undo the changes in a revision as compared to the merge of its parents
1849 1812 --revision(-r): string # Prints an error. DO NOT USE
1850 1813 --restore-descendants # Preserve the content (not the diff) when rebasing descendants
2180 2143 --help(-h) # Print help (see more with '--help')
2146 + # Execute an external command via jj
2147 + export extern "jj util exec" [
2148 + command: string # External command to execute
2149 + ...args: string # Arguments to pass to the external command
2150 + --repository(-R): string # Path to repository to operate on
2151 + --ignore-working-copy # Don't snapshot the working copy, and don't update it
2152 + --ignore-immutable # Allow rewriting immutable commits
2153 + --at-operation: string # Operation to load the repo at
2154 + --at-op: string # Operation to load the repo at
2155 + --debug # Enable debug logging
2156 + --color: string # When to colorize output (always, never, debug, auto)
2157 + --quiet # Silence non-primary command output
2158 + --no-pager # Disable the pager
2159 + --config-toml: string # Additional configuration options (can be repeated)
2160 + --help(-h) # Print help (see more with '--help')
2183 2163 # Run backend-dependent garbage collection
2184 2164 export extern "jj util gc" [
2185 2165 --expire: string # Time threshold