Last active
March 15, 2016 02:15
-
-
Save JeOam/914cf400bd96c8d28455 to your computer and use it in GitHub Desktop.
Vim 写 C、Lua 配置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" place at: ~/.vimrc | |
" Enable syntax highlighting | |
syntax on | |
" show line number | |
set nu | |
" Set to auto read when a file is changed from the outside | |
set autoread | |
" 1 tab == 4 spaces | |
set tabstop=4 | |
" Use spaces instead of tabs | |
set expandtab | |
" Configure backspace so it acts as it should act | |
set backspace=eol,start,indent | |
" Set utf8 as standard encoding and en_US as the standard language | |
set encoding=utf8 | |
" Use spaces instead of tabs | |
set expandtab | |
" Put this in your .vimrc to use Vundle. | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/.vim/bundle/plugins') | |
" let Vundle manage Vundle, required | |
Plugin 'VundleVim/Vundle.vim' | |
" The following are examples of different formats supported. | |
" Keep Plugin commands between vundle#begin/end. | |
" Install YouCompleteMe | |
Bundle 'Valloric/YouCompleteMe' | |
" All of your Plugins must be added before the following line | |
call vundle#end() " required | |
filetype plugin indent on " required | |
" | |
" Brief help | |
" :PluginList - lists configured plugins | |
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate | |
" :PluginSearch foo - searches for foo; append `!` to refresh local cache | |
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal | |
" | |
" see :h vundle for more details or wiki for FAQ | |
" Put your non-Plugin stuff after this line | |
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py" |
Delete all lines of file in Vim:
- Type
gg
to move the cursor to the first line of the file, if it is not already there. - Type
dG
to delete all the lines.
Insert mode at beginning of line: I
(the capital of i)
Insert mode at the end of the line: A
Mac OS/Vim 7.4 下,遇到错误:
Fatal Python error: PyThreadState_Get: no current thread.
可通过:
brew unlink python
解决。
复制粘贴:
# .vimrc
# use system clipboard
set clipboard=unnamed
Vim command:
# copy 1 to 2 line to clipboard
:1,2y<Enter>
Copy all lines:
ggyG
:%y+
- gg"*yG
Shift + o
: 在上一行插入一个新行o
: 在下一行插入一个新行I
: 行首输入A
: 行尾插入
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vundle (缩写自 Vim bundle) 是一个很方便的 Vim 插件管理器。
Set up Vundle:
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
编译 YouCompleteMe 需要 CMake
然后把文件 下载至
~/.vim/
目录下,命名为:.ycm_extra_conf.py
然后 vim 中:
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"