one vim, use everythere, 強推!
vim is editor? no, a program language. (vim 只是個編輯器? 不, 它是一門編程語言. 和上一句呼應)
- idea
- 高效使用pycharm
- https://laracasts.com/series/how-to-be-awesome-in-phpstorm
- https://laravist.com/series/phpstorm-the-best-php-ide-you-ever-met
編輯器: vscode
IDE: idea全家桶
其他: sublime/atom/eclipse 棄用, 已投入 vscode/idea全家桶
建議使用 IDE, 開箱即用, 而編輯器需要配置很多
phpstorm
界面配置: view|distraction-free-mode + setting|code-style|hard-wrap=500(如果發現代碼沒有最左顯示) + add-leading-space-to-comment
設置忽略文件夾:setting -> editor -> file type -> 添加 node_modules;
單行注釋: comment at first column
配置 psr: editor -> code style -> php -> set from
phpstorm EAP(Early Access Program)
修改快捷鍵: 通過 名字搜索/快捷鍵 搜索; remove -> add
多個文件夾: setting->directories-> add content root
spelling: setting->spelling-> application-level
快速找到當前文件的目錄路徑: project 試圖里的 目標圖標
配置對所有 phpstorm 生效: profile store in IDE/project; preference for current/new project
preference for new project: 設置后, 就不用每次打開新項目都得設置一遍了
代碼折疊(比如 php 的 use): code folding
phpdoc: setting-inspections, 關閉 phdoc 提示, 為了寫 doc 而寫 doc -> 需要寫 doc 的地方
setting - add package as lib: 允許編輯/定位 vendor 下的文件
C-d:復制當前行
C-y:刪除當前行(更通用的還是 C-x,導出通用)
C-S-j: 合并行
C-A-l:reformat,在設置中配置了代碼風格之后,就可以一鍵搞定代碼風格了
A-鼠標左鍵:多點編輯
ct-g:select next occu
A-insert: generate -> getter/setter 接口方法
A-6:查看 todo,項目周期特別長的時候添加
C-f12:查看文件結構,類似 sublime 里面的查看函數
A+enter: show intention action
A + num: 切換不同界面(Esc)
ideaVim: 無法使用->keymap->cmd-a-v; 如果還無法使用->keymap->exit insert mode
aceJump
live and code template|incude: Created: {DATE} ${TIME}
touch bar + fn: keymap -> always use fn
基礎概念
file: new open setting
edit: cut copy(path reference) paste(history) find(replace everywhere) line(join duplicate)
view: tool-window(alt-1~9 todo terminal) definition/document/paramter/context/error/source recent(file change) compare bar/editor mode/fullscreen
navigate(相當于 sublime 中的 goto): everywhere/file/class/symbol/line back(file edit-location) next(error emmet type change method) hierarchy(path file type method call)
code: generate(override implement) move(line statement) reformat analysis
refactor: rename(property method) move copy
run: run debug
tool: template(sublime 中 snippet) database
vcs: git(compare confilct) local
window
help
action: C-S-a(vscode C-S-p) A-enter(show intention action)
toolbox
管理 idea 全家桶的利器
使用 release 版而非 EAP
會導致 Alfred 無法切換程序 -> brew cask install phpstorm
pycharm
project interpreter -> local/ssh/docker
datagrip
foreign key
export/import: file/db
推薦理由: 強大的自動補全
data source: cmd+;
執行當前語句: cmd+enter
explain raw: ctrl+enter
參數綁定: parameter where id=:id
關鍵詞大小寫: setting->code style->sql
vim
Treat vim as a programming language, and use it everywhere.
練習工具: vimtutor(vim自帶) https://vim-adventures.com/
vim-galore 從入門到精通 https://yq.aliyun.com/articles/625429
vimrc: https://github.com/amix/vimrc
光標上次編輯點: C-O/I
刪除引號內的內容: di' -> c/d/y/v i/a/t/f '/"
合并多行: 3J 3gJ
格式化代碼/自動縮進: =
選中單詞: v e
大小寫: gu gU
undo: u/U; redo: c-r
replace: r R; change word: ce
匹配括號: %
exec ext command: :!
set option: :set xxx; :set noxxx
help: :help xxx
completion: :e -> c-d -> tab
use systemClipboard: `set clipboard=unnamed'
vimtutor
C-v # visio mod -> select -> edit
:sp :vsp C-w # 窗口
:{range}left [margin] # 代碼對齊
vscode
vscode 中文文檔
極客時間 - 玩轉VS Code
code --diff <file1> <file2>
更輕便的開發編輯器選擇, 免去很多包管理的煩惱
f8: error
zen mode
shell command
reveal 自動打開文件所在位置: 取消全局配置, 設置keymap
雙手不離鍵盤: 光標移動(單詞/行/代碼塊/文檔) 文本選擇(多加一個 shift) 自定義快捷鍵
多光標(同時編輯多處 https://www.jb51.net/softjc/609020.html): A+鼠標 C-d 復選+A-S-i
shell
shell 快捷鍵: http://blog.chinaunix.net/uid-361890-id-342066.html
光標移動單詞: esc-b/f
光標移動行: C-a/e
光標刪除行: C-u/k
刪除光標前單詞: C-w