ts keybinding update

pull/125/head
ray-x 2 years ago
parent 86d7b26846
commit 1c727c8768

@ -106,7 +106,8 @@ end
function M.version() function M.version()
local cache_dir = vim.fn.stdpath("cache") local cache_dir = vim.fn.stdpath("cache")
local path = string.format("%s%sversion.txt", cache_dir, utils.sep()) local path = string.format("%s%sversion.txt", cache_dir, utils.sep())
local gopls = _GO_NVIM_CFG.gopls_cmd or { "gopls" } local cfg = _GO_NVIM_CFG or {}
local gopls = cfg.gopls_cmd or { "gopls" }
if vim.fn.executable(gopls[1]) == 0 then if vim.fn.executable(gopls[1]) == 0 then
vim.notify("gopls not found", vim.log.levels.WARN) vim.notify("gopls not found", vim.log.levels.WARN)

@ -11,7 +11,7 @@ local long_opts = {
compile = "c", compile = "c",
tags = "t", tags = "t",
bench = "b", bench = "b",
floatterm = "F", floaterm = "F",
} }
local sep = require("go.utils").sep() local sep = require("go.utils").sep()

@ -9,8 +9,7 @@ function M.setup()
return return
end end
local ts = require("nvim-treesitter.configs") require("nvim-treesitter.configs").setup({
ts.setup({
textobjects = { textobjects = {
select = { select = {
enable = true, enable = true,
@ -27,20 +26,16 @@ function M.setup()
enable = true, enable = true,
set_jumps = true, -- whether to set jumps in the jumplist set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = { goto_next_start = {
["]m"] = "@function.outer", ["]]"] = "@function.outer",
["]]"] = "@class.outer",
}, },
goto_next_end = { goto_next_end = {
["]M"] = "@function.outer", ["]["] = "@function.outer",
["]["] = "@class.outer",
}, },
goto_previous_start = { goto_previous_start = {
["[m"] = "@function.outer", ["[["] = "@function.outer",
["[["] = "@class.outer",
}, },
goto_previous_end = { goto_previous_end = {
["[M"] = "@function.outer", ["[]"] = "@function.outer",
["[]"] = "@class.outer",
}, },
}, },
}, },

@ -206,6 +206,9 @@ end
local cache_dir = vim.fn.stdpath("cache") local cache_dir = vim.fn.stdpath("cache")
util.log = function(...) util.log = function(...)
if not _GO_NVIM_CFG then
return
end
if not _GO_NVIM_CFG.verbose then if not _GO_NVIM_CFG.verbose then
return return
end end

@ -126,7 +126,7 @@ describe("should run gofmt", function()
require("go.format").goimport() require("go.format").goimport()
print("workspaces:", vim.inspect(vim.lsp.buf.list_workspace_folders())) print("workspaces:", vim.inspect(vim.lsp.buf.list_workspace_folders()))
vim.wait(400, function() end) vim.wait(500, function() end)
vim.cmd([[w]]) vim.cmd([[w]])
local fmt = vim.fn.join(vim.fn.readfile(path), "\n") local fmt = vim.fn.join(vim.fn.readfile(path), "\n")
print(vim.inspect(fmt)) print(vim.inspect(fmt))

Loading…
Cancel
Save