usr_40.txt 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. *usr_40.txt* Nvim
  2. VIM USER MANUAL - by Bram Moolenaar
  3. Make new commands
  4. Vim is an extensible editor. You can take a sequence of commands you use
  5. often and turn it into a new command. Or redefine an existing command.
  6. Autocommands make it possible to execute commands automatically.
  7. |40.1| Key mapping
  8. |40.2| Defining command-line commands
  9. |40.3| Autocommands
  10. Next chapter: |usr_41.txt| Write a Vim script
  11. Previous chapter: |usr_32.txt| The undo tree
  12. Table of contents: |usr_toc.txt|
  13. ==============================================================================
  14. *40.1* Key mapping
  15. A simple mapping was explained in section |05.3|. The principle is that one
  16. sequence of key strokes is translated into another sequence of key strokes.
  17. This is a simple, yet powerful mechanism.
  18. The simplest form is that one key is mapped to a sequence of keys. Since
  19. the function keys, except <F1>, have no predefined meaning in Vim, these are
  20. good choices to map. Example: >
  21. :map <F2> GoDate: <Esc>:read !date<CR>kJ
  22. This shows how three modes are used. After going to the last line with "G",
  23. the "o" command opens a new line and starts Insert mode. The text "Date: " is
  24. inserted and <Esc> takes you out of insert mode.
  25. Notice the use of special keys inside <>. This is called angle bracket
  26. notation. You type these as separate characters, not by pressing the key
  27. itself. This makes the mappings better readable and you can copy and paste
  28. the text without problems.
  29. The ":" character takes Vim to the command line. The ":read !date" command
  30. reads the output from the "date" command and appends it below the current
  31. line. The <CR> is required to execute the ":read" command.
  32. At this point of execution the text looks like this:
  33. Date: ~
  34. Fri Jun 15 12:54:34 CEST 2001 ~
  35. Now "kJ" moves the cursor up and joins the lines together.
  36. To decide which key or keys you use for mapping, see |map-which-keys|.
  37. MAPPING AND MODES
  38. The ":map" command defines remapping for keys in Normal mode. You can also
  39. define mappings for other modes. For example, ":imap" applies to Insert mode.
  40. You can use it to insert a date below the cursor: >
  41. :imap <F2> <CR>Date: <Esc>:read !date<CR>kJ
  42. It looks a lot like the mapping for <F2> in Normal mode, only the start is
  43. different. The <F2> mapping for Normal mode is still there. Thus you can map
  44. the same key differently for each mode.
  45. Notice that, although this mapping starts in Insert mode, it ends in Normal
  46. mode. If you want it to continue in Insert mode, append an "a" to the
  47. mapping.
  48. Here is an overview of map commands and in which mode they work:
  49. :map Normal, Visual and Operator-pending
  50. :vmap Visual
  51. :nmap Normal
  52. :omap Operator-pending
  53. :map! Insert and Command-line
  54. :imap Insert
  55. :cmap Command-line
  56. Operator-pending mode is when you typed an operator character, such as "d" or
  57. "y", and you are expected to type the motion command or a text object. Thus
  58. when you type "dw", the "w" is entered in operator-pending mode.
  59. Suppose that you want to define <F7> so that the command d<F7> deletes a C
  60. program block (text enclosed in curly braces, {}). Similarly y<F7> would yank
  61. the program block into the unnamed register. Therefore, what you need to do
  62. is to define <F7> to select the current program block. You can do this with
  63. the following command: >
  64. :omap <F7> a{
  65. This causes <F7> to perform a select block "a{" in operator-pending mode, just
  66. like you typed it. This mapping is useful if typing a { on your keyboard is a
  67. bit difficult.
  68. LISTING MAPPINGS
  69. To see the currently defined mappings, use ":map" without arguments. Or one
  70. of the variants that include the mode in which they work. The output could
  71. look like this:
  72. _g :call MyGrep(1)<CR> ~
  73. v <F2> :s/^/> /<CR>:noh<CR>`` ~
  74. n <F2> :.,$s/^/> /<CR>:noh<CR>`` ~
  75. <xHome> <Home>
  76. <xEnd> <End>
  77. The first column of the list shows in which mode the mapping is effective.
  78. This is "n" for Normal mode, "i" for Insert mode, etc. A blank is used for a
  79. mapping defined with ":map", thus effective in both Normal and Visual mode.
  80. One useful purpose of listing the mapping is to check if special keys in <>
  81. form have been recognized (this only works when color is supported). For
  82. example, when <Esc> is displayed in color, it stands for the escape character.
  83. When it has the same color as the other text, it is five characters.
  84. REMAPPING
  85. The result of a mapping is inspected for other mappings in it. For example,
  86. the mappings for <F2> above could be shortened to: >
  87. :map <F2> G<F3>
  88. :imap <F2> <Esc><F3>
  89. :map <F3> oDate: <Esc>:read !date<CR>kJ
  90. For Normal mode <F2> is mapped to go to the last line, and then behave like
  91. <F3> was pressed. In Insert mode <F2> stops Insert mode with <Esc> and then
  92. also uses <F3>. Then <F3> is mapped to do the actual work.
  93. Suppose you hardly ever use Ex mode, and want to use the "Q" command to format
  94. text (this was so in old versions of Vim). This mapping will do it: >
  95. :map Q gq
  96. But, in rare cases you need to use Ex mode anyway. Let's map "gQ" to Q, so
  97. that you can still go to Ex mode: >
  98. :map gQ Q
  99. What happens now is that when you type "gQ" it is mapped to "Q". So far so
  100. good. But then "Q" is mapped to "gq", thus typing "gQ" results in "gq", and
  101. you don't get to Ex mode at all.
  102. To avoid keys to be mapped again, use the ":noremap" command: >
  103. :noremap gQ Q
  104. Now Vim knows that the "Q" is not to be inspected for mappings that apply to
  105. it. There is a similar command for every mode:
  106. :noremap Normal, Visual and Operator-pending
  107. :vnoremap Visual
  108. :nnoremap Normal
  109. :onoremap Operator-pending
  110. :noremap! Insert and Command-line
  111. :inoremap Insert
  112. :cnoremap Command-line
  113. RECURSIVE MAPPING
  114. When a mapping triggers itself, it will run forever. This can be used to
  115. repeat an action an unlimited number of times.
  116. For example, you have a list of files that contain a version number in the
  117. first line. You edit these files with "vim *.txt". You are now editing the
  118. first file. Define this mapping: >
  119. :map ,, :s/5.1/5.2/<CR>:wnext<CR>,,
  120. Now you type ",,". This triggers the mapping. It replaces "5.1" with "5.2"
  121. in the first line. Then it does a ":wnext" to write the file and edit the
  122. next one. The mapping ends in ",,". This triggers the same mapping again,
  123. thus doing the substitution, etc.
  124. This continues until there is an error. In this case it could be a file
  125. where the substitute command doesn't find a match for "5.1". You can then
  126. make a change to insert "5.1" and continue by typing ",," again. Or the
  127. ":wnext" fails, because you are in the last file in the list.
  128. When a mapping runs into an error halfway, the rest of the mapping is
  129. discarded. CTRL-C interrupts the mapping (CTRL-Break on MS-Windows).
  130. DELETE A MAPPING
  131. To remove a mapping use the ":unmap" command. Again, the mode the unmapping
  132. applies to depends on the command used:
  133. :unmap Normal, Visual and Operator-pending
  134. :vunmap Visual
  135. :nunmap Normal
  136. :ounmap Operator-pending
  137. :unmap! Insert and Command-line
  138. :iunmap Insert
  139. :cunmap Command-line
  140. There is a trick to define a mapping that works in Normal and Operator-pending
  141. mode, but not in Visual mode. First define it for all three modes, then
  142. delete it for Visual mode: >
  143. :map <C-A> /---><CR>
  144. :vunmap <C-A>
  145. Notice that the five characters "<C-A>" stand for the single key CTRL-A.
  146. To remove all mappings use the |:mapclear| command. You can guess the
  147. variations for different modes by now. Be careful with this command, it can't
  148. be undone.
  149. SPECIAL CHARACTERS
  150. The ":map" command can be followed by another command. A | character
  151. separates the two commands. This also means that a | character can't be used
  152. inside a map command. To include one, use <Bar> (five characters). Example:
  153. >
  154. :map <F8> :write <Bar> !checkin %:S<CR>
  155. The same problem applies to the ":unmap" command, with the addition that you
  156. have to watch out for trailing white space. These two commands are different:
  157. >
  158. :unmap a | unmap b
  159. :unmap a| unmap b
  160. The first command tries to unmap "a ", with a trailing space.
  161. When using a space inside a mapping, use <Space> (seven characters): >
  162. :map <Space> W
  163. This makes the spacebar move a blank-separated word forward.
  164. It is not possible to put a comment directly after a mapping, because the "
  165. character is considered to be part of the mapping. You can use |", this
  166. starts a new, empty command with a comment. Example: >
  167. :map <Space> W| " Use spacebar to move forward a word
  168. MAPPINGS AND ABBREVIATIONS
  169. Abbreviations are a lot like Insert mode mappings. The arguments are handled
  170. in the same way. The main difference is the way they are triggered. An
  171. abbreviation is triggered by typing a non-word character after the word. A
  172. mapping is triggered when typing the last character.
  173. Another difference is that the characters you type for an abbreviation are
  174. inserted in the text while you type them. When the abbreviation is triggered
  175. these characters are deleted and replaced by what the abbreviation produces.
  176. When typing the characters for a mapping, nothing is inserted until you type
  177. the last character that triggers it. If the 'showcmd' option is set, the
  178. typed characters are displayed in the last line of the Vim window.
  179. An exception is when a mapping is ambiguous. Suppose you have done two
  180. mappings: >
  181. :imap aa foo
  182. :imap aaa bar
  183. Now, when you type "aa", Vim doesn't know if it should apply the first or the
  184. second mapping. It waits for another character to be typed. If it is an "a",
  185. the second mapping is applied and results in "bar". If it is a space, for
  186. example, the first mapping is applied, resulting in "foo", and then the space
  187. is inserted.
  188. ADDITIONALLY...
  189. The <script> keyword can be used to make a mapping local to a script. See
  190. |:map-<script>|.
  191. The <buffer> keyword can be used to make a mapping local to a specific buffer.
  192. See |:map-<buffer>|
  193. The <unique> keyword can be used to make defining a new mapping fail when it
  194. already exists. Otherwise a new mapping simply overwrites the old one. See
  195. |:map-<unique>|.
  196. To make a key do nothing, map it to <Nop> (five characters). This will make
  197. the <F7> key do nothing at all: >
  198. :map <F7> <Nop>| map! <F7> <Nop>
  199. There must be no space after <Nop>.
  200. ==============================================================================
  201. *40.2* Defining command-line commands
  202. The Vim editor enables you to define your own commands. You execute these
  203. commands just like any other Command-line mode command.
  204. To define a command, use the ":command" command, as follows: >
  205. :command DeleteFirst 1delete
  206. Now when you execute the command ":DeleteFirst" Vim executes ":1delete", which
  207. deletes the first line.
  208. Note:
  209. User-defined commands must start with a capital letter. You cannot
  210. use ":Next". The underscore cannot be used! You can use digits, but
  211. this is discouraged.
  212. To list the user-defined commands, execute the following command: >
  213. :command
  214. Just like with the builtin commands, the user defined commands can be
  215. abbreviated. You need to type just enough to distinguish the command from
  216. another. Command line completion can be used to get the full name.
  217. NUMBER OF ARGUMENTS
  218. User-defined commands can take a series of arguments. The number of arguments
  219. must be specified by the -nargs option. For instance, the example
  220. :DeleteFirst command takes no arguments, so you could have defined it as
  221. follows: >
  222. :command -nargs=0 DeleteFirst 1delete
  223. However, because zero arguments is the default, you do not need to add
  224. "-nargs=0". The other values of -nargs are as follows:
  225. -nargs=0 No arguments
  226. -nargs=1 One argument
  227. -nargs=* Any number of arguments
  228. -nargs=? Zero or one argument
  229. -nargs=+ One or more arguments
  230. USING THE ARGUMENTS
  231. Inside the command definition, the arguments are represented by the
  232. <args> keyword. For example: >
  233. :command -nargs=+ Say :echo "<args>"
  234. Now when you type >
  235. :Say Hello World
  236. Vim echoes "Hello World". However, if you add a double quote, it won't work.
  237. For example: >
  238. :Say he said "hello"
  239. To get special characters turned into a string, properly escaped to use as an
  240. expression, use "<q-args>": >
  241. :command -nargs=+ Say :echo <q-args>
  242. Now the above ":Say" command will result in this to be executed: >
  243. :echo "he said \"hello\""
  244. The <f-args> keyword contains the same information as the <args> keyword,
  245. except in a format suitable for use as function call arguments. For example:
  246. >
  247. :command -nargs=* DoIt :call AFunction(<f-args>)
  248. :DoIt a b c
  249. Executes the following command: >
  250. :call AFunction("a", "b", "c")
  251. LINE RANGE
  252. Some commands take a range as their argument. To tell Vim that you are
  253. defining such a command, you need to specify a -range option. The values for
  254. this option are as follows:
  255. -range Range is allowed; default is the current line.
  256. -range=% Range is allowed; default is the whole file.
  257. -range={count} Range is allowed; the last number in it is used as a
  258. single number whose default is {count}.
  259. When a range is specified, the keywords <line1> and <line2> get the values of
  260. the first and last line in the range. For example, the following command
  261. defines the SaveIt command, which writes out the specified range to the file
  262. "save_file": >
  263. :command -range=% SaveIt :<line1>,<line2>write! save_file
  264. OTHER OPTIONS
  265. Some of the other options and keywords are as follows:
  266. -count={number} The command can take a count whose default is
  267. {number}. The resulting count can be used
  268. through the <count> keyword.
  269. -bang You can use a !. If present, using <bang> will
  270. result in a !.
  271. -register You can specify a register. (The default is
  272. the unnamed register.)
  273. The register specification is available as
  274. <reg> (a.k.a. <register>).
  275. -complete={type} Type of command-line completion used. See
  276. |:command-completion| for the list of possible
  277. values.
  278. -bar The command can be followed by | and another
  279. command, or " and a comment.
  280. -buffer The command is only available for the current
  281. buffer.
  282. Finally, you have the <lt> keyword. It stands for the character <. Use this
  283. to escape the special meaning of the <> items mentioned.
  284. REDEFINING AND DELETING
  285. To redefine the same command use the ! argument: >
  286. :command -nargs=+ Say :echo "<args>"
  287. :command! -nargs=+ Say :echo <q-args>
  288. To delete a user command use ":delcommand". It takes a single argument, which
  289. is the name of the command. Example: >
  290. :delcommand SaveIt
  291. To delete all the user commands: >
  292. :comclear
  293. Careful, this can't be undone!
  294. More details about all this in the reference manual: |user-commands|.
  295. ==============================================================================
  296. *40.3* Autocommands
  297. An autocommand is a command that is executed automatically in response to some
  298. event, such as a file being read or written or a buffer change. Through the
  299. use of autocommands you can train Vim to edit compressed files, for example.
  300. That is used in the |gzip| plugin.
  301. Autocommands are very powerful. Use them with care and they will help you
  302. avoid typing many commands. Use them carelessly and they will cause a lot of
  303. trouble.
  304. Suppose you want to replace a datestamp on the end of a file every time it is
  305. written. First you define a function: >
  306. :function DateInsert()
  307. : $delete
  308. : read !date
  309. :endfunction
  310. You want this function to be called each time, just before a buffer is written
  311. to a file. This will make that happen: >
  312. :autocmd BufWritePre * call DateInsert()
  313. "BufWritePre" is the event for which this autocommand is triggered: Just
  314. before (pre) writing a buffer to a file. The "*" is a pattern to match with
  315. the file name. In this case it matches all files.
  316. With this command enabled, when you do a ":write", Vim checks for any
  317. matching BufWritePre autocommands and executes them, and then it
  318. performs the ":write".
  319. The general form of the :autocmd command is as follows: >
  320. :autocmd [group] {events} {file-pattern} [++nested] {command}
  321. The [group] name is optional. It is used in managing and calling the commands
  322. (more on this later). The {events} parameter is a list of events (comma
  323. separated) that trigger the command.
  324. {file-pattern} is a filename, usually with wildcards. For example, using
  325. "*.txt" makes the autocommand be used for all files whose name end in ".txt".
  326. The optional [++nested] flag allows for nesting of autocommands (see below),
  327. and finally, {command} is the command to be executed.
  328. When adding an autocommand the already existing ones remain. To avoid adding
  329. the autocommand several times you should use this form: >
  330. :augroup updateDate
  331. : autocmd!
  332. : autocmd BufWritePre * call DateInsert()
  333. :augroup END
  334. This will delete any previously defined autocommand with `:autocmd!` before
  335. defining the new one. Groups are explained later.
  336. EVENTS
  337. One of the most useful events is BufReadPost. It is triggered after a new
  338. file is being edited. It is commonly used to set option values. For example,
  339. you know that "*.gsm" files are GNU assembly language. To get the syntax file
  340. right, define this autocommand: >
  341. :autocmd BufReadPost *.gsm set filetype=asm
  342. If Vim is able to detect the type of file, it will set the 'filetype' option
  343. for you. This triggers the Filetype event. Use this to do something when a
  344. certain type of file is edited. For example, to load a list of abbreviations
  345. for text files: >
  346. :autocmd Filetype text source ~/.config/nvim/abbrevs.vim
  347. When starting to edit a new file, you could make Vim insert a skeleton: >
  348. :autocmd BufNewFile *.[ch] 0read ~/skeletons/skel.c
  349. See |autocmd-events| for a complete list of events.
  350. PATTERNS
  351. The {file-pattern} argument can actually be a comma-separated list of file
  352. patterns. For example: "*.c,*.h" matches files ending in ".c" and ".h".
  353. The usual file wildcards can be used. Here is a summary of the most often
  354. used ones:
  355. * Match any character any number of times
  356. ? Match any character once
  357. [abc] Match the character a, b or c
  358. . Matches a dot
  359. a{b,c} Matches "ab" and "ac"
  360. When the pattern includes a slash (/) Vim will compare directory names.
  361. Without the slash only the last part of a file name is used. For example,
  362. "*.txt" matches "/home/biep/readme.txt". The pattern "/home/biep/*" would
  363. also match it. But "home/foo/*.txt" wouldn't.
  364. When including a slash, Vim matches the pattern against both the full path
  365. of the file ("/home/biep/readme.txt") and the relative path (e.g.,
  366. "biep/readme.txt").
  367. Note:
  368. When working on a system that uses a backslash as file separator, such
  369. as MS-Windows, you still use forward slashes in autocommands. This
  370. makes it easier to write the pattern, since a backslash has a special
  371. meaning. It also makes the autocommands portable.
  372. DELETING
  373. To delete an autocommand, use the same command as what it was defined with,
  374. but leave out the {command} at the end and use a !. Example: >
  375. :autocmd! FileWritePre *
  376. This will delete all autocommands for the "FileWritePre" event that use the
  377. "*" pattern.
  378. LISTING
  379. To list all the currently defined autocommands, use this: >
  380. :autocmd
  381. The list can be very long, especially when filetype detection is used. To
  382. list only part of the commands, specify the group, event and/or pattern. For
  383. example, to list all BufNewFile autocommands: >
  384. :autocmd BufNewFile
  385. To list all autocommands for the pattern "*.c": >
  386. :autocmd * *.c
  387. Using "*" for the event will list all the events. To list all autocommands
  388. for the cprograms group: >
  389. :autocmd cprograms
  390. GROUPS
  391. The {group} item, used when defining an autocommand, groups related autocommands
  392. together. This can be used to delete all the autocommands in a certain group,
  393. for example.
  394. When defining several autocommands for a certain group, use the ":augroup"
  395. command. For example, let's define autocommands for C programs: >
  396. :augroup cprograms
  397. : autocmd BufReadPost *.c,*.h :set sw=4 sts=4
  398. : autocmd BufReadPost *.cpp :set sw=3 sts=3
  399. :augroup END
  400. This will do the same as: >
  401. :autocmd cprograms BufReadPost *.c,*.h :set sw=4 sts=4
  402. :autocmd cprograms BufReadPost *.cpp :set sw=3 sts=3
  403. To delete all autocommands in the "cprograms" group: >
  404. :autocmd! cprograms
  405. NESTING
  406. Generally, commands executed as the result of an autocommand event will not
  407. trigger any new events. If you read a file in response to a FileChangedShell
  408. event, it will not trigger the autocommands that would set the syntax, for
  409. example. To make the events triggered, add the "++nested" flag: >
  410. :autocmd FileChangedShell * ++nested edit
  411. EXECUTING AUTOCOMMANDS
  412. It is possible to trigger an autocommand by pretending an event has occurred.
  413. This is useful to have one autocommand trigger another one. Example: >
  414. :autocmd BufReadPost *.new execute "doautocmd BufReadPost " . expand("<afile>:r")
  415. This defines an autocommand that is triggered when a new file has been edited.
  416. The file name must end in ".new". The ":execute" command uses expression
  417. evaluation to form a new command and execute it. When editing the file
  418. "tryout.c.new" the executed command will be: >
  419. :doautocmd BufReadPost tryout.c
  420. The expand() function takes the "<afile>" argument, which stands for the file
  421. name the autocommand was executed for, and takes the root of the file name
  422. with ":r".
  423. ":doautocmd" executes on the current buffer. The ":doautoall" command works
  424. like "doautocmd" except it executes on all the buffers.
  425. USING NORMAL MODE COMMANDS
  426. The commands executed by an autocommand are Command-line commands. If you
  427. want to use a Normal mode command, the ":normal" command can be used.
  428. Example: >
  429. :autocmd BufReadPost *.log normal G
  430. This will make the cursor jump to the last line of *.log files when you start
  431. to edit it.
  432. Using the ":normal" command is a bit tricky. First of all, make sure its
  433. argument is a complete command, including all the arguments. When you use "i"
  434. to go to Insert mode, there must also be a <Esc> to leave Insert mode again.
  435. If you use a "/" to start a search pattern, there must be a <CR> to execute
  436. it.
  437. The ":normal" command uses all the text after it as commands. Thus there
  438. can be no | and another command following. To work around this, put the
  439. ":normal" command inside an ":execute" command. This also makes it possible
  440. to pass unprintable characters in a convenient way. Example: >
  441. :autocmd BufReadPost *.chg execute "normal ONew entry:\<Esc>" |
  442. \ 1read !date
  443. This also shows the use of a backslash to break a long command into more
  444. lines. This can be used in Vim scripts (not at the command line).
  445. When you want the autocommand do something complicated, which involves jumping
  446. around in the file and then returning to the original position, you may want
  447. to restore the view on the file. See |restore-position| for an example.
  448. IGNORING EVENTS
  449. At times, you will not want to trigger an autocommand. The 'eventignore'
  450. option contains a list of events that will be totally ignored. For example,
  451. the following causes events for entering and leaving a window to be ignored: >
  452. :set eventignore=WinEnter,WinLeave
  453. To ignore all events, use the following command: >
  454. :set eventignore=all
  455. To set it back to the normal behavior, make 'eventignore' empty: >
  456. :set eventignore=
  457. ==============================================================================
  458. Next chapter: |usr_41.txt| Write a Vim script
  459. Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: