Skip to content
프로젝트

소개

Neovim용 마우스 제스처 플러그인

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

gesture.nvim

ci

gesture.nvim is a mouse gesture plugin for Neovim (nightly).

Example

vim.o.mouse = "a"
vim.o.mousemoveevent = true

vim.keymap.set("n", "<LeftDrag>", [[<Cmd>lua require("gesture").draw()<CR>]], { silent = true })
vim.keymap.set("n", "<LeftRelease>", [[<Cmd>lua require("gesture").finish()<CR>]], { silent = true })

-- or if you would like to use right click
vim.keymap.set("n", "<RightMouse>", [[<Nop>]])
vim.keymap.set("n", "<RightDrag>", [[<Cmd>lua require("gesture").draw()<CR>]], { silent = true })
vim.keymap.set("n", "<RightRelease>", [[<Cmd>lua require("gesture").finish()<CR>]], { silent = true })

local gesture = require("gesture")
gesture.register({
  name = "scroll to bottom",
  inputs = { gesture.up(), gesture.down() },
  action = "normal! G",
})
gesture.register({
  name = "next tab",
  inputs = { gesture.right() },
  action = "tabnext",
})
gesture.register({
  name = "previous tab",
  inputs = { gesture.left() },
  action = function(_) -- also can use callable
    vim.cmd.tabprevious()
  end,
})
gesture.register({
  name = "go back",
  inputs = { gesture.right(), gesture.left() },
  -- map to `<C-o>` keycode
  action = function()
    vim.api.nvim_feedkeys(vim.keycode("<C-o>"), "n", true)
  end,
})
gesture.register({
  name = "close gesture traced windows",
  match = function(ctx)
    local last_input = ctx.inputs[#ctx.inputs]
    return last_input and last_input.direction == "UP"
  end,
  can_match = function(ctx)
    local first_input = ctx.inputs[1]
    return first_input and first_input.direction == "RIGHT"
  end,
  action = function(ctx)
    table.sort(ctx.window_ids, function(a, b)
      return a > b
    end)
    for _, window_id in ipairs(ctx.window_ids) do
      if vim.api.nvim_win_is_valid(window_id) then
        vim.api.nvim_win_close(window_id, false)
      end
    end
  end,
})

관련 프로젝트 살펴보기

불러오는 중…