Code Monkey home page Code Monkey logo

keplervim's Introduction

 _  __          _                    __     ___
| |/ /___ _ __ | | ___ _ __          \ \   / (_)_ __ __
| ' // _ \ '_ \| |/ _ \ '__|  _____   \ \ / /| | '_ ` _ \ 
| . \  __/ |_) | |  __/ |    |_____|   \ V / | | | | | | |
|_|\_\___| .__/|_|\___|_|               \_/  |_|_| |_| |_|
         |_|

目录

KeplerVim 简介

preview

修改自humiaozuzu/dot-vimrc
使用的YCM编译后的文件,网盘下载

安装

  1. 编译安装vim8.0 博客

  2. 下载本项目

git clone https://github.com/M-Kepler/Keplervim.git
  1. 把文件夹放到 Home 目录下, 并改名为.vim
mv keplervim/ ~/.vim
cd .vim
ln -s ~/.vim/vimrc ~/.vimrc
  1. 安装插件管理Vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
  1. 安装插件

先去编辑 ~/.vim/bundles.vimPlugin 'Valloric/YouCompleteMe' 注释掉, 然后:x保存退出, 终端输入vim, 不管提示的错误, 一直回车进入到界面就行, 输入命令:BundleInstall 直到所有插件安装正确, 安装出错就再执行一次.
这些插件安装完后再把 ~/.vim/bundles.vim 里的Plugin 'Valloric/YouCompeteMe' 的注释去掉就可以了

  1. 显示md文档的目录结构

创建ctags的软链到home目录下

ln  -s ~/.vim/ctags ~/.ctags
  1. 系统环境需求
  • ** 注** :
  1. 由于自己编译YCM太麻烦了,而且不一定能成功,反正我的电脑上没成功.
    所以下载别人编译后的YCM,然后放到 ~/.vim/bundle/ 下就可以了.
    如果输入vim出错提示与EOF相关, 就先把.vimrc 23 到 29 行注释掉, 这几行是为了补全python虚拟环境里的库用的
  2. 想用漂亮的airline的话,需要安装特定的字体, 博客

特色和快捷键

我的默认leader键为;,你也可以在.vimrc里面修改.

表格中空白表示没有使用插件.

** 请注意查看最后面的 说明. **

PLUGINS DESCRIPTION HOW TO USE
NERDTreeToggle 目录树 <Leader>tn
NERDCommenter 快速注释 <Leader>cc & <Leader>cu
Tabular 任意对齐 Tab/=
TagbarToggle 代码结构 <Leader>tg
YouCompleteMe 大名鼎鼎的YCM
markdown preview Markdown实时预览 :MarkdownPreview 或 F5
syntastic 语法格式检查 <Leader>e
snippet 自动补全代码块 <Leader>Tab
fugitive 官网
Gundo 记录文档修改记录 <Leader>u
Ctrlp 快速打开文件 <Leader>o
Leaderf 快速打开文件,可以替代ctrlp <Leader>f
Emmet HTML/CSS补全 <Leader>h
ack.vim 整个工程下全局代码搜索 <Leader>a
dict.vim 翻译当前光标下的单词 <Leader>fy
tasklist Eclipse里的TODO/FIXME/XXX <Leader>tl
vim-devicons 目录文件显示图形字符
python程序的调试 Ctrl + d插入断点并进入调试
打开粘贴模式 <Leader>p
C/C++/JAVA/PYTHON/SHELL 一键编译 F6
C/C++/JAVA/PYTHON/SHELL 一键运行 F5
插入作者信息(已注释掉) Ctrl+i
快速修改.vimrc <Leader>ev
输入 + - / * = < >可以自动在前后添加空格 (已注释,vimrc里取消注释后生效)
括号自动补全 (已注释,vimrc里取消注释后生效)
编辑时才发现要sudo w!!
分割窗口的切换 <Leader>wh/j/k/l
标签页 <Leader>x关闭 / bn / bp切换

Vim 使用备忘

vim command vim使用笔记
gd 跳转到局部变量定义处
'' (两个单引号) 跳转到上次停靠处
:earlier 10m 恢复到10分钟以前的状态
ge 移动到上一个单词的词未
+/- 移到下/上一列第一个字符处
(/) 移到句首/句末
{/} 段首/段未
NG 文件的第n列
N+/n- 移动光标位置之后/前第N列
. 重做
:n 跳到第n行
:Tx 移动到光标后第一个x处
ma
gv 重新选择曾选择过的文本块
ctrl + g 查看当前位置
g + ctrl + g 统计
q: 显示输入过的命令历史
vim -M file_name 只读形式打开文件

常用命令

  • 多行行首插入:
按 Ctrl + v 进入列选择模式,选择需要行首插入的行
然后按 I,进入列插入状态,
输入星号 *,再按下 ESC
你会看到,所有行之前都出现了一个星号
  • 多行行末插入:
    Ctrl-v + $ + A + 想插入的字符 + esc

  • 折叠命令

  • zc 折叠,只折叠最外层的折叠

  • zo 展开,只展开最外层的折叠

  • zC 对所在范围内所有嵌套的折叠点折叠,包括嵌套的折叠.

  • zO 对所在范围内所有嵌套的折叠点展开,包括嵌套折叠.

说明

  • 一键编译说明 :
C,C++,Fortran,Python,java,Latex,sh等按`<F6>`编译
  • 一键运行说明 :
C,C++,Fortran,Python,java,Latex,sh等按`<F5>`编译运行
其中, python 程序是默认使用系统 python 版本(python2.7)的,
你也可以在对应的地方改为 python3
  • 关于粘贴说明 :
其实,普通文本不打开粘贴,也是可以直接将系统剪切板的内容粘贴到vim编辑器里的,而且格式不会乱
Ctrl + <Leader>就可以选择粘贴系统剪切板的内容了
代码的话还是先打开粘贴模式,在粘贴
  • syntastic 说明
<Leader>c  close errors windows
<Leader>n  jump to next error
<Leader>p  jump to pre error
用 ipdb 的话把对应的pdb改为ipdb就可以了
  • 可以查看windows的文本文件,不会显示乱码

keplervim's People

Contributors

m-kepler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alpha19976

keplervim's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.