NotePad++安裝和配置C/C++開發插件


NotePad++ - 安裝和配置C/C++開發插件 | NotePad++ - Install and Configure plugins for develop C/C++  

http://aofengblog.blog.163.com/blog/static/63170212010111164752194/

  文章聲明

作者:傲風(aofengblog@163.com)       編寫時間:2010年12月11日 

網址:http://aofengblog.blog.163.com

作者保留所有權利,轉載請保留文章全部內容!

 



一、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++。效果如下:

NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 

 

五、NppExec插件安裝和配置 / Howto Install and Configure Plugin "NppExec"

1、NppExec安裝。
  1. 下載並解壓 NppExec_041_dll_Unicode.zip
  2. 將 NppExec.dll 和目錄NppExec 復制到Notepad++ 的 plugins 目錄下。
  3. 將doc目錄下的 fparser.html、NppExec.txt、NppExec_Manual.chm、NppExec_Manual.knt、NppExec_TechInfo.txt 復制到 plugins\doc\NppExec 目錄下。
  4. 重啟NotePad++。

2、NppExec配置。
1. 打開菜單 Plugins -> NppExec -> Execute...。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來


2. 配置編譯C文件。
進入“Execute...” 對話框,輸入 cmd /c "gcc -o $(CURRENT_DIRECTORY)$(NAME_PART) $(FULL_CURRENT_PATH) ",點擊“Save...”按鈕保存,命名為“CompileC”。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 

3. 配置編譯C++文件。
 進入“Execute...” 對話框,輸入 cmd /c "g++ -o $(CURRENT_DIRECTORY)$(NAME_PART) $(FULL_CURRENT_PATH) ",點擊“Save...”按鈕保存,命名為“CompileC++”。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 

4、將“CompileC”,“CompileC++”添加到宏菜單(Macros)下。
1)打開菜單 Plugins -> NppExec ->Advanced Options...。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 
2)在Associated script:下面下拉框中選擇“CompileC”,“CompileC++”,點擊“Add/Modify”按鈕將它們依次添加到Menu items下面的列表中。
選擇 "Place to the Macros submenu"復選框。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 
3)打開菜單 Macro ,可以看到“CompileC”,“CompileC++”都已經添加到宏菜單(Macros)下。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 

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 文件。
NotePad++ - 安裝C/C++開發插件 | NotePad++ - Install plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來

NotePad++ - 安裝和配置C/C++開發插件 | NotePad++ - Install and Configure plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來 說明:如果編譯的 *.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
NotePad++ - 安裝和配置C/C++開發插件 | NotePad++ - Install and Configure plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 
3、在編輯區域中,輸入內容,自動聯想提示功能效果如下圖所示。
NotePad++ - 安裝和配置C/C++開發插件 | NotePad++ - Install and Configure plugins for develop C/C++ - 傲風 - 寶劍鋒從磨礪出 梅花香自苦寒來
 
 

參考資料 /References

1、http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central
2、http://yihui.name/en/2010/08/auto-completion-in-notepad-for-r-script/


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM