You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I frequently use <C + r> to choose a register to paste text from, and when I am viewing code that has different languages in comments, I need to translate, but can not easily type this myself.
The problem I'm running into with Pantran, is that whenever I try to paste text from a register while in Insert mode, I get an error message:
:Pantran
Go into Insert mode
Type <C + r> in the source window, I get this error:
Here is my config:
root init.lua
require("plugins")
require("mason").setup()
require("nvim-tree").setup({
filters= {
exclude= { ".env" },
},
})
require("transparent").setup()
require("pantran").setup({
default_engine="google",
})
require("nvim-treesitter.configs").setup({
ensure_installed= {
"bash",
"css",
"dockerfile",
"fish",
"html",
"http",
"javascript",
"jq",
"json",
"lua",
"markdown",
"ruby",
"scss",
"sql",
"toml",
"tsx",
"typescript",
"vim",
"vimdoc",
"yaml",
},
-- required by 'nvim-treesitter-endwise'endwise= {
enable=true,
},
})
require("web-tools").setup({
keymaps= {
rename=nil, -- by default use same setup of lspconfigrepeat_rename=".", -- . to repeat
},
hurl= { -- hurl defaultshow_headers=false, -- do not show http headersfloating=false, -- use floating windows (need guihua.lua)formatters= { -- format the result by filetypejson= { "jq" },
html= { "prettier", "--parser", "html" },
},
},
})
require("rest-nvim").setup({
-- Open request results in a horizontal splitresult_split_horizontal=false,
-- Keep the http file buffer above|left when split horizontal|verticalresult_split_in_place=true,
-- Skip SSL verification, useful for unknown certificatesskip_ssl_verification=false,
-- Encode URL before making requestencode_url=true,
-- Highlight request on runhighlight= {
enabled=true,
timeout=150,
},
result= {
-- toggle showing URL, HTTP info, headers at top the of result windowshow_url=true,
-- show the generated curl command in case you want to launch-- the same request via the terminal (can be verbose)show_curl_command=false,
show_http_info=true,
show_headers=true,
-- executables or functions for formatting response body [optional]-- set them to false if you want to disable themformatters= {
json="jq",
html=function(body)
returnvim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end,
},
},
-- Jump to request line on runjump_to_request=false,
env_file=".env",
custom_dynamic_variables= {},
yank_dry_run=true,
})
vim.keymap.set('n', '<leader>x', '<Plug>RestNvim', { desc='execute request' })
vim.keymap.set('n', '<leader>p', '<Plug>RestNvimPreview', { desc='preview curl' })
vim.keymap.set('n', '<leader>l', '<Plug>RestNvimLast', { desc='repeat last request' })
-- Add additional capabilities supported by nvim-cmplocalcapabilities=require("cmp_nvim_lsp").default_capabilities()
-- Language Server Configuration STARTlocallspconfig=require("lspconfig")
localservers= {
"jsonls",
"html",
"cssls",
"yamlls",
"tsserver",
"eslint",
"cucumber_language_server",
"tailwindcss",
}
for_, lspinipairs(servers) dolspconfig[lsp].setup({
capabilities=capabilities,
})
end-- RECOMMENDED 'nvim-lspconfig' SETUP START-- luasnip setuplocalluasnip=require("luasnip")
-- nvim-cmpsetuplocalcmp=require("cmp")
cmp.setup({
snippet= {
expand=function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping=cmp.mapping.preset.insert({
["<C-u>"] =cmp.mapping.scroll_docs(-4), -- Up
["<C-d>"] =cmp.mapping.scroll_docs(4), -- Down-- C-b (back) C-f (forward) for snippet placeholder navigation.
["<C-Space>"] =cmp.mapping.complete(),
["<CR>"] =cmp.mapping.confirm({
behavior=cmp.ConfirmBehavior.Replace,
select=true,
}),
["<Tab>"] =cmp.mapping(function(fallback)
ifcmp.visible() thencmp.select_next_item()
elseifluasnip.expand_or_jumpable() thenluasnip.expand_or_jump()
elsefallback()
endend, { "i", "s" }),
["<S-Tab>"] =cmp.mapping(function(fallback)
ifcmp.visible() thencmp.select_prev_item()
elseifluasnip.jumpable(-1) thenluasnip.jump(-1)
elsefallback()
endend, { "i", "s" }),
}),
sources= {
{ name="nvim_lsp" },
{ name="luasnip" },
},
})
-- RECOMMENDED 'nvim-lspconfig' SETUP END-- 'nvim-lsp' suggested keymappings, completion-- Global mappings.-- See `:help vim.diagnostic.*` for documentation on any of the below functionsvim.keymap.set("n", "<space>e", vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist)
-- Use LspAttach autocommand to only map the following keys-- after the language server attaches to the current buffervim.api.nvim_create_autocmd("LspAttach", {
group=vim.api.nvim_create_augroup("UserLspConfig", {}),
callback=function(ev)
-- Enable completion triggered by <c-x><c-o>vim.bo[ev.buf].omnifunc="v:lua.vim.lsp.omnifunc"-- Buffer local mappings.-- See `:help vim.lsp.*` for documentation on any of the below functionslocalopts= { buffer=ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<space>f", function()
vim.lsp.buf.format({ async=true })
end, opts)
end,
})
-- Language Server Configuration END-- FZFvim.keymap.set("n", "<C-p>", ":FZF<CR>", { noremap=false })
-- lualinerequire("lualine").setup()
-- general configslocalset=vim.optset.expandtab=trueset.tabstop=4set.shiftwidth=4set.softtabstop=4set.number=trueset.hlsearch=falsevim.cmd([[autocmd FileType * set formatoptions-=ro]])
set.syntax="on"-- Ensures we only generate 'tags' file in Ruby projectsvim.cmd([[ let g:gutentags_project_root = ['Gemfile']]])
vim.cmd([[colorscheme onedark]])
localfunctionopen_nvim_tree()
-- open the treerequire("nvim-tree.api").tree.open()
endvim.api.nvim_create_autocmd({ "VimEnter" }, { callback=open_nvim_tree })
I frequently use
<C + r>
to choose a register to paste text from, and when I am viewing code that has different languages in comments, I need to translate, but can not easily type this myself.The problem I'm running into with
Pantran
, is that whenever I try to paste text from a register while in Insert mode, I get an error message::Pantran
<C + r>
in the source window, I get this error:Here is my config:
root
init.lua
plugins/init.lua
:This happens no matter what engine I choose to use
The text was updated successfully, but these errors were encountered: