Vim 8.0 於 Linux 使用滑鼠選取自動複製的快速鍵

Vim 8.0 於 Linux 的 CLI 環境,使用滑鼠選取文字的話,預設不是 Xwindow 的選取方式,而是 Vim 內部的選取方式(v),所以文字要複製沒辦法使用 Ctrl + c 等等複製到系統的記憶體。

  • 註1:預設為 set mouse=a 的模式
  • 註2:Debian stretch 目前安裝就是 Vim 8.0,就會遇到此情況

想要複製到系統的記憶體,可以使用下述兩種方式:

  • 按住 Shift 後,在用滑鼠選取,可以使用 Ctrl + c 複製,或 此時用滑鼠中間就可以貼上。(再按一下 Shift 選取反白才會消失)
  • :set mouse= 或 :set mouse=r 或 :set mouse=v (設定不要為 a 就可以使用標準系統的選取、複製模式)

相關說明

*'mouse'* *E538*
'mouse'         string  (default "", "a" for GUI, MS-DOS and Win32)
            global
            {not in Vi}
    Enable the use of the mouse.  Only works for certain terminals
    (xterm, MS-DOS, Win32 |win32-mouse|, QNX pterm, *BSD console with
    sysmouse and Linux console with gpm).  For using the mouse in the
    GUI, see |gui-mouse|.
    The mouse can be enabled for different modes:
        n   Normal mode
        v   Visual mode
        i   Insert mode
        c   Command-line mode
        h   all previous modes when editing a help file
        a   all previous modes
        r   for |hit-enter| and |more-prompt| prompt
    Normally you would enable the mouse in all four modes with:
        :set mouse=a
    When the mouse is not enabled, the GUI will still use the mouse for
    modeless selection.  This doesn't move the text cursor.

    See |mouse-using|.  Also see |'clipboard'|.

    Note: When enabling the mouse in a terminal, copy/paste will use the
    "* register if there is access to an X-server.  The xterm handling of
    the mouse buttons can still be used by keeping the shift key pressed.
    Also see the 'clipboard' option.

林金宏 講解 火災發生的「火場求生」注意事項

火場求生的正確觀念,跟以前教得不太一樣,遇到火災不是要快逃,而是要關起門來等待救援。

  • 「遇到火災,關門大吉」「克服心魔、等待救援」

閱讀全文〈林金宏 講解 火災發生的「火場求生」注意事項〉

tail 遠端多台機器 Log 檔的工具

遠端機器很多,或者機器有多台,但是想要將 Log 檔靠 tail 一起持續觀看(ex: 看每台的 syslog.. 等),可以使用下述程式:

  • monkeytail - tail variant designed for web developers monitoring logfiles

閱讀全文〈tail 遠端多台機器 Log 檔的工具〉

國家地理頻道:洪水來臨前 - 限時免費觀賞

李奧納多監製環保紀錄片《洪水來臨前Before The Flood》,國家地理頻道全台首播,而且台灣到2016/11/6為止,在 YouTube 限時免費收看。

影片提要:

李奧納多狄卡皮歐出任聯合國和平大使,接下關注氣候變遷議題的終身任務。李奧納多前往格陵蘭的荒野、蘇門答臘炙熱的森林,再前往梵蒂岡教廷拜訪,一路上探索氣候變遷對地球帶來的重大衝擊。他利用前所未有的機會,與社運人士、科學家,和各國元首會談,包括美國總統歐巴馬、創業家伊隆馬斯克,以及教宗方濟各。李奧納多帶領大家深入瞭解危機形成的原因,並揭露可能的解決之道,並且為下列問題找到答案:「我們能夠在為時未晚之前,採取行動阻止災難發生嗎?」

閱讀全文〈國家地理頻道:洪水來臨前 - 限時免費觀賞〉

於 Linux Shell 使用 shuf 將檔案依行數「隨機排列」

Linux 於 Bash shell 的檔案內容,通常經過去掉重複後,通常都是 sort 過的內容,想要將這個檔案的內容在讓他「隨機排序」,要怎麼做呢?

閱讀全文〈於 Linux Shell 使用 shuf 將檔案依行數「隨機排列」〉

Yarn 取代 npm 的套件管理工具

npm 速度慢是眾人皆知,Facebook 開發出新的套件管理工具來取代 npm,看起來速度差異非常顯著,而 yarn.lock 可以鎖住套件版本,確保安裝在每台機器的套件版本都是一致的。

註:Yarn 還很新,可能會有意外狀況,最好先測試看看再上線。

閱讀全文〈Yarn 取代 npm 的套件管理工具〉

iPhone (iOS) 更新造成 Xcode 不支援如何手動升級 - 2016

iOS 10.1 release,手邊的 iPhone 6 很自然的就選擇升級上去,沒想到 Xcode 編譯要直接上 iPhone 就說不支援,但是 Mac 系統升級也做了,App Store 的 Xcode 就是一直
沒新版,所以來手動先抓新版的來用~

閱讀全文〈iPhone (iOS) 更新造成 Xcode 不支援如何手動升級 - 2016〉