现在的位置: 首页 > 综合 > 正文

notepad++ Function List 插件

2013年01月26日 ⁄ 综合 ⁄ 共 9108字 ⁄ 字号 评论关闭

//z 2013-09-20 18:55:38 IS2120@BG57IV3 T1452062141.K.F3569790369[T2,L51,R1,V7]
0. 注:FunctionList 这个插件看代码的话会方便很多,但很久未更新了在NPP 5.9 之后使用问题多多(未证实)。我在6.x上使用是无法显示出对应的dialog的。
//z 2013-09-20 18:59:11 IS2120@BG57IV3 T2664333720.K.F3569790369[T3,L52,R1,V8]
0.1 改了一处代码,能显示对话框和函数列表了;但是切换文档无法更新函数列表。
0.2 大家还是不要企图使用这个插件了;作者不更新了,与新版本NOTEPAD++存在兼容性问题。而且是采用自己解析代码的方式来做的
(感觉这种方法相当地费力不讨好)。

1. 在 windows 7 上安装 FunctionList 插件 (Notepad++ , functionlist)
//z 2013-09-20 18:46:33 IS2120@BG57IV3 T4264964152.K.F3569790369[T1,L49,R1,V4]
I use Notepad++ daily for PHP Development. I love it, it’s simple and powerful at the same time.

One good feature is the plugins that are available. One of them is Functions List.

If you try to install that plugin on a Windows 7 Machine, it will not work ok. You have to do some extra steps (found here).

1. Download Function List Plugin
2. Copy the files: C++.flb, FunctionListRules.xml, Gmod Lua.bmp to: [DRIVE LETTER]:\Users\[YOUR USER NAME]\AppData\Roaming\Notepad++\plugins\config
3. Copy the file FunctionList.dll to your instaltion folder for example: [DRIVE LETTER]:\Program Files (x86)\Notepad++\plugins

Another good tutorial to enhance the capabilities of this plugin for php is found here:http://www.danielkassner.com/2010/01/22/using-notepads-function-list-plugin-for-php-development
https://github.com/gwarnants/FunctionList-PHP-Patch

1.1 安装说明
Function List是Notepad++诸多很酷的功能之一。但最新的版本需要额外的步骤来正确设置Function List。笔者就将介绍如何安装Function List,以及如何设置Function List。

首先,Function List插件并没有在Notepad++自带的插件清单里,也没有在Plugin Manager的Available List里 = =|||。所以要安装Function List,还得去Plugin_Central下载,笔者下载的最新版本是2.1.0.1。

将下载的压缩包解压后就有诸多的文件了,首先复制FunctionList.dll到<notepad++ install dir>/plugins目录,再把FunctionListRules.xml,Gmod Lua.bmp和C++.flb复制到<notepad++ install
dir>/plugins/config,到这里安装部分就完成了。

2. php patch for functionlist

PHP parsing rules

    <Language name="PHP" imagelistpath="plugins\Config\php.bmp">
        <CommList param1="#" param2="" />
        <CommList param1="//" param2="" />
        <CommList param1="/\*" param2="\*/" />
        <Group name="INCLUDE" subgroup="" icon="2" child="2" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg='^\s*(include|require)(_once)?[\s&apos;&quot;\(]*' regexfunc="[\w./-]+" regexend='[&apos;&quot;\)\s]*;$' bodybegin="" bodyend="" sep="" />
            <Rules regexbeg="^\s*use\s+" regexfunc="[\w\\]+" regexend="[\w\s]*;$" bodybegin="" bodyend="" sep="" />
        </Group>
        <Group name="CLASS" subgroup="" icon="1" child="1" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="\{" keywords="">
            <Rules regexbeg="^\s*(abstract|final)?\s*class\s*" regexfunc="\w+" regexend="" bodybegin="\{" bodyend="\}" sep="" />
        </Group>
        <Group name="INTERFACE" subgroup="" icon="0" child="0" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="\{" keywords="">
            <Rules regexbeg="^\s*interface\s+" regexfunc="\w+" regexend="" bodybegin="\{" bodyend="\}" sep="" />
        </Group>
        <Group name="CONSTANT" subgroup="" icon="8" child="8" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*const\s+" regexfunc="[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
            <Rules regexbeg='^\s*define\s*[\(&apos;&quot;\)\s]+' regexfunc="[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="PUBLIC VAR" subgroup="" icon="6" child="6" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public|var)\s+" regexfunc="\$[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="PUBLIC STATIC VAR" subgroup="" icon="7" child="7" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public\s+)?static\s+(public\s+)?" regexfunc="\$[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="PROTECTED VAR" subgroup="" icon="4" child="4" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*protected\s+" regexfunc="\$[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="PROTECTED STATIC VAR" subgroup="" icon="5" child="5" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(protected\s+static|static\s+protected)\s+" regexfunc="\$[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="PRIVATE VAR" subgroup="" icon="9" child="9" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*private\s+" regexfunc="\$[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="PRIVATE STATIC VAR" subgroup="" icon="10" child="10" autoexp="0" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(private\s+static|static\s+private)\s+" regexfunc="\$[\w_]+" regexend="" bodybegin="" bodyend="$" sep="" />
        </Group>
        <Group name="CONSTRUCTOR" subgroup="" icon="21" child="21" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public\s+)?function\s+" regexfunc="[__construct]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PUBLIC METHOD/FUNCTION" subgroup="" icon="19" child="19" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public\s+)?function\s+" regexfunc="(?&lt;!\b__construct)\b(?!(?:__construct)\b)[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PUBLIC STATIC METHOD" subgroup="" icon="20" child="20" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public\s+)*static\s+(public\s+|final\s+)*function\s+" regexfunc='[&quot;\w_]+\s*\(.*\)' regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PUBLIC ABSTRACT METHOD" subgroup="" icon="23" child="23" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public\s+|static\s+)*abstract\s+(static\s+|public\s+)*?function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*;" bodybegin="" bodyend="" sep=";" />
        </Group>
        <Group name="PUBLIC FINAL METHOD" subgroup="" icon="22" child="22" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(public\s+)?final\s+(public\s+|static\s+)*function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PROTECTED METHOD" subgroup="" icon="11" child="11" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*protected\s+function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PROTECTED STATIC METHOD" subgroup="" icon="12" child="12" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(static\s+(final\s+)?protected\s+(final\s+)?|protected\s+static\s+(final\s+)?)function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PROTECTED ABSTRACT METHOD" subgroup="" icon="13" child="13" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(static\s+)?(abstract\s+(static\s+)?protected|protected\s+(static\s+)?abstract)\s+(static\s+)?function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*;" bodybegin="" bodyend="" sep=";" />
        </Group>
        <Group name="PROTECTED FINAL METHOD" subgroup="" icon="14" child="14" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*((protected\s+final\s+(static\s+)?)|final\s+(static\s+)?protected\s+(static\s+)?)function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PRIVATE METHOD" subgroup="" icon="16" child="16" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(final\s+)?private\s+(final\s+)?function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
        <Group name="PRIVATE STATIC METHOD" subgroup="" icon="17" child="17" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*(static\s+(final\s+)?private\s+(final\s+)?|private\s+static\s+(final\s+)?)function\s+" regexfunc="[\w_]+\s*\(.*\)" regexend="\s*" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
    </Language>

CSS parsing rules

    <Language name="CSS" imagelistpath="plugins\Config\php.bmp">
        <CommList param1="/\*" param2="\*/" />
        <Group name="IMPORT" subgroup="" icon="2" child="2" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg='^\s*@import\s+[\w]*[\s\(&quot;]*\s*' regexfunc="[\w./-]+" regexend="[&quot;\)]+[\w\s,]*;$" bodybegin="" bodyend="" sep=";" />
        </Group>
        <Group name="SELECTOR" subgroup="" icon="19" child="19" autoexp="4" matchcase="0" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^\s*[\w.#\s:\[\]=~\*,\+&gt;-]+\s*" regexfunc="[\w.#\s:\[\]=~\*,\+&gt;-]*" regexend="" bodybegin="\{" bodyend="\}" sep=";" />
        </Group>
    </Language>

ChangeLog

  • v1.0 - 2012-04-24

    • new: public constructor recognition
    • fix: better class properties and methods recognition
    • fix: better static/final keywords support
    • fix: optimized icons file size
    • now using PCRE regular expressions (require Notepad++ 6.x)
  • v0.9.1 - 2012-04-17

    • new: added CSS language parsing rules
    • fix: fixed properties parsing rules since Notepad++ 6.x
    • fix: rewritten from default Function List configuration file
    • fix: some minor improvements
  • v0.9 - 2010-12-11

    • initial release

3. 一个更为详细的说明

如果只是小改程式,只開啟Notepad++編輯PHP似乎已經是我自己的習慣,但如果要修改稍微大一點的程式,使用Notepad++似乎就有點麻煩,因為沒有FunctionList可以參考,後來我就試著在網路上找到了「Using
Notepad++’s Function List plugin for PHPdevelopment
」這個解決方案,其實也很夠用了(其畫面如文章開頭圖片左邊),但後來又更深入的去搜尋,又找到了另外一個使用同樣方法,但修改的更好看的方式「Patch
PHP5 pour le plugin FunctionList de Notepad++
」,使用它的方法修改後,它的頁面會像是Eclipse編輯器裡面那樣的Function List,就如文章開頭圖片的中間的那畫面。

在這邊就從頭到尾再記錄一次安裝的過程:

1. 首先必須先下載function list這個Notepad++ Plugin,可以到以下這連結下載(http://sourceforge.net/projects/npp-plugins/files/Function%20List/ ),以目前最新版本為

抱歉!评论已关闭.