1
0
mirror of https://github.com/amix/vimrc synced 2025-07-08 18:04:59 +08:00

Use sources_non_forked folder for pathogen path, with sources_non_forked_fallback folder as fallback.

This commit is contained in:
Wu Tingfeng
2022-11-21 22:56:20 +08:00
parent dddd2e4152
commit d9555d618c
1756 changed files with 4 additions and 250 deletions

View File

@ -0,0 +1,7 @@
*cached_file_contents* read contents of a file then cache extracted data
Author: Marc Weber, marco-oweber@gmx.de
-----------------------------------------------------------------------
HOWTO~
see cached_file_contents#Test()

View File

@ -0,0 +1,35 @@
*funcref* create lazier function references. Pass arguments to create closure
like function calls
Author: Marc Weber, marco-oweber@gmx.de
-----------------------------------------------------------------------
HOWTO~
Use *funcref#Function* to create a special dict called
*faked-function-reference* which can be called by *funcref#Call*
>
{ 'faked_function_reference': 'file#FuncName' }
< passing some arguments and / or self: >
{ 'faked_function_reference': 'MyFunc', 'args': [1,2], 'self' : { a object ] }
< You can also create lambda like functions which will be evaled: >
{ 'faked_function_reference': 'return ARGS[1]' }
REASONS ~
Creating a Vim funcref pointing to an autoload function will make Vim source
that file. This is not lazy enough. (Seems to be no longer true? Has this changed?)
A Vim function reference neither allows attaching arguments nor self.
Don't care about case of variables. Normally when using Vim function
references you have to use variable names starting with an upper case letter
(E704)
Example: ~
>
let f = funcref#Function('return ARGS[0].ARGS[1].SELF["key"]',{'args':[3], 'self':{'key': 'value'} })
echo funcref#Call(f, [2])
" prints "32value"
echo funcref#Call('no value')
<
echo funcref#Call(f, [2])

View File

@ -0,0 +1,18 @@
*tiny-cmd* make long commands short so that they hopefully no longer trigger "press Enter .. [ok]"
Author: Marc Weber, marco-oweber@gmx.de
-----------------------------------------------------------------------
HOWTO~
Problem: >
exec 'map <F2> :silent! let g:g="'.repeat('foobar ',200).'"<cr>'
Now run the mapping by pressing <F2> and you notice what I'm talking about
Solution (Example):
Example usage: >
let nr = tiny_cmd#Put('let g:g="'.repeat('foobar ',200).'"')
exec 'map <F2> :exec tiny_cmd#Get('.nr.')<cr>'
<
Use Pop instead of Get if you use this command once only