A bunch of changes, mostly to neovim
- global abbreviations - better firenvim setup - magma.nvim (never used it, might unisntall)
This commit is contained in:
parent
d573e17a00
commit
bf7427d8c7
|
@ -1,5 +1,3 @@
|
||||||
local A = require("my.abbreviations")
|
|
||||||
|
|
||||||
-- Use vt to test
|
-- Use vt to test
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
|
@ -17,16 +15,3 @@ vim.keymap.set(
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.opt.expandtab = true -- Use spaces for the tab char
|
vim.opt.expandtab = true -- Use spaces for the tab char
|
||||||
|
|
||||||
local abbreviations = {
|
|
||||||
{ "land", "/\\" },
|
|
||||||
{ "lor", "\\/" },
|
|
||||||
{ "tto", "->" },
|
|
||||||
{ "iip", "=>" },
|
|
||||||
{ "frl", "forall" },
|
|
||||||
{ "ott", "<-" }, -- opposite of tto
|
|
||||||
}
|
|
||||||
|
|
||||||
A.manyLocalAbbr(abbreviations)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ local abbreviations = {
|
||||||
{ "iin", "\\in" },
|
{ "iin", "\\in" },
|
||||||
{ "tto", "\\to" },
|
{ "tto", "\\to" },
|
||||||
{ "iip", "\\implies" },
|
{ "iip", "\\implies" },
|
||||||
|
{ "iib", "\\impliedby" },
|
||||||
{ "iff", "\\iff" },
|
{ "iff", "\\iff" },
|
||||||
{ "land", "\\land" },
|
{ "land", "\\land" },
|
||||||
{ "lor", "\\lor" },
|
{ "lor", "\\lor" },
|
||||||
|
@ -117,6 +118,9 @@ local abolishAbbreviations = {
|
||||||
{ "dete{,s}", "determinant{}" },
|
{ "dete{,s}", "determinant{}" },
|
||||||
{ "ort{n,g}", "orto{normal,gonal}" },
|
{ "ort{n,g}", "orto{normal,gonal}" },
|
||||||
{ "l{in,de}", "linearly {independent,dependent}" },
|
{ "l{in,de}", "linearly {independent,dependent}" },
|
||||||
|
{ "lcon{,s}", "linear combination{}" },
|
||||||
|
{ "vsm", "\\vecspace" }, -- math vector space
|
||||||
|
{ "vst{,s}", "vector space{,s}" }, -- text vector space
|
||||||
|
|
||||||
-- Graph theory
|
-- Graph theory
|
||||||
{ "vx{,s}", "vert{ex,ices}" },
|
{ "vx{,s}", "vert{ex,ices}" },
|
||||||
|
@ -210,12 +214,9 @@ local abolishAbbreviations = {
|
||||||
|
|
||||||
local expanded = scrap.expand_many(abolishAbbreviations)
|
local expanded = scrap.expand_many(abolishAbbreviations)
|
||||||
|
|
||||||
-- print("Expanded")
|
|
||||||
A.manyLocalAbbr(abbreviations)
|
A.manyLocalAbbr(abbreviations)
|
||||||
A.manyLocalAbbr(expanded)
|
A.manyLocalAbbr(expanded)
|
||||||
|
|
||||||
print(#expanded .. " abbreviations")
|
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>lc",
|
"<leader>lc",
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"leap": { "branch": "main", "commit": "f565a9c4d92245d8b619235bebeaa73cc38aa40e" },
|
"leap": { "branch": "main", "commit": "f565a9c4d92245d8b619235bebeaa73cc38aa40e" },
|
||||||
"lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
|
"lspkind.nvim": { "branch": "master", "commit": "c68b3a003483cf382428a43035079f78474cd11e" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
|
"lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" },
|
||||||
|
"magma-nvim": { "branch": "main", "commit": "395b48e2e202d82fca76c15d2dcd8785c125d686" },
|
||||||
"mind.nvim": { "branch": "master", "commit": "e59c52758c399caceb549c698cfa2d65e6bbb9f9" },
|
"mind.nvim": { "branch": "master", "commit": "e59c52758c399caceb549c698cfa2d65e6bbb9f9" },
|
||||||
"neoconf.nvim": { "branch": "main", "commit": "f67013cf18d9db5cc6c3ce2d5a4051bad75fe628" },
|
"neoconf.nvim": { "branch": "main", "commit": "f67013cf18d9db5cc6c3ce2d5a4051bad75fe628" },
|
||||||
"neodev.nvim": { "branch": "main", "commit": "6a2310ef6386e7a5ad5bdc56c844410bf5de8225" },
|
"neodev.nvim": { "branch": "main", "commit": "6a2310ef6386e7a5ad5bdc56c844410bf5de8225" },
|
||||||
|
|
34
dotfiles/neovim/lua/my/abbreviations/global.lua
Normal file
34
dotfiles/neovim/lua/my/abbreviations/global.lua
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
local A = require("my.abbreviations")
|
||||||
|
local scrap = require("scrap")
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.symols = {
|
||||||
|
-- Unicode:
|
||||||
|
{ "iin", "∈" }, -- [I]ncluded [i][n]
|
||||||
|
{ "mfrl", "∀" }, -- [M]ath [f]o[r]al[l]
|
||||||
|
|
||||||
|
-- Ascii stuff:
|
||||||
|
{ "tto", "->" }, -- [t]o
|
||||||
|
{ "ffrom", "<-" }, -- [f]rom
|
||||||
|
{ "iip", "=>" }, -- [i]t [i]m[p]lies
|
||||||
|
{ "iib", "<=" }, -- [i]t's [i]mplied [b]ly
|
||||||
|
|
||||||
|
{ "leq", "<=" }, -- [l]ess than or [e][q]ual
|
||||||
|
{ "geq", ">=" }, -- [g]reater than or [e][q]ual
|
||||||
|
{ "eq", "=" }, -- [e][q]ual
|
||||||
|
{ "deq", "==" }, -- [d]ouble [e][q]ual
|
||||||
|
{ "land", "/\\" }, -- [l]ogial [a][n][d]
|
||||||
|
{ "lor", "\\/" }, -- [l]ogial [o][r]
|
||||||
|
}
|
||||||
|
|
||||||
|
M.words = {
|
||||||
|
{ "thrf", "therefore" },
|
||||||
|
{ "frl", "forall" },
|
||||||
|
}
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
A.manyGlobalAbbr(scrap.expand_many(M.words))
|
||||||
|
A.manyGlobalAbbr(scrap.expand_many(M.symols, { capitalized = false }))
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
|
@ -16,4 +16,15 @@ function M.abbr(lhs, rhs)
|
||||||
vim.cmd(":iabbrev " .. lhs .. " " .. rhs)
|
vim.cmd(":iabbrev " .. lhs .. " " .. rhs)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.manyGlobalAbbr(abbreviations)
|
||||||
|
for _, value in pairs(abbreviations) do
|
||||||
|
M.abbr(value[1], value[2])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
require("my.abbreviations.global").setup()
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
|
@ -1,6 +1,9 @@
|
||||||
local function makeEnv(cond)
|
local function makeEnv(cond)
|
||||||
return {
|
return {
|
||||||
active = cond,
|
-- I am doing this to get type hints!
|
||||||
|
active = function()
|
||||||
|
return cond
|
||||||
|
end,
|
||||||
not_active = function()
|
not_active = function()
|
||||||
return not cond()
|
return not cond()
|
||||||
end,
|
end,
|
||||||
|
@ -36,5 +39,5 @@ return {
|
||||||
return makeEnv(function()
|
return makeEnv(function()
|
||||||
return a.active() or b.active()
|
return a.active() or b.active()
|
||||||
end)
|
end)
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ function M.setup()
|
||||||
require("my.options").setup()
|
require("my.options").setup()
|
||||||
require('my.keymaps').setup()
|
require('my.keymaps').setup()
|
||||||
require('my.lazy').setup()
|
require('my.lazy').setup()
|
||||||
|
require('my.abbreviations').setup()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -14,6 +14,9 @@ function M.config()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Disable status line
|
||||||
|
vim.opt.laststatus = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -3,7 +3,7 @@ local env = require("my.helpers.env")
|
||||||
local M = {
|
local M = {
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
cond = env.vscode.not_active(),
|
cond = env.vscode.not_active() and env.firenvim.not_active(),
|
||||||
}
|
}
|
||||||
|
|
||||||
function M.config()
|
function M.config()
|
||||||
|
|
61
dotfiles/neovim/lua/my/plugins/magma.lua
Normal file
61
dotfiles/neovim/lua/my/plugins/magma.lua
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
local M = {
|
||||||
|
"dccsillag/magma-nvim",
|
||||||
|
cmd = "MagmaInit",
|
||||||
|
config = function()
|
||||||
|
local prefix = "<leader>M"
|
||||||
|
|
||||||
|
local status, wk = pcall(require, "which-key")
|
||||||
|
|
||||||
|
if status then
|
||||||
|
wk.register({
|
||||||
|
[prefix] = {
|
||||||
|
desc = "[M]agma",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
prefix .. "e",
|
||||||
|
"<cmd>MagmaEvaluateOperator<cr>",
|
||||||
|
{ expr = true, silent = true, desc = "[E]valuate motion" }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
prefix .. "ee",
|
||||||
|
"<cmd>MagmaEvaluateLine<cr>",
|
||||||
|
{ silent = true, desc = "[E]valuate line" }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
prefix .. "r",
|
||||||
|
"<cmd>MagmaReevaluateCell<cr>",
|
||||||
|
{ silent = true, desc = "[R]e-evaluate cell" }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
prefix .. "d",
|
||||||
|
"<cmd>MagmaDelete<cr>",
|
||||||
|
{ silent = true, desc = "[D]elete cell" }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
prefix .. "o",
|
||||||
|
"<cmd>MagmaShowOutput<cr>",
|
||||||
|
{ silent = true, desc = "Show [o]utput" }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
"v",
|
||||||
|
prefix .. "e",
|
||||||
|
"<cmd><C-u>MagmaEvaluateVisual<cr>",
|
||||||
|
{ silent = true, desc = "[E]vluate visual selection" }
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
|
@ -36,6 +36,10 @@ let
|
||||||
|
|
||||||
texlive.combined.scheme-full # Latex stuff
|
texlive.combined.scheme-full # Latex stuff
|
||||||
python38Packages.pygments # required for latex syntax highlighting
|
python38Packages.pygments # required for latex syntax highlighting
|
||||||
|
|
||||||
|
# Required by magma-nvim:
|
||||||
|
# python310Packages.pynvim
|
||||||
|
# python310Packages.jupyter
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
let
|
let
|
||||||
|
|
Loading…
Reference in a new issue