1
0

fix alias and copy-mode

This commit is contained in:
2025-04-03 19:20:29 +02:00
parent 3993cd733e
commit d372b7c89b
4 changed files with 28 additions and 20 deletions

View File

@@ -1,6 +1,15 @@
globals = { -- Rerun tests only if their modification time changed.
"vim", cache = true
ignore = {
"122", -- Setting a read-only field of a global variable.
"212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
} }
-- Global objects defined by the C code
read_globals = { read_globals = {
"vim",
"Snacks", "Snacks",
} }
files["snippets/*.lua"] = { ignore = { "211", "631" } }

View File

@@ -10,23 +10,20 @@ return {
config = function() config = function()
local ls = require("luasnip") local ls = require("luasnip")
local snippets_folder = vim.fn.stdpath("config") .. "/snippets" local snippets_folder = vim.fn.stdpath("config") .. "/snippets"
local function load_snippets() -- Load all Lua files in the snippets directory except init.lua
-- Load all Lua files in the snippets directory except init.lua local files = vim.fn.glob(snippets_folder .. "/*.lua", false, true)
local files = vim.fn.glob(snippets_folder .. "/*.lua", false, true) for _, file in ipairs(files) do
for _, file in ipairs(files) do local filename = vim.fn.fnamemodify(file, ":t")
local filename = vim.fn.fnamemodify(file, ":t") -- Remove .lua extension to get the filetype
-- Remove .lua extension to get the filetype local ft = filename:match("(.+)%.lua$")
local ft = filename:match("(.+)%.lua$") if ft then
if ft then -- Load the file which should return a table of snippets
-- Load the file which should return a table of snippets local ok, snippets = pcall(dofile, file)
local ok, snippets = pcall(dofile, file) if ok and type(snippets) == "table" then
if ok and type(snippets) == "table" then ls.add_snippets(ft, snippets)
ls.add_snippets(ft, snippets)
end
end end
end end
end end
load_snippets()
end, end,
}, },
{ {

View File

@@ -30,6 +30,8 @@ bind-key -n C-S-Left swap-window -t -1\; select-window -t -1
bind-key -n C-S-Right swap-window -t +1\; select-window -t +1 bind-key -n C-S-Right swap-window -t +1\; select-window -t +1
setw -g mode-keys vi setw -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
set -g set-clipboard on set -g set-clipboard on
set -g focus-events on set -g focus-events on

View File

@@ -101,10 +101,10 @@ alias tfp="tf plan -lock=false"
alias tfa="tf apply" alias tfa="tf apply"
alias tfu="tf get -update" alias tfu="tf get -update"
alias tg="_terra_cmd terragrunt" alias tg="_terra_cmd terragrunt"
alias tgi="tg grunt init" alias tgi="tg init"
alias tgp="tg grunt plan -lock=false" alias tgp="tg plan -lock=false"
alias tga="tg grunt apply" alias tga="tg apply"
alias tgu="tg grunt get -update" alias tgu="tg get -update"
alias curltime="curl -w \"@$HOME/.curl-format.txt\" -o /dev/null -s " alias curltime="curl -w \"@$HOME/.curl-format.txt\" -o /dev/null -s "