Skip to content
/ vim.d Public
forked from feiyuw/vim.d

used to store my vim configurations

Notifications You must be signed in to change notification settings

tafanfly/vim.d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains three configuration files:

  • vimrc
  • tmux.conf

VIM

  1. It works fine on 64bit Lubuntu with VIM 7.4.
  2. It should be OK for other Linux and VIM 7.+.
  3. Cmake is needed, apt-get install cmake

Install & Upgrade

Install

  1. Install vundle

     git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
    
  2. Clone vim.d

     git clone https://github.com/tafanfly/vim.d.git ~/workspace/vim.d
    
  3. Create ~/.vimrc

     ln -s ~/workspace/vim.d/vimrc ~/.vimrc
    
  4. Open vim, execute :BundleInstall

  5. Patch power-line font

    mkdir ~/.fonts
    git clone https://github.com/powerline/fonts.git ~/.fonts/powerline-fonts
    cd ~/.fonts/powerline-fonts
    ./install.sh
  6. Install YouCompleteMe

    cd ~/.vim/bundle/YouCompleteMe
    ./install.sh
  7. Open vim again, enjoy!

Upgrade

  1. Update vim.d
    cd ~/Workspace/vim.d
    git pull
  1. Open vim, execute :BundleClean
  2. Open vim, execute :BundleUpdate

Update colorscheme

  1. Copy intersted colorscheme file such as monokai.vim under ~/.vim/bundle/vim-colors-solarized/colors
  2. Set colorscheme monokai in your ~/vimrc file

Issue

  1. Open vim without color
    vim ~/.vimrc
    add line syntax on

Plugins

The plugins I used are:

  • gmarik/vundle
  • altercation/vim-colors-solarized
  • ctrlpvim/ctrlp.vim
  • tacahiroy/ctrlp-funky
  • FelikZ/ctrlp-py-matcher
  • scrooloose/nerdtree
  • NERD_tree-Project
  • scrooloose/nerdcommenter
  • plasticboy/vim-markdown
  • majutsushi/tagbar
  • bling/vim-airline
  • tpope/vim-fugitive
  • Valloric/YouCompleteMe
  • godlygeek/tabular
  • scrooloose/syntastic
  • digitaltoad/vim-jade
  • rking/ag.vim
  • mfukar/robotframework-vim
  • ntpeters/vim-better-whitespace
  • elzr/vim-json
  • tpope/vim-surround
  • pangloss/vim-javascript
  • mxw/vim-jsx
  • othree/html5.vim
  • airblade/vim-gitgutter
  • wavded/vim-stylus
  • moll/vim-node
  • jiangmiao/auto-pairs
  • ekalinin/Dockerfile.vim
  • fatih/vim-go
  • fcitx.vim
  • christoomey/vim-tmux-navigator

Shortcuts

  1. ,e

    open file

  2. ,s

    open file in split window

  3. ,vs

    open file in vertical split window

  4. ,m

    comment/uncomment code

  5. ,f

    open function list of current file, like Ctrl-R in sublime

  6. <F4>

    open/close tag bar on the right panel

  7. <F5>

    execute "make test" in project root

  8. <F12>

    open/close project browser on the left panel

  9. <Ctrl-Tab>

    in normal mode, switch files in minibuffer; in insert mode, used to select code snippet

  10. <Ctrl-p>

    in insert mode, used to open specified file quickly; see detail in ctrlp.vim plugin

  11. ,;

    auto complete

  12. ,c

    copy to system clipboard

  13. ,v

    paste from system clipboard

Some Tips

Edit file in column

  1. in normal mode, <Ctrl-v> start to select column, <Shift-v> to select multiple lines
  2. after select several columns,
    • I used to add content before cursor column
    • A used to add content after cursor column
    • r used to modify content under cursor
    • x used to delete content under cursor

Quick Move

  1. <Ctrl-o> move to previous edit position
  2. <Ctrl-i> move to forward edit position
  3. b move to previous word, w move to next word
    • try B and W, and see what's the difference
  4. { move to previous block, } move to next block
  5. 0 move to start of the line, $ move to end of the line
    • ^ move to first char of the line
  6. gg move to the start of the file, G move to the end of the file
  7. <Ctrl-]> jump to the definition of content under cursor, while <Ctrl-t> jump back

Quick Edit

  1. u undo, <Ctrl-r> redo
  2. . report last step
  3. di' delete content in '
  4. dt' delete content from current position to '
  5. cw modify the current word
  6. caw modify the current word
  7. c0 modify from start to current position
  8. c$ modify from current position to end of this line
  9. R update the content until got ESC

总结常用的command

vim命令 描述
,e 打开一个文件
Tab 普通模式下切换文件
,m 注释一行/解注释
F12 浏览/关闭项目目录
Ctrl + v 普通模式下选择列
Shift + v 普通模式下选择行
Ctrl + v/Shift + y + p 普通模式下选择,然后copy,再paste
u 撤销上一步
c0 修改行开头到当前位置
c$ 修改当前位置到行未
0 跳到行头
$ 跳到行末
^ 跳到该行第一个字符
b 跳到前一个word
w 跳到后一个word
gg 跳到文件开头
G 跳到文件末尾
{ 跳到上一个block
} 跳到下一个block

Macro

  1. qa start to record macro a
  2. execute some steps
  3. q stop to record
  4. @a execute the macro
  5. @@ execute the last executed macro

Screenshot

panel usage

Reference

  1. VIM Tips
  2. VIM scripts
  3. ctrlp.vim introduction
  4. Practical VIM

Tmux

See in tmux.readme, tmux.config

About

used to store my vim configurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%