-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
32 lines (26 loc) · 908 Bytes
/
init.lua
File metadata and controls
32 lines (26 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
-- 自动进入插入模式
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "*",
command = "startinsert",
})
-- 禁止 Esc 和 Ctrl-[ 切换到命令模式
vim.api.nvim_create_autocmd("TermOpen", {
pattern = "*",
callback = function()
vim.api.nvim_buf_set_keymap(0, "i", "<C-[>", "<Nop>", { noremap = true, silent = true })
end,
})
vim.o.guifont = "JetBrainsMono Nerd Font:h12"
-- 确保你已安装 yazi,适当配置插件和命令
-- 定义一个函数来使用 yazi 打开图片文件
local function open_with_yazi()
local file = vim.fn.expand('%:p')
vim.fn.jobstart({'yazi', file})
end
-- 创建一个自动命令,在打开图片文件时调用 open_with_yazi 函数
vim.api.nvim_create_autocmd("BufRead", {
pattern = {"*.jpg", "*.jpeg", "*.png", "*.gif", "*.bmp"},
callback = open_with_yazi,
})