1. 程式人生 > >notepad-ken,不用按esc,但實現了常用程式碼編輯器功能的VIM

notepad-ken,不用按esc,但實現了常用程式碼編輯器功能的VIM

Centos、Redhat、Fedora安裝:

yum install ctags cscope wget unzip vim -y && wget https://github.com/langsim/notepad-ken/archive/master.zip -O master.zip && unzip -o master.zip && rm -rf ~/.vim && \cp -rf notepad-ken-master/.vim* ~ ; rm -rf master.zip notepad-ken-master

Debian、Ubuntu安裝:

apt-get install ctags cscope wget unzip vim -y && wget https://github.com/langsim/notepad-ken/archive/master.zip -O master.zip && unzip -o master.zip && rm -rf ~/.vim && \cp -rf notepad-ken-master/.vim* ~ ; rm -rf master.zip notepad-ken-master

使用方法

在專案的根目錄開啟vim,按F2開啟目錄樹,按ctrl-left將游標移動到目錄樹,C/C++專案第一次開啟時需要按F3更新索引。

快捷鍵

F2 開啟IDE模式
F3 在C/C++中可以更新索引
F4 貼上模式
F5 高亮游標下單詞
F6 顯示隱藏字元
F7 跳轉到變數或函式定義
F8 搜尋變數或函式
F9 儲存
F10 退出

ctrl-r 在當前檔案裡搜尋
ctrl-t 在當前目錄及子目錄搜尋
:%s /patten1/patten2/g 替換
ctrl-y 重做
ctrl-a 全選
ctrl-d 進入行選模式
ctrl-f 進入選擇模式
ctrl-g 進入命令模式
ctrl-z 撤銷
ctrl-x 剪下
ctrl-c 複製
ctrl-v 貼上
ctrl-left 跳轉到左邊視窗
ctrl-right 跳轉到右邊視窗
ctrl-up 跳轉到上邊視窗
ctrl-down 跳轉到下邊視窗

部分終端需要配置的按鍵序列

ctrl-up \033[1;5A ^[[1;5A
ctrl-down \033[1;5B ^[[1;5B
ctrl-left \033[1;5C ^[[1;5C
ctrl-right \033[1;5D ^[[1;5D
ctrl-home \033[1;5H ^[[1;5H    
ctrl-end \033[1;5F ^[[1;5F

Q&A

專案誕生緣由
    減少讀寫程式碼所需的手指運動量、大腦思維量和CPU佔用率。
開發主題
    簡單即美。

Centos、Redhat、Fedora Install:

yum install ctags cscope wget unzip -y && wget https://github.com/langsim/notepad-ken/archive/master.zip -O master.zip && unzip -o master.zip && rm -rf ~/.vim && \cp -rf notepad-ken-master/.vim* ~ ; rm -rf master.zip notepad-ken-master

Debian、Ubuntu Install:

apt-get install ctags cscope wget unzip -y && wget https://github.com/langsim/notepad-ken/archive/master.zip -O master.zip && unzip -o master.zip && rm -rf ~/.vim && \cp -rf notepad-ken-master/.vim* ~ ; rm -rf master.zip notepad-ken-master

Operating Instruction

Open vim in project root dir,press F2 and ctrl-left to use file tree. Press F3 to update index when open C/C++ project first time.

Function Key

F2 open IDE mode
F3 In C/C++ update index
F4 paste mode
F5 highlight word under cursor
F6 display the hidden character
F7 jump to variable or function defination
F8 search variable or function defination
F9 save
F10 quit

ctrl-r search in current file
ctrl-t search in current folder and child folder
:%s /patten1/patten2/g replace    
ctrl-y redo
ctrl-a select all
ctrl-d switch to row select mode
ctrl-f switch to select mode
ctrl-g switch to command mode
ctrl-z undo
ctrl-x cut
ctrl-c copy
ctrl-v paste
ctrl-left jump to left window
ctrl-right jump to right window
ctrl-up jump to up window
ctrl-down jump to down window

some teminal need to config

ctrl-up \033[1;5A ^[[1;5A
ctrl-down \033[1;5B ^[[1;5B
ctrl-left \033[1;5C ^[[1;5C
ctrl-right \033[1;5D ^[[1;5D
ctrl-home \033[1;5H ^[[1;5H    
ctrl-end \033[1;5F ^[[1;5F

Q&A

Target
    Consuming less finger, less brain and less cpu to read and write code
Theme
    Pretty is simple