nvim

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit f0854b80db9dec403e3ec78d67b12324e8e8c10e
parent 86304850e1306c8e769d3958dd6368d6dce77125
Author: Andrew <andrewlaack1@gmail.com>
Date:   Wed, 18 Dec 2024 01:44:32 -0600

Syncing

Diffstat:
MLuaSnip/tex.lua | 55++++++++++++++++++++++++++++++++++++++-----------------
Mlua/core/keymaps.lua | 18+++++++++++++++++-
2 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/LuaSnip/tex.lua b/LuaSnip/tex.lua @@ -32,7 +32,7 @@ return { " colframe=black, % Frame color", " colback=white, % Background color", " boxrule=0.2mm, % Thickness of the frame", -" sharpe corners,", +" sharp corners,", "}", "\\author{Andrew Laack}", "\\title{TITLE}", @@ -56,8 +56,8 @@ return { require("luasnip").snippet( { - trig=";twoPhotos", - dscr="Autotriggered snippet to replace ;twoPhotos with side by side figures.", + trig=";twoFigs", + dscr="Autotriggered snippet to replace ;twoFigs with side by side figures.", snippetType="autosnippet", regTrig=false, priority=100, @@ -85,8 +85,8 @@ return { require("luasnip").snippet( { - trig=";onePhoto", - dscr="Autotriggered snippet to replace ;twoPhotos with side by side figures.", + trig=";oneFig", + dscr="Autotriggered snippet to replace ;oneFig with one figure.", snippetType="autosnippet", regTrig=false, priority=100, @@ -105,8 +105,8 @@ return { ), require("luasnip").snippet( { - trig=";alphaQuestion", - dscr="Autotriggered snippet to replace ;alphaQuestion with a question with alpha ordered list", + trig=";alphaList", + dscr="Autotriggered snippet to replace ;alphaList with a question and answer list", snippetType="autosnippet", regTrig=false, priority=100, @@ -151,8 +151,8 @@ return { require("luasnip").snippet( { - trig=";answer", - dscr="Autotriggered snippet to replace ;answer with answer area", + trig=";alphaAnswer", + dscr="Autotriggered snippet to replace ;alphaAnswer with answer area", snippetType="autosnippet", regTrig=false, priority=100, @@ -166,26 +166,27 @@ return { } ), - require("luasnip").snippet( { - trig=";alphaList", - dscr="Autotriggered snippet to replace ;alphaList with a alphabetical list", + trig=";alphaPhotos", + dscr="Autotriggered snippet to replace ;alphaPhotos with list of photos to be placed in alphaAnswer.", snippetType="autosnippet", regTrig=false, priority=100, }, { t({ - "\\begin{enumerate}[label=\\alph*)]", - " \\item", - " \\item", - " \\item", - "\\end{enumerate}", +"\\begin{flushleft}", +" \\includegraphics[scale=.20]{images/PICTURE1}", +" \\includegraphics[scale=.20]{images/PICTURE2}", +" \\includegraphics[scale=.20]{images/PICTURE3}", +" \\includegraphics[scale=.20]{images/PICTURE4}", +"\\end{flushleft}" } ), } ), + require("luasnip").snippet( { trig=";numList", @@ -226,6 +227,26 @@ require("luasnip").snippet( } ), +require("luasnip").snippet( + { + trig=";alphaFig", + dscr="Autotriggered snippet to expand ;alphaFig to a figure to go in an alpha answer", + snippetType="autosnippet", + regTrig=false, + priority=100, + }, + { + t({ + "\\centering", + "\\includegraphics[scale=.5]{images/PICTURE.png}", + "\\captionof{figure}{CAPTION}" + } + ), + } + ), + + + require("luasnip").snippet( { diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua @@ -95,7 +95,6 @@ for group, opts in pairs(highlights) do vim.api.nvim_set_hl(0, group, opts) end - -- Map C-Right to w vim.api.nvim_set_keymap('n', '<C-Right>', 'w', { noremap = true, silent = true }) vim.api.nvim_set_keymap('v', '<C-Right>', 'w', { noremap = true, silent = true }) @@ -116,3 +115,20 @@ local opts = { noremap = true, silent = true } for i = 1, 9 do map('n', '<leader>' .. i, ':lua require("harpoon.ui").nav_file(' .. i .. ')<CR>', opts) end + + +-- Use internal formatting for bindings like gq. + vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + vim.bo[args.buf].formatexpr = nil + end, + }) + +-- Set up a global shortcut to toggle textwidth +vim.api.nvim_set_keymap( + "n", + "<leader>wt", + ":lua vim.opt.textwidth = (vim.opt.textwidth:get() == 80) and 0 or 80<CR>", + { noremap = true, silent = true } +) +