diff --git a/flake.lock b/flake.lock index e7e8ab9..e9b7ce5 100644 --- a/flake.lock +++ b/flake.lock @@ -62,11 +62,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1685948350, - "narHash": "sha256-1FldJ059so0X/rScdbIiOlQbjjSNCCTdj2cUr5pHU4A=", + "lastModified": 1686747123, + "narHash": "sha256-XUQK9kwHpTeilHoad7L4LjMCCyY13Oq383CoFADecRE=", "owner": "serokell", "repo": "deploy-rs", - "rev": "65211db63ba1199f09b4c9f27e5eba5ec50d76ac", + "rev": "724463b5a94daa810abfc64a4f87faef4e00f984", "type": "github" }, "original": { @@ -301,11 +301,11 @@ "paisano": "paisano" }, "locked": { - "lastModified": 1686502488, - "narHash": "sha256-sLSiDkU9oNpcl1QEge0xVviD7N87iVdrwl7l9i+6mxQ=", + "lastModified": 1686781920, + "narHash": "sha256-1KHvvV2qcypAC6Zn+7HL+VxOuVttB3Iqrp/kDwLbqiI=", "owner": "divnix", "repo": "hive", - "rev": "e8b46fa4d2917dfd456f3f040e9761262b4648d2", + "rev": "a057e2df518c7ecb0dd14bd42661dc11129609c4", "type": "github" }, "original": { @@ -504,11 +504,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1686501370, - "narHash": "sha256-G0WuM9fqTPRc2URKP9Lgi5nhZMqsfHGrdEbrLvAPJcg=", + "lastModified": 1686592866, + "narHash": "sha256-riGg89eWhXJcPNrQGcSwTEEm7CGxWC06oSX44hajeMw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "75a5ebf473cd60148ba9aec0d219f72e5cf52519", + "rev": "0eeebd64de89e4163f4d3cf34ffe925a5cf67a05", "type": "github" }, "original": { diff --git a/native_configs/neovim/init.lua b/native_configs/neovim/init.lua index 5fcd059..38b72c8 100644 --- a/native_configs/neovim/init.lua +++ b/native_configs/neovim/init.lua @@ -1,5 +1,4 @@ --- What: Mono-file nvim configuration file Why: Easy to see through everything without needing to navigate thru files Features: --- - LSP +-- What: Mono-file nvim configuration file Why: Easy to see through everything without needing to navigate thru files Features: - LSP -- - Auto-complete (in insert mode: ctrl-space, navigate w/ Tab+S-Tab, confirm: Enter) -- - df to format document -- - Harpoon marks: Navigate through main files within each project @@ -29,10 +28,12 @@ for _, path in ipairs(vim.api.nvim_list_runtime_paths()) do end end +local wplug_log = require('plenary.log').new({ plugin = 'wplug_log', level = 'debug', use_console = false }) -- Do Plug if plugin not yet linked in `rtp`. This takes care of Nix-compatibility local function WPlug(plugin_path, ...) local plugin_name = string.lower(plugin_path:match("/([^/]+)$")) if not installed_plugins[plugin_name] then + wplug_log.info("Plugging " .. plugin_path) Plug(plugin_path, ...) end end @@ -262,6 +263,7 @@ vim.opt.listchars:append "eol:↴" require("indent_blankline").setup { show_end_of_line = true, space_char_blankline = " ", + } -- User command that transform into 2-spaces by translating to tabstop vim.api.nvim_create_user_command( @@ -535,7 +537,7 @@ require("inlay-hints").setup { -- renderer to use -- possible options are dynamic, eol, virtline and custom -- renderer = "inlay-hints/render/dynamic", - renderer = "inlay-hints/render/dynamic", + renderer = "inlay-hints/render/eol", hints = { parameter = { @@ -637,6 +639,42 @@ cmp.event:on( ) +---@alias EntryFilter {id: integer, compe: lsp.CompletionItem, return_type: string, return_type2: string, score: number, label: string, source_name: string, bufnr: number?, offset: number?, kind: lsp.CompletionItemKind } +---@param entry cmp.Entry +---@return EntryFilter +local function entry_filter_sync(entry) + local compe = entry:get_completion_item() + local return_type = compe.data and compe.data.return_type + local return_type2 = compe.detail + local score = entry.score + local label = compe.label + local source_name = entry.source.name + local bufnr = entry.context.bufnr + local offset = entry:get_offset() + local kind = entry:get_kind() + local id = entry.id + return { + id = id, + compe = compe, + return_type = return_type, + return_type2 = return_type2, + score = score, + label = label, + source_name = source_name, + bufnr = bufnr, + offset = offset, + kind = kind, + } +end + +---@param entry cmp.Entry +---@param callback fun(entry: EntryFilter): any +local function entry_filter(entry, callback) + entry:resolve(function() + callback(entry_filter_sync(entry)) + end) +end + ---@type cmp.ConfigSchema local cmp_config = { snippet = { @@ -645,7 +683,7 @@ local cmp_config = { end, }, mapping = cmp.mapping.preset.insert { - ['