🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

style: fmt

robin bf591949 24def90d

+145 -136
+3 -3
config/after/plugin/winbar.lua
··· 35 35 end 36 36 37 37 local name = vim.api.nvim_buf_get_name(buf) 38 - local m = string.match(name, '^%w+://') 39 - if m ~= 'file://' then 38 + local m = string.match(name, "^%w+://") 39 + if m ~= "file://" then 40 40 return 41 41 end 42 42 43 43 vim.g.winbar = winbar.current 44 - vim.api.nvim_set_option_value("winbar", '%!v:lua.vim.g.winbar()', { scope = "local" }) 44 + vim.api.nvim_set_option_value("winbar", "%!v:lua.vim.g.winbar()", { scope = "local" }) 45 45 end 46 46 47 47 local function getfilename()
+1 -1
config/lua/ivy/config/autocmds.lua
··· 18 18 group = vim.api.nvim_create_augroup("editor:macro:print", { clear = true }), 19 19 callback = function(data) 20 20 local msg = data.event == "RecordingEnter" and "Recording macro..." or "Macro recorded" 21 - vim.api.nvim_echo({ { msg, "ModeMsg" } }, false, { }) 21 + vim.api.nvim_echo({ { msg, "ModeMsg" } }, false, {}) 22 22 end, 23 23 desc = "Notify when recording macro", 24 24 })
+8 -11
config/lua/ivy/config/keybinds.lua
··· 2 2 local keymaps = require("keymaps").setup() 3 3 4 4 local function kmgroup(mappings) 5 - coroutine.wrap(function () 5 + coroutine.wrap(function() 6 6 vim.iter(ipairs(mappings)):each(function(_, map) 7 7 if #map < 4 then 8 - vim.notify( 9 - string.format("[%s] %s", "kmgroup", "requires 4 paramaters per keymap"), 10 - vim.log.levels.WARN 11 - ) 8 + vim.notify(string.format("[%s] %s", "kmgroup", "requires 4 paramaters per keymap"), vim.log.levels.WARN) 12 9 return 13 10 end 14 11 local mode = map[1] ··· 16 13 local rhs = map[3] 17 14 local desc = map[4] 18 15 19 - vim.schedule(function() 20 - vim.keymap.set(mode, lhs, rhs, { noremap = true, silent = true, desc = desc }) 21 - end) 16 + vim.schedule(function() 17 + vim.keymap.set(mode, lhs, rhs, { noremap = true, silent = true, desc = desc }) 18 + end) 22 19 end) 23 20 end)() 24 21 end 25 22 26 23 local function directionalmap(mode, lhs, f, fmt) 27 - vim.iter(ipairs({ {"h", "left"}, {"j", "down"}, {"k", "up"}, {"l", "right"} })):each(function(_, map) 24 + vim.iter(ipairs({ { "h", "left" }, { "j", "down" }, { "k", "up" }, { "l", "right" } })):each(function(_, map) 28 25 local d = map[1] 29 26 local _lhs = lhs:format(d) 30 27 local direction = map[2] ··· 135 132 vim.keymap.set("v", ";", "iw", { desc = "select inside word" }) 136 133 137 134 -- [edit] 138 - vim.keymap.set({'n', 'v'}, "C", "\"_c", { desc = "non-copy change" }) 139 - vim.keymap.set({'n', 'v'}, "D", "\"_d", { desc = "non-copy delete" }) 135 + vim.keymap.set({ "n", "v" }, "C", '"_c', { desc = "non-copy change" }) 136 + vim.keymap.set({ "n", "v" }, "D", '"_d', { desc = "non-copy delete" }) 140 137 vim.keymap.set("n", "<leader>D", "0d$", { desc = "clear current line" }) 141 138 142 139 -- [quickfix]
+1 -1
config/lua/ivy/config/lsp.lua
··· 8 8 ---@diagnostic disable-next-line: param-type-mismatch 9 9 local ok, result = pcall(vim.lsp.config, name, cfg) 10 10 if not ok then 11 - vim.notify(('unable to configure lsp server %s:\n\t%s'):format(name, result)) 11 + vim.notify(("unable to configure lsp server %s:\n\t%s"):format(name, result)) 12 12 return 13 13 end 14 14 vim.lsp.enable(name)
+1 -1
config/lua/ivy/config/neovide.lua
··· 41 41 vim.opt.guifont = { 42 42 "Maple Mono", 43 43 "Symbols Nerd Font", 44 - string.format(":h%d", vim.g.fontsize) 44 + string.format(":h%d", vim.g.fontsize), 45 45 } 46 46 vim.g.lineheight = 1.2 47 47
+1 -1
config/lua/ivy/config/options.lua
··· 204 204 }, 205 205 } 206 206 207 - vim.g.border_style = 'single' 207 + vim.g.border_style = "single" 208 208 -- my custom borderchars 209 209 vim.g.bc = borderchars[vim.g.border_style] 210 210 vim.g.bc_all = {
+41 -39
config/lua/ivy/init.lua
··· 24 24 on_init = function(client) 25 25 if client.workspace_folders then 26 26 local path = client.workspace_folders[1].name 27 - if path ~= vim.fn.stdpath('config') and (vim.uv.fs_stat(path .. '/.luarc.json') or vim.uv.fs_stat(path .. '/.luarc.jsonc')) 27 + if 28 + path ~= vim.fn.stdpath("config") 29 + and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc")) 28 30 then 29 31 return 30 32 end 31 33 end 32 - client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { 34 + client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { 33 35 workspace = { 34 36 checkThirdParty = false, 35 37 library = { 36 - vim.env.VIMRUNTIME 38 + vim.env.VIMRUNTIME, 37 39 -- Depending on the usage, you might want to add additional paths here. 38 40 -- "${3rd}/luv/library" 39 41 }, ··· 43 45 settings = { 44 46 Lua = { 45 47 runtime = { 46 - version = 'LuaJIT', 48 + version = "LuaJIT", 47 49 path = { 48 - 'lua/?.lua', 49 - 'lua/?/init.lua', 50 + "lua/?.lua", 51 + "lua/?/init.lua", 50 52 }, 51 53 }, 52 54 diagnostics = { ··· 74 76 schemas = vim.tbl_extend("keep", { 75 77 ["https://json.schemastore.org/github-action"] = ".github/action.{yaml,yml}", 76 78 ["https://json.schemastore.org/github-workflow"] = ".github/workflows/*", 77 - ["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = 78 - "*lab-ci.{yaml,yml}", 79 - ["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = 80 - "docker-compose.{yml,yaml}", 79 + ["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = "*lab-ci.{yaml,yml}", 80 + ["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "docker-compose.{yml,yaml}", 81 81 ["https://goreleaser.com/static/schema.json"] = ".goreleaser.{yml,yaml}", 82 82 }, require("schemastore").yaml.schemas()), 83 83 }, ··· 124 124 end, 125 125 } 126 126 127 - local config_base = 'ivy.config' 127 + local config_base = "ivy.config" 128 128 129 129 local load_cfg = function(name) 130 - local mod = config_base .. '.' .. name 130 + local mod = config_base .. "." .. name 131 131 local ok, result = pcall(require, mod) 132 132 if not ok then 133 - return vim.notify('error loading ' .. mod .. ':\n\t' .. result, vim.log.levels.ERROR) 133 + return vim.notify("error loading " .. mod .. ":\n\t" .. result, vim.log.levels.ERROR) 134 134 end 135 135 return result 136 136 end 137 137 138 - vim.iter(ipairs({ 139 - {'disable'}, 140 - {'autocmds'}, 141 - {'cmds', event = 'VimEnter'}, 142 - {'ft'}, 143 - {'keybinds', event = 'UIEnter'}, 144 - {'lsp', event = { 'BufReadPre', 'BufNewFile' }}, 145 - {'neovide', event = 'UIEnter'}, 146 - {'options'}, 147 - })):each(function(_, opts) 148 - local name = opts[1] 149 - if not name then 150 - return 151 - end 152 - if opts.event then 153 - vim.api.nvim_create_autocmd(opts.event, { 154 - group = vim.api.nvim_create_augroup('ivy:' .. vim.inspect(opts.event) .. '[' .. name .. ']', { clear = true }), 155 - callback = function(_) 156 - load_cfg(name) 157 - end, 158 - once = true, 159 - }) 160 - return 161 - end 162 - load_cfg(name) 163 - end) 138 + vim 139 + .iter(ipairs({ 140 + { "disable" }, 141 + { "autocmds" }, 142 + { "cmds", event = "VimEnter" }, 143 + { "ft" }, 144 + { "keybinds", event = "UIEnter" }, 145 + { "lsp", event = { "BufReadPre", "BufNewFile" } }, 146 + { "neovide", event = "UIEnter" }, 147 + { "options" }, 148 + })) 149 + :each(function(_, opts) 150 + local name = opts[1] 151 + if not name then 152 + return 153 + end 154 + if opts.event then 155 + vim.api.nvim_create_autocmd(opts.event, { 156 + group = vim.api.nvim_create_augroup("ivy:" .. vim.inspect(opts.event) .. "[" .. name .. "]", { clear = true }), 157 + callback = function(_) 158 + load_cfg(name) 159 + end, 160 + once = true, 161 + }) 162 + return 163 + end 164 + load_cfg(name) 165 + end) 164 166 165 167 require("lz.n").load("ivy.plugins") 166 168
+2 -2
config/lua/ivy/plugins/code-snips.lua
··· 1 1 return { 2 2 { 3 3 "freeze.nvim", 4 - event = 'BufReadPost', 4 + event = "BufReadPost", 5 5 after = function() 6 6 vim.keymap.set("v", "<leader>sc", "<cmd>Freeze<cr>") 7 7 ··· 18 18 }, 19 19 { 20 20 "sayama.nvim", 21 - event = 'BufReadPost', 21 + event = "BufReadPost", 22 22 after = function() 23 23 require("sayama").setup({ 24 24 dir = vim.fn.glob("$XDG_DATA_HOME/zzz"),
+43 -41
config/lua/ivy/plugins/completion.lua
··· 3 3 "blink.cmp", 4 4 event = "DeferredUIEnter", 5 5 after = function() 6 - local ok, icons = pcall(require, 'mini.icons') 6 + local ok, icons = pcall(require, "mini.icons") 7 7 if not ok then 8 - vim.notify('could not find `mini.icons` module', vim.log.leves.WARN) 8 + vim.notify("could not find `mini.icons` module", vim.log.leves.WARN) 9 9 end 10 10 11 - require('lz.n').trigger_load({'windsurf.nvim'}) 11 + require("lz.n").trigger_load({ "windsurf.nvim" }) 12 12 13 13 local keymap = { 14 - preset = 'none', 14 + preset = "none", 15 15 ["<c-space>"] = { "show", "show_documentation", "hide_documentation" }, 16 - ['<C-e>'] = { 'hide' }, 17 - ['<CR>'] = { 'accept', 'fallback' }, 16 + ["<C-e>"] = { "hide" }, 17 + ["<CR>"] = { "accept", "fallback" }, 18 18 19 19 ["<tab>"] = { 20 20 "select_next", ··· 25 25 ["<down>"] = { "select_next", "fallback" }, 26 26 ["<up>"] = { "select_prev", "fallback" }, 27 27 28 - ['<c-b>'] = { 'scroll_documentation_up', 'fallback' }, 29 - ['<c-f>'] = { 'scroll_documentation_down', 'fallback' }, 28 + ["<c-b>"] = { "scroll_documentation_up", "fallback" }, 29 + ["<c-f>"] = { "scroll_documentation_down", "fallback" }, 30 30 } 31 31 32 32 local ok, result = pcall(require("blink.cmp").setup, { ··· 67 67 68 68 appearance = { 69 69 kind_icons = { 70 - Class = icons.get('lsp', 'class'), 71 - Color = icons.get('lsp', 'color'), 72 - Constant = icons.get('lsp', 'constant'), 73 - Constructor = icons.get('lsp', 'constructor'), 74 - Enum = icons.get('lsp', 'enum'), 75 - EnumMember = icons.get('lsp', 'enummember'), 76 - Event = icons.get('lsp', 'event'), 77 - Field = icons.get('lsp', 'field'), 78 - File = icons.get('lsp', 'file'), 79 - Folder = icons.get('lsp', 'folder'), 80 - Function = icons.get('lsp', 'function'), 81 - Interface = icons.get('lsp', 'interface'), 82 - Keyword = icons.get('lsp', 'keyword'), 83 - Method = icons.get('lsp', 'method'), 84 - Module = icons.get('lsp', 'module'), 85 - Operator = icons.get('lsp', 'operator'), 86 - Property = icons.get('lsp', 'property'), 87 - Reference = icons.get('lsp', 'reference'), 88 - Snippet = icons.get('lsp', 'snippet'), 89 - Struct = icons.get('lsp', 'struct'), 90 - Text = icons.get('lsp', 'text'), 91 - TypeParameter = icons.get('lsp', 'typeparameter'), 92 - Unit = icons.get('lsp', 'unit'), 93 - Value = icons.get('lsp', 'value'), 94 - Variable = icons.get('lsp', 'variable'), 70 + Class = icons.get("lsp", "class"), 71 + Color = icons.get("lsp", "color"), 72 + Constant = icons.get("lsp", "constant"), 73 + Constructor = icons.get("lsp", "constructor"), 74 + Enum = icons.get("lsp", "enum"), 75 + EnumMember = icons.get("lsp", "enummember"), 76 + Event = icons.get("lsp", "event"), 77 + Field = icons.get("lsp", "field"), 78 + File = icons.get("lsp", "file"), 79 + Folder = icons.get("lsp", "folder"), 80 + Function = icons.get("lsp", "function"), 81 + Interface = icons.get("lsp", "interface"), 82 + Keyword = icons.get("lsp", "keyword"), 83 + Method = icons.get("lsp", "method"), 84 + Module = icons.get("lsp", "module"), 85 + Operator = icons.get("lsp", "operator"), 86 + Property = icons.get("lsp", "property"), 87 + Reference = icons.get("lsp", "reference"), 88 + Snippet = icons.get("lsp", "snippet"), 89 + Struct = icons.get("lsp", "struct"), 90 + Text = icons.get("lsp", "text"), 91 + TypeParameter = icons.get("lsp", "typeparameter"), 92 + Unit = icons.get("lsp", "unit"), 93 + Value = icons.get("lsp", "value"), 94 + Variable = icons.get("lsp", "variable"), 95 95 }, 96 96 }, 97 97 ··· 111 111 min_width = vim.o.pumwidth, 112 112 max_height = vim.o.pumheight, 113 113 scrolloff = 0, 114 - border = 'none', 114 + border = "none", 115 115 116 116 draw = { 117 117 -- align_to = "label", -- or 'none' to disable, or 'cursor' to align to the cursor ··· 135 135 return ctx.kind_icon .. ctx.icon_gap 136 136 end, 137 137 highlight = function(ctx) 138 - local _, hl, _ = require('mini.icons').get('lsp', ctx.kind) 138 + local _, hl, _ = require("mini.icons").get("lsp", ctx.kind) 139 139 return hl 140 140 end, 141 141 }, 142 142 kind = { 143 143 highlight = function(ctx) 144 - local _, hl, _ = require('mini.icons').get('lsp', ctx.kind) 144 + local _, hl, _ = require("mini.icons").get("lsp", ctx.kind) 145 145 return hl 146 146 end, 147 - } 147 + }, 148 148 }, 149 149 }, 150 150 }, ··· 165 165 166 166 providers = { 167 167 windsurf = { 168 - name = 'windsurf', module = 'codeium.blink', async = true, 168 + name = "windsurf", 169 + module = "codeium.blink", 170 + async = true, 169 171 max_items = 2, 170 172 }, 171 173 }, ··· 177 179 if item.kind == require("blink.cmp.types").CompletionItemKind.Snippet then 178 180 item.score_offset = item.score_offset + 1 179 181 end 180 - if item.source == 'windsurf' then 182 + if item.source == "windsurf" then 181 183 item.score_offset = item.score_offset + 2 182 184 end 183 185 return item ··· 218 220 219 221 -- sources 220 222 { 221 - 'windsurf.nvim', 223 + "windsurf.nvim", 222 224 after = function() 223 - require('codeium').setup({ 225 + require("codeium").setup({ 224 226 enable_cmp_source = false, 225 227 }) 226 228 end,
+2 -2
config/lua/ivy/plugins/fzf.lua
··· 64 64 theme.git = { blame = { winopts = up }, commits = { winopts = up } } 65 65 theme.quickfix = theme.blines 66 66 theme.builtin = { winopts = theme.winopts } 67 - theme.colorschemes = { winopts = vim.tbl_deep_extend('force', theme.winopts, { 68 - height = 6 67 + theme.colorschemes = { winopts = vim.tbl_deep_extend("force", theme.winopts, { 68 + height = 6, 69 69 }) } 70 70 71 71 local opts = {
+15 -10
config/lua/ivy/plugins/init.lua
··· 223 223 }) 224 224 local keymaps = require("keymaps").setup() 225 225 keymaps.normal["<space>sp"] = { require("mini.files").open, "Open Files", group = "UI" } 226 - keymaps.normal["-"] = { function() 227 - require("mini.files").open(vim.api.nvim_buf_get_name(0)) 228 - end } 226 + keymaps.normal["-"] = { 227 + function() 228 + require("mini.files").open(vim.api.nvim_buf_get_name(0)) 229 + end, 230 + } 229 231 end, 230 232 }, 231 233 { ··· 246 248 } 247 249 require("mini.icons").setup({ 248 250 filetype = { 249 - qmljs = { glyph = '󰫾', hl = 'MiniIconsAzure' }, 251 + qmljs = { glyph = "󰫾", hl = "MiniIconsAzure" }, 250 252 tera = { glyph = "󰅩", hl = "MiniIconsOrange" }, 251 253 }, 252 254 file = { ··· 276 278 constant = { glyph = "󰏿" }, 277 279 constructor = { glyph = "󰒓" }, 278 280 event = { glyph = "󱐋" }, 279 - file = { glyph = '󰈚' }, 281 + file = { glyph = "󰈚" }, 280 282 ["function"] = { glyph = "󰊕" }, 281 283 property = { glyph = "󰖷" }, 282 284 snippet = { glyph = "󱄽" }, ··· 373 375 }, 374 376 375 377 -- lsp 376 - { "rainbow-delimiters.nvim", before = function () 377 - vim.g.rainbow_delimiters = { 378 - blacklist = { 'markdown', 'markdown_inline', 'help' }, 379 - } 380 - end }, 378 + { 379 + "rainbow-delimiters.nvim", 380 + before = function() 381 + vim.g.rainbow_delimiters = { 382 + blacklist = { "markdown", "markdown_inline", "help" }, 383 + } 384 + end, 385 + }, 381 386 382 387 -- rust lsp + formmating 383 388 {
+7 -7
config/lua/ivy/plugins/lsp.lua
··· 34 34 "nvim-lint", 35 35 event = "BufAdd", 36 36 after = function() 37 - require('lint').linters_by_ft = { 38 - nix = { 'deadnix', 'statix' }, 39 - lua = { 'selene' }, 40 - markdown = { 'proselint' }, 37 + require("lint").linters_by_ft = { 38 + nix = { "deadnix", "statix" }, 39 + lua = { "selene" }, 40 + markdown = { "proselint" }, 41 41 } 42 42 43 43 vim.api.nvim_create_autocmd({ "BufWritePost" }, { 44 - group = vim.api.nvim_create_augroup('nvim-lint:try_lint', { clear = true }), 44 + group = vim.api.nvim_create_augroup("nvim-lint:try_lint", { clear = true }), 45 45 callback = function() 46 46 require("lint").try_lint() 47 47 end, ··· 62 62 63 63 { 64 64 "quill.nvim", 65 - event = 'DeferredUIEnter', 65 + event = "DeferredUIEnter", 66 66 after = function() 67 67 -- require("quill").setup() 68 68 end, 69 69 }, 70 70 { 71 71 "symbol-usage.nvim", 72 - event = 'BufReadPost', 72 + event = "BufReadPost", 73 73 after = function() 74 74 local SymbolKind = vim.lsp.protocol.SymbolKind 75 75
+1 -1
config/lua/ivy/plugins/markdown.lua
··· 30 30 -- allow me to paste images really easy 31 31 { 32 32 "img-clip.nvim", 33 - ft = { 'markdown' }, 33 + ft = { "markdown" }, 34 34 after = function() 35 35 require("img-clip").setup({ 36 36 filetypes = {
+1 -1
config/lua/ivy/plugins/trouble.lua
··· 1 1 return { 2 2 { 3 3 "trouble.nvim", 4 - event = 'DeferredUIEnter', 4 + event = "DeferredUIEnter", 5 5 after = function() 6 6 local trouble = require("trouble") 7 7 trouble.setup({})
+18 -15
config/lua/ivy/plugins/ui.lua
··· 1 1 return { 2 2 { 3 3 "lualine.nvim", 4 - event = 'DeferredUIEnter', 4 + event = "DeferredUIEnter", 5 5 after = function() 6 6 local lualine_require = require("lualine_require") 7 7 lualine_require.require = require 8 8 9 9 local winbar = { 10 10 lualine_c = { 11 - { function() 12 - return "▌" 13 - end, color = "MiniIconsAzure" }, 11 + { 12 + function() 13 + return "▌" 14 + end, 15 + color = "MiniIconsAzure", 16 + }, 14 17 { "filename", path = 1 }, 15 18 "searchcount", 16 19 }, ··· 22 25 theme = "auto", 23 26 disabled_filetypes = { 24 27 statusline = { "dashboard", "alpha", "ministarter" }, 25 - winbar = { }, 28 + winbar = {}, 26 29 }, 27 30 component_separators = { left = "", right = "" }, 28 31 section_separators = { left = "", right = "" }, ··· 79 82 "tabby.nvim", 80 83 event = "DeferredUIEnter", 81 84 after = function() 82 - local left_sep = '' 83 - local right_sep = '' 85 + local left_sep = "" 86 + local right_sep = "" 84 87 85 - local C = require('evergarden.colors').get() 86 - local tab_hl = 'TabLine' 87 - local cur_hl = 'TabLineSel' 88 + local C = require("evergarden.colors").get() 89 + local tab_hl = "TabLine" 90 + local cur_hl = "TabLineSel" 88 91 local o = { 89 92 theme = { 90 93 fill = { fg = C.overlay0 }, ··· 103 106 line.sep(left_sep, hl, opt.theme.fill), 104 107 tab.in_jump_mode() and tab.jump_key() or { 105 108 tab.number(), 106 - margin = ' ', 109 + margin = " ", 107 110 }, 108 111 line.sep(right_sep, hl, opt.theme.fill), 109 112 hl = hl, 110 - margin = ' ', 113 + margin = " ", 111 114 } 112 115 end 113 116 ··· 118 121 win.buf_name(), 119 122 line.sep(right_sep, hl, opt.theme.fill), 120 123 hl = hl, 121 - margin = ' ', 124 + margin = " ", 122 125 } 123 126 end 124 127 require("tabby").setup({ ··· 136 139 } 137 140 end, 138 141 }) 139 - end 142 + end, 140 143 }, 141 144 142 145 { 143 146 "fidget.nvim", 144 - event = 'DeferredUIEnter', 147 + event = "DeferredUIEnter", 145 148 after = function() 146 149 require("fidget").setup({ 147 150 notification = {