repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk

1901534cc2c184c83fcc2d7c7f3c633cb5b355cc

Oliver Jan Krylow <olver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (33)

+2200 / −1349 text lines · all files grouped into 32 bars

Diff layout

neovim/after/queries/lua/highlights.scm

Added
new file mode 100644

+12 / −0 text lines

1(("local" @keyword) (#set! conceal "⋅"))
2(("function" @keyword.function) (#set! conceal "ϝ"))
3(("end" @keyword.function) (#set! conceal "∎"))
4(("return" @keyword.return) (#set! conceal "↳"))
5(("then" @conditional) (#set! conceal "⟶"))
6
7((dot_index_expression table: (identifier) @variable (#eq? @variable "vim")) (#set! conceal ""))
8
9((function_call name: (identifier) @function (#eq? @function "require")) (#set! conceal ""))
11; ((function_call name: (identifier) @function (#eq? @function "want")) (#set! conceal "ω"))
12; ((local_declaration name: (identifier) @variable (#eq? @variable "want") (#set! conceal "ω"))

neovim/ftplugin/lua.lua

Modified

+4 / −0 text lines

1-- conceal some syntax with pretty symbols and show them only in
2-- insert mode. see after/queries/lua/highlights.scm for more.
3vim.opt_local.conceallevel = 2
4vim.opt_local.concealcursor = 'nc'

neovim/init.lua

Modified

+14 / −12 text lines

2929-- load ui stuff
3030require 'bugabinga.notify'
3131require 'bugabinga.colortheme'
32require 'bugabinga.devicons'
3233require 'bugabinga.colorcolumn'
33require 'bugabinga.icons'
3434require 'bugabinga.fuzzy-search-ui'
3535require 'bugabinga.colorizer'
3636require 'bugabinga.smooth-scroll'
6262-- lsp
6363require 'bugabinga.lsp'
65-- TODO: DAP
66-- TODO: put all keybinds into facade
67-- TODO: preview multimedia with telescope
68-- TODO: icon facade: icon.get("name")
69-- TODO: use nvim-specific lsp only in neovim config
70-- TODO: stop treesitter error highlight while typing
65-- diagnostic
66require 'bugabinga.diagnostic'
7168-- TODO: fix gitsigns highights
69-- TODO: preview multimedia with telescope
70-- TODO: nugu theme
7271-- TODO: hydra cycle buffers
73-- TODO: add fstabfmt to null-ls
74-- TODO: load plugins/init.lua and sync on write. reload init.lua?
75-- TODO: lsp diagnostics hide in insert mode
7672-- TODO: cross platform status bar
7773-- TODO: show winbar
7874-- TODO: show read only files in winbar
79-- TODO: make cursor red if diagnostics
80-- TODO: toggle diagnostics keybind
75-- TODO: load plugins/init.lua and sync on write. reload init.lua?
76-- TODO: use nvim-specific lsp only in neovim config
77-- TODO: steal filetype settings from shark, astrovim, lunarvim etc
78-- TODO: is it possible to cache LSP init per project?
79-- TODO: DAP
80-- TODO: fix cursor flicker when openinig neotree and other windows stuff in lsp buffers
8282--
8383-- PLUGINS TO TRY
9494-- https://github.com/rktjmp/lush.nvim
9595-- https://github.com/jbyuki/venn.nvim
9696-- https://github.com/ziontee113/color-picker.nvim
97-- https://github.com/sQVe/sort.nvim
98-- https://github.com/ThePrimeagen/harpoon
9799--
98100-- DAP PLUGINS
99101-- https://github.com/mfussenegger/nvim-dap

neovim/lua/bugabinga/colortheme.lua

Modified

+10 / −2 text lines

11local want = require 'bugabinga.std.want'
2want { 'boo-colorscheme' }(function(boo)
3 boo.use()
2want { 'boo-colorscheme' } (function(boo)
3 boo.use()
4 vim.api.nvim_set_hl(0, 'LspReferenceText', {})
5 vim.api.nvim_set_hl(0, 'LspReferenceRead', {
6 standout = true,
7 })
8 vim.api.nvim_set_hl(0, 'LspReferenceWrite', {
9 standout = true,
10 bold = true,
11 })
412end)

neovim/lua/bugabinga/devicons.lua

Added
new file mode 100644

+125 / −0 text lines

1-- TODO: once the colortheme is lushified, use it as a source of colors here
2local want = require 'bugabinga.std.want'
3want { 'nvim-web-devicons' } (function(devicons)
4 devicons.setup {
5 -- return a default icon when icon query cannot be mapped to existing icon
6 default = true,
7 override = {
8 --
9 -- FILE
10 sh = { icon = '', color = '#1DC123', cterm_color = '59', name = 'Sh' },
11 toml = { icon = '', color = '#e24329', cterm_color = '59', name = 'Toml' },
12 justfile = { icon = 'ﮧ', color = '#999eff', cterm_color = '59', name = 'Justfile' },
13 Justfile = { icon = 'ﮧ', color = '#999eff', cterm_color = '59', name = 'Justfile' },
14 ['.justfile'] = { icon = 'ﮧ', color = '#999eff', cterm_color = '59', name = 'Justfile' },
15 ['.Justfile'] = { icon = 'ﮧ', color = '#999eff', cterm_color = '59', name = 'Justfile' },
16 ['.gitattributes'] = { icon = '', color = '#e24329', cterm_color = '59', name = 'GitAttributes' },
17 ['.gitconfig'] = { icon = '', color = '#e24329', cterm_color = '59', name = 'GitConfig' },
18 ['.gitignore'] = { icon = '', color = '#e24329', cterm_color = '59', name = 'GitIgnore' },
19 ['.gitlab-ci.yml'] = { icon = '', color = '#e24329', cterm_color = '166', name = 'GitlabCI' },
20 ['.gitmodules'] = { icon = '', color = '#e24329', cterm_color = '59', name = 'GitModules' },
21 ['diff'] = { icon = '', color = '#e24329', cterm_color = '59', name = 'Diff' },
22 --
23 -- KIND
24 Text = { icon = '', color = '#949494', cterm_color = '59', name = 'TextSymbol' },
25 Method = { icon = 'm', color = '#949494', cterm_color = '59', name = 'MethodSymbol' },
26 Function = { icon = '', color = '#949494', cterm_color = '59', name = 'FunctionSymbol' },
27 Constructor = { icon = '', color = '#949494', cterm_color = '59', name = 'ConstructorSymbol' },
28 Field = { icon = '', color = '#949494', cterm_color = '59', name = 'FieldSymbol' },
29 Variable = { icon = '', color = '#949494', cterm_color = '59', name = 'VariableSymbol' },
30 Class = { icon = '', color = '#949494', cterm_color = '59', name = 'ClassSymbol' },
31 Interface = { icon = '', color = '#949494', cterm_color = '59', name = 'InterfaceSymbol' },
32 Module = { icon = '', color = '#949494', cterm_color = '59', name = 'ModuleSymbol' },
33 Property = { icon = '', color = '#949494', cterm_color = '59', name = 'PropertySymbol' },
34 Unit = { icon = '', color = '#949494', cterm_color = '59', name = 'UnitSymbol' },
35 Value = { icon = '', color = '#949494', cterm_color = '59', name = 'ValueSymbol' },
36 Enum = { icon = '', color = '#949494', cterm_color = '59', name = 'EnumSymbol' },
37 Keyword = { icon = '', color = '#949494', cterm_color = '59', name = 'KeywordSymbol' },
38 Snippet = { icon = '', color = '#949494', cterm_color = '59', name = 'SnippetSymbol' },
39 Color = { icon = '', color = '#949494', cterm_color = '59', name = 'ColorSymbol' },
40 File = { icon = '', color = '#949494', cterm_color = '59', name = 'FileSymbol' },
41 Reference = { icon = '', color = '#949494', cterm_color = '59', name = 'ReferenceSymbol' },
42 Folder = { icon = '', color = '#949494', cterm_color = '59', name = 'FolderSymbol' },
43 EnumMember = { icon = '', color = '#949494', cterm_color = '59', name = 'EnumMemberSymbol' },
44 Constant = { icon = '', color = '#949494', cterm_color = '59', name = 'ConstantSymbol' },
45 Struct = { icon = '', color = '#949494', cterm_color = '59', name = 'StructSymbol' },
46 Event = { icon = '', color = '#949494', cterm_color = '59', name = 'EventSymbol' },
47 Operator = { icon = '', color = '#949494', cterm_color = '59', name = 'OperatorSymbol' },
48 TypeParameter = { icon = '', color = '#949494', cterm_color = '59', name = 'TypeParameterSymbol' },
49 --
50 -- TYPE
51 Array = { icon = '', color = '#949494', cterm_color = '59', name = 'ArraySymbol' },
52 Number = { icon = '', color = '#949494', cterm_color = '59', name = 'NumberSymbol' },
53 String = { icon = '', color = '#949494', cterm_color = '59', name = 'StringSymbol' },
54 Boolean = { icon = '蘒', color = '#949494', cterm_color = '59', name = 'BooleanSymbol' },
55 Object = { icon = '', color = '#949494', cterm_color = '59', name = 'ObjectSymbol' },
56 --
57 -- DOCUMENTS
58 Files = { icon = '', color = '#949494', cterm_color = '59', name = 'FilesSymbol' },
59 OpenFolder = { icon = '', color = '#949494', cterm_color = '59', name = 'OpenFolderSymbol' },
60 EmptyFolder = { icon = '', color = '#949494', cterm_color = '59', name = 'EmptyFolderSymbol' },
61 --
62 -- VCS
63 VcsAdded = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsAddedSymbol' },
64 VcsModified = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsModifiedSymbol' },
65 VcsRemoved = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsRemovedSymbol' },
66 VcsIgnored = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsIgnoredSymbol' },
67 VcsRenamed = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsRenamedSymbol' },
68 VcsDiff = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsDiffSymbol' },
69 VcsRepo = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsRepoSymbol' },
70 VcsUntracked = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsUntrackedSymbol' },
71 VcsUnstaged = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsUnstagedSymbol' },
72 VcsStaged = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsStagedSymbol' },
73 VcsConflicted = { icon = '', color = '#949494', cterm_color = '59', name = 'VcsConflictedSymbol' },
74 --
75 --UI
76 ArrowClosed = { icon = '', color = '#949494', cterm_color = '59', name = 'ArrowClosedSymbol' },
77 ArrowOpen = { icon = '', color = '#949494', cterm_color = '59', name = 'ArrowOpenSymbol' },
78 Lock = { icon = '', color = '#949494', cterm_color = '59', name = 'LockSymbol' },
79 Circle = { icon = '', color = '#949494', cterm_color = '59', name = 'CircleSymbol' },
80 BigCircle = { icon = '', color = '#949494', cterm_color = '59', name = 'BigCircleSymbol' },
81 BigUnfilledCircle = { icon = '', color = '#949494', cterm_color = '59', name = 'BigUnfilledCircleSymbol' },
82 Close = { icon = '', color = '#949494', cterm_color = '59', name = 'CloseSymbol' },
83 NewFile = { icon = '', color = '#949494', cterm_color = '59', name = 'NewFileSymbol' },
84 Search = { icon = '', color = '#949494', cterm_color = '59', name = 'SearchSymbol' },
85 Lightbulb = { icon = '', color = '#949494', cterm_color = '59', name = 'LightbulbSymbol' },
86 Project = { icon = '', color = '#949494', cterm_color = '59', name = 'ProjectSymbol' },
87 Dashboard = { icon = '', color = '#949494', cterm_color = '59', name = 'DashboardSymbol' },
88 History = { icon = '', color = '#949494', cterm_color = '59', name = 'HistorySymbol' },
89 Comment = { icon = '', color = '#949494', cterm_color = '59', name = 'CommentSymbol' },
90 Bug = { icon = '', color = '#949494', cterm_color = '59', name = 'BugSymbol' },
91 Code = { icon = '', color = '#949494', cterm_color = '59', name = 'CodeSymbol' },
92 Telescope = { icon = '', color = '#949494', cterm_color = '59', name = 'TelescopeSymbol' },
93 Gear = { icon = '', color = '#949494', cterm_color = '59', name = 'GearSymbol' },
94 Package = { icon = '', color = '#949494', cterm_color = '59', name = 'PackageSymbol' },
95 List = { icon = '', color = '#949494', cterm_color = '59', name = 'ListSymbol' },
96 SignIn = { icon = '', color = '#949494', cterm_color = '59', name = 'SignInSymbol' },
97 SignOut = { icon = '', color = '#949494', cterm_color = '59', name = 'SignOutSymbol' },
98 Check = { icon = '', color = '#949494', cterm_color = '59', name = 'CheckSymbol' },
99 Fire = { icon = '', color = '#949494', cterm_color = '59', name = 'FireSymbol' },
100 Note = { icon = '', color = '#949494', cterm_color = '59', name = 'NoteSymbol' },
101 BookMark = { icon = '', color = '#949494', cterm_color = '59', name = 'BookMarkSymbol' },
102 Pencil = { icon = '', color = '#949494', cterm_color = '59', name = 'PencilSymbol' },
103 ChevronRight = { icon = '', color = '#949494', cterm_color = '59', name = 'ChevronRightSymbol' },
104 Table = { icon = '', color = '#949494', cterm_color = '59', name = 'TableSymbol' },
105 Calendar = { icon = '', color = '#949494', cterm_color = '59', name = 'CalendarSymbol' },
106 CloudDownload = { icon = '', color = '#949494', cterm_color = '59', name = 'CloudDownloadSymbol' },
107 --
108 -- DIAGNOSTICS
109 Error = { icon = '', color = '#949494', cterm_color = '59', name = 'ErrorSymbol' },
110 Warning = { icon = '', color = '#949494', cterm_color = '59', name = 'WarningSymbol' },
111 Information = { icon = '', color = '#949494', cterm_color = '59', name = 'InformationSymbol' },
112 Question = { icon = '', color = '#949494', cterm_color = '59', name = 'QuestionSymbol' },
113 Hint = { icon = '', color = '#949494', cterm_color = '59', name = 'HintSymbol' },
114 --
115 -- MISCELLANEOUS
116 Robot = { icon = 'ﮧ', color = '#949494', cterm_color = '59', name = 'RobotSymbol' },
117 Squirrel = { icon = '', color = '#949494', cterm_color = '59', name = 'SquirrelSymbol' },
118 Tag = { icon = '', color = '#949494', cterm_color = '59', name = 'TagSymbol' },
119 Watch = { icon = '', color = '#949494', cterm_color = '59', name = 'WatchSymbol' },
120 },
121 }
122 -- devicons will return some default icon, when an icon name could not be mapped.
123 -- in order to quickly notice these cases and debug them, set a noticeable icon as default.
124 devicons.set_default_icon('ﴫ', '#ff00ff')
125end)

neovim/lua/bugabinga/diagnostic.lua

Added
new file mode 100644

+153 / −0 text lines

1-- the topic 'diagnotics' was refactored out of LSP into its own thing some time
2-- ago. that is why it gets its own section in this config now, but right now,
3-- those settings overlap with lsp-zero.
4
5local auto = require 'bugabinga.std.auto'
6local map = require 'bugabinga.std.keymap'
7local icon = require 'bugabinga.std.icon'
8
9local diagnostic = vim.diagnostic
11local diagnostic_format = function(context)
12 local message = context.message
13 local severity = context.severity
14 local symbol = ''
15 if severity == diagnostic.severity.ERROR then
16 symbol = icon 'Error'
17 elseif severity == diagnostic.severity.WARN then
18 symbol = icon 'Warning'
19 elseif severity == diagnostic.severity.INFO then
20 symbol = icon 'Information'
21 elseif severity == diagnostic.severity.HINT then
22 symbol = icon 'Hint'
23 end
24 return string.format('%s | %s', symbol, message)
25end
27local prefix_format = function(context, index, total)
28 local source = context.source
29 local severity = context.severity
30 local symbol = ''
31 if severity == diagnostic.severity.ERROR then
32 symbol = icon 'Error'
33 elseif severity == diagnostic.severity.WARN then
34 symbol = icon 'Warning'
35 elseif severity == diagnostic.severity.INFO then
36 symbol = icon 'Information'
37 elseif severity == diagnostic.severity.HINT then
38 symbol = icon 'Hint'
39 end
40 return string.format('%s/%s %s %s ', index, total, source, symbol)
41end
43diagnostic.config {
44 underline = {
45 severity = diagnostic.severity.ERROR,
46 },
47 virtual_text = {
48 severity = diagnostic.severity.HINT,
49 source = false,
50 spacing = 0,
51 prefix = '',
52 format = diagnostic_format,
53 },
54 float = {
55 focusable = false,
56 style = 'minimal',
57 border = 'rounded',
58 source = false,
59 header = '',
60 prefix = prefix_format,
61 },
62 update_in_insert = false,
63 signs = true,
64 severity_sort = true,
65}
67local sign = function(options)
68 vim.fn.sign_define(options.name, {
69 texthl = options.name,
70 text = options.text,
71 numhl = '',
72 })
73end
75sign { name = 'DiagnosticSignError', text = icon 'Error' }
76sign { name = 'DiagnosticSignWarn', text = icon 'Warning' }
77sign { name = 'DiagnosticSignHint', text = icon 'Hint' }
78sign { name = 'DiagnosticSignInfo', text = icon 'Information' }
80auto 'hide_diagnostics' {
81 description = 'Hide diagnostics by default',
82 events = { 'BufReadPre' },
83 pattern = '*',
84 command = function()
85 diagnostic.disable(0)
86 end,
87}
88local saved_cursor_highlight = vim.api.nvim_get_hl_by_name('Cursor', true)
89-- TODO: get colors from theme
90local noticeable = { foreground = '#ffffff', background = '#ff0000'}
92auto 'cursor_attention_if_diagnostics' {
93 description = 'Make cursor very noticeable, if diagnostics are present',
94 events = 'DiagnosticChanged',
95 pattern = '*',
96 command = function()
97 local diagnostic_number = #vim.diagnostic.get(0,{severity = vim.diagnostic.severity.ERROR})
98 if diagnostic_number > 0 then
99 vim.api.nvim_set_hl(0, 'Cursor', noticeable)
100 else
101 vim.api.nvim_set_hl(0, 'Cursor', saved_cursor_highlight)
102 end
103 end,
104}
106map {
107 description = 'Enable diagnostics',
108 category = map.CATEGORY.PROBLEMS,
109 mode = map.MODE.NORMAL,
110 keys = map.KEY.LEADER .. map.KEY.P,
111 command = function()
112 diagnostic.enable(0)
113 end,
114}
115map {
116 description = 'Disable diagnostics',
117 category = map.CATEGORY.PROBLEMS,
118 mode = map.MODE.NORMAL,
119 keys = map.KEY.LEADER .. map.KEY.P .. map.KEY.P,
120 command = function()
121 diagnostic.disable(0)
122 end,
123}
124map {
125 description = 'Show diagnostics in float window',
126 category = map.CATEGORY.PROBLEMS,
127 mode = map.MODE.NORMAL,
128 keys = map.KEY.F6,
129 command = function()
130 diagnostic.enable(0)
131 diagnostic.open_float()
132 end,
133}
134map {
135 description = 'Go to previous diagnostic',
136 category = map.CATEGORY.PROBLEMS,
137 mode = map.MODE.NORMAL,
138 keys = map.KEY.F7,
139 command = function()
140 diagnostic.enable(0)
141 diagnostic.goto_prev()
142 end,
143}
144map {
145 description = 'Go to next diagnostic',
146 category = map.CATEGORY.PROBLEMS,
147 mode = map.MODE.NORMAL,
148 keys = map.KEY.F8,
149 command = function()
150 diagnostic.enable(0)
151 diagnostic.goto_next()
152 end,
153}

neovim/lua/bugabinga/fast-navigation.lua

Modified

+2 / −3 text lines

11local want = require 'bugabinga.std.want'
2want { 'leap' }(function(leap)
3 --FIXME should these bindings go into command center? or hydra?
4 leap.set_default_keymaps()
2want { 'leap' } (function(leap)
3 leap.set_default_keymaps()
54end)

neovim/lua/bugabinga/file-explorer.lua

Modified

+342 / −382 text lines

11local want = require 'bugabinga.std.want'
2want { 'window-picker', 'neo-tree' }(function(picker, tree)
3 picker.setup {
4 autoselect_one = true,
5 include_current = false,
6 filter_rules = {
7 -- filter using buffer options
8 bo = {
9 -- if the file type is one of following, the window will be ignored
10 filetype = { 'neo-tree', 'neo-tree-popup', 'notify', 'quickfix' },
2local map = require 'bugabinga.std.keymap'
3local fmt = require 'bugabinga.std.fmt'
4local icon = require 'bugabinga.std.icon'
12 -- if the buffer type is one of following, the window will be ignored
13 buftype = { 'terminal' },
14 },
15 },
16 other_win_hl_color = '#e35e4f',
17 }
6want {
7 'window-picker',
8 'neo-tree',
9} (function(picker, tree)
10 picker.setup {
11 autoselect_one = true,
12 include_current = false,
13 filter_rules = {
14 -- filter using buffer options
15 bo = {
16 -- if the file type is one of following, the window will be ignored
17 filetype = { 'neo-tree', 'neo-tree-popup', 'notify', 'quickfix' },
19 -- Unless you are still migrating, remove the deprecated commands from v1.x
20 vim.g.neo_tree_remove_legacy_commands = 1
19 -- if the buffer type is one of following, the window will be ignored
20 buftype = { 'terminal' },
21 },
22 },
23 --TODO: get this color from colortheme
24 other_win_hl_color = '#7e297e',
25 }
22 -- FIXME: use icons from devicons
23 -- FIXME: make keybinding
27 -- Unless you are still migrating, remove the deprecated commands from v1.x
28 vim.g.neo_tree_remove_legacy_commands = 1
25 -- If you want icons for diagnostic errors, you'll need to define them somewhere:
26 vim.fn.sign_define('DiagnosticSignError', { text = ' ', texthl = 'DiagnosticSignError' })
27 vim.fn.sign_define('DiagnosticSignWarn', { text = ' ', texthl = 'DiagnosticSignWarn' })
28 vim.fn.sign_define('DiagnosticSignInfo', { text = ' ', texthl = 'DiagnosticSignInfo' })
29 vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' })
30 map {
31 description = 'Open File Explorer',
32 category = map.CATEGORY.NAVIGATION,
33 mode = map.MODE.NORMAL,
34 keys = map.KEY.LEADER .. map.KEY.E,
35 command = fmt.cmd 'Neotree filesystem reveal right toggle',
36 }
37 map {
38 description = 'Open Buffer Explorer',
39 category = map.CATEGORY.NAVIGATION,
40 mode = map.MODE.NORMAL,
41 keys = map.KEY.LEADER .. map.KEY.E .. map.KEY.B,
42 command = fmt.cmd 'Neotree buffers reveal float toggle',
43 }
44 map {
45 description = 'Open Git Explorer',
46 category = map.CATEGORY.NAVIGATION,
47 mode = map.MODE.NORMAL,
48 keys = map.KEY.LEADER .. map.KEY.E .. map.KEY.G,
49 command = fmt.cmd 'Neotree git_status reveal current toggle',
50 }
31 tree.setup {
32 close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
33 -- popup_border_style is for input and confirmation dialogs.
34 -- Configurtaion of floating window is done in the individual source sections.
35 -- "NC" is a special style that works well with NormalNC set
36 close_floats_on_escape_key = true,
37 default_source = 'filesystem',
38 enable_diagnostics = true,
39 enable_git_status = true,
40 enable_modified_markers = true, -- Show markers for files with unsaved changes.
41 enable_refresh_on_write = true, -- Refresh the tree when a file is written. Only used if `use_libuv_file_watcher` is false.
42 git_status_async = true,
43 -- These options are for people with VERY large git repos
44 git_status_async_options = {
45 batch_size = 1000, -- how many lines of git status results to process at a time
46 batch_delay = 10, -- delay in ms between batches. Spreads out the workload to let other processes run.
47 max_lines = 10000, -- How many lines of git status results to process. Anything after this will be dropped.
48 -- Anything before this will be used. The last items to be processed are the untracked files.
49 },
50 log_level = 'info', -- "trace", "debug", "info", "warn", "error", "fatal"
51 log_to_file = false, -- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
52 open_files_in_last_window = true, -- false = open files in top left window
53 popup_border_style = 'NC', -- "double", "none", "rounded", "shadow", "single" or "solid"
54 resize_timer_interval = 500, -- in ms, needed for containers to redraw right aligned and faded content
55 -- set to -1 to disable the resize timer entirely
56 -- -- NOTE: this will speed up to 50 ms for 1 second following a resize
57 sort_case_insensitive = false, -- used when sorting files and directories in the tree
58 sort_function = nil, -- uses a custom function for sorting files and directories in the tree
59 use_popups_for_input = true, -- If false, inputs will use vim.ui.input() instead of custom floats.
60 use_default_mappings = true,
61 --
62 --event_handlers = {
63 -- {
64 -- event = "before_render",
65 -- handler = function (state)
66 -- -- add something to the state that can be used by custom components
67 -- end
68 -- },
69 -- {
70 -- event = "file_opened",
71 -- handler = function(file_path)
72 -- --auto close
73 -- require("neo-tree").close_all()
74 -- end
75 -- },
76 -- {
77 -- event = "file_opened",
78 -- handler = function(file_path)
79 -- --clear search after opening a file
80 -- require("neo-tree.sources.filesystem").reset_search()
81 -- end
82 -- },
83 -- {
84 -- event = "file_renamed",
85 -- handler = function(args)
86 -- -- fix references to file
87 -- print(args.source, " renamed to ", args.destination)
88 -- end
89 -- },
90 -- {
91 -- event = "file_moved",
92 -- handler = function(args)
93 -- -- fix references to file
94 -- print(args.source, " moved to ", args.destination)
95 -- end
96 -- },
97 -- {
98 -- event = "neo_tree_buffer_enter",
99 -- handler = function()
100 -- vim.cmd 'highlight! Cursor blend=100'
101 -- end
102 -- },
103 -- {
104 -- event = "neo_tree_buffer_leave",
105 -- handler = function()
106 -- vim.cmd 'highlight! Cursor guibg=#5f87af blend=0'
107 -- end
108 -- }
109 --},
110 default_component_configs = {
111 container = {
112 enable_character_fade = true,
113 },
114 indent = {
115 indent_size = 2,
116 padding = 1,
117 -- indent guides
118 with_markers = true,
119 indent_marker = '│',
120 last_indent_marker = '└',
121 highlight = 'NeoTreeIndentMarker',
122 -- expander config, needed for nesting files
123 with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
124 expander_collapsed = '',
125 expander_expanded = '',
126 expander_highlight = 'NeoTreeExpander',
127 },
128 icon = {
129 folder_closed = '',
130 folder_open = '',
131 folder_empty = 'ﰊ',
132 },
133 modified = {
134 symbol = '[+]',
135 highlight = 'NeoTreeModified',
136 },
137 name = {
138 trailing_slash = false,
139 use_git_status_colors = true,
140 highlight = 'NeoTreeFileName',
141 },
142 git_status = {
143 symbols = {
144 -- Change type
145 added = '✚', -- NOTE: you can set any of these to an empty string to not show them
146 deleted = '✖',
147 modified = '',
148 renamed = '',
149 -- Status type
150 untracked = '',
151 ignored = '',
152 unstaged = '',
153 staged = '',
154 conflict = '',
155 },
156 align = 'right',
157 },
158 },
159 renderers = {
160 directory = {
161 { 'indent' },
162 { 'icon' },
163 { 'current_filter' },
164 {
165 'container',
166 width = '100%',
167 right_padding = 1,
168 --max_width = 60,
169 content = {
170 { 'name', zindex = 10 },
171 {
172 'symlink_target',
173 zindex = 10,
174 highlight = 'NeoTreeSymbolicLinkTarget',
175 },
176 { 'clipboard', zindex = 10 },
177 { 'diagnostics', errors_only = true, zindex = 20, align = 'right' },
178 },
179 },
180 },
181 file = {
182 { 'indent' },
183 { 'icon' },
184 {
185 'container',
186 width = '100%',
187 right_padding = 1,
188 --max_width = 60,
189 content = {
190 {
191 'name',
192 use_git_status_colors = true,
193 zindex = 10,
194 },
195 {
196 'symlink_target',
197 zindex = 10,
198 highlight = 'NeoTreeSymbolicLinkTarget',
199 },
200 { 'clipboard', zindex = 10 },
201 { 'bufnr', zindex = 10 },
202 { 'modified', zindex = 20, align = 'right' },
203 { 'diagnostics', zindex = 20, align = 'right' },
204 { 'git_status', zindex = 20, align = 'right' },
205 },
206 },
207 },
208 message = {
209 { 'indent', with_markers = false },
210 { 'name', highlight = 'NeoTreeMessage' },
211 },
212 terminal = {
213 { 'indent' },
214 { 'icon' },
215 { 'name' },
216 { 'bufnr' },
217 },
218 },
219 nesting_rules = {},
220 window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
221 -- possible options. These can also be functions that return these options.
222 position = 'left', -- left, right, float, current
223 width = 40, -- applies to left and right positions
224 popup = { -- settings that apply to float position only
225 size = {
226 height = '80%',
227 width = '50%',
228 },
229 position = '50%', -- 50% means center it
230 -- you can also specify border here, if you want a different setting from
231 -- the global popup_border_style.
232 },
233 -- Mappings for tree window. See `:h neo-tree-mappings` for a list of built-in commands.
234 -- You can also create your own commands by providing a function instead of a string.
235 mapping_options = {
236 noremap = true,
237 nowait = true,
238 },
239 mappings = {
240 ['<space>'] = {
241 'toggle_node',
242 nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
243 },
244 ['<2-LeftMouse>'] = 'open',
245 ['<cr>'] = 'open',
246 ['S'] = 'split_with_window_picker',
247 ['s'] = 'vsplit_with_window_picker',
248 ['t'] = 'open_tabnew',
249 ['w'] = 'open_with_window_picker',
250 ['C'] = 'close_node',
251 ['z'] = 'close_all_nodes',
252 ['R'] = 'refresh',
253 ['a'] = {
254 'add',
255 -- some commands may take optional config options, see `:h neo-tree-mappings` for details
256 config = {
257 show_path = 'none', -- "none", "relative", "absolute"
258 },
259 },
260 ['A'] = 'add_directory', -- also accepts the config.show_path option.
261 ['d'] = 'delete',
262 ['r'] = 'rename',
263 ['y'] = 'copy_to_clipboard',
264 ['x'] = 'cut_to_clipboard',
265 ['p'] = 'paste_from_clipboard',
266 ['c'] = 'copy', -- takes text input for destination, also accepts the config.show_path option
267 ['m'] = 'move', -- takes text input for destination, also accepts the config.show_path option
268 ['q'] = 'close_window',
269 ['?'] = 'show_help',
270 },
271 },
272 filesystem = {
273 window = {
274 mappings = {
275 ['H'] = 'toggle_hidden',
276 ['/'] = 'fuzzy_finder',
277 ['f'] = 'filter_on_submit',
278 ['<C-x>'] = 'clear_filter',
279 ['<bs>'] = 'navigate_up',
280 ['.'] = 'set_root',
281 ['[g'] = 'prev_git_modified',
282 [']g'] = 'next_git_modified',
283 },
284 },
285 async_directory_scan = 'auto', -- "auto" means refreshes are async, but it's synchronous when called from the Neotree commands.
286 -- "always" means directory scans are always async.
287 -- "never" means directory scans are never async.
288 bind_to_cwd = true, -- true creates a 2-way binding between vim's cwd and neo-tree's root
289 -- The renderer section provides the renderers that will be used to render the tree.
290 -- The first level is the node type.
291 -- For each node type, you can specify a list of components to render.
292 -- Components are rendered in the order they are specified.
293 -- The first field in each component is the name of the function to call.
294 -- The rest of the fields are passed to the function as the "config" argument.
295 filtered_items = {
296 visible = true, -- when true, they will just be displayed differently than normal items
297 force_visible_in_empty_folder = false, -- when true, hidden files will be shown if the root folder is otherwise empty
298 show_hidden_count = false, -- when true, the number of hidden items in each folder will be shown as the last entry
299 hide_dotfiles = true,
300 hide_gitignored = true,
301 hide_hidden = true, -- only works on Windows for hidden files/directories
302 hide_by_name = {
303 '.DS_Store',
304 'thumbs.db',
305 'node_modules',
306 'zig-cache',
307 'target',
308 },
309 hide_by_pattern = { -- uses glob style patterns
310 --"*.meta"
311 },
312 never_show = { -- remains hidden even if visible is toggled to true
313 --".DS_Store",
314 --"thumbs.db"
315 },
316 },
317 find_by_full_path_words = false, -- `false` means it only searches the tail of a path.
318 -- `true` will change the filter into a full path
319 -- search with space as an implicit ".*", so
320 -- `fi init`
321 -- will match: `./sources/filesystem/init.lua
322 --find_command = "fd", -- this is determined automatically, you probably don't need to set it
323 --find_args = { -- you can specify extra args to pass to the find command.
324 -- fd = {
325 -- "--exclude", ".git",
326 -- "--exclude", "node_modules"
327 -- }
328 --},
329 ---- or use a function instead of list of strings
330 --find_args = function(cmd, path, search_term, args)
331 -- if cmd ~= "fd" then
332 -- return args
333 -- end
334 -- --maybe you want to force the filter to always include hidden files:
335 -- table.insert(args, "--hidden")
336 -- -- but no one ever wants to see .git files
337 -- table.insert(args, "--exclude")
338 -- table.insert(args, ".git")
339 -- -- or node_modules
340 -- table.insert(args, "--exclude")
341 -- table.insert(args, "node_modules")
342 -- --here is where it pays to use the function, you can exclude more for
343 -- --short search terms, or vary based on the directory
344 -- if string.len(search_term) < 4 and path == "/home/cseickel" then
345 -- table.insert(args, "--exclude")
346 -- table.insert(args, "Library")
347 -- end
348 -- return args
349 --end,
350 group_empty_dirs = false, -- when true, empty folders will be grouped together
351 search_limit = 50, -- max number of search results when using filters
352 follow_current_file = false, -- This will find and focus the file in the active buffer every time
353 -- the current file is changed while the tree is open.
354 hijack_netrw_behavior = 'open_default', -- netrw disabled, opening a directory opens neo-tree
355 -- in whatever position is specified in window.position
356 -- "open_current",-- netrw disabled, opening a directory opens within the
357 -- window like netrw would, regardless of window.position
358 -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
359 use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
360 -- instead of relying on nvim autocmd events.
361 },
362 buffers = {
363 bind_to_cwd = true,
364 follow_current_file = true, -- This will find and focus the file in the active buffer every time
365 -- the current file is changed while the tree is open.
366 group_empty_dirs = true, -- when true, empty directories will be grouped together
367 window = {
368 mappings = {
369 ['<bs>'] = 'navigate_up',
370 ['.'] = 'set_root',
371 ['bd'] = 'buffer_delete',
372 },
373 },
374 },
375 git_status = {
376 window = {
377 mappings = {
378 ['A'] = 'git_add_all',
379 ['gu'] = 'git_unstage_file',
380 ['ga'] = 'git_add_file',
381 ['gr'] = 'git_revert_file',
382 ['gc'] = 'git_commit',
383 ['gp'] = 'git_push',
384 ['gg'] = 'git_commit_and_push',
385 },
386 },
387 },
388 }
52 tree.setup {
53 close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
54 -- popup_border_style is for input and confirmation dialogs.
55 -- Configurtaion of floating window is done in the individual source sections.
56 -- "NC" is a special style that works well with NormalNC set
57 close_floats_on_escape_key = true,
58 default_source = 'filesystem',
59 enable_diagnostics = true,
60 enable_git_status = true,
61 enable_modified_markers = true, -- Show markers for files with unsaved changes.
62 enable_refresh_on_write = true, -- Refresh the tree when a file is written. Only used if `use_libuv_file_watcher` is false.
63 git_status_async = true,
64 -- These options are for people with VERY large git repos
65 git_status_async_options = {
66 batch_size = 1000, -- how many lines of git status results to process at a time
67 batch_delay = 10, -- delay in ms between batches. Spreads out the workload to let other processes run.
68 max_lines = 10000, -- How many lines of git status results to process. Anything after this will be dropped.
69 -- Anything before this will be used. The last items to be processed are the untracked files.
70 },
71 log_level = 'info', -- "trace", "debug", "info", "warn", "error", "fatal"
72 log_to_file = false, -- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
73 open_files_in_last_window = true, -- false = open files in top left window
74 popup_border_style = 'NC', -- "double", "none", "rounded", "shadow", "single" or "solid"
75 resize_timer_interval = 500, -- in ms, needed for containers to redraw right aligned and faded content
76 sort_case_insensitive = false, -- used when sorting files and directories in the tree
77 sort_function = nil, -- uses a custom function for sorting files and directories in the tree
78 use_popups_for_input = true, -- If false, inputs will use vim.ui.input() instead of custom floats.
79 use_default_mappings = true,
80 default_component_configs = {
81 container = {
82 enable_character_fade = true,
83 },
84 indent = {
85 indent_size = 2,
86 padding = 1,
87 -- indent guides
88 with_markers = true,
89 indent_marker = '│',
90 last_indent_marker = '└',
91 highlight = 'NeoTreeIndentMarker',
92 -- expander config, needed for nesting files
93 with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
94 expander_collapsed = icon 'ArrowClosed',
95 expander_expanded = icon 'ArrowOpen',
96 expander_highlight = 'NeoTreeExpander',
97 },
98 icon = {
99 folder_closed = icon 'Folder',
100 folder_open = icon 'OpenFolder',
101 folder_empty = icon 'EmptyFolder',
102 },
103 modified = {
104 symbol = icon 'VcsModified',
105 highlight = 'NeoTreeModified',
106 },
107 name = {
108 trailing_slash = false,
109 use_git_status_colors = true,
110 highlight = 'NeoTreeFileName',
111 },
112 git_status = {
113 symbols = {
114 -- Change type
115 added = icon 'VcsAdded',
116 deleted = icon 'VcsRemoved',
117 modified = icon 'VcsModified',
118 renamed = icon 'VcsRenamed',
119 -- Status type
120 untracked = icon 'VcsUntracked',
121 ignored = icon 'VcsIgnored',
122 unstaged = icon 'VcsUnstaged',
123 staged = icon 'VcsStaged',
124 conflict = icon 'VcsConflicted',
125 },
126 align = 'right',
127 },
128 },
129 renderers = {
130 directory = {
131 { 'indent' },
132 { 'icon' },
133 { 'current_filter' },
134 {
135 'container',
136 width = '100%',
137 right_padding = 1,
138 --max_width = 60,
139 content = {
140 { 'name', zindex = 10 },
141 { 'clipboard', zindex = 10 },
142 { 'diagnostics', errors_only = true, zindex = 20, align = 'right' },
143 },
144 },
145 },
146 file = {
147 { 'indent' },
148 { 'icon' },
149 {
150 'container',
151 width = '100%',
152 right_padding = 1,
153 --max_width = 60,
154 content = {
155 {
156 'name',
157 use_git_status_colors = true,
158 zindex = 10,
159 },
160 { 'clipboard', zindex = 10 },
161 { 'bufnr', zindex = 10 },
162 { 'modified', zindex = 20, align = 'right' },
163 { 'diagnostics', zindex = 20, align = 'right' },
164 { 'git_status', zindex = 20, align = 'right' },
165 },
166 },
167 },
168 message = {
169 { 'indent', with_markers = false },
170 { 'name', highlight = 'NeoTreeMessage' },
171 },
172 terminal = {
173 { 'indent' },
174 { 'icon' },
175 { 'name' },
176 { 'bufnr' },
177 },
178 },
179 nesting_rules = {},
180 window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
181 -- possible options. These can also be functions that return these options.
182 position = 'left', -- left, right, float, current
183 width = 40, -- applies to left and right positions
184 popup = { -- settings that apply to float position only
185 size = {
186 height = '80%',
187 width = '50%',
188 },
189 position = '50%', -- 50% means center it
190 -- you can also specify border here, if you want a different setting from
191 -- the global popup_border_style.
192 },
193 -- Mappings for tree window. See `:h neo-tree-mappings` for a list of built-in commands.
194 -- You can also create your own commands by providing a function instead of a string.
195 mapping_options = {
196 noremap = true,
197 nowait = true,
198 },
199 mappings = {
200 ['<space>'] = {
201 'toggle_node',
202 nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
203 },
204 ['<2-LeftMouse>'] = 'open',
205 ['<cr>'] = 'open',
206 ['S'] = 'split_with_window_picker',
207 ['s'] = 'vsplit_with_window_picker',
208 ['t'] = 'open_tabnew',
209 ['w'] = 'open_with_window_picker',
210 ['C'] = 'close_node',
211 ['z'] = 'close_all_nodes',
212 ['R'] = 'refresh',
213 ['a'] = {
214 'add',
215 -- some commands may take optional config options, see `:h neo-tree-mappings` for details
216 config = {
217 show_path = 'none', -- "none", "relative", "absolute"
218 },
219 },
220 ['A'] = 'add_directory', -- also accepts the config.show_path option.
221 ['d'] = 'delete',
222 ['<F2>'] = 'rename',
223 ['y'] = 'copy_to_clipboard',
224 ['x'] = 'cut_to_clipboard',
225 ['p'] = 'paste_from_clipboard',
226 ['c'] = 'copy', -- takes text input for destination, also accepts the config.show_path option
227 ['m'] = 'move', -- takes text input for destination, also accepts the config.show_path option
228 ['q'] = 'close_window',
229 ['?'] = 'show_help',
230 },
231 },
232 filesystem = {
233 window = {
234 mappings = {
235 ['H'] = 'toggle_hidden',
236 ['/'] = 'fuzzy_finder',
237 ['f'] = 'filter_on_submit',
238 ['<C-x>'] = 'clear_filter',
239 ['<bs>'] = 'navigate_up',
240 ['.'] = 'set_root',
241 ['[g'] = 'prev_git_modified',
242 [']g'] = 'next_git_modified',
243 },
244 },
245 async_directory_scan = 'auto', -- "auto" means refreshes are async, but it's synchronous when called from the Neotree commands.
246 -- "always" means directory scans are always async.
247 -- "never" means directory scans are never async.
248 bind_to_cwd = true, -- true creates a 2-way binding between vim's cwd and neo-tree's root
249 -- The renderer section provides the renderers that will be used to render the tree.
250 -- The first level is the node type.
251 -- For each node type, you can specify a list of components to render.
252 -- Components are rendered in the order they are specified.
253 -- The first field in each component is the name of the function to call.
254 -- The rest of the fields are passed to the function as the "config" argument.
255 filtered_items = {
256 visible = true, -- when true, they will just be displayed differently than normal items
257 force_visible_in_empty_folder = false, -- when true, hidden files will be shown if the root folder is otherwise empty
258 show_hidden_count = false, -- when true, the number of hidden items in each folder will be shown as the last entry
259 hide_dotfiles = true,
260 hide_gitignored = true,
261 hide_hidden = true, -- only works on Windows for hidden files/directories
262 hide_by_name = {
263 '.DS_Store',
264 'thumbs.db',
265 'node_modules',
266 'zig-cache',
267 'target',
268 },
269 hide_by_pattern = { -- uses glob style patterns
270 --"*.meta"
271 },
272 never_show = { -- remains hidden even if visible is toggled to true
273 --".DS_Store",
274 --"thumbs.db"
275 },
276 },
277 find_by_full_path_words = false, -- `false` means it only searches the tail of a path.
278 -- `true` will change the filter into a full path
279 -- search with space as an implicit ".*", so
280 -- `fi init`
281 -- will match: `./sources/filesystem/init.lua
282 --find_command = "fd", -- this is determined automatically, you probably don't need to set it
283 --find_args = { -- you can specify extra args to pass to the find command.
284 -- fd = {
285 -- "--exclude", ".git",
286 -- "--exclude", "node_modules"
287 -- }
288 --},
289 ---- or use a function instead of list of strings
290 --find_args = function(cmd, path, search_term, args)
291 -- if cmd ~= "fd" then
292 -- return args
293 -- end
294 -- --maybe you want to force the filter to always include hidden files:
295 -- table.insert(args, "--hidden")
296 -- -- but no one ever wants to see .git files
297 -- table.insert(args, "--exclude")
298 -- table.insert(args, ".git")
299 -- -- or node_modules
300 -- table.insert(args, "--exclude")
301 -- table.insert(args, "node_modules")
302 -- --here is where it pays to use the function, you can exclude more for
303 -- --short search terms, or vary based on the directory
304 -- if string.len(search_term) < 4 and path == "/home/cseickel" then
305 -- table.insert(args, "--exclude")
306 -- table.insert(args, "Library")
307 -- end
308 -- return args
309 --end,
310 group_empty_dirs = false, -- when true, empty folders will be grouped together
311 search_limit = 50, -- max number of search results when using filters
312 follow_current_file = false, -- This will find and focus the file in the active buffer every time
313 -- the current file is changed while the tree is open.
314 hijack_netrw_behavior = 'open_default', -- netrw disabled, opening a directory opens neo-tree
315 -- in whatever position is specified in window.position
316 -- "open_current",-- netrw disabled, opening a directory opens within the
317 -- window like netrw would, regardless of window.position
318 -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
319 use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes
320 -- instead of relying on nvim autocmd events.
321 },
322 buffers = {
323 bind_to_cwd = true,
324 follow_current_file = true, -- This will find and focus the file in the active buffer every time
325 -- the current file is changed while the tree is open.
326 group_empty_dirs = true, -- when true, empty directories will be grouped together
327 window = {
328 mappings = {
329 ['<bs>'] = 'navigate_up',
330 ['.'] = 'set_root',
331 ['bd'] = 'buffer_delete',
332 },
333 },
334 },
335 git_status = {
336 window = {
337 mappings = {
338 ['A'] = 'git_add_all',
339 ['gu'] = 'git_unstage_file',
340 ['ga'] = 'git_add_file',
341 ['gr'] = 'git_revert_file',
342 ['gc'] = 'git_commit',
343 ['gp'] = 'git_push',
344 ['gg'] = 'git_commit_and_push',
345 },
346 },
347 },
348 }
389349end)

neovim/lua/bugabinga/fuzzy-search-ui.lua

Modified

+58 / −68 text lines

11local map = require 'bugabinga.std.keymap'
22local want = require 'bugabinga.std.want'
3want { 'telescope', 'command_center', 'dressing' }(function(telescope, command_center, dressing)
4 -- Command Center gets loaded here to configure it in the context of Telescope.
5 -- DO NOT use it to add keybindings.
6 -- Instead, use the `bugabinga.std.keymap` facade.
3want { 'telescope', 'command_center', 'dressing' } (function(telescope, command_center, dressing)
4 -- Command Center gets loaded here to configure it in the context of Telescope.
5 -- DO NOT use it to add keybindings.
6 -- Instead, use the `bugabinga.std.keymap` facade.
8 map {
9 name = 'Open Command Center',
10 description = 'Opens the Command Center with Telescope to show all available keybound commands.',
11 mode = map.MODE.NORMAL,
12 keys = '<C-p>',
13 command = function()
14 telescope.extensions.command_center.command_center()
15 end,
16 }
8 map {
9 name = 'Open Command Center',
10 description = 'Opens the Command Center with Telescope to show all available keybound commands.',
11 mode = map.MODE.NORMAL,
12 keys = '<C-p>',
13 command = function()
14 telescope.extensions.command_center.command_center()
15 end,
16 }
18 telescope.setup {
19 defaults = {
20 history = {
21 path = vim.fn.stdpath 'data' .. 'telescope_history.sqlite3',
22 limit = 100,
23 },
24 },
25 extensions = {
26 command_center = {
27 -- Change what to show on telescope prompt and in which order
28 -- Currently support the following three components
29 -- Components may repeat
30 components = {
31 command_center.component.DESCRIPTION,
32 command_center.component.KEYBINDINGS,
33 -- command_center.component.COMMAND,
34 },
35 -- Change the separator used to separate each component
36 separator = ' ',
37 -- When set to false,
38 -- The description compoenent will be empty if it is not specified
39 auto_replace_desc_with_cmd = false,
40 },
41 },
42 }
18 telescope.setup {
19 extensions = {
20 command_center = {
21 -- Change what to show on telescope prompt and in which order
22 -- Currently support the following three components
23 -- Components may repeat
24 components = {
25 command_center.component.DESCRIPTION,
26 command_center.component.KEYBINDINGS,
27 -- command_center.component.COMMAND,
28 },
29 -- Change the separator used to separate each component
30 separator = ' ',
31 -- When set to false,
32 -- The description compoenent will be empty if it is not specified
33 auto_replace_desc_with_cmd = false,
34 },
35 },
36 }
44 local extensions = {
45 -- Plug Command Center into Telescope
46 'command_center',
47 -- show history of notifications
48 'notify',
49 -- save yank history
50 'neoclip',
51 -- telescope for vim.ui.select
52 'ui-select',
53 -- sort by frecency
54 'frecency',
55 -- cheat sheet
56 'cheat',
57 -- file browser
58 'file_browser',
59 -- manage projects
60 'project',
61 -- project specific history
62 'smart_history',
63 }
38 local extensions = {
39 -- Plug Command Center into Telescope
40 'command_center',
41 -- show history of notifications
42 'notify',
43 -- save yank history
44 'neoclip',
45 -- telescope for vim.ui.select
46 'ui-select',
47 -- cheat sheet
48 'cheat',
49 -- file browser
50 'file_browser',
51 -- manage projects
52 'project',
53 }
65 for _, extension in pairs(extensions) do
66 if not pcall(telescope.load_extension, extension) then
67 vim.notify('Telescope extension ' .. extension .. ' could not be loaded!', 'error')
68 end
69 end
55 for _, extension in pairs(extensions) do
56 if not pcall(telescope.load_extension, extension) then
57 vim.notify('Telescope extension ' .. extension .. ' could not be loaded!', 'error')
58 end
59 end
71 dressing.setup {
72 input = { enable = true },
73 -- vim.ui.select is already handled by telescope extension
74 select = { enable = false },
75 }
61 dressing.setup {
62 input = { enable = true },
63 -- vim.ui.select is already handled by telescope extension
64 select = { enable = false },
65 }
7666end)

neovim/lua/bugabinga/git-status.lua

Modified

+69 / −4 text lines

1local fmt = require 'bugabinga.std.fmt'
2local map = require 'bugabinga.std.keymap'
13local want = require 'bugabinga.std.want'
2want { 'gitsigns' }(function(gitsigns)
3 -- FIXME use keymap facade
4 -- FIXME integrate into null-ls
5 gitsigns.setup()
4
5want { 'gitsigns' } (function(gitsigns)
6 map {
7 description = 'toogle git status line highlight',
8 category = map.CATEGORY.VERSION_CONTROL,
9 mode = map.MODE.NORMAL,
10 keys = map.KEY.LEADER .. map.KEY.V .. map.KEY.L,
11 command = fmt.cmd'gitsigns toggle_linehl',
12 }
13 map {
14 description = 'toogle git status signs',
15 category = map.CATEGORY.VERSION_CONTROL,
16 mode = map.MODE.NORMAL,
17 keys = map.KEY.LEADER .. map.KEY.V .. map.KEY.S,
18 command = fmt.cmd'gitsigns toggle_signs',
19 }
20 map {
21 description = 'Toogle Git Blame Line',
22 category = map.CATEGORY.VERSION_CONTROL,
23 mode = map.MODE.NORMAL,
24 keys = map.KEY.LEADER .. map.KEY.V .. map.KEY.B,
25 command = fmt.cmd'Gitsigns toggle_current_line_blame',
26 }
27 gitsigns.setup {
28 signs = {
29 add = { hl = 'GitSignsAdd', text = '│', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' },
30 change = { hl = 'GitSignsChange', text = '│', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
31 delete = { hl = 'GitSignsDelete', text = '_', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
32 topdelete = { hl = 'GitSignsDelete', text = '‾', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
33 changedelete = { hl = 'GitSignsChange', text = '~', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
34 },
35 signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
36 numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
37 linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
38 word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
39 diff_opts = {
40 internal = true,
41 },
42 watch_gitdir = {
43 interval = 1000,
44 follow_files = true,
45 },
46 attach_to_untracked = true,
47 current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
48 current_line_blame_opts = {
49 virt_text = true,
50 virt_text_pos = 'right_align', -- 'eol' | 'overlay' | 'right_align'
51 delay = 866,
52 ignore_whitespace = true,
53 },
54 current_line_blame_formatter = '<author>, <author_time:%d/%m/%Y> - <summary>',
55 sign_priority = 6,
56 update_debounce = 100,
57 status_formatter = nil, -- Use default
58 max_file_length = 40000,
59 preview_config = {
60 -- Options passed to nvim_open_win
61 border = 'rounded',
62 style = 'minimal',
63 relative = 'cursor',
64 row = 0,
65 col = 1,
66 },
67 yadm = {
68 enable = false,
69 },
70 }
671end)

neovim/lua/bugabinga/health.lua

Modified

+12 / −13 text lines

66local _ = {}
88local function program_installed(name_of_executable)
9 return (vim.fn.executable(name_of_executable) ~= 0)
9 return (vim.fn.executable(name_of_executable) ~= 0)
1010end
1212local function check_program(name, name_of_executable)
13 vim.health.report_start(name .. ' report')
14 if program_installed(name_of_executable) then
15 vim.health.report_ok(name_of_executable .. ' found on system')
16 else
17 vim.health.report_error(name .. ' is not installed on the system')
18 end
13 vim.health.report_start(name .. ' report')
14 if program_installed(name_of_executable) then
15 vim.health.report_ok(name_of_executable .. ' found on system')
16 else
17 vim.health.report_error(name .. ' is not installed on the system')
18 end
1919end
2121_.check = function()
22 check_program('ripgrep', 'rg')
23 check_program('find-fd', 'fd')
24 check_program('SQLite3', 'sqlite3')
25 check_program('Nushell', 'nu')
26 check_program('vim-startuptime', 'vim-startuptime')
27 check_program('Pandoc', 'pandoc')
22 check_program('ripgrep', 'rg')
23 check_program('find-fd', 'fd')
24 check_program('Nushell', 'nu')
25 check_program('vim-startuptime', 'vim-startuptime')
26 check_program('Pandoc', 'pandoc')
2827end
3029return _

neovim/lua/bugabinga/icons.lua

Deleted
deleted file mode 100644

+0 / −181 text lines

1local want = require 'bugabinga.std.want'
2want { 'nvim-web-devicons' }(function(devicons)
3 devicons.setup {
4 override = {
5 sh = {
6 icon = '',
7 color = '#1DC123',
8 cterm_color = '59',
9 name = 'Sh',
10 },
11 toml = {
12 icon = '',
13 color = '#e24329',
14 cterm_color = '59',
15 name = 'Toml',
16 },
17 justfile = {
18 icon = 'ﮧ',
19 color = '#999eff',
20 cterm_color = '59',
21 name = 'Justfile',
22 },
23 Justfile = {
24 icon = 'ﮧ',
25 color = '#999eff',
26 cterm_color = '59',
27 name = 'Justfile',
28 },
29 ['.justfile'] = {
30 icon = 'ﮧ',
31 color = '#999eff',
32 cterm_color = '59',
33 name = 'Justfile',
34 },
35 ['.Justfile'] = {
36 icon = 'ﮧ',
37 color = '#999eff',
38 cterm_color = '59',
39 name = 'Justfile',
40 },
41 ['.gitattributes'] = {
42 icon = '',
43 color = '#e24329',
44 cterm_color = '59',
45 name = 'GitAttributes',
46 },
47 ['.gitconfig'] = {
48 icon = '',
49 color = '#e24329',
50 cterm_color = '59',
51 name = 'GitConfig',
52 },
53 ['.gitignore'] = {
54 icon = '',
55 color = '#e24329',
56 cterm_color = '59',
57 name = 'GitIgnore',
58 },
59 ['.gitlab-ci.yml'] = {
60 icon = '',
61 color = '#e24329',
62 cterm_color = '166',
63 name = 'GitlabCI',
64 },
65 ['.gitmodules'] = {
66 icon = '',
67 color = '#e24329',
68 cterm_color = '59',
69 name = 'GitModules',
70 },
71 ['diff'] = {
72 icon = '',
73 color = '#e24329',
74 cterm_color = '59',
75 name = 'Diff',
76 },
77 },
78 default = true,
79 }
80end)
82--[[ FIXME: integrate those into devicons
83return {
84 kind = {
85 Text = "",
86 Method = "m",
87 Function = "",
88 Constructor = "",
89 Field = "",
90 Variable = "",
91 Class = "",
92 Interface = "",
93 Module = "",
94 Property = "",
95 Unit = "",
96 Value = "",
97 Enum = "",
98 Keyword = "",
99 Snippet = "",
100 Color = "",
101 File = "",
102 Reference = "",
103 Folder = "",
104 EnumMember = "",
105 Constant = "",
106 Struct = "",
107 Event = "",
108 Operator = "",
109 TypeParameter = "",
110 },
111 type = {
112 Array = "",
113 Number = "",
114 String = "",
115 Boolean = "蘒",
116 Object = "",
117 },
118 documents = {
119 File = "",
120 Files = "",
121 Folder = "",
122 OpenFolder = "",
123 },
124 git = {
125 Add = "",
126 Mod = "",
127 Remove = "",
128 Ignore = "",
129 Rename = "",
130 Diff = "",
131 Repo = "",
132 },
133 ui = {
134 ArrowClosed = "",
135 ArrowOpen = "",
136 Lock = "",
137 Circle = "",
138 BigCircle = "",
139 BigUnfilledCircle = "",
140 Close = "",
141 NewFile = "",
142 Search = "",
143 Lightbulb = "",
144 Project = "",
145 Dashboard = "",
146 History = "",
147 Comment = "",
148 Bug = "",
149 Code = "",
150 Telescope = "",
151 Gear = "",
152 Package = "",
153 List = "",
154 SignIn = "",
155 SignOut = "",
156 Check = "",
157 Fire = "",
158 Note = "",
159 BookMark = "",
160 Pencil = "",
161 ChevronRight = "",
162 Table = "",
163 Calendar = "",
164 CloudDownload = "",
165 },
166 diagnostics = {
167 Error = "",
168 Warning = "",
169 Information = "",
170 Question = "",
171 Hint = "",
172 },
173 misc = {
174 Robot = "ﮧ",
175 Squirrel = "",
176 Tag = "",
177 Watch = "",
178 },
179}
180]]
181--

neovim/lua/bugabinga/lsp.lua

Modified

+286 / −105 text lines

1local icon = require 'bugabinga.std.icon'
2local map = require 'bugabinga.std.keymap'
3local auto = require 'bugabinga.std.auto'
4local project = require 'bugabinga.std.project'
15local want = require 'bugabinga.std.want'
6
7-- TODO: setup codelens -> use lsp-signature plugin?
8-- TODO: setup custom cmp keybinds
29want {
3 'lsp-zero',
4 'null-ls',
5 'nvim-lsp-installer',
6 'lua-dev',
7 'rust-tools',
8 'nvim-navic',
9 'lsp-status',
10}(function(zero, null_ls, installer, luadev, rust, navic, lsp_status)
11 installer.settings {
12 ui = {
13 border = 'rounded',
14 },
15 }
10 'lsp-zero',
11 'null-ls',
12 'nvim-lsp-installer',
13 'lua-dev',
14 'rust-tools',
15 'nvim-navic',
16 'lsp-status',
17} (function(zero, null_ls, installer, luadev, rust, navic, lsp_status)
18 installer.settings {
19 ui = {
20 --TODO: use some global float window settings
21 border = 'rounded',
22 },
23 }
17 zero.preset 'recommended'
25 zero.preset 'recommended'
26 zero.set_preferences {
27 configure_diagnostics = false,
28 set_lsp_keymaps = false,
29 sign_icons = {
30 error = icon 'Error',
31 warn = icon 'Warning',
32 hint = icon 'Hint',
33 info = icon 'Information',
34 },
35 }
19 -- setup lsp for my neovim config
20 zero.nvim_workspace {
21 -- add paths of all plugins and neovim
22 library = vim.api.nvim_get_runtime_file('', true),
23 }
24 -- Initialize rust_analyzer with rust-tools
25 rust.setup {
26 server = zero.build_options('rust_analyzer', {}),
27 }
37 -- setup lsp for my neovim config
38 zero.nvim_workspace {
39 -- add paths of all plugins and neovim
40 library = vim.api.nvim_get_runtime_file('', true),
41 }
42 -- Initialize rust_analyzer with rust-tools
43 rust.setup {
44 server = zero.build_options('rust_analyzer', {}),
45 }
29 -- this will prevent zero from loading this server.
30 -- Java will be managed by nvim-jdtls, which wants to do things differently.
31 -- see ftplugin/java.lua
32 zero.build_options('jdtls', {})
47 -- this will prevent zero from loading this server.
48 -- Java will be managed by nvim-jdtls, which wants to do things differently.
49 -- see ftplugin/java.lua
50 zero.build_options('jdtls', {})
34 -- lua neovim lsp
35 luadev.setup {
36 lspconfig = zero.defaults.nvim_workspace(),
37 }
52 -- lua neovim lsp
53 luadev.setup {
54 lspconfig = zero.defaults.nvim_workspace(),
55 }
39 -- disable disco mode while typing
40 zero.setup_nvim_cmp {
41 completion = {
42 autocomplete = false,
43 },
44 }
57 -- disable disco mode while typing
58 zero.setup_nvim_cmp {
59 completion = {
60 autocomplete = false,
61 },
62 }
46 -- Format on Save when any LSP supports it.
47 local auto = require 'bugabinga.std.auto'
48 local null_opts = zero.build_options('null-ls', {
49 on_attach = function(client)
50 if client.server_capabilities.documentFormattingProvider then
51 auto 'format_buffer_on_write' {
52 description = 'Format the current buffer before writing.',
53 events = 'BufWritePre',
54 pattern = '<buffer>',
55 callback = function(context)
56 vim.lsp.buf.format()
57 vim.notify('Formatted ' .. context.file)
58 end,
59 }
60 end
61 end,
62 })
64 local null_opts = zero.build_options 'null-ls'
64 local formatting = null_ls.builtins.formatting
65 local diagnostics = null_ls.builtins.diagnostics
66 local code_actions = null_ls.builtins.code_actions
67 local hover = null_ls.builtins.hover
68 local completion = null_ls.builtins.completion
66 local formatting = null_ls.builtins.formatting
67 local diagnostics = null_ls.builtins.diagnostics
68 local code_actions = null_ls.builtins.code_actions
69 local hover = null_ls.builtins.hover
70 local completion = null_ls.builtins.completion
70 -- run diagnostics on save
71 local diagnostics_on_save = { method = null_ls.methods.DIAGNOSTICS_ON_SAVE }
72 null_ls.setup {
73 on_attach = null_opts.on_attach,
74 sources = {
75 formatting.black.with { extra_args = { '--fast' } },
76 formatting.stylua,
77 formatting.clang_format,
78 formatting.codespell,
79 formatting.jq,
80 formatting.protolint,
81 formatting.shellharden,
82 formatting.shfmt,
83 formatting.taplo,
72 -- run diagnostics on save
73 local diagnostics_on_save = { method = null_ls.methods.DIAGNOSTICS_ON_SAVE }
74 null_ls.setup {
75 on_attach = null_opts.on_attach,
76 sources = {
77 formatting.stylua,
78 formatting.clang_format,
79 formatting.codespell,
80 formatting.jq,
81 formatting.protolint,
82 formatting.shellharden,
83 formatting.shfmt,
84 formatting.taplo,
85 hover.dictionary,
86 hover.dictionary,
87 diagnostics.actionlint.with(diagnostics_on_save),
88 diagnostics.checkmake.with(diagnostics_on_save),
89 diagnostics.codespell.with(diagnostics_on_save),
90 diagnostics.editorconfig_checker.with(diagnostics_on_save).with { command = 'editorconfig-checker' },
91 diagnostics.gitlint.with(diagnostics_on_save),
92 diagnostics.protoc_gen_lint.with(diagnostics_on_save),
93 diagnostics.protolint.with(diagnostics_on_save),
94 diagnostics.selene.with(diagnostics_on_save).with {
95 -- null-ls determines the root in a too simplistic manner.
96 -- since my neovim configuration live inside my dotfiles, the dotfiles root
97 -- was taken. but i want the neovim config folder as root.
98 cwd = function(parameters)
99 local project = require 'bugabinga.std.project'
100 local root = project.determine_project_root({ name = 'selene.toml', weight = 10 }, parameters.root)
101 return root or parameters.root
102 end,
103 },
104 diagnostics.shellcheck.with(diagnostics_on_save),
105 diagnostics.tidy.with(diagnostics_on_save),
88 diagnostics.actionlint.with(diagnostics_on_save),
89 diagnostics.checkmake.with(diagnostics_on_save),
90 diagnostics.codespell.with(diagnostics_on_save),
91 diagnostics.editorconfig_checker.with(diagnostics_on_save).with { command = 'editorconfig-checker' },
92 diagnostics.gitlint.with(diagnostics_on_save),
93 diagnostics.protoc_gen_lint.with(diagnostics_on_save),
94 diagnostics.protolint.with(diagnostics_on_save),
95 diagnostics.selene.with(diagnostics_on_save).with {
96 -- null-ls determines the root in a too simplistic manner.
97 -- since my neovim configuration live inside my dotfiles, the dotfiles root
98 -- was taken. but i want the neovim config folder as root.
99 cwd = function(parameters)
100 local root = project.determine_project_root({ name = 'selene.toml', weight = 10 }, parameters.root)
101 return root or parameters.root
102 end,
103 },
104 diagnostics.shellcheck.with(diagnostics_on_save),
105 diagnostics.tidy.with(diagnostics_on_save),
107 code_actions.refactoring,
108 code_actions.shellcheck,
107 code_actions.refactoring,
108 code_actions.shellcheck,
110 completion.luasnip,
111 },
112 }
110 completion.luasnip,
111 },
112 }
114 zero.on_attach(function(client, buffer_number)
115 if client.name ~= 'null-ls' and not vim.b.lsp_attached then
116 navic.attach(client, buffer_number)
117 lsp_status.on_attach(client, buffer_number)
118 end
119 end)
114local function setup_keybinds_and_actions(client, buffer_number)
115 -- TODO: make format changed lines command
116 local capabilities = client.resolved_capabilities
117 if capabilities.document_formatting then
118 map {
119 description = 'Format buffer using LSP',
120 category = map.CATEGORY.EDITING,
121 mode = map.MODE.NORMAL,
122 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.F,
123 command = function()
124 vim.lsp.buf.format { bufnr = buffer_number }
125 vim.notify('Formatted ' .. vim.api.nvim_buf_get_name(buffer_number))
126 end,
127 }
128 end
129 if capabilities.document_range_formatting then
130 map {
131 description = 'Format range using LSP',
132 category = map.CATEGORY.EDITING,
133 mode = map.MODE.VISUAL,
134 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.F,
135 command = function()
136 vim.lsp.buf.range_formatting { bufnr = buffer_number }
137 vim.notify('Formatted range in ' .. vim.api.nvim_buf_get_name(buffer_number))
138 end,
139 }
140 end
141 --TODO: change some of these commands to telescoped versions
142 if capabilities.hover then
143 map {
144 description = 'Show Hover',
145 category = map.CATEGORY.VIEW,
146 mode = map.MODE.NORMAL,
147 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.K,
148 command = function()
149 vim.lsp.buf.hover()
150 end,
151 }
152 end
153 if capabilities.goto_definition then
154 map {
155 description = 'Go to Definition',
156 category = map.CATEGORY.NAVIGATION,
157 mode = map.MODE.NORMAL,
158 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.D,
159 command = function()
160 vim.lsp.buf.definition()
161 end,
162 }
163 end
164 if capabilities.declaration then
165 map {
166 description = 'Go to Declaration',
167 category = map.CATEGORY.NAVIGATION,
168 mode = map.MODE.NORMAL,
169 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.D .. map.KEY.D,
170 command = function()
171 vim.lsp.buf.declaration()
172 end,
173 }
174 end
175 if capabilities.implementation then
176 map {
177 description = 'Go to Implementation',
178 category = map.CATEGORY.NAVIGATION,
179 mode = map.MODE.NORMAL,
180 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.I,
181 command = function()
182 vim.lsp.buf.implementation()
183 end,
184 }
185 end
186 if capabilities.type_definition then
187 map {
188 description = 'Go to Type Definition',
189 category = map.CATEGORY.NAVIGATION,
190 mode = map.MODE.NORMAL,
191 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.T,
192 command = function()
193 vim.lsp.buf.type_definition()
194 end,
195 }
196 end
197 if capabilities.find_references then
198 map {
199 description = 'Go to References',
200 category = map.CATEGORY.NAVIGATION,
201 mode = map.MODE.NORMAL,
202 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.R,
203 command = function()
204 vim.lsp.buf.references()
205 end,
206 }
207 end
208 if capabilities.call_hierarchy then
209 map {
210 description = 'Go to Incoming Call',
211 category = map.CATEGORY.NAVIGATION,
212 mode = map.MODE.NORMAL,
213 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.C,
214 command = function()
215 vim.lsp.buf.incoming_calls()
216 end,
217 }
218 map {
219 description = 'Go to Outgoing Call',
220 category = map.CATEGORY.NAVIGATION,
221 mode = map.MODE.NORMAL,
222 keys = map.KEY.LEADER .. map.KEY.L .. map.KEY.C .. map.KEY.C,
223 command = function()
224 vim.lsp.buf.outgoing_calls()
225 end,
226 }
227 end
228 if capabilities.rename then
229 map {
230 description = 'Rename symbol',
231 category = map.CATEGORY.EDITING,
232 mode = map.MODE.NORMAL,
233 keys = map.KEY.F2,
234 command = function()
235 vim.lsp.buf.rename()
236 end,
237 }
238 end
239 if capabilities.code_action then
240 map {
241 description = 'Show code actions',
242 category = map.CATEGORY.VIEW,
243 mode = map.MODE.NORMAL,
244 keys = map.KEY.F4,
245 command = function()
246 vim.lsp.buf.code_action()
247 end,
248 }
249 map {
250 description = 'Show code actions in range',
251 category = map.CATEGORY.VIEW,
252 mode = map.MODE.VISUAL,
253 keys = map.KEY.F4,
254 command = function()
255 vim.lsp.buf.range_code_action()
256 end,
257 }
258 end
259 if capabilities.document_highlight then
260 -- this variable should technically be scoped to the current buffer.
261 -- how to do that?
262 local highlight_timer = nil
263 auto 'highlight_reference_under_cursor' {
264 {
265 description = 'Automatically highlight a symbol under cursor',
266 events = 'CursorHold',
267 pattern = '<buffer>',
268 command = function()
269 if not highlight_timer then
270 highlight_timer = vim.defer_fn(function()
271 vim.lsp.buf.document_highlight()
272 highlight_timer = nil
273 end, 866)
274 end
275 end,
276 },
277 {
278 description = 'Clear highlighted symbol under cursor',
279 events = { 'CursorMoved', 'CursorMovedI', 'InsertEnter' },
280 pattern = '<buffer>',
281 command = function()
282 if highlight_timer then
283 highlight_timer:close()
284 highlight_timer = nil
285 end
286 vim.lsp.buf.clear_references()
287 end,
288 },
289 }
290 end
291 end
121 zero.setup()
293 zero.on_attach(function(client, buffer_number)
294 if client.name ~= 'null-ls' and not vim.b.lsp_attached then
295 navic.attach(client, buffer_number)
296 lsp_status.on_attach(client, buffer_number)
297 setup_keybinds_and_actions(client, buffer_number)
298 end
299 end)
301 zero.setup()
302
122303end)

neovim/lua/bugabinga/module-cache.lua

Modified

+3 / −3 text lines

33-- to get most out of the cache.
44local ok, impatient = pcall(require, 'impatient')
55if not ok then
6 vim.notify('modules will not be cached, because `impatient` could not be found.', 'error')
7 return
6 vim.notify('modules will not be cached, because `impatient` could not be found.', 'error')
7 return
88end
9-- FIXME: enable profile only when neovim was startet with --startuptime?
9-- FIXME: enable profile only when global vim.g.profile_mode is true
1010impatient.enable_profile()

neovim/lua/bugabinga/move-code.lua

Modified

+3 / −3 text lines

4040 }
4141 map {
4242 description = 'Move line up',
43 category = map.CATEGORY.EDITING,
43 category = map.CATEGORY.EDITING,
4444 command = '<Plug>GoNSMUp',
4545 mode = map.MODE.NORMAL,
4646 keys = map.KEY.ALT_K,
7474 }
7575 map {
7676 description = 'Move block up',
77 category = map.CATEGORY.EDITING,
7877 command = '<Plug>GoVSMUp',
78 category = map.CATEGORY.EDITING,
7979 mode = map.MODE.VISUAL,
8080 keys = map.KEY.ALT_K,
8181 options = options,
8585 category = map.CATEGORY.EDITING,
8686 command = '<Plug>GoVSMRight',
8787 mode = map.MODE.VISUAL,
88 keys = map.KEY.ALT_K,
88 keys = map.KEY.ALT_L,
8989 options = options,
9090 }

neovim/lua/bugabinga/options/autocommands.lua

Modified

+2 / −2 text lines

44 description = 'briefly highlight yanked text',
55 events = 'TextYankPost',
66 pattern = '*',
7 callback = function()
7 command = function()
88 vim.highlight.on_yank { timeout = 500 }
99 end,
1313 description = 'Hide colorcolumn in buffers, that do not show source code.',
1414 events = { 'FileType' },
1515 pattern = 'Trouble,qf,help,toggleterm',
16 callback = function()
16 command = function()
1717 vim.opt_local.colorcolumn = {}
1818 end,

neovim/lua/bugabinga/options/ui.lua

Modified

+26 / −23 text lines

11-- show trailing whitespace
22vim.opt.list = true
33vim.opt.listchars = {
4 space = '⋅',
5 eol = '↴',
6 tab = '__',
7 trail = '•',
8 extends = '❯',
9 precedes = '❮',
10 nbsp = '_',
4 space = '⋅',
5 eol = '↴',
6 tab = '__',
7 trail = '•',
8 extends = '❯',
9 precedes = '❮',
10 nbsp = '_',
1313-- do not spam the cmdline with every little input
2929-- hide weird symbol at end of buffer
3030vim.opt.fillchars = {
31 eob = ' ',
32 fold = ' ',
33 diff = '╱',
31 eob = ' ',
32 fold = ' ',
33 diff = '╱',
3636-- hide output of insert completion popup in status
3737vim.opt.shortmess:append 'c'
39-- hide cmd window to give status more room
40vim.opt.cmdheight = 0
39-- show cmd window to prevent jitter ui
40vim.opt.cmdheight = 1
4242-- do not conceal special characters by default. filestypes can enable this on demand.
4343vim.opt.conceallevel = 0
5555vim.opt.pumheight = 10
5757-- transparent popups and floating windows
58vim.opt.pumblend = 30
59vim.opt.winblend = 15
58vim.opt.pumblend = 5
59vim.opt.winblend = 5
6161-- hide the mode indicator in status
6262vim.opt.showmode = false
6868vim.opt.termguicolors = true
6969vim.opt.lazyredraw = true
71-- cursor
72vim.opt.guicursor = 'n-v-c-sm:block-Cursor,i-ci-ve:ver25-blinkon250,r-cr:hor20,o:hor50'
7174-- font
72vim.opt.guifont = 'BlexMono Nerd Font:h16:antialias=true'
75vim.opt.guifont = 'BlexMono Nerd Font:h11:antialias=true'
7477-- neovide only options
7578if vim.g.neovide then
76 vim.g.neovide_floating_blur_amount_x = 4.0
77 vim.g.neovide_floating_blur_amount_y = 4.0
78 vim.g.neovide_scroll_animation_length = 0.33
79 vim.g.neovide_fullscreen = true
80 vim.g.neovide_profiler = false
81 vim.g.neovide_cursor_animation_length = 0.11
82 vim.g.neovide_cursor_trail_length = 0.666
83 vim.g.neovide_cursor_vfx_mode = 'pixiedust'
79 vim.g.neovide_floating_blur_amount_x = 4.0
80 vim.g.neovide_floating_blur_amount_y = 4.0
81 vim.g.neovide_scroll_animation_length = 0.33
82 vim.g.neovide_fullscreen = true
83 vim.g.neovide_profiler = false
84 vim.g.neovide_cursor_animation_length = 0.11
85 vim.g.neovide_cursor_trail_length = 0.666
86 vim.g.neovide_cursor_vfx_mode = 'pixiedust'
8487end

neovim/lua/bugabinga/plugins/init.lua

Modified

+163 / −173 text lines

11local paq = require 'bugabinga.plugins.install'
22paq {
3 -- allow paq to manage itself
4 'savq/paq-nvim',
5 -- caches other plugins for faster startup
6 'lewis6991/impatient.nvim',
7 -- Utilities used by some plugins, e.g. telescope
8 'nvim-lua/plenary.nvim',
9 -- collection of icons used by other plugins. needs a nerd font
10 'kyazdani42/nvim-web-devicons',
11 -- fuzzy search ui over many parts of neovim and other plugins
12 'nvim-telescope/telescope.nvim',
13 -- use telescope as `vim.ui.select`
14 'nvim-telescope/telescope-ui-select.nvim',
15 -- use telescope as `vim.ui.input`
16 'stevearc/dressing.nvim',
17 -- use frecency algorithm when sorting files. Needs sqlite3 installed
18 'nvim-telescope/telescope-frecency.nvim',
19 -- display cheat sheet with telesope
20 'nvim-telescope/telescope-cheat.nvim',
21 -- keep project specific histories in telescope
22 'nvim-telescope/telescope-smart-history.nvim',
23 -- show file browser in telescope
24 'nvim-telescope/telescope-file-browser.nvim',
25 -- manage projects via telescope
26 'nvim-telescope/telescope-project.nvim',
27 -- pick a symbol (emoji, icon, kaomoji,...) via telescope
28 'nvim-telescope/telescope-symbols.nvim',
29 -- sqplite lua bindings some plugins use
30 'tami5/sqlite.lua',
31 -- status and tablines
32 'beauwilliams/statusline.lua',
33 -- visual indicator if code actions are available
34 'kosayoda/nvim-lightbulb',
35 -- some bug fix for LSP
36 'antoinemadec/FixCursorHold.nvim',
37 -- allows statusbar plugins to query LSP
38 'nvim-lua/lsp-status.nvim',
39 -- keybindings api that integrates into telescope to make keymaps searchable
40 'gfeiyou/command-center.nvim',
41 -- search and replace
42 'nvim-pack/nvim-spectre',
43 -- automatically manage window sizes based on focus
44 'beauwilliams/focus.nvim',
45 -- avoid jitter in buffers when windows change
46 'luukvbaal/stabilize.nvim',
47 -- keybindings that require a persistent chain
48 'anuvyklack/hydra.nvim',
49 -- extends hydra with pink heads
50 'anuvyklack/keymap-layer.nvim',
51 -- configure some editor settings according to editorconfig file, if present
52 'gpanders/editorconfig.nvim',
53 -- highlight words under cursor
54 -- "RRethy/vim-illuminate",
55 -- highlight matched wors more clearly
56 'kevinhwang91/nvim-hlslens',
57 -- draw lines to indicate indentation levels
58 'lukas-reineke/indent-blankline.nvim',
59 -- move blocks of code around
60 'booperlv/nvim-gomove',
61 -- toolkit for creating themes
62 'rktjmp/lush.nvim',
63 -- theme with colors i like
64 'rockerBOO/boo-colorscheme-nvim',
65 -- display the colorcolumn as a virtual character
66 'lukas-reineke/virt-column.nvim',
67 -- jump cursor to last known position on neovim start
68 'ethanholz/nvim-lastplace',
69 -- smooth scrolling for movement
70 'declancm/cinnamon.nvim',
71 -- fast navigation in buffer via shortcut labels
72 'ggandor/leap.nvim',
73 -- breadcrumbs in window bar
74 'SmiteshP/nvim-navic',
75 -- show color values inline
76 -- this plugins seems a little unmaintained right now.
77 -- using some forks for now
78 --'norcalli/nvim-colorizer.lua',
79 --'NvChad/nvim-colorizer.lua',
80 'lasse16/nvim-colorizer.lua',
81 -- intelligent commenting
82 'numToStr/Comment.nvim',
83 -- show git status in ui
84 'lewis6991/gitsigns.nvim',
85 -- sexy start page
86 'goolord/alpha-nvim',
87 -- extend vim.notify with fancy ui
88 'rcarriga/nvim-notify',
89 -- show registers ui
90 'tversteeg/registers.nvim',
91 -- markdown editor
92 -- 'jakewvincent/mkdnflow.nvim',
93 -- highlight TODOs and collect them
94 'folke/todo-comments.nvim',
95 -- centralized view for code issues
96 'folke/trouble.nvim',
97 -- faster access to terminal
98 'akinsho/toggleterm.nvim',
99 -- File Browser
100 {
101 'nvim-neo-tree/neo-tree.nvim',
102 branch = 'v2.x',
103 },
104 -- ui elements for other plugins
105 'MunifTanjim/nui.nvim',
106 -- window picker component for other plugins
107 {
108 's1n7ax/nvim-window-picker',
109 branch = 'v1.3',
110 },
111 -- clipboard/yank history
112 'AckslD/nvim-neoclip.lua',
113 -- the treesitter parser is not compatible with current nushell for now
114 -- {
115 -- 'LhKipp/nvim-nu',
116 -- run = function() require'nvim-treesitter.install'.ensure_installed('nu') end,
117 -- },
118 -- smart parser for syntax
119 {
120 'nvim-treesitter/nvim-treesitter',
121 run = function()
122 require('nvim-treesitter.install').update()
123 end,
124 },
125 -- extend treesittier with light refactorings
126 'nvim-treesitter/nvim-treesitter-refactor',
127 -- add movement around structural syntax elements
128 'nvim-treesitter/nvim-treesitter-textobjects',
129 -- expand selection based on structure
130 'RRethy/nvim-treesitter-textsubjects',
131 -- highlight function arguments
132 'm-demare/hlargs.nvim',
133 -- inspect treesitter queries and get helpful functions
134 'nvim-treesitter/playground',
135 -- set commentstring when in polyglot files
136 'JoosepAlviste/nvim-ts-context-commentstring',
137 -- generate doc comment boilerplate
138 'danymat/neogen',
139 -- automatically change corresponding tag, when editing markup (xml/html)
140 'windwp/nvim-ts-autotag',
141 -- autoclose pairs on enter and completion
142 'windwp/nvim-autopairs',
143 -- glue, that binds all the neovim lsp crap
144 'VonHeikemen/lsp-zero.nvim',
145 -- LSP Support
146 'neovim/nvim-lspconfig',
147 'williamboman/nvim-lsp-installer',
148 'simrat39/symbols-outline.nvim',
149 -- Autocompletion
150 'hrsh7th/nvim-cmp',
151 'hrsh7th/cmp-buffer',
152 'hrsh7th/cmp-path',
153 'hrsh7th/cmp-nvim-lsp-document-symbol',
154 'saadparwaiz1/cmp_luasnip',
155 'hrsh7th/cmp-nvim-lsp',
156 'hrsh7th/cmp-nvim-lua',
157 -- Snippets
158 'L3MON4D3/LuaSnip',
159 'rafamadriz/friendly-snippets',
160 -- rust development
161 'simrat39/rust-tools.nvim',
162 -- java development
163 'mfussenegger/nvim-jdtls',
164 -- lua neovim config development
165 'folke/lua-dev.nvim',
166 -- fake lsp to pipe in non-lsp tools, like formatters, into lsp api
167 'jose-elias-alvarez/null-ls.nvim',
168 -- Special Java LSP integration sauce
169 'mfussenegger/nvim-jdtls',
170 -- debug adapter protocol
171 'mfussenegger/nvim-dap',
172 -- color picker
173 'ziontee113/color-picker.nvim',
174 -- motions around object
175 'kylechui/nvim-surround',
3 -- allow paq to manage itself
4 'savq/paq-nvim',
5 -- caches other plugins for faster startup
6 'lewis6991/impatient.nvim',
7 -- Utilities used by some plugins, e.g. telescope
8 'nvim-lua/plenary.nvim',
9 -- collection of icons used by other plugins. needs a nerd font
10 'kyazdani42/nvim-web-devicons',
11 -- fuzzy search ui over many parts of neovim and other plugins
12 'nvim-telescope/telescope.nvim',
13 -- use telescope as `vim.ui.select`
14 'nvim-telescope/telescope-ui-select.nvim',
15 -- use telescope as `vim.ui.input`
16 'stevearc/dressing.nvim',
17 -- display cheat sheet with telesope
18 'nvim-telescope/telescope-cheat.nvim',
19 -- show file browser in telescope
20 'nvim-telescope/telescope-file-browser.nvim',
21 -- manage projects via telescope
22 'nvim-telescope/telescope-project.nvim',
23 -- pick a symbol (emoji, icon, kaomoji,...) via telescope
24 'nvim-telescope/telescope-symbols.nvim',
25 -- visual indicator if code actions are available
26 'kosayoda/nvim-lightbulb',
27 -- some bug fix for LSP
28 'antoinemadec/FixCursorHold.nvim',
29 -- allows statusbar plugins to query LSP
30 'nvim-lua/lsp-status.nvim',
31 -- keybindings api that integrates into telescope to make keymaps searchable
32 'gfeiyou/command-center.nvim',
33 -- search and replace
34 'nvim-pack/nvim-spectre',
35 -- automatically manage window sizes based on focus
36 'beauwilliams/focus.nvim',
37 -- avoid jitter in buffers when windows change
38 'luukvbaal/stabilize.nvim',
39 -- keybindings that require a persistent chain
40 'anuvyklack/hydra.nvim',
41 -- extends hydra with pink heads
42 'anuvyklack/keymap-layer.nvim',
43 -- configure some editor settings according to editorconfig file, if present
44 'gpanders/editorconfig.nvim',
45 -- highlight matched wors more clearly
46 'kevinhwang91/nvim-hlslens',
47 -- draw lines to indicate indentation levels
48 'lukas-reineke/indent-blankline.nvim',
49 -- move blocks of code around
50 'booperlv/nvim-gomove',
51 -- toolkit for creating themes
52 'rktjmp/lush.nvim',
53 -- theme with colors i like
54 'rockerBOO/boo-colorscheme-nvim',
55 -- display the colorcolumn as a virtual character
56 'lukas-reineke/virt-column.nvim',
57 -- jump cursor to last known position on neovim start
58 'ethanholz/nvim-lastplace',
59 -- smooth scrolling for movement
60 'declancm/cinnamon.nvim',
61 -- fast navigation in buffer via shortcut labels
62 'ggandor/leap.nvim',
63 -- breadcrumbs in window bar
64 'SmiteshP/nvim-navic',
65 -- show color values inline
66 -- this plugins seems a little unmaintained right now.
67 -- using some forks for now
68 --'norcalli/nvim-colorizer.lua',
69 --'NvChad/nvim-colorizer.lua',
70 'lasse16/nvim-colorizer.lua',
71 -- intelligent commenting
72 'numToStr/Comment.nvim',
73 -- show git status in ui
74 'lewis6991/gitsigns.nvim',
75 -- sexy start page
76 'goolord/alpha-nvim',
77 -- extend vim.notify with fancy ui
78 'rcarriga/nvim-notify',
79 -- show registers ui
80 'tversteeg/registers.nvim',
81 -- markdown editor
82 -- 'jakewvincent/mkdnflow.nvim',
83 -- highlight TODOs and collect them
84 'folke/todo-comments.nvim',
85 -- centralized view for code issues
86 'folke/trouble.nvim',
87 -- faster access to terminal
88 'akinsho/toggleterm.nvim',
89 -- File Browser
90 {
91 'nvim-neo-tree/neo-tree.nvim',
92 branch = 'v2.x',
93 },
94 -- ui elements for other plugins
95 'MunifTanjim/nui.nvim',
96 -- window picker component for other plugins
97 {
98 's1n7ax/nvim-window-picker',
99 branch = 'v1.3',
100 },
101 -- clipboard/yank history
102 'AckslD/nvim-neoclip.lua',
103 -- the treesitter parser is not compatible with current nushell for now
104 -- {
105 -- 'LhKipp/nvim-nu',
106 -- run = function() require'nvim-treesitter.install'.ensure_installed('nu') end,
107 -- },
108 -- smart parser for syntax
109 {
110 'nvim-treesitter/nvim-treesitter',
111 run = function()
112 require('nvim-treesitter.install').update()
113 end,
114 },
115 -- extend treesittier with light refactorings
116 'nvim-treesitter/nvim-treesitter-refactor',
117 -- add movement around structural syntax elements
118 'nvim-treesitter/nvim-treesitter-textobjects',
119 -- expand selection based on structure
120 'RRethy/nvim-treesitter-textsubjects',
121 -- highlight function arguments
122 'm-demare/hlargs.nvim',
123 -- inspect treesitter queries and get helpful functions
124 'nvim-treesitter/playground',
125 -- set commentstring when in polyglot files
126 'JoosepAlviste/nvim-ts-context-commentstring',
127 -- generate doc comment boilerplate
128 'danymat/neogen',
129 -- automatically change corresponding tag, when editing markup (xml/html)
130 'windwp/nvim-ts-autotag',
131 -- autoclose pairs on enter and completion
132 'windwp/nvim-autopairs',
133 -- glue, that binds all the neovim lsp crap
134 'VonHeikemen/lsp-zero.nvim',
135 -- LSP Support
136 'neovim/nvim-lspconfig',
137 'williamboman/nvim-lsp-installer',
138 'simrat39/symbols-outline.nvim',
139 -- Autocompletion
140 'hrsh7th/nvim-cmp',
141 'hrsh7th/cmp-buffer',
142 'hrsh7th/cmp-path',
143 'hrsh7th/cmp-nvim-lsp-document-symbol',
144 'saadparwaiz1/cmp_luasnip',
145 'hrsh7th/cmp-nvim-lsp',
146 'hrsh7th/cmp-nvim-lua',
147 -- Snippets
148 'L3MON4D3/LuaSnip',
149 'rafamadriz/friendly-snippets',
150 -- rust development
151 'simrat39/rust-tools.nvim',
152 -- java development
153 'mfussenegger/nvim-jdtls',
154 -- lua neovim config development
155 'folke/lua-dev.nvim',
156 -- fake lsp to pipe in non-lsp tools, like formatters, into lsp api
157 'jose-elias-alvarez/null-ls.nvim',
158 -- Special Java LSP integration sauce
159 'mfussenegger/nvim-jdtls',
160 -- debug adapter protocol
161 'mfussenegger/nvim-dap',
162 -- color picker
163 'ziontee113/color-picker.nvim',
164 -- motions around object
165 'kylechui/nvim-surround',
177167-- local plugins. they may override plugins from above
178168vim.opt.runtimepath:append '~/Workspace/lsp-zero.nvim'

neovim/lua/bugabinga/search.lua

Modified

+56 / −22 text lines

1local map = require 'bugabinga.std.keymap'
12local want = require 'bugabinga.std.want'
2want { 'hlslens' }(function(_)
3 local noremap_silent = { noremap = true, silent = true }
5 -- FIXME: hlslens uses some highlights, that my theme does not cover yet
6 -- FIXME: use keymap facade
7 -- FIXME: change commands to lua callbacks
8 vim.api.nvim_set_keymap(
9 'n',
10 'n',
11 [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]],
12 noremap_silent
13 )
14 vim.api.nvim_set_keymap(
15 'n',
16 'N',
17 [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]],
18 noremap_silent
19 )
20 vim.api.nvim_set_keymap('n', '*', [[*<Cmd>lua require('hlslens').start()<CR>]], noremap_silent)
21 vim.api.nvim_set_keymap('n', '#', [[#<Cmd>lua require('hlslens').start()<CR>]], noremap_silent)
22 vim.api.nvim_set_keymap('n', 'g*', [[g*<Cmd>lua require('hlslens').start()<CR>]], noremap_silent)
23 vim.api.nvim_set_keymap('n', 'g#', [[g#<Cmd>lua require('hlslens').start()<CR>]], noremap_silent)
4want { 'hlslens' } (function(lens)
25 vim.api.nvim_set_keymap('n', '<LEADER><LEADER>', '<CMD>noh<CR>', noremap_silent)
6 -- this highlight links by default to WildMenu, which is to offensive
7 vim.api.nvim_set_hl(0, 'HlSearchLens', { link = 'Search' })
8
9 map {
10 description = 'Go to next highlighted search match',
11 category = map.CATEGORY.SEARCH,
12 mode = map.MODE.NORMAL,
13 keys = map.KEY.N,
14 command = function()
15 vim.fn.execute('normal! ' .. vim.v.count1 .. map.KEY.N)
16 lens.start()
17 end,
18 }
19 map {
20 description = 'Go to previous highlighted search match',
21 category = map.CATEGORY.SEARCH,
22 mode = map.MODE.NORMAL,
23 keys = map.KEY.SHIFT_N,
24 command = function()
25 vim.fn.execute('normal! ' .. vim.v.count1 .. map.KEY.SHIFT_N)
26 lens.start()
27 end,
28 }
30 map {
31 description = 'Search next word under cursor',
32 category = map.CATEGORY.SEARCH,
33 mode = map.MODE.NORMAL,
34 keys = map.KEY.MULTIPLY,
35 command = function()
36 vim.api.nvim_feedkeys(map.KEY.MULTIPLY, map.MODE.NORMAL, true)
37 lens.start()
38 end,
39 }
40 map {
41 description = 'Search previous word under cursor',
42 category = map.CATEGORY.SEARCH,
43 mode = map.MODE.NORMAL,
44 keys = map.KEY.HASHTAG,
45 command = function()
46 vim.api.nvim_feedkeys(map.KEY.HASHTAG, map.MODE.NORMAL, true)
47 lens.start()
48 end,
49 }
51 map {
52 description = 'Clear search highlights',
53 category = map.CATEGORY.SEARCH,
54 mode = map.MODE.NORMAL,
55 keys = map.KEY.LEADER .. map.KEY.LEADER,
56 command = function()
57 vim.cmd 'nohlsearch'
58 end,
59 }
2660end)

neovim/lua/bugabinga/smooth-scroll.lua

Modified

+149 / −3 text lines

1local map = require'bugabinga.std.keymap'
2local fmt = require'bugabinga.std.fmt'
13local want = require 'bugabinga.std.want'
2want { 'cinnamon' }(function(cinnamon)
3 --FIXME: use keymap facade instead of default bindings
4 cinnamon.setup()
4
5want { 'cinnamon' } (function(cinnamon)
6 cinnamon.setup {
7 default_keymaps = false,
8 hide_cursor = true,
9 }
10 -- weird. when using the Scroll function via lua directly, it does seemingly nothing...
11 --
12 -- Half-window movements:
13 map {
14 description = 'Scroll half window up',
15 category = map.CATEGORY.SCROLL,
16 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
17 keys = map.KEY.CONTROL_U,
18 command = fmt.cmd'lua Scroll("<C-u>", 1, 1)',
19 }
20 map {
21 description = 'Scroll half window down',
22 category = map.CATEGORY.SCROLL,
23 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
24 keys = map.KEY.CONTROL_D,
25 command = fmt.cmd'lua Scroll("<C-d>", 1, 1)',
26 }
28 --
29 -- Page movements:
30 map {
31 description = 'Scroll half page up',
32 category = map.CATEGORY.SCROLL,
33 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
34 keys = map.KEY.CONTROL_B,
35 command = fmt.cmd'lua Scroll("<C-b>", 1, 1)',
36 }
37 map {
38 description = 'Scroll half page down',
39 category = map.CATEGORY.SCROLL,
40 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
41 keys = map.KEY.CONTROL_F,
42 command = fmt.cmd'lua Scroll("<C-f>", 1, 1)',
43 }
44 map {
45 description = 'Scroll half page up',
46 category = map.CATEGORY.SCROLL,
47 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
48 keys = map.KEY.PAGE_UP,
49 command = fmt.cmd'lua Scroll("<PageUp>", 1, 1)',
50 }
51 map {
52 description = 'Scroll half page down',
53 category = map.CATEGORY.SCROLL,
54 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
55 keys = map.KEY.PAGE_DOWN,
56 command = fmt.cmd'lua Scroll("<PageDown>", 1, 1)',
57 }
59-- Start/end of file and line number movements:
60 map {
61 description = 'Scroll to start of buffer',
62 category = map.CATEGORY.SCROLL,
63 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
64 keys = map.KEY.G .. map.KEY.G,
65 command = fmt.cmd'lua Scroll("gg")',
66 }
67 map {
68 description = 'Scroll to end of buffer',
69 category = map.CATEGORY.SCROLL,
70 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
71 keys = map.KEY.SHIFT_G,
72 command = fmt.cmd'lua Scroll("G", 0, 1)',
73 }
75-- Start/end of line:
76 map {
77 description = 'Scroll to start of line',
78 category = map.CATEGORY.SCROLL,
79 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
80 keys = map.KEY.ZERO,
81 command = fmt.cmd'lua Scroll("0")',
82 }
83 map {
84 description = 'Scroll to first word of line',
85 category = map.CATEGORY.SCROLL,
86 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
87 keys = map.KEY.CARET,
88 command = fmt.cmd'lua Scroll("^")',
89 }
90 map {
91 description = 'Scroll to end of line',
92 category = map.CATEGORY.SCROLL,
93 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
94 keys = map.KEY.DOLLAR,
95 command = fmt.cmd'lua Scroll("$", 0 ,1)',
96 }
98-- Paragraph movements:
99vim.keymap.set({ 'n', 'x' }, '{', "<Cmd>lua Scroll('{')<CR>")
100 map {
101 description = 'Scroll to previous paragraph',
102 category = map.CATEGORY.SCROLL,
103 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
104 keys = map.KEY.OPEN_CURLY_BRACKET,
105 command = fmt.cmd'lua Scroll("{")',
106 }
107vim.keymap.set({ 'n', 'x' }, '}', "<Cmd>lua Scroll('}')<CR>")
108 map {
109 description = 'Scroll to next paragraph',
110 category = map.CATEGORY.SCROLL,
111 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
112 keys = map.KEY.CLOSE_CURLY_BRACKET,
113 command = fmt.cmd'lua Scroll("}")',
114 }
115 --
116-- Up/down movements:
117vim.keymap.set({ 'n', 'x' }, 'k', "<Cmd>lua Scroll('k', 0, 1)<CR>")
118 map {
119 description = 'Scroll line up',
120 category = map.CATEGORY.SCROLL,
121 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
122 keys = map.KEY.K,
123 command = fmt.cmd'lua Scroll("k", 0, 1)',
124 }
125vim.keymap.set({ 'n', 'x' }, 'j', "<Cmd>lua Scroll('j', 0, 1)<CR>")
126 map {
127 description = 'Scroll line down',
128 category = map.CATEGORY.SCROLL,
129 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
130 keys = map.KEY.J,
131 command = fmt.cmd'lua Scroll("j", 0, 1)',
132 }
134-- SCROLL_WHEEL_KEYMAPS:
136 map {
137 description = 'Scroll wheel up',
138 category = map.CATEGORY.SCROLL,
139 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
140 keys = map.KEY.SCROLL_WHEEL_UP,
141 command = fmt.cmd'lua Scroll("<ScrollWheelUp>")',
142 }
143 map {
144 description = 'Scroll wheel down',
145 category = map.CATEGORY.SCROLL,
146 mode = { map.MODE.NORMAL, map.MODE.VISUAL },
147 keys = map.KEY.SCROLL_WHEEL_DOWN,
148 command = fmt.cmd'lua Scroll("<ScrollWheelDown>")',
149 }
5151end)

neovim/lua/bugabinga/start-screen.lua

Modified

+43 / −28 text lines

1local map = require 'bugabinga.std.keymap'
2local fmt = require 'bugabinga.std.fmt'
13local want = require 'bugabinga.std.want'
2want { 'alpha', 'alpha.themes.startify' }(function(alpha, theme)
3 --FIXME add "open alpha" keymap
4 theme.section.header.val = {
5 [[ ▄▄▄▄ █ ██ ▄████ ▄▄▄ ▄▄▄▄ ██▓███▄ █ ▄████ ▄▄▄ ]],
6 [[▓█████▄ ██ ▓██▒██▒ ▀█▒████▄ ▓█████▄▓██▒██ ▀█ █ ██▒ ▀█▒████▄ ]],
7 [[▒██▒ ▄█▓██ ▒██▒██░▄▄▄▒██ ▀█▄ ▒██▒ ▄█▒██▓██ ▀█ ██▒██░▄▄▄▒██ ▀█▄ ]],
8 [[▒██░█▀ ▓▓█ ░██░▓█ ██░██▄▄▄▄██▒██░█▀ ░██▓██▒ ▐▌██░▓█ ██░██▄▄▄▄██ ]],
9 [[░▓█ ▀█▒▒█████▓░▒▓███▀▒▓█ ▓██░▓█ ▀█░██▒██░ ▓██░▒▓███▀▒▓█ ▓██▒]],
10 [[░▒▓███▀░▒▓▒ ▒ ▒ ░▒ ▒ ▒▒ ▓▒█░▒▓███▀░▓ ░ ▒░ ▒ ▒ ░▒ ▒ ▒▒ ▓▒█░]],
11 [[▒░▒ ░░░▒░ ░ ░ ░ ░ ▒ ▒▒ ▒░▒ ░ ▒ ░ ░░ ░ ▒░ ░ ░ ▒ ▒▒ ░]],
12 [[ ░ ░ ░░░ ░ ░░ ░ ░ ░ ▒ ░ ░ ▒ ░ ░ ░ ░░ ░ ░ ░ ▒ ]],
13 [[ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░]],
14 [[ ░ ░ ]],
15 }
16 theme.section.top_buttons.val = {
17 theme.button('e', ' New file', '<CMD>new | startinsert <CR>'),
18 }
19 theme.section.bottom_buttons.val = {
20 theme.button('q', ' Quit NVIM', ':qa<CR>'),
21 }
22 theme.section.mru.val = { { type = 'padding', val = 0 } }
23 theme.section.footer = {
24 { type = 'text', val = 'bugabinga.net' },
25 }
26 theme.mru_opts.ignore = function(path, _)
27 return string.find(path, 'COMMIT_EDITMSG')
28 end
29 alpha.setup(theme.config)
4
5want {
6 'alpha',
7 'alpha.themes.startify',
8 'nvim-web-devicons',
9} (function(alpha, theme, devicons)
10 theme.section.header.val = {
11 [[ ▄▄▄▄ █ ██ ▄████ ▄▄▄ ▄▄▄▄ ██▓███▄ █ ▄████ ▄▄▄ ]],
12 [[▓█████▄ ██ ▓██▒██▒ ▀█▒████▄ ▓█████▄▓██▒██ ▀█ █ ██▒ ▀█▒████▄ ]],
13 [[▒██▒ ▄█▓██ ▒██▒██░▄▄▄▒██ ▀█▄ ▒██▒ ▄█▒██▓██ ▀█ ██▒██░▄▄▄▒██ ▀█▄ ]],
14 [[▒██░█▀ ▓▓█ ░██░▓█ ██░██▄▄▄▄██▒██░█▀ ░██▓██▒ ▐▌██░▓█ ██░██▄▄▄▄██ ]],
15 [[░▓█ ▀█▒▒█████▓░▒▓███▀▒▓█ ▓██░▓█ ▀█░██▒██░ ▓██░▒▓███▀▒▓█ ▓██▒]],
16 [[░▒▓███▀░▒▓▒ ▒ ▒ ░▒ ▒ ▒▒ ▓▒█░▒▓███▀░▓ ░ ▒░ ▒ ▒ ░▒ ▒ ▒▒ ▓▒█░]],
17 [[▒░▒ ░░░▒░ ░ ░ ░ ░ ▒ ▒▒ ▒░▒ ░ ▒ ░ ░░ ░ ▒░ ░ ░ ▒ ▒▒ ░]],
18 [[ ░ ░ ░░░ ░ ░░ ░ ░ ░ ▒ ░ ░ ▒ ░ ░ ░ ░░ ░ ░ ░ ▒ ]],
19 [[ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░]],
20 [[ ░ ░ ]],
21 }
22 theme.section.top_buttons.val = {
23 theme.button('e', devicons.get_icon 'NewFile' .. ' New file', fmt.cmd 'new | startinsert'),
24 }
25 theme.section.bottom_buttons.val = {
26 theme.button('q', devicons.get_icon 'SignOut' .. ' Quit Neovim', fmt.cmd 'qa'),
27 }
28 -- hides the mru section
29 theme.section.mru.val = { { type = 'padding', val = 0 } }
30 theme.section.footer = {
31 { type = 'text', val = devicons.get_icon 'Bug' .. ' bugabinga.net' },
32 }
33 theme.mru_opts.ignore = function(path, _)
34 return string.find(path, 'COMMIT_EDITMSG')
35 end
36 alpha.setup(theme.config)
38 map {
39 description = 'Toggle Start Screen',
40 category = map.CATEGORY.VIEW,
41 mode = map.MODE.NORMAL,
42 keys = map.KEY.F12,
43 command = fmt.cmd 'Alpha',
44 }
3045end)

neovim/lua/bugabinga/std/auto.lua

Modified

+24 / −17 text lines

11-- Wrapper over `vim.api.nvim_create_autocmd` for automatic grouping and idempotency.
22return function(group_name)
3 local group = vim.api.nvim_create_augroup(group_name, { clear = true })
4 return function(list_of_autocommands)
5 if list_of_autocommands.events then
6 list_of_autocommands = { list_of_autocommands }
7 end
8 for _, autocommand in pairs(list_of_autocommands) do
9 vim.api.nvim_create_autocmd(autocommand.events, {
10 desc = autocommand.description,
11 group = group,
12 pattern = autocommand.pattern,
13 -- command and callback are mutually exclusive.
14 -- one of them has to be nil
15 command = autocommand.command,
16 callback = autocommand.callback,
17 })
18 end
19 end
3 local group = vim.api.nvim_create_augroup(group_name, { clear = true })
4 return function(list_of_autocommands)
5 if list_of_autocommands.events then
6 list_of_autocommands = { list_of_autocommands }
7 end
8 for _, autocommand in pairs(list_of_autocommands) do
9 -- command and callback are mutually exclusive.
10 -- one of them has to be nil
11 local command = nil
12 local callback = nil
13 if type(autocommand.command) == 'function' then
14 callback = autocommand.command
15 else
16 command = autocommand.command
17 end
18 vim.api.nvim_create_autocmd(autocommand.events, {
19 desc = autocommand.description,
20 group = group,
21 pattern = autocommand.pattern,
22 command = command,
23 callback = callback,
24 })
25 end
26 end
2027end

neovim/lua/bugabinga/std/icon.lua

Added
new file mode 100644

+19 / −0 text lines

1local want = require 'bugabinga.std.want'
2
3local function get_icon(icon_name)
4 return want { 'nvim-web-devicons' } (function(devicons)
5 return devicons.get_icon(icon_name)
6 end)
7end
8
9 --TODO: fill up those icons
10return setmetatable({
11 FILE = {},
12 UI = {},
13 DOCUMENT = {},
14 MISC = {},
15}, {
16 __call = function(_, ...)
17 return get_icon(...)
18 end,
19})

neovim/lua/bugabinga/std/keymap.lua

Modified

+110 / −63 text lines

11local want = require 'bugabinga.std.want'
2local bind = want { 'command_center' }(function(command_center)
3 return function(map)
4 map.visible = map.visible == nil or map.visible
5 map.options = map.options or {}
6 local options = vim.tbl_extend('keep', map.options, {
7 silent = true,
8 desc = map.description,
9 })
10 if map.visible then
11 local keybindings = {}
12 if type(map.mode) == 'table' then
13 for _, mode in ipairs(map.mode) do
14 table.insert(keybindings, { mode, map.keys })
15 end
16 else
17 keybindings = { map.mode, map.keys }
18 end
19 command_center.add({
20 {
21 description = map.description,
22 category = map.category,
23 cmd = map.command,
24 keybindings = keybindings,
25 },
26 }, command_center.mode.ADD_ONLY)
27 end
28 -- use neovim api to add keybind instead of command_center, because it has
29 -- nicer defaults.
30 vim.keymap.set(map.mode, map.keys, map.command, options)
31 end
2local bind = want { 'command_center' } (function(command_center)
3 return function(map)
4 map.visible = map.visible == nil or map.visible
5 map.options = map.options or {}
6 local options = vim.tbl_extend('keep', map.options, {
7 silent = true,
8 desc = map.description,
9 })
10 if map.visible then
11 local keybindings = {}
12 if type(map.mode) == 'table' then
13 for _, mode in ipairs(map.mode) do
14 table.insert(keybindings, { mode, map.keys })
15 end
16 else
17 keybindings = { map.mode, map.keys }
18 end
19 command_center.add({
20 {
21 description = map.description,
22 category = map.category,
23 cmd = map.command,
24 keybindings = keybindings,
25 },
26 }, command_center.mode.ADD_ONLY)
27 end
28 -- use neovim api to add keybind instead of command_center, because it has
29 -- nicer defaults.
30 vim.keymap.set(map.mode, map.keys, map.command, options)
31 end
3232end)
3434return setmetatable({
35 MODE = {
36 NORMAL = 'n',
37 VISUAL = 'x',
38 ALL = '',
39 },
40 KEY = {
41 SPACE = '<SPACE>',
42 ENTER = '<CR>',
43 ESCAPE = '<ESC>',
44 UP = '<Up>',
45 DOWN = '<Down>',
46 LEFT = '<Left>',
47 RIGHT = '<Right>',
48 ALT_H = '<A-h>',
49 ALT_J = '<A-j>',
50 ALT_K = '<A-k>',
51 ALT_L = '<A-l>',
52 ALT_SHIFT_H = '<A-H>',
53 ALT_SHIFT_J = '<A-J>',
54 ALT_SHIFT_K = '<A-K>',
55 ALT_SHIFT_L = '<A-L>',
56 },
57 COMMAND = {
58 NOP = function() end,
59 },
60 CATEGORY = {
61 NAVIGATION = 'navigation',
62 EDITING = 'editing',
63 NOTIFY = 'notify',
64 },
35 MODE = {
36 NORMAL = 'n',
37 VISUAL = 'x',
38 ALL = '',
39 },
40 KEY = {
41 LEADER = '<LEADER>',
42 SPACE = '<SPACE>',
43 ENTER = '<CR>',
44 ESCAPE = '<ESC>',
45 UP = '<Up>',
46 DOWN = '<Down>',
47 LEFT = '<Left>',
48 RIGHT = '<Right>',
49 PAGE_UP = '<PageUp>',
50 PAGE_DOWN = '<PageDown>',
51 SCROLL_WHEEL_UP = '<ScrollWheelUp>',
52 SCROLL_WHEEL_DOWN = '<ScrollWheelDown>',
53 CONTROL_B = '<C-b>',
54 CONTROL_D = '<C-d>',
55 CONTROL_F = '<C-f>',
56 CONTROL_U = '<C-u>',
57 SHIFT_G = 'G',
58 SHIFT_N = 'N',
59 CONTROL_SHIFT_F = '<C-F>',
60 ALT_H = '<A-h>',
61 ALT_J = '<A-j>',
62 ALT_K = '<A-k>',
63 ALT_L = '<A-l>',
64 ALT_SHIFT_H = '<A-H>',
65 ALT_SHIFT_J = '<A-J>',
66 ALT_SHIFT_K = '<A-K>',
67 ALT_SHIFT_L = '<A-L>',
68 F2 = '<F2>',
69 F4 = '<F4>',
70 F6 = '<F6>',
71 F7 = '<F7>',
72 F8 = '<F8>',
73 F12 = '<F12>',
74 CARET = '^',
75 DOLLAR = '$',
76 MULTIPLY = '*',
77 HASHTAG = '#',
78 OPEN_CURLY_BRACKET = '{',
79 CLOSE_CURLY_BRACKET = '}',
80 ZERO = '0',
81 B = 'b',
82 C = 'c',
83 D = 'd',
84 E = 'e',
85 F = 'f',
86 G = 'g',
87 I = 'i',
88 J = 'j',
89 L = 'l',
90 N = 'n',
91 K = 'k',
92 P = 'p',
93 R = 'r',
94 S = 's',
95 T = 't',
96 V = 'v',
97 },
98 COMMAND = {
99 NOP = function() end,
100 },
101 CATEGORY = {
102 NAVIGATION = 'navigation',
103 EDITING = 'editing',
104 NOTIFY = 'notify',
105 VIEW = 'view',
106 SEARCH = 'search',
107 SCROLL = 'scroll',
108 PROBLEMS = 'problems',
109 LSP = 'lsp',
110 VERSION_CONTROL = 'vcs',
111 },
65112}, {
66 __call = function(_, ...)
67 return bind(...)
68 end,
113 __call = function(_, ...)
114 return bind(...)
115 end,
69116})

neovim/lua/bugabinga/std/project.lua

Modified

+4 / −3 text lines

8484end
8686--- Determines the project root directory of the current buffer file. A "project" is not clearly defined for all programming languages, so this function uses a heuristic approach.
87---@param custom_markers table list of markers. a marker is a table with `name` and `weight` key. `name` can be a file or directory name, that indicates, that if a file/folder with that name exists in a directory, that directory is likely to be a project root. `weight` is a means to express confidence in that likelihood. Values should be between 1 and 3. Internally, there are some project-agnostic markers defined (e.g. README, LICENSE, .git, ...) that will be merged with `custom_markers`.
87---@param custom_markers table<string, number> list of markers. a marker is a table with `name` and `weight` key. `name` can be a file or directory name, that indicates, that if a file/folder with that name exists in a directory, that directory is likely to be a project root. `weight` is a means to express confidence in that likelihood. Values should be between 1 and 3. Internally, there are some project-agnostic markers defined (e.g. README, LICENSE, .git, ...) that will be merged with `custom_markers`.
8888---@param custom_root string Given a `custom_root` the path traversal can be aborted before the filesystem root is reached. A useful value might be `~` for example, if your source code is always in your home directory. the root directory itself does __not__ get searched for markers!
89---@return string project_root The project root of the current buffer, or `nil`, if none could be determined.
89---@return string|nil project_root The project root of the current buffer, or `nil`, if none could be determined.
9090local function determine_project_root(custom_markers, custom_root)
9191 -- glob expands user defined root and checks, that it exists
92 local root = vim.fn.glob(custom_root, false, false)
92 ---@diagnostic disable-next-line: missing-parameter
93 local root = vim.fn.glob(custom_root)
9394 if root == '' then
9495 vim.notify('the custom root ' .. custom_root .. ' does not exist!', error)
9596 return nil

neovim/lua/bugabinga/surround.lua

Modified

+8 / −2 text lines

11local want = require 'bugabinga.std.want'
22want { 'nvim-surround' }(function(surround)
3 --FIXME: add bindings, that do not conflict with fast navigation plugin
4 surround.setup {}
3 surround.setup {
4 insert = "ys",
5 insert_line = "yss",
6 -- this thing does seemingly nothing?
7 -- visual = "<CR>",
8 delete = "ds",
9 change = 'cs',
10 }
511end)

neovim/lua/bugabinga/terminal.lua

Modified

+37 / −37 text lines

11local auto = require 'bugabinga.std.auto'
22local want = require 'bugabinga.std.want'
33--FIXME use keymap facade
4want { 'toggleterm' }(function(toggleterm)
5 toggleterm.setup {
6 size = 20,
7 open_mapping = [[<LEADER>t]],
8 hide_numbers = true,
9 shade_filetypes = {},
10 shade_terminals = true,
11 shading_factor = 2,
12 start_in_insert = true,
13 insert_mappings = false,
14 persist_size = true,
15 direction = 'float',
16 close_on_exit = true,
17 shell = vim.o.shell,
18 float_opts = {
19 border = 'curved',
20 winblend = 0,
21 highlights = {
22 border = 'Normal',
23 background = 'Normal',
24 },
25 },
26 }
4want { 'toggleterm' } (function(toggleterm)
5 toggleterm.setup {
6 size = 20,
7 open_mapping = [[<LEADER>t]],
8 hide_numbers = true,
9 shade_filetypes = {},
10 shade_terminals = true,
11 shading_factor = 2,
12 start_in_insert = true,
13 insert_mappings = false,
14 persist_size = true,
15 direction = 'float',
16 close_on_exit = true,
17 shell = vim.o.shell,
18 float_opts = {
19 border = 'curved',
20 winblend = 0,
21 highlights = {
22 border = 'Normal',
23 background = 'Normal',
24 },
25 },
26 }
28 local function set_terminal_keymaps()
29 local opts = { noremap = true }
30 vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
31 vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
32 vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
33 vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
34 vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
35 end
28 local function set_terminal_keymaps()
29 local opts = { noremap = true }
30 vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
31 vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
32 vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
33 vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
34 vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
35 end
37 auto 'set_terminal_keymaps' {
38 description = 'Set more natural keybindings in terminal',
39 events = 'TermOpen',
40 pattern = 'term://*',
41 callback = set_terminal_keymaps,
42 }
37 auto 'set_terminal_keymaps' {
38 description = 'Set more natural keybindings in terminal',
39 events = 'TermOpen',
40 pattern = 'term://*',
41 command = set_terminal_keymaps,
42 }
4343end)

neovim/lua/bugabinga/todo.lua

Modified

+32 / −0 text lines

1local map = require 'bugabinga.std.keymap'
2local project = require 'bugabinga.std.project'
13local want = require 'bugabinga.std.want'
4
25want { 'todo-comments' }(function(todo)
36 -- HACK: #104 Invalid in command-line window
47 local hl = require 'todo-comments.highlight'
710 pcall(highlight_win, win, force)
811 end
912 todo.setup {}
14 map{
15 description = 'Show all To-Dos in the current project',
16 category = map.CATEGORY.VIEW,
17 mode = map.MODE.NORMAL,
18 keys = map.KEY.LEADER .. map.KEY.P .. map.KEY.T,
19 command = function()
20 local root = project.determine_project_root({},'~')
21 local cwd = ''
22 if root then
23 cwd = ' cwd=' .. root
24 end
25 vim.cmd ('TodoTrouble' .. cwd)
26 end,
27 }
28 map{
29 description = 'Search all To-Dos in the current project',
30 category = map.CATEGORY.VIEW,
31 mode = map.MODE.NORMAL,
32 keys = map.KEY.LEADER .. map.KEY.T .. map.KEY.T,
33 command = function()
34 local root = project.determine_project_root({},'~')
35 local cwd = ''
36 if root then
37 cwd = ' cwd=' .. root
38 end
39 vim.cmd ('TodoTelescope' .. cwd)
40 end,
41 }
1042end)

neovim/lua/bugabinga/treesitter.lua

Modified

+187 / −199 text lines

1local auto = require 'bugabinga.std.auto'
12local want = require 'bugabinga.std.want'
3
24want {
3 'nvim-treesitter.install',
4 'nvim-treesitter.configs',
5 'nvim-treesitter.parsers',
6 'hlargs',
7 'neogen',
8}(function(install, configs, parsers, hlargs, neogen)
9 install.compilers = { 'zig cc', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
10 install.prefer_git = true
5 'nvim-treesitter.install',
6 'nvim-treesitter.configs',
7 'nvim-treesitter.parsers',
8 'hlargs',
9 'neogen',
10} (function(install, configs, parsers, hlargs, neogen)
11 install.compilers = { 'zig cc', 'clang', 'gcc', 'cl', 'cc', vim.fn.getenv 'CC' }
12 install.prefer_git = true
12 configs.setup {
13 -- A list of parser names, or "all"
14 ensure_installed = {
15 'c',
16 'bash',
17 'cmake',
18 'comment',
19 'cpp',
20 'css',
21 'devicetree',
22 'dockerfile',
23 'dot',
24 'help',
25 'html',
26 'http',
27 'java',
28 'javascript',
29 'json',
30 'json5',
31 'jsonc',
32 'llvm',
33 'lua',
34 'make',
35 'markdown',
36 'markdown_inline',
37 'ninja',
38 'proto',
39 'python',
40 'query',
41 'regex',
42 'rust',
43 'toml',
44 'vim',
45 'yaml',
46 'zig',
47 },
48 -- Install parsers synchronously (only applied to `ensure_installed`)
49 sync_install = false,
50 -- List of parsers to ignore installing (for "all")
51 ignore_install = {},
14 configs.setup {
15 -- A list of parser names, or "all"
16 -- FIXME: temporarily deactivated, because i am offline
17 -- ensure_installed = 'all',
18 -- Install parsers synchronously (only applied to `ensure_installed`)
19 sync_install = true,
20 -- Automatically install missing parsers when entering buffer
21 auto_install = true,
22 -- List of parsers to ignore installing (for "all")
23 ignore_install = {},
53 highlight = {
54 -- `false` will disable the whole extension
55 enable = true,
25 highlight = {
26 -- `false` will disable the whole extension
27 enable = true,
28 disable = {},
57 -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
58 -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
59 -- the name of the parser)
60 -- list of language that will be disabled
61 disable = {},
30 -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
31 -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
32 -- Using this option may slow down your editor, and you may see some duplicate highlights.
33 -- Instead of true it can also be a list of languages
34 additional_vim_regex_highlighting = false,
35 },
36 incremental_selection = {
37 enable = true,
38 keymaps = {
39 init_selection = 'gnn',
40 node_incremental = 'grn',
41 scope_incremental = 'grc',
42 node_decremental = 'grm',
43 },
44 },
45 -- indent on = with TS
46 indent = {
47 enable = true,
48 },
49 -- These features are mostly useful when there is treesitter parser, but no
50 -- LSP.
51 -- FIXME: harmonize the keybinds with LSP equivalents
52 refactor = 'all',
53 textsubjects = {
54 enable = true,
55 prev_selection = '<Down>', -- (Optional) keymap to select the previous selection
56 keymaps = {
57 ['<Up>'] = 'textsubjects-smart',
58 ['<Right>'] = 'textsubjects-container-outer',
59 ['<Left>'] = 'textsubjects-container-inner',
60 },
61 },
62 textobjects = {
63 select = {
64 enable = true,
65 -- Automatically jump forward to textobj, similar to targets.vim
66 lookahead = true,
67 keymaps = {
68 -- You can use the capture groups defined in textobjects.scm
69 ['af'] = '@function.outer',
70 ['if'] = '@function.inner',
71 ['ac'] = '@class.outer',
72 ['ic'] = '@class.inner',
73 },
74 },
75 swap = {
76 enable = true,
77 swap_next = {
78 ['<leader>a'] = '@parameter.inner',
79 },
80 swap_previous = {
81 ['<leader>A'] = '@parameter.inner',
82 },
83 },
84 move = {
85 enable = true,
86 set_jumps = true, -- whether to set jumps in the jumplist
87 goto_next_start = {
88 [']m'] = '@function.outer',
89 [']]'] = '@class.outer',
90 },
91 goto_next_end = {
92 [']M'] = '@function.outer',
93 [']['] = '@class.outer',
94 },
95 goto_previous_start = {
96 ['[m'] = '@function.outer',
97 ['[['] = '@class.outer',
98 },
99 goto_previous_end = {
100 ['[M'] = '@function.outer',
101 ['[]'] = '@class.outer',
102 },
103 },
104 lsp_interop = {
105 enable = true,
106 border = 'rounded',
107 peek_definition_code = {
108 ['<leader>df'] = '@function.outer',
109 ['<leader>dc'] = '@class.outer',
110 },
111 },
112 },
113 playground = {
114 enable = true,
115 disable = {},
116 updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
117 persist_queries = false, -- Whether the query persists across vim sessions
118 keybindings = {
119 toggle_query_editor = 'o',
120 toggle_hl_groups = 'i',
121 toggle_injected_languages = 't',
122 toggle_anonymous_nodes = 'a',
123 toggle_language_display = 'I',
124 focus_language = 'f',
125 unfocus_language = 'F',
126 update = 'R',
127 goto_node = '<cr>',
128 show_help = '?',
129 },
130 },
131 context_commentstring = {
132 enable = true,
133 },
134 -- autoclose and rename tags
135 autotag = {
136 enable = true,
137 },
138 }
63 -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
64 -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
65 -- Using this option may slow down your editor, and you may see some duplicate highlights.
66 -- Instead of true it can also be a list of languages
67 additional_vim_regex_highlighting = false,
68 },
69 incremental_selection = {
70 enable = true,
71 keymaps = {
72 init_selection = 'gnn',
73 node_incremental = 'grn',
74 scope_incremental = 'grc',
75 node_decremental = 'grm',
76 },
77 },
78 -- indent on = with TS
79 indent = {
80 enable = true,
81 },
82 -- These features are mostly useful when there is treesitter parser, but no
83 -- LSP.
84 -- FIXME harmonize the keybinds with LSP equivalents
85 refactor = {
86 highlight_definitions = {
87 enable = true,
88 -- Set to false if you have an `updatetime` of ~100.
89 clear_on_cursor_move = false,
90 },
91 smart_rename = {
92 enable = true,
93 keymaps = {
94 smart_rename = 'grr',
95 },
96 },
97 navigation = {
98 enable = true,
99 keymaps = {
100 goto_definition = 'gnd',
101 list_definitions = 'gnD',
102 list_definitions_toc = 'gO',
103 goto_next_usage = '<a-*>',
104 goto_previous_usage = '<a-#>',
105 },
106 },
107 },
108 textsubjects = {
109 enable = true,
110 prev_selection = '<Down>', -- (Optional) keymap to select the previous selection
111 keymaps = {
112 ['<Up>'] = 'textsubjects-smart',
113 ['<Right>'] = 'textsubjects-container-outer',
114 ['<Left>'] = 'textsubjects-container-inner',
115 },
116 },
117 textobjects = {
118 select = {
119 enable = true,
120 -- Automatically jump forward to textobj, similar to targets.vim
121 lookahead = true,
122 keymaps = {
123 -- You can use the capture groups defined in textobjects.scm
124 ['af'] = '@function.outer',
125 ['if'] = '@function.inner',
126 ['ac'] = '@class.outer',
127 ['ic'] = '@class.inner',
128 },
129 },
130 swap = {
131 enable = true,
132 swap_next = {
133 ['<leader>a'] = '@parameter.inner',
134 },
135 swap_previous = {
136 ['<leader>A'] = '@parameter.inner',
137 },
138 },
139 move = {
140 enable = true,
141 set_jumps = true, -- whether to set jumps in the jumplist
142 goto_next_start = {
143 [']m'] = '@function.outer',
144 [']]'] = '@class.outer',
145 },
146 goto_next_end = {
147 [']M'] = '@function.outer',
148 [']['] = '@class.outer',
149 },
150 goto_previous_start = {
151 ['[m'] = '@function.outer',
152 ['[['] = '@class.outer',
153 },
154 goto_previous_end = {
155 ['[M'] = '@function.outer',
156 ['[]'] = '@class.outer',
157 },
158 },
159 lsp_interop = {
160 enable = true,
161 border = 'none',
162 peek_definition_code = {
163 ['<leader>df'] = '@function.outer',
164 ['<leader>dc'] = '@class.outer',
165 },
166 },
167 },
168 playground = {
169 enable = true,
170 disable = {},
171 updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
172 persist_queries = false, -- Whether the query persists across vim sessions
173 keybindings = {
174 toggle_query_editor = 'o',
175 toggle_hl_groups = 'i',
176 toggle_injected_languages = 't',
177 toggle_anonymous_nodes = 'a',
178 toggle_language_display = 'I',
179 focus_language = 'f',
180 unfocus_language = 'F',
181 update = 'R',
182 goto_node = '<cr>',
183 show_help = '?',
184 },
185 },
186 context_commentstring = {
187 enable = true,
188 },
189 -- autoclose and rename tags
190 autotag = {
191 enable = true,
192 },
193 }
140 parsers.get_parser_configs().just = {
141 install_info = {
142 url = 'https://github.com/IndianBoy42/tree-sitter-just', -- local path or git repo
143 files = { 'src/parser.c', 'src/scanner.cc' },
144 branch = 'main',
145 },
146 maintainers = { '@IndianBoy42' },
147 }
195 parsers.get_parser_configs().just = {
196 install_info = {
197 url = 'https://github.com/IndianBoy42/tree-sitter-just', -- local path or git repo
198 files = { 'src/parser.c', 'src/scanner.cc' },
199 branch = 'main',
200 },
201 maintainers = { '@IndianBoy42' },
202 }
149 -- highlight function arguments
150 -- TODO: define color
151 hlargs.setup()
204 -- highlight function arguments
205 hlargs.setup()
153 -- generate doc comment annotations
154 -- TODO: setup keybind
155 neogen.setup{
156 snippet_engine = 'luasnip',
157 }
207 -- generate doc comment annotations
208 neogen.setup()
159 map {
160 description = 'Generate Doc Comment for Function',
161 category = map.CATEGORY.EDITING,
162 mode = map.MODE.NORMAL,
163 keys = map.KEY.LEADER .. map.KEY.N .. map.KEY.F,
164 command = function() neogen.generate{ type = 'func'} end,
165 }
167 -- FIXME: this aucmd needs to be restricted to buffers where treesitter is loaded
168 -- Treesitter highlights tend to highlight syntax errors immediately.
169 -- But that i find distracting while typing.
170 -- Disable the error highlight while typing, but keep it in normal mode.
171 auto 'disable_error_highlight_while_typing' {
172 {
173 description = 'Disable the @error highlight while in Insert mode',
174 events = 'InsertEnter',
175 pattern = '*',
176 command = function()
177 want { 'nvim-treesitter.highlight' } (function(highlight)
178 pcall(highlight.stop)
179 pcall(highlight.set_custom_captures, { error = 'None' })
180 pcall(highlight.start)
181 end)
182 end,
183 },
184 {
185 description = 'Enable the @error highlight while in Normal mode',
186 events = 'InsertLeave',
187 pattern = '*',
188 command = function()
189 want { 'nvim-treesitter.highlight' } (function(highlight)
190 pcall(highlight.stop)
191 pcall(highlight.set_custom_captures, { error = 'TSError' })
192 pcall(highlight.start)
193 end)
194 end,
195 },
196 }
209197end)

neovim/startuptime/x230_2022_07_15_13_34_39.txt

Added
new file mode 100644

+142 / −0 text lines

1Extra options: [init.lua]
2Measured: 100 times
3
4Total Average: 236.690490 msec
5Total Max: 400.304000 msec
6Total Min: 195.247000 msec
7
8 AVERAGE MAX MIN
9---------------------------------
10169.968420 290.092000 139.875000: /home/oli/.config/nvim/init.lua
11 13.974000 28.363000 11.460000: loading packages
12 6.835580 12.380000 5.336000: loading after plugins
13 5.466760 8.905000 4.366000: loading rtp plugins
14 4.679380 7.926000 3.542000: sourcing vimrc file(s)
15 4.340620 8.601000 3.439000: /usr/share/nvim/runtime/filetype.lua
16 2.982450 8.741000 2.265000: reading ShaDa
17 2.655790 5.275000 1.801000: opening buffers
18 2.251370 5.856000 1.530000: BufEnter autocommands
19 1.618660 3.966000 1.083000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter-textobjects/plugin/nvim-treesitter-textobjects.vim
20 1.420820 4.173000 1.004000: /home/oli/.config/nvim/filetype.lua
21 1.237190 3.538000 0.824000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter/plugin/nvim-treesitter.lua
22 1.045070 2.595000 0.822000: /usr/share/nvim/runtime/syntax/syntax.vim
23 0.891420 2.410000 0.610000: /home/oli/.local/share/nvim/site/pack/paqs/start/symbols-outline.nvim/plugin/symbols-outline.vim
24 0.832830 2.767000 0.435000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-cmp/plugin/cmp.lua
25 0.821020 1.894000 0.597000: /usr/share/vim/vimfiles/plugin/skim.vim
26 0.798470 2.223000 0.518000: /home/oli/.local/share/nvim/site/pack/plugins/start/kommentary/plugin/kommentary.vim
27 0.740630 2.029000 0.543000: init lua interpreter
28 0.683750 1.961000 0.490000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-gomove/plugin/gomove.lua
29 0.614360 2.907000 0.361000: /home/oli/.local/share/nvim/site/pack/paqs/start/indent-blankline.nvim/plugin/indent_blankline.vim
30 0.598100 2.327000 0.300000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter-refactor/plugin/nvim-treesitter-refactor.vim
31 0.587120 2.415000 0.276000: /home/oli/.local/share/nvim/site/pack/plugins/start/lsp-colors.nvim/plugin/lsp-colors.vim
32 0.530920 1.721000 0.290000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-ts-autotag/plugin/nvim-ts-autotag.vim
33 0.524870 1.722000 0.220000: /home/oli/.local/share/nvim/site/pack/paqs/start/leap.nvim/plugin/init.lua
34 0.513220 1.815000 0.303000: /home/oli/.local/share/nvim/site/pack/paqs/start/Comment.nvim/after/plugin/Comment.lua
35 0.453430 1.854000 0.215000: /home/oli/.local/share/nvim/site/pack/paqs/start/playground/plugin/nvim-treesitter-playground.lua
36 0.427410 1.438000 0.301000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-buffer/after/plugin/cmp_buffer.lua
37 0.422150 0.948000 0.326000: /home/oli/.local/share/nvim/site/pack/plugins/start/hop.nvim/plugin/hop.vim
38 0.417700 2.051000 0.194000: /home/oli/.local/share/nvim/site/pack/paqs/start/telescope.nvim/plugin/telescope.lua
39 0.411170 0.789000 0.297000: /home/oli/.local/share/nvim/site/pack/plugins/start/completion-nvim/plugin/completion.vim
40 0.408660 1.568000 0.306000: inits 1
41 0.402360 1.614000 0.274000: /home/oli/.local/share/nvim/site/pack/paqs/start/LuaSnip/plugin/luasnip.vim
42 0.382820 1.461000 0.161000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter-refactor/plugin/nvim-treesitter-refactor.vim
43 0.335740 1.025000 0.261000: init highlight
44 0.318870 1.911000 0.122000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter-textsubjects/plugin/nvim-treesitter-textsubjects.vim
45 0.281680 1.020000 0.190000: /usr/share/nvim/runtime/plugin/rplugin.vim
46 0.241690 0.796000 0.170000: /home/oli/.local/share/nvim/site/pack/paqs/start/registers.nvim/plugin/registers.vim
47 0.233550 1.115000 0.142000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp_luasnip/after/plugin/cmp_luasnip.lua
48 0.223740 0.835000 0.088000: /home/oli/.local/share/nvim/site/pack/plugins/start/playground/plugin/nvim-treesitter-playground.vim
49 0.211190 0.833000 0.133000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-path/after/plugin/cmp_path.lua
50 0.199070 0.710000 0.101000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-ts-context-commentstring/plugin/ts_context_commentstring.vim
51 0.197310 0.894000 0.083000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-dap/plugin/dap.lua
52 0.189950 0.854000 0.125000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-nvim-lsp-document-symbol/after/plugin/cmp_nvim_lsp_document_symbol.lua
53 0.189230 0.571000 0.138000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-lsp-installer/plugin/nvim-lsp-installer.vim
54 0.168640 0.697000 0.105000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-lspconfig/plugin/lspconfig.vim
55 0.156820 0.670000 0.112000: /usr/share/nvim/runtime/syntax/synload.vim
56 0.144780 0.461000 0.083000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-hlslens/plugin/hlslens.vim
57 0.142880 0.632000 0.069000: /home/oli/.local/share/nvim/site/pack/paqs/start/dressing.nvim/plugin/dressing.lua
58 0.142150 0.399000 0.112000: event init
59 0.140790 0.590000 0.072000: /usr/share/nvim/runtime/ftplugin.vim
60 0.140150 0.659000 0.076000: /home/oli/.local/share/nvim/site/pack/paqs/start/FixCursorHold.nvim/plugin/fix_cursorhold_nvim.vim
61 0.125350 0.626000 0.078000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua
62 0.121020 0.507000 0.069000: /home/oli/.local/share/nvim/site/pack/paqs/start/hydra.nvim/plugin/hydra.lua
63 0.118740 0.457000 0.076000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-lsputils/plugin/nvim-lsputils.vim
64 0.118720 0.369000 0.078000: /usr/share/nvim/runtime/plugin/shada.vim
65 0.115230 0.321000 0.087000: early init
66 0.113220 0.887000 0.072000: /home/oli/.local/share/nvim/site/pack/paqs/start/statusline.lua/plugin/statusline.vim
67 0.112250 0.355000 0.072000: /home/oli/.local/share/nvim/site/pack/paqs/start/trouble.nvim/plugin/trouble.vim
68 0.106310 0.414000 0.067000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-web-devicons/plugin/nvim-web-devicons.vim
69 0.102860 0.379000 0.063000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua
70 0.101030 1.148000 0.059000: /usr/share/nvim/runtime/plugin/man.vim
71 0.085390 0.325000 0.052000: /home/oli/.local/share/nvim/site/pack/paqs/start/editorconfig.nvim/plugin/editorconfig.vim
72 0.082080 0.363000 0.039000: /usr/share/nvim/runtime/indent.vim
73 0.080080 0.470000 0.056000: /home/oli/.local/share/nvim/site/pack/paqs/start/lush.nvim/plugin/lush.vim
74 0.078310 0.371000 0.055000: /home/oli/.local/share/nvim/site/pack/paqs/start/plenary.nvim/plugin/plenary.vim
75 0.078270 0.282000 0.050000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-colorizer.lua/plugin/colorizer.vim
76 0.075640 0.300000 0.050000: /home/oli/.local/share/nvim/site/pack/plugins/start/popfix/plugin/popfix.vim
77 0.075340 0.483000 0.045000: /etc/xdg/nvim/sysinit.vim
78 0.075220 0.317000 0.052000: /home/oli/.local/share/nvim/site/pack/plugins/start/plenary.nvim/plugin/plenary.vim
79 0.074660 0.326000 0.043000: expanding arguments
80 0.071840 0.439000 0.045000: /home/oli/.local/share/nvim/site/pack/paqs/start/neo-tree.nvim/plugin/neo-tree.vim
81 0.070970 0.239000 0.051000: locale set
82 0.065390 0.219000 0.043000: parsing arguments
83 0.064380 0.273000 0.042000: /usr/share/vim/vimfiles/plugin/black.vim
84 0.063050 0.446000 0.033000: /home/oli/.local/share/nvim/site/pack/paqs/start/lsp-zero.nvim/plugin/lsp-zero.vim
85 0.061610 0.323000 0.041000: /home/oli/.local/share/nvim/site/pack/paqs/start/todo-comments.nvim/plugin/todo.vim
86 0.059760 0.457000 0.036000: init first window
87 0.058260 0.164000 0.041000: inits 2
88 0.057180 0.191000 0.039000: /home/oli/.local/share/nvim/site/pack/paqs/start/telescope-frecency.nvim/plugin/frecency.vim
89 0.056520 0.276000 0.039000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-jdtls/plugin/nvim_jdtls.vim
90 0.051460 0.183000 0.021000: /usr/share/nvim/runtime/plugin/gzip.vim
91 0.049720 0.424000 0.028000: clearing screen
92 0.045950 0.245000 0.031000: /usr/share/vim/vimfiles/ftdetect/meson.vim
93 0.044510 0.263000 0.023000: /usr/share/nvim/runtime/plugin/netrwPlugin.vim
94 0.041720 0.226000 0.020000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-colorizer.lua/plugin/colorizer.vim
95 0.039560 0.266000 0.025000: /usr/share/nvim/runtime/plugin/tutor.vim
96 0.039150 0.120000 0.026000: /home/oli/.local/share/nvim/site/pack/plugins/start/telescope.nvim/plugin/telescope.vim
97 0.039030 0.127000 0.028000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/query.vim
98 0.036830 0.294000 0.024000: /home/oli/.local/share/nvim/site/pack/paqs/start/rust-tools.nvim/plugin/rust-tools.vim
99 0.035770 0.256000 0.023000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/hcl.vim
100 0.034040 0.172000 0.021000: /usr/share/nvim/runtime/filetype.vim
101 0.033930 0.605000 0.021000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/graphql.vim
102 0.033530 0.200000 0.019000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-web-devicons/plugin/nvim-web-devicons.vim
103 0.032710 0.164000 0.022000: /usr/share/nvim/runtime/plugin/zipPlugin.vim
104 0.032640 0.131000 0.021000: /home/oli/.local/share/nvim/site/pack/plugins/start/which-key.nvim/plugin/which-key.vim
105 0.032400 0.124000 0.021000: /usr/share/nvim/runtime/plugin/tarPlugin.vim
106 0.031890 0.205000 0.017000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/cooklang.vim
107 0.030590 0.234000 0.020000: inits 3
108 0.029750 0.211000 0.018000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/plugin/nvim-treesitter.vim
109 0.027400 0.153000 0.019000: init default mappings
110 0.027320 0.156000 0.017000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-lspconfig/plugin/lspconfig.vim
111 0.026630 0.113000 0.018000: /usr/share/nvim/runtime/plugin/matchit.vim
112 0.026430 0.131000 0.018000: /usr/share/nvim/runtime/plugin/matchparen.vim
113 0.026210 0.091000 0.020000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/ledger.vim
114 0.026160 0.086000 0.018000: init default autocommands
115 0.025710 0.053000 0.020000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/gdresource.vim
116 0.025570 0.083000 0.019000: /home/oli/.local/share/nvim/site/pack/paqs/start/LuaSnip/ftdetect/snippets.vim
117 0.025370 0.198000 0.018000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/hack.vim
118 0.025200 0.078000 0.015000: /usr/share/nvim/runtime/plugin/health.vim
119 0.024940 0.079000 0.019000: /home/oli/.local/share/nvim/site/pack/paqs/start/editorconfig.nvim/ftdetect/editorconfig.vim
120 0.023540 0.404000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/teal.vim
121 0.023540 0.120000 0.016000: /usr/share/nvim/runtime/plugin/spellfile.vim
122 0.023360 0.149000 0.014000: /usr/share/nvim/archlinux.vim
123 0.022730 0.229000 0.015000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/surface.vim
124 0.022600 0.080000 0.015000: window checked
125 0.022550 0.193000 0.015000: /usr/share/nvim/runtime/plugin/tohtml.vim
126 0.021970 0.088000 0.016000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/ql.vim
127 0.020280 0.057000 0.015000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/fusion.vim
128 0.020210 0.073000 0.013000: /home/oli/.local/share/nvim/rplugin.vim
129 0.019480 0.064000 0.015000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/gdscript.vim
130 0.019360 0.061000 0.015000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/gowork.vim
131 0.019260 0.061000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/hjson.vim
132 0.019140 0.060000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/yang.vim
133 0.018990 0.136000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/glsl.vim
134 0.018840 0.069000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/json5.vim
135 0.018830 0.060000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/pug.vim
136 0.018770 0.049000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/tlaplus.vim
137 0.018720 0.053000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/prisma.vim
138 0.018070 0.061000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/nix.vim
139 0.017990 0.066000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/glimmer.vim
140 0.017850 0.044000 0.014000: /home/oli/.local/share/nvim/site/pack/plugins/start/nvim-treesitter/ftdetect/heex.vim
141 0.013040 0.236000 0.005000: editing files in windows
142 0.012080 0.028000 0.009000: --- NVIM STARTING ---

neovim/startuptime/x230_2022_07_17_17_59_39.txt

Added
new file mode 100644

+102 / −0 text lines

1Extra options: [init.lua]
2Measured: 100 times
3
4Total Average: 1850.736090 msec
5Total Max: 1969.983000 msec
6Total Min: 1821.947000 msec
7
8 AVERAGE MAX MIN
9------------------------------------
101006.310160 1006.838000 1006.138000: clearing screen
11 802.751960 911.582000 775.461000: /home/oli/.config/nvim/init.lua
12 7.836060 11.880000 7.161000: loading packages
13 4.288070 6.452000 3.935000: loading after plugins
14 3.741050 5.754000 3.373000: loading rtp plugins
15 3.100560 4.513000 2.869000: reading ShaDa
16 2.885810 4.400000 2.659000: sourcing vimrc file(s)
17 2.410220 4.000000 1.840000: opening buffers
18 1.840350 3.263000 1.641000: /usr/share/nvim/runtime/filetype.lua
19 1.337860 2.431000 1.042000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter-textobjects/plugin/nvim-treesitter-textobjects.vim
20 1.102050 1.896000 0.954000: /home/oli/.config/nvim/filetype.lua
21 0.973060 1.637000 0.748000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter/plugin/nvim-treesitter.lua
22 0.759020 1.349000 0.553000: BufEnter autocommands
23 0.751850 1.337000 0.675000: /usr/share/nvim/runtime/syntax/syntax.vim
24 0.667290 1.229000 0.579000: /home/oli/.local/share/nvim/site/pack/paqs/start/symbols-outline.nvim/plugin/symbols-outline.vim
25 0.650380 1.114000 0.576000: /usr/share/vim/vimfiles/plugin/skim.vim
26 0.611960 0.926000 0.559000: init lua interpreter
27 0.602680 1.008000 0.434000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-cmp/plugin/cmp.lua
28 0.565550 0.906000 0.470000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-gomove/plugin/gomove.lua
29 0.441350 0.998000 0.319000: /home/oli/.local/share/nvim/site/pack/paqs/start/indent-blankline.nvim/plugin/indent_blankline.vim
30 0.391140 0.647000 0.258000: /home/oli/.local/share/nvim/site/pack/paqs/start/leap.nvim/plugin/init.lua
31 0.371630 0.687000 0.275000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-ts-autotag/plugin/nvim-ts-autotag.vim
32 0.353460 1.047000 0.215000: /home/oli/.local/share/nvim/site/pack/paqs/start/playground/plugin/nvim-treesitter-playground.lua
33 0.335070 0.519000 0.302000: inits 1
34 0.331190 0.686000 0.187000: /home/oli/.local/share/nvim/site/pack/paqs/start/telescope.nvim/plugin/telescope.lua
35 0.308770 0.680000 0.205000: /home/oli/.local/share/nvim/site/pack/paqs/start/Comment.nvim/after/plugin/Comment.lua
36 0.304500 0.576000 0.263000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-buffer/after/plugin/cmp_buffer.lua
37 0.289440 0.392000 0.267000: init highlight
38 0.288850 0.471000 0.257000: /home/oli/.local/share/nvim/site/pack/paqs/start/LuaSnip/plugin/luasnip.vim
39 0.267110 0.720000 0.140000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter-refactor/plugin/nvim-treesitter-refactor.vim
40 0.206530 0.400000 0.113000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-treesitter-textsubjects/plugin/nvim-treesitter-textsubjects.vim
41 0.202800 0.353000 0.181000: /usr/share/nvim/runtime/plugin/rplugin.vim
42 0.187210 0.360000 0.163000: /home/oli/.local/share/nvim/site/pack/paqs/start/registers.nvim/plugin/registers.vim
43 0.167000 0.342000 0.129000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp_luasnip/after/plugin/cmp_luasnip.lua
44 0.150500 0.349000 0.099000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-ts-context-commentstring/plugin/ts_context_commentstring.vim
45 0.145620 0.307000 0.118000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-path/after/plugin/cmp_path.lua
46 0.143760 0.260000 0.123000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-lsp-installer/plugin/nvim-lsp-installer.vim
47 0.141360 0.339000 0.111000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-nvim-lsp-document-symbol/after/plugin/cmp_nvim_lsp_document_symbol.lua
48 0.138520 0.320000 0.082000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-dap/plugin/dap.lua
49 0.134770 0.333000 0.102000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-lspconfig/plugin/lspconfig.vim
50 0.133200 0.274000 0.116000: /usr/share/nvim/runtime/syntax/synload.vim
51 0.120360 0.165000 0.107000: event init
52 0.097450 0.206000 0.085000: early init
53 0.095100 0.239000 0.077000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-hlslens/plugin/hlslens.vim
54 0.086370 0.262000 0.068000: /home/oli/.local/share/nvim/site/pack/paqs/start/hydra.nvim/plugin/hydra.lua
55 0.085730 0.174000 0.070000: /home/oli/.local/share/nvim/site/pack/paqs/start/FixCursorHold.nvim/plugin/fix_cursorhold_nvim.vim
56 0.082690 0.155000 0.075000: /usr/share/nvim/runtime/plugin/shada.vim
57 0.079840 0.149000 0.071000: /home/oli/.local/share/nvim/site/pack/paqs/start/trouble.nvim/plugin/trouble.vim
58 0.079290 0.198000 0.060000: /home/oli/.local/share/nvim/site/pack/paqs/start/dressing.nvim/plugin/dressing.lua
59 0.076630 0.177000 0.064000: /usr/share/nvim/runtime/ftplugin.vim
60 0.075240 0.156000 0.057000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua
61 0.073600 0.148000 0.061000: /home/oli/.local/share/nvim/site/pack/paqs/start/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua
62 0.071170 0.204000 0.056000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-web-devicons/plugin/nvim-web-devicons.vim
63 0.064820 0.121000 0.055000: /usr/share/nvim/runtime/plugin/man.vim
64 0.060320 0.132000 0.051000: /home/oli/.local/share/nvim/site/pack/paqs/start/plenary.nvim/plugin/plenary.vim
65 0.059760 0.188000 0.050000: /home/oli/.local/share/nvim/site/pack/paqs/start/editorconfig.nvim/plugin/editorconfig.vim
66 0.059360 0.106000 0.053000: /home/oli/.local/share/nvim/site/pack/paqs/start/lush.nvim/plugin/lush.vim
67 0.055910 0.125000 0.049000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-colorizer.lua/plugin/colorizer.vim
68 0.053740 0.084000 0.047000: locale set
69 0.052100 0.256000 0.044000: parsing arguments
70 0.051790 0.083000 0.045000: /etc/xdg/nvim/sysinit.vim
71 0.050950 0.246000 0.043000: /home/oli/.local/share/nvim/site/pack/paqs/start/neo-tree.nvim/plugin/neo-tree.vim
72 0.050490 0.086000 0.044000: expanding arguments
73 0.047710 0.076000 0.040000: inits 2
74 0.047330 0.092000 0.041000: /home/oli/.local/share/nvim/site/pack/paqs/start/todo-comments.nvim/plugin/todo.vim
75 0.045090 0.081000 0.040000: /usr/share/vim/vimfiles/plugin/black.vim
76 0.044210 0.070000 0.033000: init first window
77 0.043190 0.105000 0.038000: /usr/share/nvim/runtime/indent.vim
78 0.042190 0.085000 0.037000: /home/oli/.local/share/nvim/site/pack/paqs/start/nvim-jdtls/plugin/nvim_jdtls.vim
79 0.038530 0.097000 0.034000: /usr/share/vim/vimfiles/ftdetect/meson.vim
80 0.037170 0.076000 0.031000: /home/oli/.local/share/nvim/site/pack/paqs/start/lsp-zero.nvim/plugin/lsp-zero.vim
81 0.028740 0.060000 0.023000: /usr/share/nvim/runtime/plugin/netrwPlugin.vim
82 0.026970 0.090000 0.024000: /usr/share/nvim/runtime/plugin/tutor.vim
83 0.025430 0.237000 0.021000: /usr/share/nvim/runtime/plugin/zipPlugin.vim
84 0.024940 0.052000 0.019000: /usr/share/nvim/runtime/plugin/gzip.vim
85 0.024930 0.047000 0.022000: /home/oli/.local/share/nvim/site/pack/paqs/start/rust-tools.nvim/plugin/rust-tools.vim
86 0.024220 0.040000 0.021000: /usr/share/nvim/runtime/filetype.vim
87 0.023370 0.041000 0.019000: /home/oli/.local/share/nvim/site/pack/paqs/start/LuaSnip/ftdetect/snippets.vim
88 0.022450 0.067000 0.020000: /usr/share/nvim/runtime/plugin/tarPlugin.vim
89 0.021630 0.036000 0.019000: init default mappings
90 0.021550 0.043000 0.019000: inits 3
91 0.020880 0.038000 0.018000: /home/oli/.local/share/nvim/site/pack/paqs/start/editorconfig.nvim/ftdetect/editorconfig.vim
92 0.020190 0.036000 0.018000: init default autocommands
93 0.018600 0.033000 0.016000: /usr/share/nvim/runtime/plugin/matchit.vim
94 0.018000 0.033000 0.015000: window checked
95 0.017820 0.073000 0.015000: /usr/share/nvim/runtime/plugin/matchparen.vim
96 0.016460 0.030000 0.014000: /usr/share/nvim/runtime/plugin/health.vim
97 0.015920 0.032000 0.014000: /usr/share/nvim/runtime/plugin/spellfile.vim
98 0.015430 0.029000 0.014000: /usr/share/nvim/runtime/plugin/tohtml.vim
99 0.015110 0.026000 0.013000: /usr/share/nvim/archlinux.vim
100 0.013520 0.026000 0.012000: /home/oli/.local/share/nvim/rplugin.vim
101 0.010160 0.014000 0.009000: --- NVIM STARTING ---
102 0.006420 0.019000 0.005000: editing files in windows

river/init

Modified

+2 / −1 text lines

1919ctrl="Control"
2121riverctl map normal $super Return spawn wezterm
22riverctl map normal $super+Shift Return spawn foot
2223riverctl map normal $super B spawn firefox
23riverctl map normal $super asciicircum spawn 'fuzzel --terminal "wezterm start"'
24riverctl map normal $super grave spawn 'fuzzel --terminal "wezterm start"'
2526# close the focused view
2627riverctl map normal $super Q close

ssh/config

Modified

+1 / −0 text lines

2121Host *
2222 User root
2323 Compression yes
24 AddKeysToAgent yesNo final newline