Editing
Boot up Tasks
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 程式開發者 == === 終端機命令列參數自動完成 === * [https://fig.io/ Fig] ([https://github.com/withfig/autocomplete github], [https://www.ycombinator.com/companies/fig ycombinator]) === 終端機命令列操作 === 將終端機命令列指令文字中需要經常修改的部分,放到後面 * 例如 {{kbd | key=<nowiki>grep $KEYWORD file_name</nowiki>}} 其中 {{kbd | key=<nowiki>$KEYWORD</nowiki>}} 變數需要經常修改,建議改成句子後面 {{kbd | key=<nowiki>cat file_name | grep $KEYWORD</nowiki>}}。下次輸入命令列文字時,就可以減少滑鼠游標移動的次數。 {{Linux}} 作業系統指令輸入符號 {{kbd | key=<nowiki>!$</nowiki>}} 取代上一指令的最後參數 * 說明:[https://unix.stackexchange.com/questions/88642/what-does-mean bash - What does !$ mean? - Unix & Linux Stack Exchange] === 終端機命令列縮寫指令 + GUI 視窗操作 === Example 1: Opening a Text File with [https://en.wikipedia.org/wiki/Gedit Gedit] on Linux via Terminal 1. First, ensure gedit is installed on your system * If needed, install gedit using your distribution's package manager. On Debian * Type the following commands: <pre> sudo apt update && sudo apt upgrade sudo apt install gedit </pre> 2. Launch your terminal 3. Type the following command: <pre> gedit /path/to/text-file </pre> Example 2: To open the text file with Sublime for {{Mac}} from console 設定終端機命令列縮寫指令: key-in {{kbd | key=<nowiki>subl <filename></nowiki>}} to open the file with Sublime # Key-in {{kbd | key=<nowiki>vi ~/.zshrc</nowiki>}} # Press {{kbd | key=<nowiki>i</nowiki>}} to switch the insert mode # Add the following line {{kbd | key=<nowiki>alias subl='open -a "Sublime Text"'</nowiki>}} # Press {{kbd | key=<nowiki>:</nowiki>}} # Press {{kbd | key=<nowiki>wq</nowiki>}} to save the {{kbd | key=<nowiki>~/.zshrc</nowiki>}} file and quite the vi window 返回終端機命令列 # Key-in {{kbd | key=<nowiki>subl /path/to/file</nowiki>}} 就可以使用 Sublime 編輯檔案 Example 3: To open the text file with Notepad++ for {{Win}} from console # Install [https://notepad-plus-plus.org/downloads/ Notepad++] # Key-in {{kbd | key=<nowiki>start notepad++ <filename></nowiki>}} to open the file with Notepad++ === 離線版的軟體開發說明文件 === * [https://zealdocs.org/ Zeal - Offline Documentation Browser] for {{Win}} & {{Linux}} * [https://kapeli.com/dash Dash for macOS - API Documentation Browser, Snippet Manager - Kapeli] for {{Mac}} === 從當下瀏覽的檔案視窗的資料夾路徑,快速開啟命令列視窗 === * [[Open command window here]] * [https://conemu.github.io/ ConEmu] On {{Win}} *# Setup [https://conemu.github.io/en/Tasks.html Tasks] *# Define the command e.g. Input {{kbd | key=<nowiki>-new_console:d:C:\path\to\beach cmd.exe</nowiki>}} to open the folder {{kbd | key=<nowiki>C:\path\to\beach</nowiki>}} quickly. * [https://www.cygwin.com/ Cygwin] On {{Win}} 檔案總管選定某個資料夾,點選 「傳送到」 -> 「Cygwin」,就可以開啟 Cygwin 視窗,並且自動切換到選定的資料夾<ref>[https://superuser.com/questions/115587/how-do-i-create-a-shortcut-that-opens-cygwin-bash-shell-on-a-directory-of-my-cho How do I create a shortcut that opens Cygwin bash shell on a directory of my choosing (UNC especially)? - Super User]</ref> *# Open the explorer on {{Win}} and enter the {{kbd | key=<nowiki>shell:sento</nowiki>}} to open the folder of shortcuts *# Add a new shortcut {{kbd | key=<nowiki>C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico C:\cygwin64\bin\bash.exe -l -c "cd \"$0\" ; exec bash"</nowiki>}} it the Cygwin was installed on C drive * [https://www.cygwin.com/ Cygwin] 在 {{Win}} 中,於檔案總管中選取某個資料夾後,點選「傳送到」->「Cygwin」,即可開啟 Cygwin 視窗,並自動切換至選定的資料夾。<ref>[https://superuser.com/questions/115587/how-do-i-create-a-shortcut-that-opens-cygwin-bash-shell-on-a-directory-of-my-cho How do I create a shortcut that opens Cygwin bash shell on a directory of my choosing (UNC especially)? - Super User]</ref> *# 在 {{Win}} 中開啟檔案總管,輸入 {{kbd | key=<nowiki>shell:sento</nowiki>}} 以打開捷徑資料夾 *# 新增一個捷徑 {{kbd | key=<nowiki>C:\cygwin64\bin\mintty.exe -o Locale=UTF-8 -i /Cygwin-Terminal.ico C:\cygwin64\bin\bash.exe -l -c "cd "$0" ; exec bash"</nowiki>}} (假設 Cygwin 安裝在 C 槽) 已知問題: * 捷徑需要包含「-o Locale=UTF-8」選項,否則顯示的中文檔案內容 (e.g. cat filename.csv),會變成亂碼。 * 若資料夾名稱包含中文字,捷徑可能無法正常運作。 * [https://iterm2.com/ iTerm2] On {{Mac}} [https://stackoverflow.com/questions/50370854/is-it-possibile-to-open-iterm-in-current-finder-position macos - is it possibile to open iTerm in current Finder position - Stack Overflow] === Launch the editor from terminal === * Launch [https://support.apple.com/zh-tw/guide/textedit/welcome/mac TextEdit] from the Mac OSX Terminal: e.g. Input {{kbd | key=<nowiki>open -a TextEdit README.md</nowiki>}} to open the file README.md * [https://ashleynolan.co.uk/blog/launching-sublime-from-the-terminal Launch Sublime Text 2 or 3 from the Mac OSX Terminal - AshleyNolan.co.uk - Blog and Portfolio for Ashley Nolan] ''un-verified'' === 檔案操作/資料夾 === * 「傳送到」[https://www.howtogeek.com/howto/windows-vista/customize-the-windows-vista-send-to-menu/ Customize the Send To Menu in Windows 10, 8, 7, or Vista] === 快捷文字與自動替換文字 === * [https://www.sublimetext.com/ Sublime Text] ''$'': [https://github.com/sergeche/emmet-sublime sergeche/emmet-sublime: Emmet for Sublime Text] * Sublime Text ''$'': [http://docs.sublimetext.info/en/latest/extensibility/snippets.html Snippets]、[http://docs.sublimetext.info/en/latest/reference/completions.html Completions Files] + [https://www.granneman.com/webdev/editors/sublime-text/top-features-of-sublime-text/auto-completion-in-sublime-text Auto-Completion in Sublime Text | Scott Granneman]。教學: [https://www.minwt.com/webdesign-dev/html/17946.html Sublime Text教學 – 自訂常用的程式片段,只需輸入短碼立即產生完整原始碼 | 梅問題.教學網] * [https://www.jetbrains.com/phpstorm/ PhpStorm] ''$'': [https://www.jetbrains.com/help/phpstorm/tutorial-creating-live-templates.html Tutorial: Creating Live templates - Help | PhpStorm] 輸入縮寫 (abbreviation) 立即產生完整程式碼 (template text) * [https://blog.planetoid.info/2021/04/use-gpt3-generate-css-syntax.html GPT-3 文本產生模型,快速產生 CSS 語法]
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information