小技巧 如何在SHELL裡快速啟動編輯器

2021-06-23 09:08:47 字數 520 閱讀 5222

一般來說,我們在shell裡啟動編輯器都是直接輸入命令的,如

$ vim

$ emacs

等等。但在shell裡也有乙個快捷鍵 c-x c-e可以直接啟動編輯器。

說明如下:

`edit-and-execute-command (c-xc-e)'

invoke an editor on the current command line, and execute the

result as shell commands.  bash attempts to invoke `$visual',

`$editor', and `emacs' as the editor, in that order.

這裡ctrl-x按下之後需要再按ctrl-e,這樣會開啟預設的編輯器。

如上所述,它會按乙個順序去判斷預設的編輯器,先判斷$visual環境變數,

然後是$editor環境變數,如果都沒有設那就直接呼叫emacs。

export editor="vimx"

快速編輯vb程式小技巧

1 在vb程式中,通常會遇到一些特別長的句子,這樣如果不換行則程式讀起來就很不方便。尤其是在呼叫windows api函式時,程式一般都很長。在vb中提供了一種方法可以使程式換行,只要在每次換行的最後乙個字元加上換行字元 空格加下劃線 就可以了,如下面的api函式 private declare f...

Linux編輯shell指令碼快速啟動jar包

vi start.sh將下面內容複製到檔案中 ps ef grep xf demo grep v grep awk sed e s kill 9 g sh nohup j a xms256m xmx1024m xx permsize 512m xx maxpermsize 1024m jar hom...

C 如何在程式裡定時啟動任務

c 如何在程式裡定時啟動任務 對工程進行編譯並執行,就可以看到結果了,結果如下 計畫任務測試開始 2003 13 10 11 08 15 2003 13 10 11 08 18 2003 13 10 11 08 21 2003 13 10 11 08 24 2003 13 10 11 08 27 2...