This commit is contained in:
Jeff Lance 2024-02-24 14:09:07 +01:00
parent a8a72683cc
commit a9c821a567
3 changed files with 41 additions and 40 deletions

View File

@ -10,36 +10,38 @@ Last Modified By : Jeff Lance <email@jefflance.me>
-- Set autocommands -- Set autocommands
-- --
-- Some examples of autocommands definition through lvim api.
--
local M = {} -- local M = {}
M.setup = function() -- M.setup = function()
lvim.autocommands = { -- lvim.autocommands = {
-- for any files -- -- for any files
{ -- {
-- { "VimEnter" }, -- { "VimEnter" },
-- { -- {
-- pattern = { "*" }, -- pattern = { "*" },
-- command = "FloatermNew --width=0.8 --name=terminal --cwd=<buffer>", -- command = "FloatermNew --width=0.8 --name=terminal --cwd=<buffer>",
-- } -- }
}, -- },
-- arduino files -- -- arduino files
{ -- {
{ "BufNewFile", "BufRead" }, -- { "BufNewFile", "BufRead" },
{ -- {
pattern = { "*.ino", ".pde" }, -- pattern = { "*.ino", ".pde" },
command = "set filetype=arduino", -- command = "set filetype=arduino",
} -- }
}, -- },
-- asymptote filetype -- -- asymptote filetype
{ -- {
{ "BufNewFile", "BufRead" }, -- { "BufNewFile", "BufRead" },
{ -- {
pattern = { "*.asy" }, -- pattern = { "*.asy" },
command = "set filetype=asy", -- command = "set filetype=asy",
} -- }
}, -- },
} -- }
end -- end
return M -- return M

View File

@ -12,11 +12,11 @@ local M = {}
M.setup = function() M.setup = function()
-- ============ -- ============
-- key mappings -- key mappings examples using nvim or lvim api.
-- --
-- vim-surround shortcuts as example
-- vim.api.nvim_set_keymap("n", "sw", "<Plug>Ysurroundiw", { noremap = true, silent = true }) -- vim.api.nvim_set_keymap("n", "sw", "<Plug>Ysurroundiw", { noremap = true, silent = true })
-- vim.api.nvim_set_keymap("n", "Sw", "<Plug>YSurroundiw", { noremap = true, silent = true }) -- vim.api.nvim_set_keymap("n", "Sw", "<Plug>YSurroundiw", { noremap = true, silent = true })
-- lvim.keys.normal_mode["<C-t>"] = ":FloatermToggle terminal<CR>"
-- --
lvim.leader = ";" lvim.leader = ";"
@ -28,7 +28,6 @@ M.setup = function()
lvim.keys.normal_mode["<C-r>"] = "<CMD>redo<CR>" lvim.keys.normal_mode["<C-r>"] = "<CMD>redo<CR>"
lvim.keys.normal_mode["<C-[>"] = ":<<CR>" lvim.keys.normal_mode["<C-[>"] = ":<<CR>"
lvim.keys.normal_mode["<C-]>"] = ":><CR>" lvim.keys.normal_mode["<C-]>"] = ":><CR>"
-- lvim.keys.normal_mode["<C-t>"] = ":FloatermToggle terminal<CR>"
end end

View File

@ -89,15 +89,15 @@ Last Modified By : Jeff Lance <email@jefflance.me>
-- local rows = tonumber(snip.captures[2]) -- local rows = tonumber(snip.captures[2])
-- local cols = tonumber(snip.captures[3]) -- local cols = tonumber(snip.captures[3])
-- local nodes = {} -- local nodes = {}
-- local ins_indx = 1 -- local ins_indx = 1
-- for j = 1, rows do -- for j = 1, rows do
-- table.insert(nodes, r(ins_indx, tostring(j) .. "x1", i(1))) -- table.insert(nodes, r(ins_indx, tostring(j) .. "x1", i(1)))
-- ins_indx = ins_indx + 1 -- ins_indx = ins_indx + 1
-- for k = 2, cols do -- for k = 2, cols do
-- table.insert(nodes, t(" & ")) -- table.insert(nodes, t(" & "))
-- table.insert(nodes, r(ins_indx, tostring(j) .. "x" .. tostring(k), i(1))) -- table.insert(nodes, r(ins_indx, tostring(j) .. "x" .. tostring(k), i(1)))
-- ins_indx = ins_indx + 1 -- ins_indx = ins_indx + 1
-- end -- end
-- table.insert(nodes, t({ " \\\\", "" })) -- table.insert(nodes, t({ " \\\\", "" }))
-- end -- end
-- -- fix last node. -- -- fix last node.