Function List是Notepad++诸多很酷的功能之一。但最新的版本需要额外的步骤来正确设置Function List。笔者就将介绍如何安装Function List,以及如何设置Function List。
首先,Function List插件并没有在Notepad++自带的插件清单里,也没有在Plugin Manager的Available List里 = =|||。所以要安装Function List,还得去Plugin_Central下载,笔者下载的最新版本是2.1.0.1。 http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central#F //FunctionList
http://notepad-plus-plus.org/download/v5.9.3.html //notepad++
将下载的压缩包解压后就有诸多的文件了,首先复制FunctionList.dll到<notepad++ install dir>/plugins目录,再把FunctionListRules.xml,Gmod Lua.bmp和C++.flb复制到<notepad++ install dir>/plugins/config,到这里安装部分就完成了。
接下来就需要打开Notepad++对Function List进行设置了。Plugins->Function List->Language Parsing Rules。然后,在语言列表中选择C/C++,勾选上“Bitmap List”checkbox。浏览到plugins/config目录,并选择C++.flb,于是乎就万事大吉了。
一、下载MinGW和NotePad++,并安装好,建议下载安装版。
二、配置:
1)为NotePad++安装两个有用的插件:
Function List的安装:
a、将FunctionList.dll复制到NotePad++安装目录的plugins目录下;
b、将C++.flb和GmodLua.bmp复制到plugins/config目录下;
c、将FunctionListRules.xml复制到C:/Users/daniel/AppData/Roaming/Notepad++/plugins/config下。
NppExec的安装:
a、将NppExec.dll和目录NppExec复制到Notepad++的plugins目录下;
b、将doc目录下的内容复制到plugins/doc/NppExec目录下。
重启Notepad++。
2)为MinGW添加环境变量:
需要添加以下三个路径,即添加到path中(注意以分号相隔):
C:/Program Files/MinGW/bin;C:/Program Files/MinGW/include;C:/Program Files/MinGW/lib;
测试MinGW是否配置成功,命令行输入:
g++ -o hello.exe hello.cpp
没有报错,说明配置成功。
3)配置C/C++源文件的调试、编译和运行:
a、调试:
选择菜单:Plugins->NppExec->Execute...
输入:cmd /k gdb $(CURRENT_DIRECTORY)/$(NAME_PART).exe
保存为Cpp_Debug
b、编译命令:
选择菜单:Plugins->NppExec->Execute...
输入:cmd /k g++.exe -g -W -Wall -o $(CURRENT_DIRECTORY)/$(NAME_PART).exe $(FULL_CURRENT_PATH)
保存为Cpp_Compile
c、运行命令:
同样选择Plugins->NppExec->Execute...
输入:cmd /k $(CURRENT_DIRECTORY)/$(NAME_PART).exe $(FULL_CURRENT_PATH
保存为:Cpp_Run
4)将调试、编译、运行命令添加到宏菜单(Macros)下:
打开菜单:Plugins->NppExec->Advanced Options:
将Associated script下的Cpp_Debug、Cpp_Compile和Cpp_Run 添加进去,同时选中:加入到宏子菜单。
最后重启Notepad++即可。点击菜单Macro下的Cpp_Compile和Cpp_Run即可编译和运行c/c++源程序。
http://aofengblog.blog.163.com/blog/static/63170212010111164752194/
文章声明
一、NotePad++插件 / NotePad++ Plugins
1、Function List ( Unicode )
当前最新版本:Version 2.1
发布日期:2010-02-18
安装程序下载地址:http://sourceforge.net/projects/npp-plugins/files/Function%20List/FunctionList%20Plugin%20v2.1/FunctionList_2_1_UNI_dll.zip/download
2、NppExec ( Unicode )
当前最新版本:Version 0.4.1
发布日期:2010-07-22
安装程序下载地址:http://sourceforge.net/projects/npp-plugins/files/NppExec/NppExec%20Plugin%20v0.4.1/NppExec_041_dll_Unicode.zip/download
二、安装环境 / Environment
Windows2003 / Windows XP
Notepad++-5.8.5 (Unicode版本)
三、NotePad++插件安装 / NotePad++ - Howto Install Plugins
如何安装NotePad++的插件,其官网原文如下:
Usually, the only installation procedure plugins require is to
- place the dll in the plugins subfolder of the Notepad++ install folder;
- place any configuration file it comes with in plugin\config
- preferrably, place all documentation files in plugin\doc, or in some subfolder of it
Notepad++ loads plugins at startup. To load a new plugin, you can either close and restart Notepad++, or use the Settings -> Import -> Import plugin command. The latter will copy the dll in the plugin folder if it is not already there.
译文:
通常情况下,安装程序插件只需要执行如下方法:
- 将DLL文件复制到Notepad++安装目录的plugins目录下;
- 将配置文件复制到plugins\Config目录下;
- 更好的做法,将所有的文档文件复制到plugins\doc目录下,或它的子目录下。
Notepad++在启动的时候载入插件。要载入一个新插件,你可以关闭并重启Notepad++,或使用 Setting -> Import -> Import plugin 命令。稍后将复制插件的DLL到plugins目录下。
四、Function List 插件安装 / Howto Install Plugin "Function List"
1、下载并解压
FunctionList_2_1_UNI_dll.zip。
2、将 FunctionList.dll 复制到Notepad++ 的 plugins 目录下。
3、将C++.flb、FunctionListRules.xml、Gmod Lua.bmp 复制到 plugins\Config 目录下。
4、重启NotePad++。效果如下:
五、NppExec插件安装和配置 / Howto Install and Configure Plugin "NppExec"
1、NppExec安装。- 下载并解压 NppExec_041_dll_Unicode.zip。
- 将 NppExec.dll 和目录NppExec 复制到Notepad++ 的 plugins 目录下。
- 将doc目录下的 fparser.html、NppExec.txt、NppExec_Manual.chm、NppExec_Manual.knt、NppExec_TechInfo.txt 复制到 plugins\doc\NppExec 目录下。
- 重启NotePad++。
2、NppExec配置。
1. 打开菜单 Plugins -> NppExec -> Execute...。
2. 配置编译C文件。
进入“Execute...” 对话框,输入 cmd /c "gcc -o $(CURRENT_DIRECTORY)$(NAME_PART) $(FULL_CURRENT_PATH) ",点击“Save...”按钮保存,命名为“CompileC”。
3. 配置编译C++文件。
进入“Execute...” 对话框,输入 cmd /c "g++ -o $(CURRENT_DIRECTORY)$(NAME_PART) $(FULL_CURRENT_PATH) ",点击“Save...”按钮保存,命名为“CompileC++”。
4、将“CompileC”,“CompileC++”添加到宏菜单(Macros)下。
1)打开菜单 Plugins -> NppExec ->Advanced Options...。
2)在Associated script:下面下拉框中选择“CompileC”,“CompileC++”,点击“Add/Modify”按钮将它们依次添加到Menu items下面的列表中。
选择 "Place to the Macros submenu"复选框。
3)打开菜单 Macro ,可以看到“CompileC”,“CompileC++”都已经添加到宏菜单(Macros)下。
5、编译C语言helloworld程序 。
1)输入helloworld.c 的源代码:
#include <stdio.h>
void print() {
printf ("Hello World!\n");
}
main() {
print();
return 0;
}
2)点击菜单 Macro -> CompileC,执行效果如下图所示。
在与helloworld.c 相同的目录下生成了一个 hellowrold.exe 文件。
说明:如果编译的 *.c文件的路径中包含了空格,在执行“Compile C”命令时将报错。
六、NotePad++ 开启自动联想提示 / NotePad++ - Enable Autocompletion
1、打开菜单 Settings -> Preferences...。
2、点击 Backup/Auto-Completion 选项卡。
选择 Enable auto-completion on each input.
选择 World completion。
选择 Function parameters hint on input
参考资料 /References
1、http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central2、http://yihui.name/en/2010/08/auto-completion-in-notepad-for-r-script/