From bc26d8569e738372e7df57f790a7f15ce8a7742f Mon Sep 17 00:00:00 2001 From: Tine Date: Tue, 6 Feb 2024 21:22:41 +0100 Subject: [PATCH] chore: changes --- nix/home.nix | 12 ++++++++---- nvim/lua/code_helpers.lua | 23 +++++++++++++---------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/nix/home.nix b/nix/home.nix index 2380ce2..06be305 100644 --- a/nix/home.nix +++ b/nix/home.nix @@ -30,6 +30,14 @@ fd fzf gnumake + age + sops + jq + yq + http-prompt + + # Docker + docker-compose # Nodejs nodejs_20 @@ -71,10 +79,6 @@ recursive = true; source = ../nvim; }; - "~/.local/bin/docker".text = '' - #!/usr/bin/env bash - exec podman "$@" - ''; }; programs.git = { diff --git a/nvim/lua/code_helpers.lua b/nvim/lua/code_helpers.lua index 34254a2..1f51f53 100644 --- a/nvim/lua/code_helpers.lua +++ b/nvim/lua/code_helpers.lua @@ -6,6 +6,9 @@ require("copilot").setup({ javascript = true, typescript = true, rust = true, + go = true, + yaml = true, + python = true, }, }) require("copilot_cmp").setup() @@ -53,20 +56,20 @@ cmp.setup({ mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping(function(fallback) - local col = vim.fn.col(".") - 1 - + -- This little snippet will confirm with tab, and if no entry is selected, will confirm the first item if cmp.visible() then - cmp.select_next_item(select_opts) - elseif col == 0 or vim.fn.getline("."):sub(col, col):match("%s") then - fallback() + local entry = cmp.get_selected_entry() + if not entry then + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) + else + cmp.confirm() + end else - cmp.complete() + fallback() end - end, { "i", "s" }), + end, { "i", "s", "c" }), }), sources = cmp.config.sources({ { name = "copilot" }, @@ -85,7 +88,7 @@ cmp.setup({ -- Set configuration for specific filetype. cmp.setup.filetype("gitcommit", { sources = cmp.config.sources({ - { name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). + { name = "git" }, }, { { name = "buffer" }, }),