1
Fork 0

Many changes

This commit is contained in:
Matei Adriel 2022-11-01 16:48:18 +01:00
parent 104ae1ec42
commit 7c61e64fa8
14 changed files with 139 additions and 92 deletions

View file

@ -25,7 +25,7 @@ local abbreviations = {
{ "nuls", "\\varnothing" },
-- Other fancy symvols
{ "ints", "\\mathbb{I}" },
{ "ints", "\\mathbb{Z}" },
{ "nats", "\\mathbb{N}" },
{ "rats", "\\mathbb{Q}" },
{ "rrea", "\\mathbb{R}" },
@ -44,6 +44,7 @@ local abbreviations = {
{ "etn", "^{-}" },
{ "ett", "^{t}" },
{ "tmat", "^{T}" }, -- Tranpose of a matrix
{ "cmat", "^{*}" }, -- Conjugate of a matrix
{ "etp", "^{+}" },
-- Subscripts
@ -108,19 +109,21 @@ local abbreviations = {
{ "div", "\\|" },
{ "ndiv", "\\not\\|\\:" },
-- words
{ "rref", "reduced row echalon form" },
{ "thrf", "therefore" }
}
local abolishAbbreviations = {
{ "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" },
{ "ib{p,s}", "integration by {parts,substitution}" },
{ "mx{,s}", "matri{x,ces}" }
{ "mx{,s}", "matri{x,ces}" },
{ "thrf", "therefore" }
}
A.manyLocalAbbr(abbreviations)
AB.abolishMany(abolishAbbreviations)
vim.keymap.set("n", "<leader>lc", "<cmd>VimtexCompile<cr>", { desc = "Compile current buffer using vimtex" })
vim.keymap.set("n", "<leader>lc", "<cmd>VimtexCompile<cr>", {
desc = "Compile current buffer using vimtex",
buffer = true
})

View file

@ -7,7 +7,6 @@ function M.setup()
require("my.theme").setup()
require("my.options").setup()
require('my.keymaps').setup()
require('my.snippets').setup()
require('my.plugins').setup()
require("telescope.extensions.unicode").setupAbbreviations()
end

View file

@ -77,7 +77,7 @@ function M.setup()
name = "Go to"
},
r = {
name = "Rename / Replace"
name = "Rename / Replace / Reload"
},
["<leader>"] = {
name = "Easymotion"

View file

@ -1,18 +0,0 @@
local M = {}
local bindings = {
-- Open files with control + P
files = "<c-P>",
-- See diagnostics with space + d
lsp_document_diagnostics = "<space>d",
lsp_workspace_diagnostics = "<space>D"
}
function M.setup()
for action, keybind in pairs(bindings) do
-- Maps the keybind to the action
vim.keymap.set('n', keybind, require('fzf-lua')[action])
end
end
return M

View file

@ -6,6 +6,11 @@ function M.setup()
require('fidget').setup()
require('dressing').setup()
require("my.plugins.easymotion").setup()
require("my.plugins.autopairs").setup()
require("my.plugins.telescope").setup()
require("my.plugins.surround").setup()
env.vscode.unless(function()
env.firevim.unless(function()
require("presence"):setup({})
@ -35,10 +40,6 @@ function M.setup()
require("my.plugins.paperplanes").setup()
end
require("my.plugins.easymotion").setup()
require("my.plugins.autopairs").setup()
require("my.plugins.telescope").setup()
require("my.plugins.surround").setup()
require("my.plugins.hydra").setup()
require("my.plugins.clipboard-image").setup()

View file

@ -1,6 +1,10 @@
local M = {}
local luasnip = require("luasnip")
local function reload()
require("luasnip.loaders.from_vscode").lazy_load()
end
function M.setup()
vim.keymap.set("i", "<Tab>", function()
if luasnip.jumpable(1) then
@ -12,6 +16,12 @@ function M.setup()
vim.keymap.set("i", "<S-Tab>", function()
luasnip.jump(-1)
end)
vim.keymap.set("n", "<leader>rs", reload, {
desc = "Reload luasnip snippets"
})
reload()
end
return M

View file

@ -1,12 +1,10 @@
local global = require("my.helpers").global
local M = {}
function M.setup()
-- Viewer method
vim.g.vimtex_view_method = "zathura"
vim.g.Tex_DefaultTargetFormat = "pdf"
vim.g.vimtex_fold_enabled = 1
vim.g.vimtex_fold_enabled = 0
vim.g.vimtex_compiler_latexmk = {
options = {
"-pdf", "-shell-escape", "-verbose", "-file-line-error", "-synctex=1", "-interaction=nonstopmode"

View file

@ -1,8 +0,0 @@
local M = {}
function M.setup()
-- require("luasnip").config.setup({ enable_autosnippets = false })
require("luasnip.loaders.from_vscode").lazy_load()
end
return M

View file

@ -32,6 +32,12 @@
],
"path": "./snippets/latex/core.json"
},
{
"language": [
"tex"
],
"path": "./snippets/latex/explain.json"
},
{
"language": [
"lua"

View file

@ -12,10 +12,7 @@
"Absolute value": {
"prefix": "abs",
"description": "Absolute values",
"body": "|$1|$0",
"luasnip": {
"autotrigger": true
}
"body": "|$1|$0"
},
"Lemma": {
"prefix": "lemma",
@ -59,26 +56,27 @@
"Subscript": {
"prefix": "ss",
"description": "Subscript",
"body": "_{$1}$0",
"luasnip": {
"autotrigger": true
}
"body": "_{$1}$0"
},
"Exponent": {
"prefix": "ee",
"description": "Exponent",
"body": "^{$1}$0",
"luasnip": {
"autotrigger": true
}
"body": "^{$1}$0"
},
"Nth derivative": {
"prefix": "dd",
"description": "Nth derivative",
"body": "^{($1)}$0",
"luasnip": {
"autotrigger": true
}
"body": "^{($1)}$0"
},
"Overline": {
"prefix": "ol",
"description": "Overline",
"body": "\\overline{$1}$0"
},
"Z Mod": {
"prefix": "zmod",
"description": "The set of Z/nZ",
"body": "\\mathbb{Z}/$1\\mathbb{Z}$0"
},
"Section": {
"prefix": "section",
@ -133,74 +131,47 @@
"Sigma sum": {
"prefix": "bsum",
"description": "Create a sum using sigma notation",
"body": "\\sum_{$1 = $2}^{$3}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\sum_{$1 = $2}^{$3}$0"
},
"Pi product": {
"prefix": "bproduct",
"description": "Create a produt using pi notation",
"body": "\\prod_{$1 = $2}^{$3}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\prod_{$1 = $2}^{$3}$0"
},
"Fraction": {
"prefix": "frac",
"description": "Create a fraction",
"body": "\\frac{$1}{$2}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\frac{$1}{$2}$0"
},
"Choose": {
"prefix": "binom",
"description": "Create a (n choose k) thingy",
"body": "\\binom{$1}{$2}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\binom{$1}{$2}$0"
},
"Limit": {
"prefix": "lim",
"description": "Create a limit",
"body": "\\lim _{$1 \\to $2}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\lim _{$1 \\to $2}$0"
},
"Limit to infinity": {
"prefix": "ilim",
"description": "Create a limit as a variable goes to infinity",
"body": "\\lim _{$1 \\to \\infty}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\lim _{$1 \\to \\infty}$0"
},
"Limit to negative infinity": {
"prefix": "nlim",
"description": "Create a limit as a variable goes to negative infinity",
"body": "\\lim _{$1 \\to -\\infty}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\lim _{$1 \\to -\\infty}$0"
},
"Limit to zero": {
"prefix": "zlim",
"description": "Create a limit as a variable goes to 0",
"body": "\\lim _{$1 \\to 0}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\lim _{$1 \\to 0}$0"
},
"Sqrt": {
"prefix": "sqrt",
"description": "Create a sqrt",
"body": "\\sqrt[$1]{$2}$0",
"luasnip": {
"autotrigger": true
}
"body": "\\sqrt[$1]{$2}$0"
},
"Sin": {
"prefix": "sin",

View file

@ -0,0 +1,77 @@
{
"Text explanation in math mode": {
"prefix": "texpl",
"description": "Explain a step using text in math mode",
"body": "&& \\text{($1)}$0"
},
"Explanation in math mode": {
"prefix": "expl",
"description": "Explain a step in math mode",
"body": "&& ($1) $0"
},
"Explain division": {
"prefix": "exdiv",
"description": "Explain a division inside an equation",
"body": "&& \\left(\\frac{\\square}{$1}\\right)$0"
},
"Explain fraction": {
"prefix": "exfract",
"description": "Explain a step which wraps both sides of an equation by a fraction",
"body": "&& \\left(\\frac{$1}{$2} \\right)$0"
},
"Explain right multiplication": {
"prefix": "exmul",
"description": "Explain a right multiplication inside an equation",
"body": "&& \\left(\\square \\cdot $1 \\right)$0"
},
"Explain left multiplication": {
"prefix": "exlmul",
"description": "Explain a left multiplication inside an equation",
"body": "&& \\left($1 \\cdot \\square\\right)$0"
},
"Explain differentiation": {
"prefix": "exdiff",
"description": "Explain a step which differentiates both sides of an equation",
"body": "&& \\left( \\frac{d \\square} {d $1} \\right)$0"
},
"Explain integration": {
"prefix": "exint",
"description": "Explain a step which integrates both sides of an equation",
"body": "&& \\left(\\int \\square d$1 \\right)$0"
},
"Explain definite integration": {
"prefix": "exdint",
"description": "Explain a step which applies a definite integral to both sides of an equation",
"body": "&& \\left(\\int _{$1} ^{$2} \\square d$3 \\right)$0"
},
"Explain addition": {
"prefix": "exadd",
"description": "Explain a step which adds to both sides of an equation",
"body": "&& \\left( \\square + $1 \\right)$0"
},
"Explain subtraction": {
"prefix": "exsub",
"description": "Explain a step which subtracts from both sides of an equation",
"body": "&& \\left( \\square - $1 \\right)$0"
},
"Explain negation": {
"prefix": "exneg",
"description": "Explain a step which negates both sides of an equation",
"body": "&& (- \\square )$0"
},
"Explain power": {
"prefix": "expow",
"description": "Explain a step which raises both sides of an equation to a given power",
"body": "&& \\left( \\square ^{$1} \\right)$0"
},
"Explain exponentiation": {
"prefix": "exexp",
"description": "Explain a step which raises a given value to both sides of an equation",
"body": "&& \\left( $1 ^{\\square} \\right)$0"
},
"Explain natural logarithm": {
"prefix": "exln",
"description": "Explain a step which applies the ln function to both sides of an equation",
"body": "&& \\left( \\ln $1 \\right)$0"
}
}

BIN
img/22-10-19-16-13-24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View file

@ -25,6 +25,7 @@
# ./chromium.nix
./vieb.nix
./polybar.nix
./hamachi.nix
];
}

View file

@ -0,0 +1,7 @@
{ pkgs, ... }: {
services.logmein-hamachi.enable = true;
home-manager.users.adrielus.home.packages = [
pkgs.logmein-hamachi
pkgs.unstable.haguichi
];
}