2015-08-23 6 views
13

मैंने हाल ही में विम के लिए इस अजीब प्लगइन में टक्कर लगी और इसका पता नहीं लगा कि इसका क्या उपयोग है।एल 9 विम प्लगइन क्या है?

यह लगभग दस्तावेज नहीं है और नोबी वास्तव में इसके बारे में बात करता है, लेकिन यह कुछ अन्य प्लगइन के लिए महत्वपूर्ण लगता है।

सभी मैंने पाया यहाँ है:

http://www.vim.org/scripts/script.php?script_id=3252

और

https://github.com/eparreno/vim-l9

लेकिन वे कहते हैं कि "यह एक पुस्तकालय है" और "sourcecode देखें"।

कोई भी जानता है कि यह क्या है, अगर मुझे यह चाहिए, तो मुझे क्या चाहिए, या अगर मैं इसे हटा सकता हूं, तो कुछ निर्भरता किसी अन्य प्लगइन में अनमेट नहीं हो जाती है?

+5

ठीक है, और क्या आप परे पता करने की जरूरत है ": यहाँ अपने एपीआई के थोक, सूची, संख्या, तार, पंक्तियाँ, पथ, फ़ाइलें, बफ़र्स, खिड़कियां, खोज के विम के उपचार बढ़ाने, और अधिक है यह एक पुस्तकालय है "? एल 9 अन्य प्लगइन्स द्वारा उपयोग की जाने वाली लाइब्रेरी है, इसलिए इसे किसी भी अन्य निर्भरता की तरह प्रबंधित किया जाता है: जब आपको इसकी आवश्यकता होती है तो * इसे * जोड़ना चाहिए और जब आप इसे छोड़ सकते हैं तो इसे छोड़ सकते हैं या हटा सकते हैं। यदि आप प्लगइन डेवलपर नहीं हैं, तो वह लाइब्रेरी क्या करती है या नहीं, लेकिन यदि आप उत्सुक हैं, तो स्रोत कोड पढ़ना पर्याप्त होना चाहिए। – romainl

+5

@romaini "यह एक पुस्तकालय है" जैसा कि कहता है: "कुछ कोड": बिल्कुल कुछ भी नहीं। एक अच्छे सॉफ़्टवेयर उत्पाद में कुछ विवरण होना चाहिए कि यह किस प्रकार है और इसका उपयोग कैसे किया जाए, यह रिलीज पैकेज का हिस्सा बनता है। कोड बहुत लंबा नहीं है, तो बस "कोड पढ़ें" कहकर एक स्मार्ट-गधे होने के नाते ठीक है। – eddy147

उत्तर

14

मैंने हाल ही में वंडल से कुछ स्थानों में L9 के संदर्भों को देखा है। सच है, यह शुरुआत में दस्तावेज नहीं है। लेकिन मुख्य स्रोत फ़ाइल, autoload/l9.vim में सभ्य टिप्पणी है। यह सामान्य उद्देश्य उपयोगिता कार्यों का एक सेट है।

" returns false if the caller script should finish. 
" a:vimVersion: if 0, don't check vim version 
" a:l9Version: same rule as v:version 
function l9#guardScriptLoading(path, vimVersion, l9Version, exprs) 

" Removes duplicates (unstable) 
" This function doesn't change the list of argument. 
function l9#unique(items) 

" [ [0], [1,2], [3] ] -> [ 0, 1, 2, 3 ] 
" This function doesn't change the list of argument. 
function l9#concat(items) 

" [ [0,1,2], [3,4], [5,6,7,8] ] -> [ [0,3,5],[1,4,6] ] 
" This function doesn't change the list of argument. 
function l9#zip(items) 

" filter() with the maximum number of items 
" This function doesn't change the list of argument. 
function l9#filterWithLimit(items, expr, limit) 

" Removes if a:expr is evaluated as non-zero and returns removed items. 
" This function change the list of argument. 
function l9#removeIf(items, expr) 

" Snips a:str and add a:mask if the length of a:str is more than a:len 
function l9#snipHead(str, len, mask) 

" Snips a:str and add a:mask if the length of a:str is more than a:len 
function l9#snipTail(str, len, mask) 

" Snips a:str and add a:mask if the length of a:str is more than a:len 
function l9#snipMid(str, len, mask) 

" wildcard -> regexp 
function l9#convertWildcardToRegexp(expr) 

" Removes from the line matching with a:begin first to the line matching with 
" a:end next and returns removed lines. 
" If matching range is not found, returns [] 
function l9#removeLinesBetween(lines, begin, end) 

" returns the path separator charactor. 
function l9#getPathSeparator() 

" [ 'a', 'b/', '/c' ] -> 'a/b/c' 
function l9#concatPaths(paths) 

" path: '/a/b/c/d', dir: '/a/b' => 'c/d' 
function l9#modifyPathRelativeToDir(path, dir) 

" Almost same as readfile(). 
function l9#readFile(...) 

" Almost same as writefile(). 
function l9#writeFile(...) 

" :wall/:wall! wrapper. Useful for writing readonly buffers. 
function l9#writeAll() 

" Loads given files with :edit command 
function l9#loadFilesToBuffers(files) 

" Deletes all buffers except given files with :bdelete command 
function l9#deleteAllBuffersExcept(files) 

" move current window to next tabpage. 
function l9#shiftWinNextTabpage() 

" move current window to previous tabpage. 
function l9#shiftWinPrevTabpage() 

" move to a window containing specified buffer. 
" returns 0 if the buffer is not found. 
function l9#moveToBufferWindowInCurrentTabpage(bufNr) 

" returns 0 if the buffer is not found. 
function s:moveToOtherTabpageOpeningBuffer(bufNr) 

" move to a window containing specified buffer. 
" returns 0 if the buffer is not found. 
function l9#moveToBufferWindowInOtherTabpage(bufNr) 

" echo/echomsg with highlighting. 
function l9#echoHl(hl, msg, prefix, addingHistory) 

" input() with highlighting. 
" This function can take list as {completion} argument. 
function l9#inputHl(hl, ...) 

" only called by l9#inputHl() for completion. 
function l9#completeForInputHl(lead, line, pos) 

" returns last selected text in Visual mode. 
function l9#getSelectedText() 

" loads given text as Vim script with :source command 
function l9#loadScript(text) 

" Execute :vimgrep and opens the quickfix window if matches are found. 
" 
" a:pattern: search pattern. If ommitted, last search pattern (@/) is used. 
" a:files: List of files 
function l9#grepFiles(pattern, files) 

" Execute :vimgrep for buffers using l9#grepFiles() 
" See also: :L9GrepBuffer :L9GrepBufferAll 
function l9#grepBuffers(pattern, bufNrs) 

" Highlights lines using :sign define and :sign place. 
" a:linehl, a:text, a:texthl: See |signs|. Ignored if empty string. 
" a:locations: List of [{buffer number}, {line number}] for highlighting 
function l9#placeSign(linehl, text, texthl, locations) 

" Notify a message using an external program. 
" Currently supports Balloonly, Screen, and Tmux. 
function l9#notifyExternally(msg) 
संबंधित मुद्दे