• Like
Vim&tmux
Upcoming SlideShare
Loading in...5
×
Uploaded on

This slide introduces the vim 's basic command and vim's plugin which is called "Vundle".Vim is a text editor which can provide massively flexible settings for what you want to have …

This slide introduces the vim 's basic command and vim's plugin which is called "Vundle".Vim is a text editor which can provide massively flexible settings for what you want to have .Furthermore,another tool for terminal is called "Tmux".Tmux is a terminal multiplexer,so you can make your terminal more useful.

More in: Software , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
293
On Slideshare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
8
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Vim Plugin &Tmux
  • 2. Tmuxhttp://lukaszwrobel.pl/blog/tmux-tutorial-split-terminal-windows-easily
  • 3. Introduction  Tmux 的全名是 Terminal Multiplexer (終端多工器)  而Tmux的優點大致有以下這幾點:  可以被多個SSH同時連線  可在Session中切換到不同的Session  強大的分割視窗
  • 4. Compare to Screen
  • 5. Installation and Execution  Installation: Sudo apt-get install tmux  Execution:
  • 6. Tumx設定 http://blog.longwin.com.tw/2011/04/tmux-learn-screen-config-2011/4  首先,先創建 .tmux.conf檔 ex: vim ~/.tmux.conf  這個檔案主要是來設定Tmux的快捷鍵,可參考上面網址已經設定好的檔案  Prefix key: CTRL + b  熱鍵設定方式: bind ex:bind c new-window 需要先按Prefix key才+c 就可以建立新視窗 bind-key –n 不用先執行Prefix key 就可以執行指令 bind-key –r 熱鍵可以repeat,只要一直按著,就能重複執行。
  • 7. 常用指令  視窗取回 tmux attach –t session-id  列出所有視窗 tmux ls  刪除session tmux kill-session –t session-id  開啟自訂視窗 tmux new –s session-id
  • 8. 常用指令  水平分割視窗 Prefix key + |  垂直分割視窗 Prefix key + v  建立新視窗 Prefix key + c  換pane prefix key + h,j,k,l  換視窗 prefix key + n,p  離開Session但是不切斷Session prefix key + ctrl d
  • 9. Vim Plugin http://ben198777.blogspot.tw/2013/08/vim-plugin.html http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide
  • 10. vim的一些基本指令 http://linux.vbird.org/linux_basic/0310vi.php  Example: 按i可進入編輯模式 Esc離開編輯模式 輸入:wq 儲存後離開 :q為直接離開(後面有 ! 表示強制執行這個動作) h j k l 分別代表(左 上 下 右) ctrl+f b 向下、上移動一頁 G 移動到最後一行 gg移動到第一行 u 復原前一個動作 ctrl+r 重複上一個動作 ndd (n為數字 從游標開始刪除n行) :1,$s/word1/word2/g (從1到最後一行把word1取代成word2)
  • 11. 管理plugin 的工具:vundle  先安裝git 和vim sudo apt-get install git (若無法安裝先更新軟體) sudo apt-get update  接著透過git clne直接從網站抓下來 git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle  至於plugin的安裝都會寫在~/.vimrc裡面
  • 12. .vimrc  基本上跟vim有關的設定以及plugin都會寫在~/.vimrc裡面 ex: tab的空格數 ,plugin,字體顏色…等等等
  • 13. 一些好用的vim plugin for python http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide https://www.openfoundry.org/tw/tech-column/2244--vim-plugin http://ben198777.blogspot.tw/2013/09/vim-plugin-for-python-and-java.html  SnipMate (補齊code)  The-NERD-tree (讓filesystem 呈樹狀結構)  Auto-Pairs(讓符號成對出現)  Taglist.vim(需安裝ctags,code架構) http://blog.eddie.com.tw/2012/06/01/screencast-3-vim-plugins/  Pep 8 (在vim可以查看python語法正確性)  Vim-surround(ex: “tab” 打cs “‟ -> „tab‟)  Vim-indent-object (選取 block for python or ruby)  Code folding(這個vim本身有內建)