From a9c821a567f34b839e01c15153e9de60d9397b8d Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Sat, 24 Feb 2024 14:09:07 +0100 Subject: [PATCH] Up. --- conf.d/lvim/lua/user/autocommands.lua | 62 ++++++++++--------- conf.d/lvim/lua/user/keybindings.lua | 5 +- conf.d/lvim/lua/user/luasnip-helper-funcs.lua | 14 ++--- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/conf.d/lvim/lua/user/autocommands.lua b/conf.d/lvim/lua/user/autocommands.lua index f8e03e8..50c88c0 100644 --- a/conf.d/lvim/lua/user/autocommands.lua +++ b/conf.d/lvim/lua/user/autocommands.lua @@ -10,36 +10,38 @@ Last Modified By : Jeff Lance -- Set autocommands -- +-- Some examples of autocommands definition through lvim api. +-- -local M = {} +-- local M = {} -M.setup = function() - lvim.autocommands = { - -- for any files - { - -- { "VimEnter" }, - -- { - -- pattern = { "*" }, - -- command = "FloatermNew --width=0.8 --name=terminal --cwd=", - -- } - }, - -- arduino files - { - { "BufNewFile", "BufRead" }, - { - pattern = { "*.ino", ".pde" }, - command = "set filetype=arduino", - } - }, - -- asymptote filetype - { - { "BufNewFile", "BufRead" }, - { - pattern = { "*.asy" }, - command = "set filetype=asy", - } - }, - } -end +-- M.setup = function() +-- lvim.autocommands = { +-- -- for any files +-- { +-- { "VimEnter" }, +-- { +-- pattern = { "*" }, +-- command = "FloatermNew --width=0.8 --name=terminal --cwd=", +-- } +-- }, +-- -- arduino files +-- { +-- { "BufNewFile", "BufRead" }, +-- { +-- pattern = { "*.ino", ".pde" }, +-- command = "set filetype=arduino", +-- } +-- }, +-- -- asymptote filetype +-- { +-- { "BufNewFile", "BufRead" }, +-- { +-- pattern = { "*.asy" }, +-- command = "set filetype=asy", +-- } +-- }, +-- } +-- end -return M +-- return M diff --git a/conf.d/lvim/lua/user/keybindings.lua b/conf.d/lvim/lua/user/keybindings.lua index ba844e2..4f4f1fb 100644 --- a/conf.d/lvim/lua/user/keybindings.lua +++ b/conf.d/lvim/lua/user/keybindings.lua @@ -12,11 +12,11 @@ local M = {} 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", "Ysurroundiw", { noremap = true, silent = true }) -- vim.api.nvim_set_keymap("n", "Sw", "YSurroundiw", { noremap = true, silent = true }) + -- lvim.keys.normal_mode[""] = ":FloatermToggle terminal" -- lvim.leader = ";" @@ -28,7 +28,6 @@ M.setup = function() lvim.keys.normal_mode[""] = "redo" lvim.keys.normal_mode[""] = ":<" lvim.keys.normal_mode[""] = ":>" - -- lvim.keys.normal_mode[""] = ":FloatermToggle terminal" end diff --git a/conf.d/lvim/lua/user/luasnip-helper-funcs.lua b/conf.d/lvim/lua/user/luasnip-helper-funcs.lua index d812c86..7bbf547 100644 --- a/conf.d/lvim/lua/user/luasnip-helper-funcs.lua +++ b/conf.d/lvim/lua/user/luasnip-helper-funcs.lua @@ -89,15 +89,15 @@ Last Modified By : Jeff Lance -- local rows = tonumber(snip.captures[2]) -- local cols = tonumber(snip.captures[3]) -- local nodes = {} --- local ins_indx = 1 --- for j = 1, rows do +-- local ins_indx = 1 +-- for j = 1, rows do -- table.insert(nodes, r(ins_indx, tostring(j) .. "x1", i(1))) --- ins_indx = ins_indx + 1 --- for k = 2, cols do +-- ins_indx = ins_indx + 1 +-- for k = 2, cols do -- table.insert(nodes, t(" & ")) --- table.insert(nodes, r(ins_indx, tostring(j) .. "x" .. tostring(k), i(1))) --- ins_indx = ins_indx + 1 --- end +-- table.insert(nodes, r(ins_indx, tostring(j) .. "x" .. tostring(k), i(1))) +-- ins_indx = ins_indx + 1 +-- end -- table.insert(nodes, t({ " \\\\", "" })) -- end -- -- fix last node.