dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim: enables project local overrides for lsp settings, some neovim opitons, save actions.
5ba4c370b533a104d8b893760f91368ed48b390d
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (33)
neovim/.editorconfig
Modified 5 11 indent_style =
space neovim/.lazy.specs.lua
Modified 3 - 'WhoIsSethDaniel/mason-tool-installer.nvim',
3 + "WhoIsSethDaniel/mason-tool-installer.nvim",
neovim/.lsp.settings.lua
Addednew file mode 100644No text changes.
neovim/.save.actions.lua
Addednew file mode 10064441 39 * Bug: LuaLS is getting crazy diagnosing non-stop...
42 -* TAB highlights are borked
43 -* think about formatting. prefer lsp or not?
44 -* once a terminal was open, i cannot quit with :wqa anymore...
40 +* integrate language tool?
41 +* ]s [s to jump to spelling mistakes
45 42 * adapt config to respect `vim.g.nerdfont` (std.constants?)
46 -* learn from <https://github.com/stevearc/dotfiles/blob/master/.config/nvim/plugin/exrc.lua> and maybe adapt `std.localrc`
47 43 * make lsp config extensible, so that plugin configs can hook into it (e.g. on_attach)
48 -* scavenge stevearc dotfiles for nvim goodies
49 44 * write plugin to parse lsp settings locally and apply them
50 45 * pandoc with lua filters for diagrams for generating documents and previewing --> https://github.com/tex/vimpreviewpandoc
51 -* learn marks and refactor mark.lua
46 +* once a terminal was open, i cannot quit with :wqa anymore...
52 47 * create facade over vim.api.nvim_create_user_command
53 48 * use ltex-ls for markdown, code comments and commit messages
49 +* learn from <https://github.com/stevearc/dotfiles/blob/master/.config/nvim/plugin/exrc.lua> and maybe adapt `std.localrc`
55 51 * nvim spell for camel case words
52 +* learn marks and refactor mark.lua
56 53 * add nu-check to nvim-lint
57 54 * create skeleton-plugin for default file content based on file type (BufNewFile?)
58 55 * add support for Java multi line string in autopairs
19 19 ok, loaded
= pcall(
require,
'bugabinga.options' )
20 -if not ok
then vim.print(
'error while loading options', loaded )
end 21 + vim.print(
'error while loading options', loaded )
25 +ok, loaded
= pcall(
require,
'bugabinga.editorconfig' )
27 + vim.print(
'error while loading editorconfg extensions', loaded )
23 31 ok, loaded
= pcall(
require,
'bugabinga.lazy' )
24 -if not ok
then vim.print(
'error while loading lazy', loaded )
end 33 + vim.print(
'error while loading lazy', loaded )
27 37 ok, loaded
= pcall(
require,
'bugabinga.diagnostic' )
28 -if not ok
then vim.print(
'error while loading diagnostic', loaded )
end 39 + vim.print(
'error while loading diagnostic', loaded )
31 -ok, loaded
= pcall(
require,
'bugabinga.trim' )
32 -if not ok
then vim.print(
'error while loading trim', loaded )
end 43 +ok, loaded
= pcall(
require,
'bugabinga.save_actions' )
45 + vim.print(
'error while loading save_actions', loaded )
35 49 ok, loaded
= pcall(
require,
'bugabinga.mark' )
36 -if not ok
then vim.print(
'error while loading mark', loaded )
end 51 + vim.print(
'error while loading mark', loaded )
39 55 ok, loaded
= pcall(
require,
'bugabinga.lsp' )
40 -if not ok
then vim.print(
'error while loading lsp', loaded )
end 57 + vim.print(
'error while loading lsp', loaded )
neovim/lazy-lock.json
Modified 3 3 "Comment.nvim": {
"branch":
"master",
"commit":
"e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
4 4 "LuaSnip": {
"branch":
"master",
"commit":
"a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
5 5 "actions-preview.nvim": {
"branch":
"master",
"commit":
"5072b1b1065a6b22bdd46b5c21780a91d6a08071" },
6 - "aerial.nvim": {
"branch":
"master",
"commit":
"993142d49274092c64a2d475aa726df3c323949d" },
6 + "aerial.nvim": {
"branch":
"master",
"commit":
"51a07949abf169b4cad30e14c165ac1ec0ce4e6f" },
7 7 "auto-dark-mode.nvim": {
"branch":
"master",
"commit":
"e328dc463d238cb7d690fb4daf068eba732a5a14" },
8 8 "better-escape.nvim": {
"branch":
"master",
"commit":
"7e86edafb8c7e73699e0320f225464a298b96d12" },
9 9 "cmp-buffer": {
"branch":
"main",
"commit":
"3022dbc9166796b644a841a02de8dd1cc1d311fa" },
16 16 "dressing.nvim": {
"branch":
"master",
"commit":
"18e5beb3845f085b6a33c24112b37988f3f93c06" },
17 17 "fidget.nvim": {
"branch":
"main",
"commit":
"4e854f3299e21d1c18279add340428a97520fc44" },
18 18 "flash.nvim": {
"branch":
"main",
"commit":
"48817af25f51c0590653bbc290866e4890fe1cbe" },
19 - "gitsigns.nvim": {
"branch":
"main",
"commit":
"078041e9d060a386b0c9d3a8c7a7b019a35d3fb0" },
19 + "gitsigns.nvim": {
"branch":
"main",
"commit":
"6ef8c54fb526bf3a0bc4efb0b2fe8e6d9a7daed2" },
20 20 "glow.nvim": {
"branch":
"main",
"commit":
"238070a686c1da3bccccf1079700eb4b5e19aea4" },
21 21 "heirline.nvim": {
"branch":
"master",
"commit":
"03cff30d7e7d3ba6fdc00925f015822f79cef908" },
22 22 "indent-blankline.nvim": {
"branch":
"master",
"commit":
"3d08501caef2329aba5121b753e903904088f7e6" },
23 - "lazy.nvim": {
"branch":
"main",
"commit":
"83493db50a434a4c5c648faf41e2ead80f96e478" },
23 + "lazy.nvim": {
"branch":
"main",
"commit":
"08954f723bf2d442ea020551e3acc956f4dc6dc7" },
24 24 "lsp_signature.nvim": {
"branch":
"master",
"commit":
"c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
25 25 "lspkind.nvim": {
"branch":
"master",
"commit":
"1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
26 26 "mason-tool-installer.nvim": {
"branch":
"main",
"commit":
"1212fb6082b7177dde17ea65e429e027835aeb40" },
27 27 "mason.nvim": {
"branch":
"main",
"commit":
"c43eeb5614a09dc17c03a7fb49de2e05de203924" },
28 28 "mini.bracketed": {
"branch":
"main",
"commit":
"65c7dfb51e832de9e279e5d5b0741e7af6755ab5" },
29 29 "mkdir.nvim": {
"branch":
"main",
"commit":
"c55d1dee4f099528a1853b28bb28caa802eba217" },
30 - "neogen": {
"branch":
"main",
"commit":
"b95347a588401a755eadd17482edc1662876bd58" },
31 - "neorg": {
"branch":
"main",
"commit":
"086891d396ac9fccd91faf1520f563b6eb9eb942" },
30 + "neogen": {
"branch":
"main",
"commit":
"0daffcec249bf42275e322361fe55b89a05ff278" },
31 + "neorg": {
"branch":
"main",
"commit":
"df755b5f5cf837743b78392fa90fd8d993263ca1" },
32 32 "neotest": {
"branch":
"master",
"commit":
"e07fe8241112274aae9947b98d255763738a1d52" },
33 33 "neotest-plenary": {
"branch":
"master",
"commit":
"dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" },
34 34 "nrpattern.nvim": {
"branch":
"master",
"commit":
"f862ce687761078ef3155688151c55f69d28453e" },
35 35 "nui.nvim": {
"branch":
"main",
"commit":
"cbd2668414331c10039278f558630ed19b93e69b" },
36 36 "nvim-autopairs": {
"branch":
"master",
"commit":
"dbfc1c34bed415906395db8303c71039b3a3ffb4" },
37 - "nvim-cmp": {
"branch":
"main",
"commit":
"43b460a2bd02fd898e67f5f1f65dfd1cce26203a" },
37 + "nvim-cmp": {
"branch":
"main",
"commit":
"97dc716fc914c46577a4f254035ebef1aa72558a" },
38 38 "nvim-dap": {
"branch":
"master",
"commit":
"c1695e500c7d552a0a19953a9aefcc89178fb1af" },
39 39 "nvim-dap-ui": {
"branch":
"master",
"commit":
"edfa93f60b189e5952c016eee262d0685d838450" },
40 40 "nvim-dap-virtual-text": {
"branch":
"master",
"commit":
"baa5b0dc6663284cce32e0d00ac1f2511b13496f" },
44 44 "nvim-lastplace": {
"branch":
"main",
"commit":
"0bb6103c506315044872e0f84b1f736c4172bb20" },
45 45 "nvim-lint": {
"branch":
"master",
"commit":
"2669aabb8362fdc36aced5ba864b7135636ea863" },
46 46 "nvim-lsp-file-operations": {
"branch":
"master",
"commit":
"223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
47 - "nvim-navbuddy": {
"branch":
"master",
"commit":
"f137a3466a6cd1965cdcc5398daff54e66eebbe5" },
47 + "nvim-navbuddy": {
"branch":
"master",
"commit":
"f34237e8a41ebc6e2716af2ebf49854d8c5289c8" },
48 48 "nvim-navic": {
"branch":
"master",
"commit":
"8649f694d3e76ee10c19255dece6411c29206a54" },
49 49 "nvim-neoclip.lua": {
"branch":
"main",
"commit":
"798cd0592a81c185465db3a091a0ff8a21af60fd" },
50 - "nvim-nio": {
"branch":
"master",
"commit":
"7054695117581bdb0183b8d27d8d82b4a2ac8958" },
51 - "nvim-spectre": {
"branch":
"master",
"commit":
"1d23be1165c373a6026e42f3b3a5100126eaf81d" },
50 + "nvim-nio": {
"branch":
"master",
"commit":
"33c62b3eadd8154169e42144de16ba4db6784bec" },
51 + "nvim-spectre": {
"branch":
"master",
"commit":
"31f62d7fc30257b2a5c5327ff7b47719da37a1b4" },
52 52 "nvim-surround": {
"branch":
"main",
"commit":
"84a26afce16cffa7e3322cfa80a42cddf60616eb" },
53 - "nvim-tree.lua": {
"branch":
"master",
"commit":
"707b24af91a1d05823099ed8c5450796290466ba" },
54 - "nvim-treesitter": {
"branch":
"master",
"commit":
"722617e6726c1508adadf83d531f54987c703be0" },
53 + "nvim-tree.lua": {
"branch":
"master",
"commit":
"85c502e9076d9c82e2f04addabb3614846ae7558" },
54 + "nvim-treesitter": {
"branch":
"master",
"commit":
"33c9db832b6f25446f7bd2dd3353f7737a3476c4" },
55 55 "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" },
56 56 "nvim-ts-autotag": {
"branch":
"main",
"commit":
"531f48334c422222aebc888fd36e7d109cb354cd" },
57 57 "nvim-ts-context-commentstring": {
"branch":
"main",
"commit":
"7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
58 - "nvim-web-devicons": {
"branch":
"master",
"commit":
"cb0c967c9723a76ccb1be0cc3a9a10e577d2f6ec" },
58 + "nvim-web-devicons": {
"branch":
"master",
"commit":
"6662f059bf78e6092ba90cd1929599625f448f55" },
59 59 "nvim-window": {
"branch":
"main",
"commit":
"e7f5d60eeec8ff37af7be4c9a99f65edf67fc574" },
60 60 "oil.nvim": {
"branch":
"master",
"commit":
"e462a3446505185adf063566f5007771b69027a1" },
61 - "overseer.nvim": {
"branch":
"master",
"commit":
"b72f6d23ce47ccd427be2341f389c63448278f17" },
61 + "overseer.nvim": {
"branch":
"master",
"commit":
"b04b0b105c07b4f02b3073ea3a98d6eca90bf152" },
62 62 "playground": {
"branch":
"master",
"commit":
"ba48c6a62a280eefb7c85725b0915e021a1a0749" },
63 63 "plenary.nvim": {
"branch":
"master",
"commit":
"f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
64 64 "qf_helper.nvim": {
"branch":
"master",
"commit":
"91dad029c11d1c39b0d1276eda52616f651072be" },
65 65 "resession.nvim": {
"branch":
"master",
"commit":
"dc8825439c619030925543a444c4186a2487c200" },
66 - "schemastore.nvim": {
"branch":
"main",
"commit":
"9ad2209d3fe54f99e3df2c26fadd6f4a3ecae44c" },
66 + "schemastore.nvim": {
"branch":
"main",
"commit":
"290e692d568e55be475f6af4579fea434e20ba0c" },
67 67 "specs.nvim": {
"branch":
"main",
"commit":
"e929006d3f6bb8e43f03e13ac364c67236eb5299" },
68 68 "speedtyper.nvim": {
"branch":
"main",
"commit":
"2d158eed4c753995b0501a3a7a72464fbb213e3d" },
69 69 "ssr.nvim": {
"branch":
"main",
"commit":
"bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
neovim/lua/bugabinga/const.lua
Addednew file mode 100644 3 + win32 = vim.loop.os_uname().sysname:match
'Win',
4 + wsl2 = vim.loop.os_uname().release:match
'WSL2',
neovim/lua/bugabinga/editorconfig.lua
Addednew file mode 100644 1 +local editorconfig
= require 'editorconfig' 13 +local tobool = function ( str )
15 + return str
== 'true' 18 +local expose_option = function ( option_name, parser )
19 + editorconfig.properties[option_name]
= function ( _, value )
20 + vim.opt_local[option_name]
= parser( value )
26 +expose_option(
'spell', tobool )
27 +expose_option(
'number', tobool )
28 +expose_option(
'cursorline', tobool )
29 +expose_option(
'virtualedit',
tostring )
31 +editorconfig.properties.
diagnostic = function ( bufnr, value )
32 + local option
= tobool( value )
34 + vim.diagnostic.enable( bufnr )
36 + vim.diagnostic.disable( bufnr )
neovim/lua/bugabinga/lazy.lua
Modified 1 1 local win32
= vim.loop.os_uname().sysname:match
'Win' 2 2 local lazypath
= vim.fn.stdpath
'data' .. '/lazy/lazy.nvim' 3 3 if not vim.loop.fs_stat( lazypath )
then 7 - '--filter=blob:none',
8 - 'https://github.com/folke/lazy.nvim.git',
7 + '--filter=blob:none',
8 + 'https://github.com/folke/lazy.nvim.git',
13 13 vim.opt.rtp:prepend( lazypath )
19 19 local lazy
= require 'lazy' 20 20 local icon
= require 'std.icon' 22 -local overrides
= require 'std.localrc' '.lazy.specs.lua' 22 +local overrides
= require 'std.localrc' (
'.lazy.specs.lua',
'table' )
25 25 vim.g.FILE_LOADED_EVENTS
= {
'BufRead',
'BufNew',
'SessionLoadPost', }
28 - spec = { {
import =
'bugabinga.plugins', }, overrides, },
35 - colorscheme = {
'nugu_fresh',
'quiet', },
38 - enabled =
not win32,
42 - size = {
width =
0.69,
heigth =
0.69, },
43 - border = vim.g.border_style,
46 - task = icon.terminal,
50 - [
'<localleader>l'] = {
52 - require 'lazy.util'.float_term( {
'gitui', }, {
56 - desc =
'Open gitui',
28 + spec = { {
import =
'bugabinga.plugins', }, overrides, },
35 + colorscheme = {
'nugu_fresh',
'quiet', },
38 + enabled =
not win32,
42 + size = {
width =
0.69,
heigth =
0.69, },
43 + border = vim.g.border_style,
46 + task = icon.terminal,
50 + [
'<localleader>l'] = {
52 + require 'lazy.util'.float_term( {
'gitui', }, {
56 + desc =
'Open gitui',
59 - [
'<localleader>t'] = {
61 - require 'lazy.util'.float_term(
nil, {
65 - desc =
'Open terminal in plugin dir',
69 - diff = {
cmd =
'diffview.nvim', },
70 - change_detection = {
notify =
false, },
73 - disabled_plugins = {
77 - 'netrwFileHandlers',
100 - patterns = {
'bugabinga', },
101 - path = win32
and 'W:/' or '~/Workspace',
59 + [
'<localleader>t'] = {
61 + require 'lazy.util'.float_term(
nil, {
65 + desc =
'Open terminal in plugin dir',
69 + diff = {
cmd =
'diffview.nvim', },
70 + change_detection = {
notify =
false, },
73 + disabled_plugins = {
77 + 'netrwFileHandlers',
100 + patterns = {
'bugabinga', },
101 + path = win32
and 'W:/' or '~/Workspace',
105 105 local map
= require 'std.map' 107 107 local lazy_cmds
= vim.iter {
108 - {
'Show',
'', lazy.show, },
109 - {
'Install',
'i', lazy.install, },
110 - {
'Update',
'u', lazy.update, },
111 - {
'Sync',
's', lazy.sync, },
112 - {
'Clean',
'x', lazy.clean, },
113 - {
'Check',
'c', lazy.check, },
114 - {
'Log',
'l', lazy.log, },
115 - {
'Restore',
'r', lazy.restore, },
116 - {
'Profile',
'p', lazy.profile, },
117 - {
'Debug',
'd', lazy.debug, },
108 + {
'Show',
'', lazy.show, },
109 + {
'Install',
'i', lazy.install, },
110 + {
'Update',
'u', lazy.update, },
111 + {
'Sync',
's', lazy.sync, },
112 + {
'Clean',
'x', lazy.clean, },
113 + {
'Check',
'c', lazy.check, },
114 + {
'Log',
'l', lazy.log, },
115 + {
'Restore',
'r', lazy.restore, },
116 + {
'Profile',
'p', lazy.profile, },
117 + {
'Debug',
'd', lazy.debug, },
120 120 local base_key
= '<leader>z' 122 122 lazy_cmds:each(
function ( cmd )
124 - description = cmd[
1],
125 - category =
'plugins',
126 - keys = base_key
.. cmd[
2],
124 + description = cmd[
1],
125 + category =
'plugins',
126 + keys = base_key
.. cmd[
2],
131 131 local auto
= require 'std.auto' 133 133 auto
'display_startup_time' {
134 - description =
'Display startup time on starter screen',
136 - pattern =
'LazyVimStarted',
138 - command = vim.schedule_wrap(
function ()
139 - local startuptime
= lazy.stats().startuptime
140 - vim.notify(
'neovim started in ' .. startuptime
.. 'ms' )
134 + description =
'Display startup time on starter screen',
136 + pattern =
'LazyVimStarted',
138 + command = vim.schedule_wrap(
function ()
139 + local startuptime
= lazy.stats().startuptime
140 + vim.notify(
'neovim started in ' .. startuptime
.. 'ms' )
neovim/lua/bugabinga/lsp/clients/bash.lua
Deleteddeleted file mode 100644 1 -local project
= require 'std.project' 5 - command = {
'bash-language-server',
'start', },
6 - filetypes = {
'sh', },
7 - root_dir = project.find_vcs_project_root,
8 - single_file_support =
true,
19 - globPattern = vim.env.GLOB_PATTERN
or '*@(.sh|.inc|.bash|.command)',
neovim/lua/bugabinga/lsp/clients/init.lua
Modified 4 4 require 'bugabinga.lsp.clients.java',
5 5 require 'bugabinga.lsp.clients.lua',
6 6 require 'bugabinga.lsp.clients.json',
7 7 require 'bugabinga.lsp.clients.asm',
8 - require 'bugabinga.lsp.clients.bash',
9 8 require 'bugabinga.lsp.clients.c',
10 9 require 'bugabinga.lsp.clients.graphviz',
11 10 require 'bugabinga.lsp.clients.markdown',
neovim/lua/bugabinga/lsp/init.lua
Modified 1 -require 'bugabinga.lsp.lightbulb' 3 1 local debug = require 'std.debug' 4 2 local defer
= require 'std.defer' 5 3 local map
= require 'std.map' 9 7 local ignored
= require 'std.ignored' 10 8 local user_command
= vim.api.nvim_create_user_command
11 9 local lsp_client_configs
= require 'bugabinga.lsp.clients' 10 +local localrc
= require 'std.localrc' 14 -local token_update = function ( lsp_client )
14 +require 'bugabinga.lsp.lightbulb' 16 +local token_update = function ( lsp_client )
15 17 local token
= lsp_client.data.token
16 18 local buffer
= lsp_client.buffer
17 19 local client_id
= lsp_client.data.client_id
30 -local expand_path = function ( path )
32 +local expand_path = function ( path )
31 33 if vim.fn.executable( path )
== 1 then 32 34 return vim.fn.exepath( path )
38 -local expand_command = function ( command )
40 +local expand_command = function ( command )
39 41 vim.validate {
command = { command, {
'string',
'table', }, }, }
41 43 if type( command )
== 'table' then 46 48 return expand_path( command )
49 -local lsp_start = function ( file_type_event )
51 +local lsp_start = function ( file_type_event )
50 52 debug.print
'trying to start lsp' 51 53 local match
= file_type_event.match
120 + local project_local_lsp_settings
= localrc(
'.lsp.settings.lua',
'table' )
or {}
120 122 for _, config
in ipairs( potential_client_configs )
do 121 123 local root_dir
= type( config.root_dir )
== 'string' and config.root_dir
or config.root_dir( buffer_path )
192 194 local old_omnifunc
193 195 local old_tagfunc
196 -local add = function ( client_id, keybind_remover )
198 +local add = function ( client_id, keybind_remover )
198 200 client_id = { client_id,
'number', },
199 201 keybind_remover = { keybind_remover,
'function', },
204 206 table.
insert( keybinds[client_id], keybind_remover )
207 -local lsp_attach = function ( args )
209 +local lsp_attach = function ( args )
208 210 local bufnr
= args.buf
209 211 local client_id
= args.data.client_id
210 212 local client
= vim.lsp.get_client_by_id( client_id )
364 -local lsp_detach = function ( args )
366 +local lsp_detach = function ( args )
365 367 debug.print(
'DETACH LSP', args )
367 369 local bufnr
= args.buf
neovim/lua/bugabinga/options/behaviour.lua
Modified 35 35 vim.opt.smartindent
= true 37 37 vim.opt.autoindent
= true 38 38 vim.opt.copyindent
= true 100 100 if table.contains( ignored.filetypes, filetype )
then return end 101 101 local buftype
= vim.api.nvim_buf_get_option( buffer,
'buftype' )
102 102 if table.contains( ignored.buftypes, buftype )
then return end 103 - local project
= project.find_root_by_filetype( file, filetype )
104 - if not project
then return end 105 - local root
= vim.fs.normalize(project)
103 + local project_root
= project.find_root_by_filetype( file, filetype )
104 + if not project_root
then return end 105 + local root
= vim.fs.normalize( project_root )
106 106 local cwd
= vim.fs.normalize( vim.uv.cwd() )
107 107 if root
and cwd
~= root
then 108 108 vim.uv.chdir( root )
neovim/lua/bugabinga/options/keymaps.lua
Modified 1 1 local map
= require 'std.map' 2 +local const
= require 'bugabinga.const' 2 3 local togglers
= require 'bugabinga.options.togglers' 18 19 local current_buffer
= 0 19 20 local current_line
= vim.api.nvim_win_get_cursor( current_buffer )[
1]
20 21 local strict_indexing
= false 21 - local newline
= {
'' }
22 + local newline
= {
'', }
22 23 vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )
31 32 local current_buffer
= 0 32 33 local current_line
= vim.api.nvim_win_get_cursor( current_buffer )[
1]
- 1 33 34 local strict_indexing
= false 34 - local newline
= {
'' }
35 + local newline
= {
'', }
36 37 vim.api.nvim_buf_set_lines( current_buffer, current_line, current_line, strict_indexing, newline )
84 - description =
'system clipboard motion',
85 - category =
'editing',
91 - description =
'Cycle through autocomplete popup',
92 - category =
'editing',
94 - options = {
expr =
true },
95 - command =
function ()
return vim.fn.pumvisible()
== 1 and '<C-n>' or '<tab>' end,
99 -local win32
= vim.loop.os_uname().sysname:match
'Win' 100 -local wsl2
= vim.loop.os_uname().release:match
'WSL2' 102 83 local function open_link_under_cursor()
104 85 local file_under_cursor
= vim.fn.expand
'<cfile>' 107 88 if file_under_cursor
and file_under_cursor:match
'%a+://.+' then 110 - (win32
or wsl2)
and {
'cmd.exe',
'/C',
'start',
'msedge', file_under_cursor }
111 - or {
'firefox', file_under_cursor },
91 + (const.win32
or const.wsl2)
and {
'cmd.exe',
'/C',
'start',
'msedge', file_under_cursor, }
92 + or {
'firefox', file_under_cursor, },
113 94 function ( completed )
114 95 if completed.code
== 0 then 115 - vim.schedule(
function () vim.notify(
'Opened ' .. file_under_cursor )
end )
96 + vim.schedule(
function ()
97 + vim.notify(
'Opened ' .. file_under_cursor )
117 100 error(
'Failed to open ' .. file_under_cursor
.. ' because: ' .. completed.stderr )
130 113 command
= open_link_under_cursor,
134 - description =
'Grep search for word under cursor',
135 - category =
'search',
137 - command =
'<cmd>grep <cword> . <cr>',
141 117 description =
'Dismiss current search highlight',
142 118 category =
'search',
143 119 keys =
'<esc><esc>',
144 - command =
function () vim.cmd
[[ nohlsearch ]] end,
120 + command =
function ()
121 + vim.cmd
[[ nohlsearch ]] 150 128 keys
= '<leader>tt',
151 129 command = function ()
152 131 if vim.opt.background:get()
== 'dark' then 153 132 vim.opt.background
= 'light' 155 134 vim.opt.background
= 'dark' 157 137 vim.notify(
'Toggled background to ' .. vim.opt.background:get()
.. '.' )
179 159 command
= vim.cmd.redo,
183 - description =
'Run save actions',
186 - command =
function ()
188 - vim.cmd
'TrimTrailingWhitespace' 191 - vim.lsp.buf.format {
async =
false }
200 - vim.api.nvim_feedkeys(
'zz',
'n',
true )
204 162 for _, toggler
in ipairs( togglers )
do 205 163 local option_name
= toggler.options[
1].name
206 164 local first_char
= string.
sub( option_name,
1,
1 )
209 167 description
= 'Toggle ' .. option_name
.. ' option',
210 168 category
= 'options',
211 169 keys
= '<leader>to' .. first_char,
212 - command = function () toggler:toggle()
end,
170 + command = function ()
neovim/lua/bugabinga/options/ui.lua
Modified 3 3 local icon
= require 'std.icon' 4 4 local auto
= require 'std.auto' 5 5 local ignored
= require 'std.ignored' 7 7 auto
'highlight_yanked_text' {
8 - description =
'briefly highlight yanked text',
9 - events =
'TextYankPost',
11 - command =
function () vim.highlight.on_yank()
end,
8 + description =
'briefly highlight yanked text',
9 + events =
'TextYankPost',
11 + command =
function () vim.highlight.on_yank()
end,
14 14 auto
'disable_columns_in_special_buffers' {
15 - description =
'Hide columns in buffers, that do not show source code.',
16 - events = {
'FileType', },
17 - pattern = ignored.filetypes,
18 - command =
function ()
19 - vim.opt_local.colorcolumn
= {}
20 - vim.opt_local.signcolumn
= 'no' 21 - vim.opt_local.foldcolumn
= '0' 22 - vim.opt_local.number
= false 15 + description =
'Hide columns in buffers, that do not show source code.',
16 + events = {
'FileType', },
17 + pattern = ignored.filetypes,
18 + command =
function ()
19 + vim.opt_local.colorcolumn
= {}
20 + vim.opt_local.signcolumn
= 'no' 21 + vim.opt_local.foldcolumn
= '0' 22 + vim.opt_local.number
= false 27 27 vim.opt.list
= true 28 28 vim.opt.listchars
= {
33 - extends = icon.extends,
34 - precedes = icon.precedes,
31 + tab = icon.tab
.. icon.middle_ellipsis,
33 + extends = icon.extends,
34 + precedes = icon.precedes,
55 55 vim.opt.fillchars
= {
110 110 local is_tty
= os.
getenv 'XDG_SESSION_TYPE' == 'tty' and os.
getenv 'SSH_TTY' == '' 112 - vim.opt.termguicolors
= false 113 - vim.g.nerdfont
= false 114 - vim.opt.lazyredraw
= true 112 + vim.opt.termguicolors
= false 113 + vim.g.nerdfont
= false 114 + vim.opt.lazyredraw
= true 116 - vim.opt.termguicolors
= true 117 - vim.g.nerdfont
= true 118 - vim.opt.lazyredraw
= false 116 + vim.opt.termguicolors
= true 117 + vim.g.nerdfont
= true 118 + vim.opt.lazyredraw
= false 134 134 if vim.g.neovide
then 139 - vim.g.neovide_remember_window_size
= true 140 - vim.g.neovide_profiler
= false 143 - vim.g.neovide_cursor_vfx_mode
= 'railgun' 145 - vim.g.neovide_cursor_antialiasing
= true 146 - vim.g.neovide_padding_top
= 0 147 - vim.g.neovide_padding_bottom
= 0 148 - vim.g.neovide_padding_right
= 0 149 - vim.g.neovide_padding_left
= 0 150 - vim.g.neovide_hide_mouse_when_typing
= true 151 - vim.g.neovide_theme
= 'auto' 152 - vim.g.neovide_refresh_rate
= vim.uv.os_gethostname()
== 'pop-os' and 144 or 60 153 - vim.g.neovide_refresh_rate_idle
= 5 139 + vim.g.neovide_remember_window_size
= true 140 + vim.g.neovide_profiler
= false 143 + vim.g.neovide_cursor_vfx_mode
= 'railgun' 145 + vim.g.neovide_cursor_antialiasing
= true 146 + vim.g.neovide_padding_top
= 0 147 + vim.g.neovide_padding_bottom
= 0 148 + vim.g.neovide_padding_right
= 0 149 + vim.g.neovide_padding_left
= 0 150 + vim.g.neovide_hide_mouse_when_typing
= true 151 + vim.g.neovide_theme
= 'auto' 152 + vim.g.neovide_refresh_rate
= vim.uv.os_gethostname()
== 'pop-os' and 144 or 60 153 + vim.g.neovide_refresh_rate_idle
= 5 neovim/lua/bugabinga/plugins/aerial.lua
Modified 57 + nerd_font
= vim.g.nerdfont,
neovim/lua/bugabinga/plugins/format.lua
Modified 1 +local debug = require 'std.debug' 2 +local map
= require 'std.map' 4 +local format = function ()
5 + require 'conform'.format( {
async =
false,
lsp_fallback =
true, },
function ( err )
6 + if err
and debug.get()
then 7 + vim.print(
'Format failed', err )
13 + description =
'Format buffer',
14 + category =
'format',
20 +vim.api.nvim_create_user_command(
'Format', format, {} )
3 23 'stevearc/conform.nvim',
4 - event = {
'BufWritePre', },
5 24 cmd = {
'ConformInfo', },
10 - require 'conform'.format( {
async =
true,
lsp_fallback =
true, },
function ( err )
12 - if vim.startswith( vim.api.nvim_get_mode().mode:lower(),
'v' )
then 13 - vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes(
'<Esc>',
true,
false,
true ),
'n',
true )
19 - desc =
'Format buffer',
23 26 formatters_by_ft = {
24 - markdown = {
'injected', },
25 - norg = {
'injected', },
26 - lua = {
'stylua', },
27 - go = {
'goimports',
'gofmt', },
30 + toml = {
'taplo', },
29 33 zig = {
'zigfmt', },
35 + [
'*'] = {
'injected',
'typos', },
30 38 [
'_'] = {
'trim_whitespace',
'trim_newlines', },
35 - lang_to_formatters = {
41 - prepend_args = {
'-i',
'2', },
43 + prepend_args = {
'--end-markers',
'?!.', },
44 - log_level = vim.log.levels.TRACE,
45 - format_after_save =
function ( bufnr )
46 - if vim.b[bufnr].disable_autoformat
then 49 - return {
timeout_ms =
5000,
lsp_fallback =
true, }
46 + log_level =
debug.get()
and vim.log.levels.TRACE
or vim.log.levels.INFO,
52 - init =
function () vim.o.formatexpr
= "v:lua.require'conform'.formatexpr()" end,
49 + vim.o.formatexpr
= "v:lua.require'conform'.formatexpr()" neovim/lua/bugabinga/plugins/mason.lua
Modified 2 - 'williamboman/mason.nvim',
2 + "williamboman/mason.nvim",
14 - 'WhoIsSethDaniel/mason-tool-installer.nvim',
14 + "WhoIsSethDaniel/mason-tool-installer.nvim",
17 17 ensure_installed = {
18 - 'lua-language-server',
20 - 'editorconfig-checker',
24 - 'java-debug-adapter',
18 + "lua-language-server",
20 + "editorconfig-checker",
24 + "java-debug-adapter",
neovim/lua/bugabinga/plugins/quickfix.lua
Modified 1 +local map
= require 'std.map' 4 + description =
'Grep search for word under cursor',
7 + command =
'<cmd>cclose <bar> Grep <cword><cr>',
11 + description =
'Goto next quickfix item',
12 + category =
'navigation',
14 + command =
'<cmd>QNext<cr>',
18 + description =
'Goto previous quickfix item',
19 + category =
'navigation',
21 + command =
'<cmd>QPrev<cr>',
25 + description =
'Toggle open quickfix window',
26 + category =
'navigation',
28 + command =
'<cmd>QFToggle!<CR>',
32 + description =
'Toggle open loclist window',
33 + category =
'navigation',
35 + command =
'<cmd>LLToggle!<CR>',
3 39 'stevearc/qf_helper.nvim',
5 41 cmd = {
'QNext',
'QPrev',
'QFToggle',
'QFOpen',
'LLToggle', },
7 - {
']q',
'<cmd>QNext<CR>',
mode =
'n', },
8 - {
'[q',
'<cmd>QPrev<CR>',
mode =
'n', },
9 - {
'<leader>q',
'<cmd>QFToggle!<CR>',
mode =
'n', },
10 - {
'<leader>l',
'<cmd>LLToggle!<CR>',
mode =
'n', },
43 + prefer_loclist =
false,
12 - config =
function ()
13 - require 'qf_helper'.setup {
14 - prefer_loclist =
false,
neovim/lua/bugabinga/plugins/telescope.lua
Modified 11 11 local map
= require 'std.map' 12 12 local icon
= require 'std.icon' 13 -local table = require 'std.table' 16 15 description =
'Switch to recently used folders',
137 + keymaps = dropdown,
138 + diagnostics = dropdown,
141 + current_buffer_fuzzy_find = cursor,
147 146 zoxide = {
prompt_title =
'Navigate deez nuts!', },
neovim/lua/bugabinga/plugins/tint.lua
Modified1 -return {
'levouh/tint.nvim',
opts = {}, }
3 + event = {
'WinNew',
'SessionLoadPost', },
neovim/lua/bugabinga/plugins/toggleterm.lua
Modified30 30 toggleterm.setup( opts )
32 32 local set_terminal_keymaps = function ()
33 - local local_to_buffer
= {
buffer =
0, }
35 34 description =
'Quit insert mode',
36 35 category =
'terminal',
38 - options = local_to_buffer,
39 38 command =
[[ <C-\><C-n> ]],
41 + vim.opt_local.spell
= false 43 44 auto
'normalize_terminal_windows' {
neovim/lua/bugabinga/save_actions.lua
Addednew file mode 100644 1 +local map
= require 'std.map' 2 +local localrc
= require 'std.localrc' 4 +local global_actions
= vim.g.save_actions
or {}
5 +local project_local_actions
= localrc(
'.save.actions.lua',
'table' )
or {}
6 +local all_actions
= vim.tbl_deep_extend(
'force', global_actions, project_local_actions )
8 +local apply_save_actions = function ( options )
9 + options
= options
or {}
11 + vim.iter( all_actions ):each(
14 + action = { action,
'string', },
16 + local user_command
= vim.api.nvim_parse_cmd( action, {} )
17 + vim.api.nvim_cmd( user_command, {
output =
not options.bang, } )
26 +vim.api.nvim_create_user_command(
'SaveActions', apply_save_actions, {
bang =
true, } )
29 + description =
'Save all buffers and apply save actions',
30 + category =
'actions',
32 + command =
'<cmd>SaveActions<cr>',
neovim/lua/bugabinga/trim.lua
Deleteddeleted file mode 100644 3 -local function trim_space_preview(opts, preview_ns, preview_buf)
4 - vim.cmd(
'hi clear Whitespace')
5 - local line1
= opts.line1
6 - local line2
= opts.line2
7 - local buf
= vim.api.nvim_get_current_buf()
8 - local lines
= vim.api.nvim_buf_get_lines(buf, line1
- 1, line2,
false)
9 - local preview_buf_line
= 0 10 - for i, line
in ipairs(lines)
do 11 - local start_idx, end_idx
= string.
find(line,
'%s+$')
14 - vim.api.nvim_buf_add_highlight(
25 - local prefix
= string.
format(
'|%d| ', line1
+ i
- 1)
26 - vim.api.nvim_buf_set_lines(
33 - vim.api.nvim_buf_add_highlight(
38 - #prefix
+ start_idx
- 1,
41 - preview_buf_line
= preview_buf_line
+ 1 49 -local function trim_space(opts)
50 - local line1
= opts.line1
51 - local line2
= opts.line2
52 - local buf
= vim.api.nvim_get_current_buf()
53 - local lines
= vim.api.nvim_buf_get_lines(buf, line1
- 1, line2,
false)
54 - local new_lines
= {}
55 - for i, line
in ipairs(lines)
do 56 - new_lines[i]
= string.
gsub(line,
'%s+$',
'')
58 - vim.api.nvim_buf_set_lines(buf, line1
- 1, line2,
false, new_lines)
61 -vim.api.nvim_create_user_command(
62 - 'TrimTrailingWhitespace',
64 - {
nargs =
'?',
range =
'%',
addr =
'lines',
preview = trim_space_preview }
neovim/lua/std/debug.lua
Modified18 18 vim.notify(
'Toggled debug mode to ' .. tostring( is_debug_mode() ) )
21 22 vim.api.nvim_create_user_command(
'Debug', toggle_debug_mode, {} )
neovim/lua/std/icon.lua
Modified 52 + middle_ellipsis
= '⋯',
neovim/lua/std/localrc.lua
Modified1 -return function ( file_name )
1 +local debug = require 'std.debug' 9 +return function ( file_name, validator )
2 10 local filepath
= vim.fn.fnamemodify( file_name,
':p' )
3 11 local file
= vim.secure.read( filepath )
7 - return loadstring( file )()
15 + local value, err
= loadstring( file )()
17 + debug.print(
'unable to load ' .. file_name
.. '. ' .. err )
19 + local validator_type
= type( validator )
20 + if validator_type
== 'string' or validator_type
== table then 21 + local expected_types
= validator_type
== table and validator
or { validator, }
22 + local value_type
= type( value )
23 + local is_valid
= vim.iter( expected_types ):any(
function ( t )
return t
== value_type
end )
24 + return is_valid
and value
or nil 26 + return validator( value )
and value
or nil neovim/lua/std/map.lua
Modified 1 1 local available_modes
= {
2 - normal_visual_select_operator_pending =
'',
2 + normal_visual_select_operator_pending =
"",
13 - visual_select =
'v',
14 + visual_select =
"v",
19 - operator_pending =
'o',
20 + operator_pending =
"o",
23 - insert_command_line =
'!',
24 + insert_command_line =
"!",
32 -local bind = function ( self, map )
34 - map = { map,
'table', },
35 - [
'map.keys'] = { map.keys, {
'string',
'table', }, },
36 - [
'map.command'] = { map.command, {
'function',
'string', }, },
33 +local bind = function(self, map)
35 + map = { map,
"table" },
36 + [
"map.keys"] = { map.keys, {
"string",
"table" } },
37 + [
"map.command"] = { map.command, {
"function",
"string" } },
39 40 local keys
= map.keys
40 41 local command
= map.command
42 43 map.options
= map.options
or {}
44 45 if map.category
and map.description
then 45 - map.description
= map.category
.. ': ' .. map.description
46 + map.description
= map.category
.. ": " .. map.description
48 - local options
= vim.tbl_extend(
'keep', map.options, {
49 + local options
= vim.tbl_extend(
"keep", map.options, {
50 51 desc = map.description,
53 - if vim.tbl_isempty( self.modes )
then self.modes[
1]
= available_modes.normal_visual_select_operator_pending
end 54 + if vim.tbl_isempty(self.modes)
then 55 + self.modes[
1]
= available_modes.normal_visual_select_operator_pending
55 - if type( keys )
== 'table' then 56 - for _, key
in ipairs( keys )
do 57 - vim.keymap.set( self.modes, key, command, options )
58 + if type(keys)
== "table" then 59 + for _, key
in ipairs(keys)
do 60 + vim.keymap.set(self.modes, key, command, options)
60 - vim.keymap.set( self.modes, keys, command, options )
63 + vim.keymap.set(self.modes, keys, command, options)
66 - local delete_options
= options.buffer
and {
buffer = options.buffer, }
or {}
67 - if type( keys )
== 'table' then 68 - for _, key
in ipairs( keys )
do 69 - vim.keymap.del( self.modes, key, delete_options )
69 + local delete_options
= options.buffer
and {
buffer = options.buffer }
or {}
70 + if type(keys)
== "table" then 71 + for _, key
in ipairs(keys)
do 72 + vim.keymap.del(self.modes, key, delete_options)
72 - vim.keymap.del( self.modes, keys, delete_options )
75 + vim.keymap.del(self.modes, keys, delete_options)
77 -local add_mode = function ( self, key )
80 +local add_mode = function(self, key)
78 81 local new_mode
= available_modes[key]
79 - if new_mode
== nil then error(
'unknown keymap mode requested: ' .. key )
end 82 + if new_mode
== nil then 83 + error(
"unknown keymap mode requested: " .. key)
80 85 if not self.modes[new_mode]
then 81 - table.
insert( self.modes, new_mode )
86 + table.
insert(self.modes, new_mode)
87 -local map
= setmetatable(
92 +local map
= setmetatable({
neovim/lua/std/project.lua
Modified 34 34 local MAX_TRAVERSAL_COUNT
= 100 164 164 local function find_project_root( path, markers )
166 166 local default_markers
= {
167 - {
name =
'.project_model.lua',
weight = DEFINITLY, },
168 - {
name =
'.lazy.specs.lua',
weight = DEFINITLY, },
169 - {
name =
'.editorconfig',
weight = LIKELY, },
170 - {
name =
'.git',
weight = LIKELY, },
171 - {
name =
'.gitignore',
weight = LIKELY, },
172 - {
name =
'.svn',
weight = LIKELY, },
173 - {
name =
'justfile',
weight = LIKELY, },
174 - {
name =
'Makefile',
weight = LIKELY, },
175 - {
name =
'Jenkinsfile',
weight = MAYBE, },
176 - {
name =
'LICENSE',
weight = MAYBE, },
177 - {
name =
'LICENSE.md',
weight = MAYBE, },
178 - {
name =
'LICENSE.txt',
weight = MAYBE, },
179 - {
name =
'COPYING',
weight = MAYBE, },
180 - {
name =
'README',
weight = MAYBE, },
181 - {
name =
'README.md',
weight = MAYBE, },
182 - {
name =
'flake.nix',
weight = MAYBE, },
183 - {
name =
'flake.nix',
weight = MAYBE, },
167 + {
name =
'.save.actions.lua',
weight = DEFINITELY, },
168 + {
name =
'.lsp.settings.lua',
weight = DEFINITELY, },
169 + {
name =
'.lazy.specs.lua',
weight = DEFINITELY, },
170 + {
name =
'.editorconfig',
weight = LIKELY, },
171 + {
name =
'.git',
weight = LIKELY, },
172 + {
name =
'.gitignore',
weight = LIKELY, },
173 + {
name =
'.svn',
weight = LIKELY, },
174 + {
name =
'justfile',
weight = LIKELY, },
175 + {
name =
'Makefile',
weight = LIKELY, },
176 + {
name =
'Jenkinsfile',
weight = MAYBE, },
177 + {
name =
'LICENSE',
weight = MAYBE, },
178 + {
name =
'LICENSE.md',
weight = MAYBE, },
179 + {
name =
'LICENSE.txt',
weight = MAYBE, },
180 + {
name =
'COPYING',
weight = MAYBE, },
181 + {
name =
'README',
weight = MAYBE, },
182 + {
name =
'README.md',
weight = MAYBE, },
183 + {
name =
'flake.nix',
weight = MAYBE, },
184 + {
name =
'flake.nix',
weight = MAYBE, },
186 187 markers
= markers
or {}
199 200 {
name =
'.project',
weight = LIKELY, },
200 201 {
name =
'target',
weight = LIKELY, },
201 202 {
name =
'pom.xml',
weight = LIKELY, },
202 - {
name =
'mvnw',
weight = DEFINITLY, },
203 - {
name =
'.mvn',
weight = DEFINITLY, },
204 - {
name =
'mvnw.cmd',
weight = DEFINITLY, },
205 - {
name =
'build.gradle',
weight = DEFINITLY, },
206 - {
name =
'gradle.properties',
weight = DEFINITLY, },
207 - {
name =
'settings.gradle',
weight = DEFINITLY, },
208 - {
name =
'gradlew',
weight = DEFINITLY, },
209 - {
name =
'gradlew.bat',
weight = DEFINITLY, },
203 + {
name =
'mvnw',
weight = DEFINITELY, },
204 + {
name =
'.mvn',
weight = DEFINITELY, },
205 + {
name =
'mvnw.cmd',
weight = DEFINITELY, },
206 + {
name =
'build.gradle',
weight = DEFINITELY, },
207 + {
name =
'gradle.properties',
weight = DEFINITELY, },
208 + {
name =
'settings.gradle',
weight = DEFINITELY, },
209 + {
name =
'gradlew',
weight = DEFINITELY, },
210 + {
name =
'gradlew.bat',
weight = DEFINITELY, },
211 212 return find_project_root( path, java_markers )
230 231 local find_zig_project_root = function ( path )
231 232 local zig_markers
= {
232 - {
name =
'build.zig',
weight = DEFINITLY, },
233 - {
name =
'zls.build.json',
weight = DEFINITLY, },
233 + {
name =
'build.zig',
weight = DEFINITELY, },
234 + {
name =
'zls.build.json',
weight = DEFINITELY, },
234 235 {
name =
'zig-cache',
weight = MAYBE, },
235 236 {
name =
'zig-out',
weight = MAYBE, },
242 243 local find_rust_project_root = function ( path )
243 244 local markers
= {
244 - {
name =
'Cargo.toml',
weight = DEFINITLY, },
245 + {
name =
'Cargo.toml',
weight = DEFINITELY, },
246 247 local cargo_crate_dir
= find_project_root( path, markers )
247 248 if cargo_crate_dir
== nil then return nil end neovim/neovim/lua/bugabinga/plugins/lush.lua
Deleteddeleted file mode 100644neovim/spell/nerd.utf-8.add
Modifiedneovim/spell/nerd.utf-8.add.spl
ModifiedPrevious version contains binary or non-UTF-8 data.
Current version contains binary or non-UTF-8 data.