From 2e92065686f62851318150a315591c30b8306a4b Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Thu, 14 Sep 2023 08:23:01 -0500 Subject: docs: replace
 with ``` (#25136)

---
 runtime/lua/vim/_editor.lua | 96 ++++++++++++++++++++++++---------------------
 1 file changed, 51 insertions(+), 45 deletions(-)

(limited to 'runtime/lua/vim/_editor.lua')

diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua
index 64aeb64736..0215cae0cb 100644
--- a/runtime/lua/vim/_editor.lua
+++ b/runtime/lua/vim/_editor.lua
@@ -70,23 +70,24 @@ vim.log = {
 --- Run a system command
 ---
 --- Examples:
---- 
lua
 ---
----   local on_exit = function(obj)
----     print(obj.code)
----     print(obj.signal)
----     print(obj.stdout)
----     print(obj.stderr)
----   end
+--- ```lua
 ---
----   -- Run asynchronously
----   vim.system({'echo', 'hello'}, { text = true }, on_exit)
+--- local on_exit = function(obj)
+---   print(obj.code)
+---   print(obj.signal)
+---   print(obj.stdout)
+---   print(obj.stderr)
+--- end
 ---
----   -- Run synchronously
----   local obj = vim.system({'echo', 'hello'}, { text = true }):wait()
----   -- { code = 0, signal = 0, stdout = 'hello', stderr = '' }
+--- -- Run asynchronously
+--- vim.system({'echo', 'hello'}, { text = true }, on_exit)
 ---
---- 
+--- -- Run synchronously +--- local obj = vim.system({'echo', 'hello'}, { text = true }):wait() +--- -- { code = 0, signal = 0, stdout = 'hello', stderr = '' } +--- +--- ``` --- --- See |uv.spawn()| for more details. --- @@ -200,7 +201,8 @@ do --- (such as the |TUI|) pastes text into the editor. --- --- Example: To remove ANSI color codes when pasting: - ---
lua
+  ---
+  --- ```lua
   --- vim.paste = (function(overridden)
   ---   return function(lines, phase)
   ---     for i,line in ipairs(lines) do
@@ -210,7 +212,7 @@ do
   ---     overridden(lines, phase)
   ---   end
   --- end)(vim.paste)
-  --- 
+ --- ``` --- ---@see |paste| ---@alias paste_phase -1 | 1 | 2 | 3 @@ -361,32 +363,33 @@ local VIM_CMD_ARG_MAX = 20 --- command. --- --- Example: ----
lua
----   vim.cmd('echo 42')
----   vim.cmd([[
----     augroup My_group
----       autocmd!
----       autocmd FileType c setlocal cindent
----     augroup END
----   ]])
 ---
----   -- Ex command :echo "foo"
----   -- Note string literals need to be double quoted.
----   vim.cmd('echo "foo"')
----   vim.cmd { cmd = 'echo', args = { '"foo"' } }
----   vim.cmd.echo({ args = { '"foo"' } })
----   vim.cmd.echo('"foo"')
+--- ```lua
+--- vim.cmd('echo 42')
+--- vim.cmd([[
+---   augroup My_group
+---     autocmd!
+---     autocmd FileType c setlocal cindent
+---   augroup END
+--- ]])
+---
+--- -- Ex command :echo "foo"
+--- -- Note string literals need to be double quoted.
+--- vim.cmd('echo "foo"')
+--- vim.cmd { cmd = 'echo', args = { '"foo"' } }
+--- vim.cmd.echo({ args = { '"foo"' } })
+--- vim.cmd.echo('"foo"')
 ---
----   -- Ex command :write! myfile.txt
----   vim.cmd('write! myfile.txt')
----   vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true }
----   vim.cmd.write { args = { "myfile.txt" }, bang = true }
----   vim.cmd.write { "myfile.txt", bang = true }
+--- -- Ex command :write! myfile.txt
+--- vim.cmd('write! myfile.txt')
+--- vim.cmd { cmd = 'write', args = { "myfile.txt" }, bang = true }
+--- vim.cmd.write { args = { "myfile.txt" }, bang = true }
+--- vim.cmd.write { "myfile.txt", bang = true }
 ---
----   -- Ex command :colorscheme blue
----   vim.cmd('colorscheme blue')
----   vim.cmd.colorscheme('blue')
---- 
+--- -- Ex command :colorscheme blue +--- vim.cmd('colorscheme blue') +--- vim.cmd.colorscheme('blue') +--- ``` --- ---@param command string|table Command(s) to execute. --- If a string, executes multiple lines of Vim script at once. In this @@ -871,9 +874,10 @@ end --- "Pretty prints" the given arguments and returns them unmodified. --- --- Example: ----
lua
----   local hl_normal = vim.print(vim.api.nvim_get_hl_by_name('Normal', true))
---- 
+--- +--- ```lua +--- local hl_normal = vim.print(vim.api.nvim_get_hl_by_name('Normal', true)) +--- ``` --- --- @see |vim.inspect()| --- @see |:=| @@ -900,10 +904,12 @@ end --- Translate keycodes. --- --- Example: ----
lua
----   local k = vim.keycode
----   vim.g.mapleader = k''
---- 
+--- +--- ```lua +--- local k = vim.keycode +--- vim.g.mapleader = k'' +--- ``` +--- --- @param str string String to be converted. --- @return string --- @see |nvim_replace_termcodes()| -- cgit