From 4524e2894b1d50f5aceccc8ba70ef6c5fb20bebd Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Mon, 29 Jan 2024 13:36:54 +0100 Subject: [PATCH] further nixvim config --- home/lambda/config-files/nvim/cmp/snippet.lua | 6 ++++++ home/lambda/config-files/nvim/{keybinds.lua => init.lua} | 1 + home/lambda/default.nix | 9 ++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 home/lambda/config-files/nvim/cmp/snippet.lua rename home/lambda/config-files/nvim/{keybinds.lua => init.lua} (99%) diff --git a/home/lambda/config-files/nvim/cmp/snippet.lua b/home/lambda/config-files/nvim/cmp/snippet.lua new file mode 100644 index 0000000..b71f2d2 --- /dev/null +++ b/home/lambda/config-files/nvim/cmp/snippet.lua @@ -0,0 +1,6 @@ +local luasnip = require('luasnip') +snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, +}, diff --git a/home/lambda/config-files/nvim/keybinds.lua b/home/lambda/config-files/nvim/init.lua similarity index 99% rename from home/lambda/config-files/nvim/keybinds.lua rename to home/lambda/config-files/nvim/init.lua index b94d799..5b7d53e 100644 --- a/home/lambda/config-files/nvim/keybinds.lua +++ b/home/lambda/config-files/nvim/init.lua @@ -42,3 +42,4 @@ if vim.g.neovide then end end) end + diff --git a/home/lambda/default.nix b/home/lambda/default.nix index 03e214b..332d698 100644 --- a/home/lambda/default.nix +++ b/home/lambda/default.nix @@ -45,7 +45,7 @@ programs.nixvim = { enable = true; globals.mapleader = " "; - extraConfigLua = builtins.readFile ./config-files/nvim/keybinds.lua; + extraConfigLua = builtins.readFile ./config-files/nvim/init.lua; options = { number = true; # Show line numbers @@ -89,19 +89,20 @@ {name = "luasnip";} ]; + snippet.expand = "luasnip"; + mapping = { "" = "cmp.mapping.confirm({ select = true })"; "" = { action = '' function(fallback) + local luasnip = require 'luasnip' if cmp.visible() then cmp.select_next_item() elseif luasnip.expandable() then luasnip.expand() elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() - elseif check_backspace() then - fallback() else fallback() end @@ -113,6 +114,7 @@ }; telescope.enable = true; cmp-nvim-lsp.enable = true; + cmp-nvim-lua.enable = true; noice.enable = true; notify.enable = true; luasnip.enable = true; @@ -193,6 +195,7 @@ signal-desktop vesktop telegram-desktop + webex #schildichat-desktop neovide