Mercurial > vim
diff runtime/doc/tips.txt @ 27903:d19b7aee1925
Update runtime files.
Commit: https://github.com/vim/vim/commit/c51cf0329809c7ae946c59d6f56699227efc9d1b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 26 12:25:45 2022 +0000
Update runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 26 Feb 2022 13:30:04 +0100 |
parents | babd9f1dbe12 |
children | f8116058ca76 |
line wrap: on
line diff
--- a/runtime/doc/tips.txt +++ b/runtime/doc/tips.txt @@ -101,14 +101,14 @@ What you need: create it with the shell command "mkid file1 file2 ..". Put this in your .vimrc: > - map _u :call ID_search()<Bar>execute "/\\<" . g:word . "\\>"<CR> - map _n :n<Bar>execute "/\\<" . g:word . "\\>"<CR> + map _u :call ID_search()<Bar>execute "/\\<" .. g:word .. "\\>"<CR> + map _n :n<Bar>execute "/\\<" .. g:word .. "\\>"<CR> function! ID_search() let g:word = expand("<cword>") - let x = system("lid --key=none ". g:word) + let x = system("lid --key=none " .. g:word) let x = substitute(x, "\n", " ", "g") - execute "next " . x + execute "next " .. x endfun To use it, place the cursor on a word, type "_u" and vim will load the file @@ -356,13 +356,13 @@ This mapping will format any bullet list line above and below each list entry. The expression commands are used to be able to give comments to the parts of the mapping. > - :let m = ":map _f :set ai<CR>" " need 'autoindent' set - :let m = m . "{O<Esc>" " add empty line above item - :let m = m . "}{)^W" " move to text after bullet - :let m = m . "i <CR> <Esc>" " add space for indent - :let m = m . "gq}" " format text after the bullet - :let m = m . "{dd" " remove the empty line - :let m = m . "5lDJ" " put text after bullet + :let m = ":map _f :set ai<CR>" " need 'autoindent' set + :let m ..= "{O<Esc>" " add empty line above item + :let m ..= "}{)^W" " move to text after bullet + :let m ..= "i <CR> <Esc>" " add space for indent + :let m ..= "gq}" " format text after the bullet + :let m ..= "{dd" " remove the empty line + :let m ..= "5lDJ" " put text after bullet :execute m |" define the mapping (<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not @@ -514,15 +514,15 @@ A slightly more advanced version is used let c = '\[' let c2 = '\]' endif - let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . + let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .. \ '=~? "string\\|comment"' execute 'if' s_skip '| let s_skip = 0 | endif' let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip) if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$') - exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col . - \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + exe 'match Search /\(\%' .. c_lnum .. 'l\%' .. c_col .. + \ 'c\)\|\(\%' .. m_lnum .. 'l\%' .. m_col .. 'c\)/' let s:paren_hl_on = 1 endif endfunction