Many lua changes I guess
This commit is contained in:
parent
aeefede352
commit
73e033c904
|
@ -23,12 +23,3 @@ vim.keymap.set("n", "<leader>ls", function()
|
|||
end
|
||||
end, opts("Run .setup() in current file"))
|
||||
|
||||
local status, wk = pcall(require, "which-key")
|
||||
|
||||
if status then
|
||||
wk.register({
|
||||
["<leader>l"] = {
|
||||
name = "Local commands"
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
local arpeggio = require("my.plugins.arpeggio")
|
||||
local A = require("my.abbreviations")
|
||||
|
||||
print("Initializing purescript keybinds...")
|
||||
-- print("Initializing purescript keybinds...")
|
||||
|
||||
-- Use vt to test
|
||||
arpeggio.chordSilent("n", "vt", ":VimuxRunCommand \"clear && spago test\"<CR>",
|
||||
|
|
|
@ -7,8 +7,8 @@ vim.opt.conceallevel = 0
|
|||
vim.opt.wrap = true
|
||||
|
||||
vim.g.tex_conceal = "abdmg"
|
||||
-- vim.g.vimtex_syntax_conceal = 1
|
||||
vim.g.vimtex_imaps_enabled = 0
|
||||
-- vim.g.vimtex_syntax_conceal = 1
|
||||
|
||||
local abbreviations = {
|
||||
-- Greek chars
|
||||
|
@ -28,8 +28,9 @@ local abbreviations = {
|
|||
{ "ints", "\\mathbb{I}" },
|
||||
{ "nats", "\\mathbb{N}" },
|
||||
{ "rats", "\\mathbb{Q}" },
|
||||
{ "rreal", "\\mathbb{R}" },
|
||||
{ "ffield", "\\mathbb{F}" },
|
||||
{ "rrea", "\\mathbb{R}" },
|
||||
{ "ppri", "\\mathbb{P}" },
|
||||
{ "ffie", "\\mathbb{F}" },
|
||||
{ "ccom", "\\mathbb{C}" },
|
||||
|
||||
-- Exponents
|
||||
|
@ -109,13 +110,17 @@ local abbreviations = {
|
|||
|
||||
|
||||
-- words
|
||||
{ "rref", "reduced row echalon form" }
|
||||
{ "rref", "reduced row echalon form" },
|
||||
{ "thrf", "therefore" }
|
||||
}
|
||||
|
||||
local abolishAbbreviations = {
|
||||
{ "egv{a,e}{,s}", "eigenv{alue,ector}{}" },
|
||||
{ "ib{p,s}", "integration by {parts,substitution}" }
|
||||
{ "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" },
|
||||
{ "ib{p,s}", "integration by {parts,substitution}" },
|
||||
{ "mx{,s}", "matri{x,ces}" }
|
||||
}
|
||||
|
||||
A.manyLocalAbbr(abbreviations)
|
||||
AB.abolishMany(abolishAbbreviations)
|
||||
|
||||
vim.keymap.set("n", "<leader>lc", "<cmd>VimtexCompile<cr>", { desc = "Compile current buffer using vimtex" })
|
||||
|
|
|
@ -38,6 +38,17 @@ function M.setup()
|
|||
M.move("Q", "yQ")
|
||||
M.move("<C-^>", "<Leader>a", { desc = "Go to previous file" })
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "qn", function()
|
||||
local buf = vim.api.nvim_win_get_buf(0)
|
||||
|
||||
-- Only save if file is writable
|
||||
if vim.bo[buf].modifiable and not vim.bo[buf].readonly then
|
||||
vim.cmd [[write]]
|
||||
end
|
||||
|
||||
vim.cmd "q"
|
||||
end, { desc = "Quit current buffer" })
|
||||
|
||||
vim.keymap.set("n", "Q", ":wqa<cr>", { desc = "Save all files and quit" })
|
||||
vim.keymap.set("n", "<leader>rw", ":%s/<C-r><C-w>/", {
|
||||
desc = "Replace word in file"
|
||||
|
|
|
@ -42,12 +42,7 @@ function M.setup()
|
|||
|
||||
require("my.plugins.hydra").setup()
|
||||
require("my.plugins.clipboard-image").setup()
|
||||
require("mind").setup({
|
||||
persistence = {
|
||||
state_path = "~/Mind/mind.json",
|
||||
data_dir = "~/Mind/data"
|
||||
}
|
||||
})
|
||||
require("my.plugins.mind").setup()
|
||||
|
||||
-- require("my.plugins.slam").setup()
|
||||
end
|
||||
|
|
32
dotfiles/neovim/lua/my/plugins/mind.lua
Normal file
32
dotfiles/neovim/lua/my/plugins/mind.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
local mind = require("mind")
|
||||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
mind.setup({
|
||||
persistence = {
|
||||
state_path = "~/Mind/mind.json",
|
||||
data_dir = "~/Mind/data"
|
||||
},
|
||||
ui = {
|
||||
width = 50
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>m", function()
|
||||
local buffers = vim.api.nvim_list_bufs()
|
||||
local should_open = true
|
||||
|
||||
for _, buf in pairs(buffers) do
|
||||
if vim.api.nvim_buf_is_loaded(buf) and vim.bo[buf].filetype == "mind" then
|
||||
should_open = false
|
||||
vim.cmd("bd " .. buf)
|
||||
end
|
||||
end
|
||||
|
||||
if should_open then
|
||||
mind.open_main()
|
||||
end
|
||||
end, { desc = "Toggle mind panel" })
|
||||
end
|
||||
|
||||
return M
|
|
@ -16,6 +16,7 @@ local keybinds = {
|
|||
{ "<C-P>", "find_files", "Find files" },
|
||||
{ "<Leader>ft", find_files_by_extension("tex"), "Find tex files" },
|
||||
{ "<Leader>fl", find_files_by_extension("lua"), "Find lua files" },
|
||||
{ "<Leader>fp", find_files_by_extension("purs"), "Find purescript files" },
|
||||
{ "<Leader>d", "diagnostics", "Diagnostics" },
|
||||
{ "<C-F>", "live_grep", "Search in project" },
|
||||
{ "<Leader>t", "builtin", "Show builtin pickers" },
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
local wk = require("which-key")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
require("which-key").setup({
|
||||
wk.setup({
|
||||
triggers = { "<leader>", "d", "y", "q", "z", "g", "c" }
|
||||
})
|
||||
|
||||
wk.register({
|
||||
["<leader>l"] = {
|
||||
name = "Local commands"
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
"tex"
|
||||
],
|
||||
"path": "./snippets/latex/core.json"
|
||||
},
|
||||
{
|
||||
"language": [
|
||||
"lua"
|
||||
],
|
||||
"path": "./snippets/lua/core.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
15
dotfiles/vscode-snippets/snippets/lua/core.json
Normal file
15
dotfiles/vscode-snippets/snippets/lua/core.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"Lua setup-module": {
|
||||
"prefix": "msetup",
|
||||
"description": "Create lua module with setup function inside",
|
||||
"body": [
|
||||
"local M = {}",
|
||||
"",
|
||||
"function M.setup()",
|
||||
" $0",
|
||||
"end",
|
||||
"",
|
||||
"return M"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue