Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

Commit

Permalink
auto switch input method
Browse files Browse the repository at this point in the history
  • Loading branch information
firedes committed Aug 17, 2022
1 parent e7ca292 commit 2a76c86
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/user/autocommands.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-- 在命中buffer中使用q退出
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "null-ls-info" },
callback = function()
Expand All @@ -8,12 +9,23 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
end,
})

-- 高亮复制内容
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
callback = function()
vim.highlight.on_yank { higroup = "Visual", timeout = 200 }
end,
})

-- 自动切换输入法
vim.api.nvim_create_autocmd({ "InsertLeave", "BufCreate", "BufEnter", "BufLeave" }, {
pattern = { "*" },
callback = function()
vim.cmd [[
silent !fcitx5-remote -c
]]
end,
})

-- vim.api.nvim_create_autocmd({ "BufReadPost" }, {
-- pattern = { "*" },
-- callback = function()
Expand Down

0 comments on commit 2a76c86

Please sign in to comment.