Last active
November 18, 2017 07:52
-
-
Save Springshen/f17a42e3c815abb63ffa8ce201e2ce13 to your computer and use it in GitHub Desktop.
This file contains 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
filetype on " 侦测文件类型 | |
syntax on " 语法高亮 | |
set autowrite " 自动保存 | |
set nocompatible " 关闭vi兼容模式 | |
set showmatch " 高亮显示匹配的括号 | |
set cursorline " 突出显示当前行 | |
set number " 显示行号 | |
set history=1000 " 历史记录数 | |
set ignorecase " 搜索忽略大小写 | |
set hlsearch " 高亮被搜索的句子 | |
set incsearch " 搜索逐字符高亮 | |
set fenc=utf-8 " 默认编码设置 | |
set laststatus=2 " 总是显示状态行 | |
set ruler " 打开状态栏标尺 | |
set cmdheight=5 " 命令行(在状态行下)的高度,默认为1,这里是2 | |
set nobackup " 不要备份文件 | |
"set softtabstop=4 " 插入时,<Tab>算作空格的数目 | |
set showcmd " 在屏幕最后一行显示 (部分的) 命令 | |
set encoding=utf-8 " 设置vim编码 | |
set fileencoding=utf-8 " 设置当前文件编码 | |
"set autoread " 当文件在外部被修改时,自动重新读取 | |
"set paste " 设置粘贴模式 | |
"vim设置Python自动缩进为4个空格 | |
autocmd FileType python setlocal et sta sw=4 sts=4 | |
""""""""""Vundle插件""""""""" | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
call vundle#end() | |
Bundle 'The-NERD-tree' | |
Bundle 'The-NERD-Commenter' | |
"autocmd VimEnter * NERDTree | |
map <F2> :NERDTreeToggle<CR> | |
let NERDTreeIgnore=['.pyc'] | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif | |
""""""""""Vundle插件""""""""" | |
let mapleader="#" | |
imap <leader>def def ():<CR><ESC>i<Space><Space><Space><Space><CR><ESC>i<Space><Space><Space><Space>return<ESC>kk2hi | |
"""""""""""Python配置""""""""""" | |
" F5 自定义F5快捷键来运行Python3脚本 | |
nmap <F5> :!python3 %<CR> | |
"""""""""""""""""""""""""操作备注"""""""""""""""""""""""" | |
""多窗口操作 | |
""qall! 关闭所有窗口 | |
""使用:sp + 文件名可以水平分割窗口 | |
""使用:vs + 文件名可以横向分割布局(新文件会在当前文件右侧界面打开) | |
""使用:sv + 文件名可以纵向分割布局(新文件会在当前文件下方界面打开) | |
""使用Ctrl + w可以快速在窗口间切换 | |
"" | |
""选择文本 | |
""v不规则选择 | |
""V按行选择 | |
""Ctrl + V按列选择 | |
"" | |
""插入/修改 | |
""i在当前字符前面插入 | |
""I在行首插入 | |
""a在当前字符后面插入 | |
""A在行尾插入 | |
""o在当前行的下一行插入 | |
""O在当前行的上一行插入 | |
""r更改当前的字符 | |
""R更改多个字符 | |
""cw/caw更改单词 | |
""cf + 字符更改从当前字符到指定字符 | |
""c$更改从当前字符到行尾 | |
""cc更改整行 | |
"" | |
""删除 | |
""x删除字符 | |
""df + 字符删除从当前字符到指定字符 | |
""dw/daw删除单词 | |
""d$删除从当前光标到行尾 | |
""dd删除一行 | |
"" | |
""剪切与粘帖 | |
""dd + pdelete一行,然后放在当前光标下方 | |
""dd + Pdelete一行,然后放在当前光标上方 | |
""dw + p delete单词,然后放在当前光标后面 | |
""dw + P delete单词,然后放在当前光标前面 | |
""p/P可接受计数前缀,重复粘贴 | |
"" | |
""复制 | |
""yw复制单词 | |
""yf复制从当前字符到指定字符 | |
""y$复制当前光标到行尾 | |
""yy复制整行 | |
"" | |
""撤销和恢复 | |
""u撤销 | |
""ctrl + r重做 | |
"" | |
""重复操作 | |
""数字+action表示执行某个操作多少次 | |
"".重复上一个操作 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment