2020年8月14日 星期五

Eclipse auto-completion/ suggestion 修正

發現重新安裝的 Eclipse 在寫 JAVA 時,dot(.) 之後跳出的 suggest method 錯誤機率相較原本的很高,照著網路建議改了一下,正確多了。


  1. 打開設定:Window > Preference > Java > Editor > Content Assist > Advanced
  2. 把右邊上下視窗中的 "Java Proposals" 都勾起來就可以。


SOURCE: https://dev.to/riversun/when-you-get-unintended-results-in-eclipse-s-code-completion-that-might-be-the-side-effect-of-substring-code-completion-191f

2020年6月3日 星期三

code point 與 code unit 的簡單分類

我的簡單理解方式為:

  • code unit: a byte. 較接近硬體的,但也可能因系統而異,
    e.g. UTF-16  uses two bytes as a code unit。
  • code point: a character. 某字集內的一個字元,可能為多個 code unit 組成。

2020年5月27日 星期三

terminal 文字顏色設定

\e[01;31m 表示配色開始。綠色部分為格式設定,有 [1,3,4]。黃色部分為顏色設定。m 表控制碼結束。
\e[00m 表示配色 reset


作法 1:
# -e enable interpretation of backslash escapes
$ echo -e "\e[95mHello \e[00m\e[92mWorld!\e[0m"

做法 2:
# 這種方式會影響接下來的所有輸出,無法在一列內輸出多種顏色。1~7 為 basic colors
$ tput setaf [1-7] $ echo "hello world"



tmux pane 間 copy/paste 的設定

tmux pane 之間的複製貼上因 copy mode 開始複製的 hotkey 跟輸入法切換器的 hotkey 衝突,
故改為 v 開始選擇,y 複製到 buffer。


以下貼到 ~/.tmux.conf
# Use v to trigger selection 
bind-key -T copy-mode v send-keys -X begin-selection

# Use y to yank current selection
bind-key -T copy-mode y send-keys -X copy-selection-and-cancel


------------------------------------
  1. <PREFIX> + [ 進入 copy mode。
  2. v 開始選擇。以方向鍵移動,會反白。
  3. y 複製到 buffer。
  4. <PREFIX> + ] 貼上 buffer 內的內容。


ps. <PREFIX> default 為 Ctrl-b
pps. $ tmux list-keys 可以列出 bind 的 keys