From a7099dea429fa671809743bd12cc43a01dd5f4e8 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Sat, 15 Feb 2025 01:00:36 -0500 Subject: [PATCH] 324 current 2025-02-15 01:00:19 25.05.20241217.d3c42f1 6.6.66 * --- home/programs/firefox/default.nix | 9 ++++++- home/programs/nvim/default.nix | 5 ++++ home/programs/nvim/luasnip/luasnip.lua | 27 +++++++++++++++++++++ home/programs/nvim/luasnip/snippets/all.lua | 16 ++++++++++++ home/programs/zsh/zshrc | 2 ++ 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 home/programs/nvim/luasnip/luasnip.lua create mode 100644 home/programs/nvim/luasnip/snippets/all.lua diff --git a/home/programs/firefox/default.nix b/home/programs/firefox/default.nix index 9652484..1669e12 100644 --- a/home/programs/firefox/default.nix +++ b/home/programs/firefox/default.nix @@ -129,6 +129,13 @@ # tab open behavior "browser.search.openintab" = true; "browser.search.suggest.enabled" = false; # fuck you search, wikipedia is my default. + + "browser.urlbar.suggest.topsites" = false; + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.suggest.history" = false; + "browser.urlbar.suggest.engines" = false; + "browser.urlbar.suggest.openpage" = false; + "browser.urlbar.suggest.bookmark" = false; "browser.link.open_newwindow" = 3; "browser.link.open_newwindow.restriction" = 0; @@ -297,7 +304,7 @@ }; }; programs.librewolf = { - enable = true; + enable = false; # sorry settings = { "app.update.auto" = false; # "browser.startup.homepage" = "https://lobste.rs"; diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index cd4d50f..3ef6284 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -63,6 +63,11 @@ plugin = barbar-nvim; config = toLuaFile ./plugins/barbar.lua; } + { + # the most helpful thing is this guy: https://ejmastnak.com/tutorials/vim-latex/luasnip/ + plugin = luasnip; + config = toLuaFile ./luasnip/luasnip.lua; + } { plugin = lualine-nvim; config = toLuaFile ./plugins/lualine.lua; diff --git a/home/programs/nvim/luasnip/luasnip.lua b/home/programs/nvim/luasnip/luasnip.lua new file mode 100644 index 0000000..d7de817 --- /dev/null +++ b/home/programs/nvim/luasnip/luasnip.lua @@ -0,0 +1,27 @@ +require("luasnip.loaders.from_lua").load({paths = "./snippets/"}) + +vim.cmd[[ +" Use Tab to expand and jump through snippets +imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' +smap luasnip#jumpable(1) ? 'luasnip-jump-next' : '' + +" Use Shift-Tab to jump backwards through snippets +imap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '' +smap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '' + +" Expand or jump in insert mode +imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' + +" Jump forward through tabstops in visual mode +smap luasnip#jumpable(1) ? 'luasnip-jump-next' : '' +]] + +require("luasnip").config.set_config({ -- Setting LuaSnip config + + -- Enable autotriggered snippets + enable_autosnippets = true, + + -- Use Tab (or some other key if you prefer) to trigger visual selection + store_selection_keys = "", +}) + diff --git a/home/programs/nvim/luasnip/snippets/all.lua b/home/programs/nvim/luasnip/snippets/all.lua new file mode 100644 index 0000000..5ee2906 --- /dev/null +++ b/home/programs/nvim/luasnip/snippets/all.lua @@ -0,0 +1,16 @@ +return { + -- Example: how to set snippet parameters + require("luasnip").snippet( + { -- Table 1: snippet parameters + trig="hi", + dscr="An autotriggering snippet that expands 'hi' into 'Hello, world!'", + regTrig=false, + priority=100, + snippetType="autosnippet" + }, + { -- Table 2: snippet nodes (don't worry about this for now---we'll cover nodes shortly) + t("Hello, world!"), -- A single text node + } + -- Table 3, the advanced snippet options, is left blank. + ), +} diff --git a/home/programs/zsh/zshrc b/home/programs/zsh/zshrc index 6be5b62..845aa8b 100644 --- a/home/programs/zsh/zshrc +++ b/home/programs/zsh/zshrc @@ -194,6 +194,8 @@ alias zshrc="nvim /home/synchronous/nix-cfg/home/programs/zsh/zshrc" alias sxhkdrc="nvim /home/synchronous/nix-cfg/home/programs/sxhkd/sxhkdrc" alias programs="cd /home/synchronous/nix-cfg/home/programs" +alias nrc = "cd /home/synchronous/nix-cfg/home/programs/nvim" + # ------------------- fzf configuration [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh