Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.1.1 & Your IP : 18.216.1.197
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
vim /
vim82 /
doc /
Delete
Unzip
Name
Size
Permission
Date
Action
README.Debian
324
B
-rw-r--r--
2024-08-27 05:29
arabic.txt
11.92
KB
-rw-r--r--
2025-04-02 12:39
autocmd.txt
72.57
KB
-rw-r--r--
2025-04-02 12:39
builtin.txt
379.96
KB
-rw-r--r--
2025-04-02 12:39
change.txt
77.36
KB
-rw-r--r--
2025-04-02 12:39
channel.txt
49.21
KB
-rw-r--r--
2025-04-02 12:39
cmdline.txt
48.96
KB
-rw-r--r--
2025-04-02 12:39
debug.txt
6.73
KB
-rw-r--r--
2025-04-02 12:39
debugger.txt
5.32
KB
-rw-r--r--
2025-04-02 12:39
develop.txt
22.33
KB
-rw-r--r--
2025-04-02 12:39
diff.txt
17.1
KB
-rw-r--r--
2025-04-02 12:39
digraph.txt
60.63
KB
-rw-r--r--
2025-04-02 12:39
editing.txt
73.55
KB
-rw-r--r--
2025-04-02 12:39
eval.txt
174.1
KB
-rw-r--r--
2025-04-02 12:39
farsi.txt
523
B
-rw-r--r--
2025-04-02 12:39
filetype.txt
27.34
KB
-rw-r--r--
2025-04-02 12:39
fold.txt
23.57
KB
-rw-r--r--
2025-04-02 12:39
ft_ada.txt
17.82
KB
-rw-r--r--
2025-04-02 12:39
ft_ps1.txt
2.14
KB
-rw-r--r--
2025-04-02 12:39
ft_raku.txt
4.08
KB
-rw-r--r--
2025-04-02 12:39
ft_rust.txt
9.37
KB
-rw-r--r--
2025-04-02 12:39
ft_sql.txt
29.98
KB
-rw-r--r--
2025-04-02 12:39
gui.txt
51.83
KB
-rw-r--r--
2025-04-02 12:39
gui_w32.txt
18.67
KB
-rw-r--r--
2025-04-02 12:39
gui_x11.txt
29.21
KB
-rw-r--r--
2025-04-02 12:39
hangulin.txt
598
B
-rw-r--r--
2025-04-02 12:39
hebrew.txt
5.53
KB
-rw-r--r--
2025-04-02 12:39
help.txt
8.88
KB
-rw-r--r--
2025-04-02 12:39
help.txt.vim-tiny
1.4
KB
-rw-r--r--
2024-08-27 05:29
helphelp.txt
15.56
KB
-rw-r--r--
2025-04-02 12:39
howto.txt
2.85
KB
-rw-r--r--
2025-04-02 12:39
if_cscop.txt
18.87
KB
-rw-r--r--
2025-04-02 12:39
if_lua.txt
18.11
KB
-rw-r--r--
2025-04-02 12:39
if_mzsch.txt
11.66
KB
-rw-r--r--
2025-04-02 12:39
if_ole.txt
7.19
KB
-rw-r--r--
2025-04-02 12:39
if_perl.txt
11.02
KB
-rw-r--r--
2025-04-02 12:39
if_pyth.txt
37.74
KB
-rw-r--r--
2025-04-02 12:39
if_ruby.txt
8.32
KB
-rw-r--r--
2025-04-02 12:39
if_sniff.txt
271
B
-rw-r--r--
2025-04-02 12:39
if_tcl.txt
22.4
KB
-rw-r--r--
2025-04-02 12:39
indent.txt
40.92
KB
-rw-r--r--
2025-04-02 12:39
index.txt
79.22
KB
-rw-r--r--
2025-04-02 12:39
insert.txt
85.52
KB
-rw-r--r--
2025-04-02 12:39
intro.txt
38.02
KB
-rw-r--r--
2025-04-02 12:39
map.txt
72.72
KB
-rw-r--r--
2025-04-02 12:39
mbyte.txt
58.24
KB
-rw-r--r--
2025-04-02 12:39
message.txt
30.93
KB
-rw-r--r--
2025-04-02 12:39
mlang.txt
8
KB
-rw-r--r--
2025-04-02 12:39
motion.txt
50.67
KB
-rw-r--r--
2025-04-02 12:39
netbeans.txt
37.09
KB
-rw-r--r--
2025-04-02 12:39
options.txt
391.85
KB
-rw-r--r--
2025-04-02 12:39
os_390.txt
4.64
KB
-rw-r--r--
2025-04-02 12:39
os_amiga.txt
5.34
KB
-rw-r--r--
2025-04-02 12:39
os_beos.txt
293
B
-rw-r--r--
2025-04-02 12:39
os_dos.txt
15.13
KB
-rw-r--r--
2025-04-02 12:39
os_haiku.txt
8.3
KB
-rw-r--r--
2025-04-02 12:39
os_mac.txt
6.7
KB
-rw-r--r--
2025-04-02 12:39
os_mint.txt
391
B
-rw-r--r--
2025-04-02 12:39
os_msdos.txt
523
B
-rw-r--r--
2025-04-02 12:39
os_os2.txt
299
B
-rw-r--r--
2025-04-02 12:39
os_qnx.txt
3.98
KB
-rw-r--r--
2025-04-02 12:39
os_risc.txt
328
B
-rw-r--r--
2025-04-02 12:39
os_unix.txt
2.54
KB
-rw-r--r--
2025-04-02 12:39
os_vms.txt
32.13
KB
-rw-r--r--
2025-04-02 12:39
os_win32.txt
14.07
KB
-rw-r--r--
2025-04-02 12:39
pattern.txt
61.47
KB
-rw-r--r--
2025-04-02 12:39
pi_getscript.txt
20.59
KB
-rw-r--r--
2025-04-02 12:39
pi_gzip.txt
1.26
KB
-rw-r--r--
2025-04-02 12:39
pi_logipat.txt
4.1
KB
-rw-r--r--
2025-04-02 12:39
pi_netrw.txt
177.67
KB
-rw-r--r--
2025-04-02 12:39
pi_paren.txt
2.22
KB
-rw-r--r--
2025-04-02 12:39
pi_spec.txt
4.03
KB
-rw-r--r--
2025-04-02 12:39
pi_tar.txt
7.08
KB
-rw-r--r--
2025-04-02 12:39
pi_vimball.txt
11.58
KB
-rw-r--r--
2025-04-02 12:39
pi_zip.txt
7.32
KB
-rw-r--r--
2025-04-02 12:39
popup.txt
38.76
KB
-rw-r--r--
2025-04-02 12:39
print.txt
30.48
KB
-rw-r--r--
2025-04-02 12:39
quickfix.txt
81.38
KB
-rw-r--r--
2025-04-02 12:39
quickref.txt
70.79
KB
-rw-r--r--
2025-04-02 12:39
quotes.txt
12.45
KB
-rw-r--r--
2025-04-02 12:39
recover.txt
10.47
KB
-rw-r--r--
2025-04-02 12:39
remote.txt
8.22
KB
-rw-r--r--
2025-04-02 12:39
repeat.txt
42.54
KB
-rw-r--r--
2025-04-02 12:39
rileft.txt
4.82
KB
-rw-r--r--
2025-04-02 12:39
russian.txt
2.95
KB
-rw-r--r--
2025-04-02 12:39
scroll.txt
13.46
KB
-rw-r--r--
2025-04-02 12:39
sign.txt
26.24
KB
-rw-r--r--
2025-04-02 12:39
spell.txt
62.59
KB
-rw-r--r--
2025-04-02 12:39
sponsor.txt
6.64
KB
-rw-r--r--
2025-04-02 12:39
starting.txt
71.87
KB
-rw-r--r--
2025-04-02 12:39
syntax.txt
224.41
KB
-rw-r--r--
2025-04-02 12:39
tabpage.txt
16.84
KB
-rw-r--r--
2025-04-02 12:39
tags
354.23
KB
-rw-r--r--
2025-04-02 12:39
tags.vim-tiny
30
B
-rw-r--r--
2024-08-27 05:29
tagsrch.txt
39.33
KB
-rw-r--r--
2025-04-02 12:39
term.txt
48.65
KB
-rw-r--r--
2025-04-02 12:39
terminal.txt
55.76
KB
-rw-r--r--
2025-04-02 12:39
testing.txt
16.29
KB
-rw-r--r--
2025-04-02 12:39
textprop.txt
16.01
KB
-rw-r--r--
2025-04-02 12:39
tips.txt
20.59
KB
-rw-r--r--
2025-04-02 12:39
todo.txt
299.95
KB
-rw-r--r--
2025-04-02 12:39
uganda.txt
13.7
KB
-rw-r--r--
2025-04-02 12:39
undo.txt
16.2
KB
-rw-r--r--
2025-04-02 12:39
usr_01.txt
6.92
KB
-rw-r--r--
2025-04-02 12:39
usr_02.txt
23.66
KB
-rw-r--r--
2025-04-02 12:39
usr_03.txt
23.31
KB
-rw-r--r--
2025-04-02 12:39
usr_04.txt
18.68
KB
-rw-r--r--
2025-04-02 12:39
usr_05.txt
26.39
KB
-rw-r--r--
2025-04-02 12:39
usr_06.txt
10.39
KB
-rw-r--r--
2025-04-02 12:39
usr_07.txt
15.62
KB
-rw-r--r--
2025-04-02 12:39
usr_08.txt
18.92
KB
-rw-r--r--
2025-04-02 12:39
usr_09.txt
11.23
KB
-rw-r--r--
2025-04-02 12:39
usr_10.txt
28.52
KB
-rw-r--r--
2025-04-02 12:39
usr_11.txt
12.72
KB
-rw-r--r--
2025-04-02 12:39
usr_12.txt
13.12
KB
-rw-r--r--
2025-04-02 12:39
usr_20.txt
13.41
KB
-rw-r--r--
2025-04-02 12:39
usr_21.txt
18.02
KB
-rw-r--r--
2025-04-02 12:39
usr_22.txt
14.65
KB
-rw-r--r--
2025-04-02 12:39
usr_23.txt
12.45
KB
-rw-r--r--
2025-04-02 12:39
usr_24.txt
20.34
KB
-rw-r--r--
2025-04-02 12:39
usr_25.txt
18.73
KB
-rw-r--r--
2025-04-02 12:39
usr_26.txt
8.07
KB
-rw-r--r--
2025-04-02 12:39
usr_27.txt
17.29
KB
-rw-r--r--
2025-04-02 12:39
usr_28.txt
15.64
KB
-rw-r--r--
2025-04-02 12:39
usr_29.txt
19.65
KB
-rw-r--r--
2025-04-02 12:39
usr_30.txt
22.13
KB
-rw-r--r--
2025-04-02 12:39
usr_31.txt
10.16
KB
-rw-r--r--
2025-04-02 12:39
usr_32.txt
5.25
KB
-rw-r--r--
2025-04-02 12:39
usr_40.txt
22.65
KB
-rw-r--r--
2025-04-02 12:39
usr_41.txt
93.38
KB
-rw-r--r--
2025-04-02 12:39
usr_42.txt
13.53
KB
-rw-r--r--
2025-04-02 12:39
usr_43.txt
7.24
KB
-rw-r--r--
2025-04-02 12:39
usr_44.txt
28.27
KB
-rw-r--r--
2025-04-02 12:39
usr_45.txt
17.27
KB
-rw-r--r--
2025-04-02 12:39
usr_46.txt
6.93
KB
-rw-r--r--
2025-04-02 12:39
usr_90.txt
16.44
KB
-rw-r--r--
2025-04-02 12:39
usr_toc.txt
9.28
KB
-rw-r--r--
2025-04-02 12:39
various.txt
30.75
KB
-rw-r--r--
2025-04-02 12:39
version4.txt
13.58
KB
-rw-r--r--
2025-04-02 12:39
version5.txt
301.3
KB
-rw-r--r--
2025-04-02 12:39
version6.txt
563.42
KB
-rw-r--r--
2025-04-02 12:39
version7.txt
658.89
KB
-rw-r--r--
2025-04-02 12:39
version8.txt
1.85
MB
-rw-r--r--
2025-04-02 12:39
vi_diff.txt
56.08
KB
-rw-r--r--
2025-04-02 12:39
vim9.txt
67
KB
-rw-r--r--
2025-04-02 12:39
visual.txt
21.33
KB
-rw-r--r--
2025-04-02 12:39
windows.txt
54.59
KB
-rw-r--r--
2025-04-02 12:39
workshop.txt
371
B
-rw-r--r--
2025-04-02 12:39
Save
Rename
*usr_46.txt* For Vim version 8.2. Last change: 2020 Jun 14 VIM USER MANUAL - by Bram Moolenaar Write plugins using Vim9 script The Vim9 script language is used for writing plugins, especially larger ones that use multiple files. This chapter explains how to split up a plugin into modules, import and export items and keep the rest local. |46.1| Introduction |46.2| Variable declarations |46.3| Functions and types |46.?| Using a Vim9 script from legacy script Next chapter: |usr_90.txt| Installing Vim Previous chapter: |usr_45.txt| Select your language (locale) Table of contents: |usr_toc.txt| ============================================================================== *46.1* Introduction *vim9-script-intro* Vim9 script was designed to make it easier to write large Vim scripts. It looks more like other script languages, especially Typescript. Also, functions are compiled into instructions that can be executed quickly. This makes Vim9 script a lot faster, up to a 100 times. The basic idea is that a script file has items that are private, only used inside the script file, and items that are exported, used outside of the script file. The exported items can then be used by scripts that import them. That makes very clear what is defined where. Let's start with an example, a script that exports one function and has one private function: > vim9script " This indicates a Vim9 script file. export def GetMessage(): string let result = '' ... result = GetPart(count) ... return result enddef def GetPart(nr: number): string if nr == 4 return 'yes' else return 'no' endif enddef The `vim9script` command must be the very first command in the file. Without it Vim will assume legacy script syntax. The `export def GetMessage(): string` line starts with `export`, meaning that this function can be imported and called by other scripts. The line `def GetPart(...` does not start with `export`, this is a script-local function, it can only be used inside this script file. In the `export def GetMessage(): string` line you will notice the colon and the return type. Vim9 functions, defined with `def`, require specifying the type of arguments and the return type. That way Vim can compile the code efficiently. The GetPart function defines an argument "nr" of type "number". Notice that the assignment `result = GetPart(count)` does not use the `let` command. That is explained in the next section. ============================================================================== *46.2* Variable declarations *vim9-declarations* In Vim9 script variables are declared once with a `:let` or `:const` command. Assigning a value is done without `:let` and it is not possible to `:unlet` the variable. In most cases you will want to declare the variable and initialize it at the same time: > let myText = 'some text' ... myText = 'other text' The type of the variable will be inferred from the expression. In this case it is a string. If you initialize with a number, then the type is number: > let myNumber = 1234 ... myNumber = 0 If you try to assign a string to this variable, you will get an error: > let myNumber = 'this fails!' In the rare case you want a variable that can take values of any type, you have to specify the type: > let myVar: any = 1234 myVar = 'text also works' You can also declare a variable without assigning a value. In that case Vim will initialize it to zero or empty: > let word: string if condition word = 'yes' else word = 'no' endif Although it's shorter to do: > let word = condition ? 'yes' : 'no' ============================================================================== *46.3* Functions and types Legacy Vim script does have type checking, but this happens at runtime, when the code is executed. And it's permissive, often a computation gives an unexpected value instead of reporting an error. Thus you can define a function and think it's fine, but see a problem only later when it is called: > let s:collected = '' func ExtendAndReturn(add) let s:collected += a:add return s:collected endfunc Can you spot the error? Try this: > echo ExtendAndReturn('text') And you'll see zero. Why? Because in legacy Vim script "+=" will convert the arguments to numbers, and any string without a number results in zero! With `:def` the type checking happens when compiling the function. For that you need to specify the argument types and the return type. Also notice that the argument is used without the "a:" prefix: > let s:collected = '' def ExtendAndReturn(add: string): string s:collected += add return s:collected enddef defcompile Here we use `:defcompile` to do the compilation right away, without it the compilation would happen when the function is called. Vim will tell you what you did wrong: > E1013: type mismatch, expected number but got string Vim9 script is strict, it uses the "+" operator only for numbers and floats. For string concatenation ".." must be used. This avoids mistakes and avoids the automatic conversion that gave a surprising result above. So you change the first line of the function to: > s:collected ..= add And now it works. If the function does not return anything, just leave out the return type: > def ReportResult(result: string) echo 'The result is: ' .. result enddef This is also checked, if you try to return a value you'll get an error. In case you don't care about types or have a function that does work with multiple types, you can use the "any" type: > def Store(key: string, value: any) resultDict[key] = value enddef ============================================================================== *46.?* Using a Vim9 script from legacy script *source-vim9-script* In some cases you have a legacy Vim script where you want to use items from a Vim9 script. For example in your .vimrc you want to initialize a plugin. The best way to do this is to use `:import`. For example: > import Init as NiceInit from 'myNicePlugin.vim' call NiceInit('today') This finds the exported function "Init" in the Vim9 script file and makes it available as script-local item "NiceInit". `:import` always uses the script namespace, even when "s:" is not given. If "myNicePlugin.vim" was already sourced it is not sourced again. Besides avoiding putting any items in the global namespace (where name clashes can cause unexpected errors), this also means the script is sourced only once, no matter how many times items from it are imported. In some cases, e.g. for testing, you may just want to source the Vim9 script. That is OK, but then only global items will be available. The Vim9 script will have to make sure to use a unique name for these global items. Example: > source ~/.vim/extra/myNicePlugin.vim call g:NicePluginTest() ============================================================================== Next chapter: |usr_90.txt| Installing Vim Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: