-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathexample.vim
More file actions
40 lines (31 loc) · 898 Bytes
/
example.vim
File metadata and controls
40 lines (31 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
" Sample from `:h :lua`
function! CurrentLineInfo()
lua << EOF
local linenr = vim.api.nvim_win_get_cursor(0)[1]
local curline = vim.api.nvim_buf_get_lines(
0, linenr, linenr + 1, false)[1]
-- This line should be properly wrapped when using `gw`. Also, typing after the
-- comment block, it should break the line to the next, and automatically insert
-- the comment character. Without 'comments' properly set, it doesn't.
print(string.format("Current line [%d] has %d bytes",
linenr, #curline))
EOF
endfunction
" Sample from `:h :python`
function! IcecreamInitialize()
python << EOF
class StrawberryIcecream:
def __call__(self):
print 'EAT ME'
EOF
endfunction
" Samples of Vim9 syntax in legacy script
def TestDef()
echo ':help :def'
enddef
command TestCommandBlock {
echo ':help :command-repl'
}
autocmd FileType vim {
echo ':help :autocmd-block'
}