notepad++ 操作說明

這個是 towns 將 notepad++ 相關資料整合到這裡以便於查詢

1. notepad++ 刪除特定字串行

在取代中打入 .*[字串].*,並以空白取代 <== 刪除特定字串行

在取代中打入  ^[\s]*$[\n\r]*,並以空白取代 <== 刪除空白行

註:記得下方的選項要選 “規則運算式”或“用類型表示”

參考資料:Benson 大的blog
http://momo1208.pixnet.net/blog/post/176136054-%E5%A6%82%E4%BD%95%E5%9C%A8notepad%2B%2B%E4%B8%8A%E5%88%AA%E9%99%A4%E7%89%B9%E5%AE%9A%E5%AD%97%E4%B8%B2%E7%9A%84%E6%95%B4%E8%A1%8C   


2. notepad++ 多選刪除

透過標記方式同時多選行數(在第一行按滑鼠右鍵,開始|結束選取,到指定行再用一次)

參考資料:sanqima 大說明
https://blog.csdn.net/sanqima/article/details/51459683   


3. notepad++ 加入斷行

目標 => 取代成 \r\n,使用增強(延伸)模式

參考資料:
完美半徑
https://dotblogs.com.tw/alanjiang/2012/12/23/85888    


4. notepad++  plugin -- npp-explorer 在左邊列出目錄

有很多開發工作都有這樣的功能,這個真的是很方便呢!

註:還有另一個 explorer,Light explorer,感覺上也是不錯的哦!

參考資料:
百度奇怪大的說明
https://zhidao.baidu.com/question/559755539549620484.html  

作者的 github
https://github.com/funap/npp-explorer-plugin  


5. notepad++  plugin -- 加入 Markdown

 

參考資料
睡蓮大
https://blog.waterlily-lsl.com/2017-01-09-markdown  


6. Notepad++ 加入外掛

1. 手動加入
 1.1. 開啟 notepad++ ==> 點 ? ==> 下載更多外掛模組 ==> 會帶到官方下載頁面,這時就可以找尋需要的外掛
http://docs.notepad-plus-plus.org/index.php/Plugin_Central
 1.2. 點選需要的外掛程式,下載後是一個 zip 檔
 1.3. 解開後,將檔案放到相同的路徑中(如果是外掛,通常只有 doc 及 dll 兩個檔案),完成安裝

2. 使用 plugin manager 管理
使用 manager 管理,就會顯示 GUI 介面

註:towns 常用外掛模組(有幾個應該是預設內建的)
Compare、Explorer、Mime tools、Npp Converter、NppExport

參考資料: Crifan Li 大的文章 -- notepad++ 說明文件
https://www.crifan.com/files/doc/docbook/rec_soft_npp/release/htmls/
https://www.crifan.com/files/doc/docbook/rec_soft_npp/release/htmls/plugin_download_and_install.html    


7. Notepad++ 功能

直貼功能
alt [上][下]

刪除特定字串的整行
.*pattern.*
註:下面要選 規則運算式

刪除空白行
^[\s]*$[\n\r]*

刪除特字串的整行,並刪除空行
^.*MAC Adress.*\r?\n

直行多選
alt + [滑鼠左鍵] +[滑鼠拖拉]

註:直行多選這個功能在 windows 的 cmd 模式下也可以使用

刪除日期
\d{4}-\d{2}-\d{2} => 2021-02-04

這些都是正規表示法

參考資料:Benson大的blog
http://momo1208.pixnet.net/blog/post/176136054-%E5%A6%82%E4%BD%95%E5%9C%A8notepad%2B%2B%E4%B8%8A%E5%88%AA%E9%99%A4%E7%89%B9%E5%AE%9A%E5%AD%97%E4%B8%B2%E7%9A%84%E6%95%B4%E8%A1%8C 


8. Notepad++ 轉碼方式
1. 使用Notepad++開啟原檔案
2. 使用Notepad++另開一個新檔,並設定其編碼(編碼 ==> 選擇需要的 編碼字符集),這時新檔就是指定編碼
3. 將原檔案的文字內容貼入新檔中,存檔後完成編碼變更

參考資料:KwCheng's 大的 blog
http://kwcheng0119.pixnet.net/blog/post/40667031-notepad%2B%2B---%E4%BD%BF%E7%94%A8notepad%2B%2B%E5%B0%8D%E6%96%87%E5%AD%97%E9%80%B2%E8%A1%8C%E8%BD%89%E7%A2%BC 


9. 斷行符號

各文字處理器
windows系統notepad ==> “/n”
ultraedit ==> “^p” 
notepad++ ==> \r\n

OS
DOS ==> CRLF ==> ^M$
LINUX ==> LF ==> $

註:CR ==> ^M, LF ==> $

資料來源:alanjiang大blog
http://www.dotblogs.com.tw/alanjiang/archive/2012/12/23/85888.aspx 


10. 判斷程式編碼方式
可以使用如Ultra Edit或Notepad++開啟程式後,看下面的狀態列判斷
Notepad++(5.8.6版)寫的比較詳細(如圖notepad-ANSInotepad-UTF8) 


11. 關於Notepad++ 加裝compare(文件比對套件)方式
開啟 Notepad++ ==> 外掛模組(plugins) ==> Plugin Manager ==> Shop Plugin Manager,在這裡就會列出很多的套件,towns 選了Compare這個套件 ==> 點右下角的 Install,就完成安裝了
資料來源:http://yinfox.pixnet.net/blog/post/36707904
註:Notepad++ 版本 6.1.6


12. 變更游標

Insert 會變更 Notepad++ 游標方式,並改為取代模式

參考資料:
ITread
https://www.itread01.com/content/1547302351.html  


13. 排序及去重複

這個功能另 towns 意外呢!
去重複。於搜尋內容打入  ^(.*?)$\s+?^(?=.*^\1$),並勾選“規則運算式”及“「.」包含換行
排序。將要排序的文字 mark 起來 => 編輯 => 行列處理 => 昇冪(降冪)排序文字

註:8.2.1已經有內建去重複、排序、移除空很等功能。編輯 > 行操作

參考資料:
思緒大的文章
https://sixu.life/sorting-and-removing-duplication-using-notepad.html 


14. 加入空白行

 

百度某大大
https://jingyan.baidu.com/article/b2c186c8122ebac46ef6fffa.html


其他說明:

https://ithelp.ithome.com.tw/articles/10009789?sc=pt

留言

這個網誌中的熱門文章

zimbra 安裝、管理、設定

Fortigate 100D -- 管理、設定

IT 隨手記6