repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: profiler fix

3f9201342422d89928811eb582afca870ac06b38

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

adujusted some keymaps to all follow the <leader>KEY standard.
puk had wrong data for profiler plugin cached.
i do not know hwo and why, but the content of the cached file was the
plenary plugin.

deleting and redownloading the cache fixed the issue...

Changed files (8)

neovim/init.lua

Modified
8 8 -- ▀▀▀ █ █ ██ █
9 9 -- ▀ ▀
11 --- Setup debug mode
11 +-- setup debug mode
12 12 vim.g.bugabinga_debug_mode = false
13 --- start `profiler.nvim` with `NVIM_PROFILE=1 nvim ...`
14 --- or `NVIM_PROFILE=start nvim ...`
13 +-- start `profiler.nvim` with `NVIM_PROFILE=1 nvim ...` to instrument all modules,
14 +-- but not start profiler yet.
15 +-- or `NVIM_PROFILE=start nvim ...` to start the profiler on startup
15 16 -- then hit <F12> to save profile.
16 17 -- inspect profile on https://ui.perfetto.dev
17 18 require 'bugabinga.profile'
42 43 require 'bugabinga.bigfile'
43 44 require 'bugabinga.editorconfig'
44 45 require 'bugabinga.save_actions'
45 --- i tried scheduling this, but it leads to no lsp being initially loaded, until i resource the file
46 46 require 'bugabinga.lsp'
47 47 require 'bugabinga.java'
48 -vim.schedule( function ()
49 - require 'bugabinga.in_and_out'
50 - require 'bugabinga.mkdir'
51 - require 'bugabinga.diagnostic'
52 -end )
48 +require 'bugabinga.in_and_out'
49 +require 'bugabinga.mkdir'
50 +require 'bugabinga.diagnostic'
54 52 --[[ PLUGINS ]]

neovim/lua/bugabinga/key_preview.lua

Modified
42 42 clues = {
43 43 -- Enhance this by adding descriptions for <Leader> mapping groups
44 44 { mode = 'n', keys = '<Leader>t', desc = '+Toggle' },
45 + { mode = 's', keys = '<Leader>s', desc = '+Session' },
45 46 { mode = 'n', keys = '<Leader>f', desc = '+Find' },
46 47 { mode = 'n', keys = '<Leader>r', desc = '+Rules' },
47 48 { mode = 'n', keys = '<Leader>x', desc = '+Neovim' },

neovim/lua/bugabinga/navigation.lua

Modified
1 1 local puk = require 'std.puk'
2 -puk.defer 'mini.bracketed' (function (bracketed)
3 - bracketed.setup {}
2 +puk.defer 'mini.bracketed' (function(bracketed)
3 + bracketed.setup {
4 + indent = { suffix = '' },
5 + undo = { suffix = '' },
6 + yank = { suffix = '' },
7 + window = { suffix = '' },
8 + }
4 9 end)

neovim/lua/bugabinga/options/filetypes.lua

Modified
2 2 vim.filetype.add {
3 3 extension = {
4 4 norg = 'norg',
5 5 prg = 'vfp',
6 + nuon = 'nu',
7 8 pattern = {
8 9 ['.*/%.vscode/.*%.json'] = 'json5', -- These json files frequently have comments

neovim/lua/bugabinga/profile.lua

Modified
1 1 --- Starts `profile.nvim`, if special `NVIM_PROFILE` environment variable is set.
2 +--- Any value will instrument all modules. The 'start' value will also start the
3 +--- profiler.
2 4 --- This file intentionally does not import any other Lua files, in order to not
3 5 --- skew the later profiling results with cached modules.
5 7 local should_profile = os.getenv 'NVIM_PROFILE'
6 9 if should_profile then
7 10 vim.cmd.packadd 'profile'
8 11 require 'profile'.instrument_autocmds()
17 20 local prof = require 'profile'
18 21 if prof.is_recording() then
19 22 prof.stop()
20 - vim.ui.input( { prompt = 'Save profile to:', completion = 'file', default = 'profile.json' }, function ( filename )
23 + vim.ui.input({ prompt = 'Save profile to:', completion = 'file', default = 'profile.json' }, function(filename)
21 24 if filename then
22 - prof.export( filename )
23 - vim.notify( string.format( 'Wrote %s', filename ) )
25 + prof.export(filename)
26 + vim.notify(string.format('Wrote %s', filename))
25 - end )
28 + end)
26 29 else
30 + vim.notify("Starting profiler")
27 31 prof.start '*'
30 -vim.keymap.set( '', '<F12>', toggle_profile )
35 +vim.keymap.set('n', '<F12>', toggle_profile, { desc = 'Toggle profiler' })

neovim/lua/bugabinga/search_and_replace.lua

Modified
7 7 map.normal {
8 8 description = 'search and replace current word',
9 9 category = 'find',
10 - keys = '<F4>',
10 + keys = '<leader>fr',
11 11 command = function () grug.open { prefills = { search = vim.fn.expand '<cword>' } } end,
13 13 end )

neovim/lua/bugabinga/sessions.lua

Modified
85 85 map.normal {
86 86 description = 'Load for cwd, if available.',
87 87 category = 'session',
88 - keys = '<F4>',
88 + keys = '<leader>ss',
89 89 command = load_current_session,
92 92 map.normal {
93 93 description = 'Load any.',
94 94 category = 'session',
95 - keys = '<F4><F4>',
95 + keys = '<leader>sa',
96 96 command = load_any_session,

neovim/lua/bugabinga/terminal.lua

Modified
72 72 map.normal.terminal {
73 73 description = 'Toggle terminal',
74 74 category = 'terminal',
75 - keys = '<F7>',
75 + keys = '<leader>tf',
76 76 command = toggle_terminal,
78 78 map.terminal {