zoukankan      html  css  js  c++  java
  • vim


    visual mode :

                         insert :

                                    ctrl + v

                                    select line

                                    shift + i

                                    key word

                                    Esc


    跳回上一個位置

    ctrl + o


    跳到下一個位置

    ctrl + i


    顯示完整的檔案路徑及檔名

    1 + ctrl + g


    swtich case

    ~


    Word movement

    w : moves to the start of the next word

    e : moves to the next end of a word


    Matching a paren

    % : moves to the matching paren

          work for () and [] and {}


    Moving to a character

    fx : searches forward in the line for the single character x.

          Hint: "f" stands for "Find".

     The "F" command searches to the left

    tx : works like the "fx" command, except it stops one character  before the searched character.

          Hint: "t" stands for "To".

      The "T  " command searches to the left

    copy

    y0 : copy from start of line to current.

    y$ : copy from current to end of line.

    p : paste

    5p : paste 5 times

    2yy : copy 2 lines


    replace

    range is the entire file,

    search word1, then replace it by word2, need confirm

    :1,$s/word1/word2/gc

    gd 查區域變數
    gD查全域變數
         追蹤某個變數宣告時,可以用gd或gD去跳轉

    dd 刪一整行
    dw 刪一個單字,非刪一個字母
    dw 刪掉空白至最一個字出現
          ex
                  before
                  asss   _          ddddd
     
                  after
                  asss   ddddd
     
    d$ 刪至行尾 (含游標的字元)
    d^ 刪至行首 (不含游標的字元)

    http://wen00072.github.io/blog/2018/02/15/vim-setup-for-trace-c-code/#vtr-set-vdplg-tr 

  • 相关阅读:
    Leetcode 15. 3Sum
    本周学习小结(01/07
    面试总结之Data Science
    学习笔记之MongoDB
    本周学习小结(13/05
    Django知识点总结
    Django【进阶篇 】
    Django【基础篇】
    如何拿到半数面试公司Offer——我的Python求职之路(转载)
    Django框架(三)
  • 原文地址:https://www.cnblogs.com/youchihwang/p/6204524.html
Copyright © 2011-2022 走看看