Skip to content

Commit

Permalink
更新README
Browse files Browse the repository at this point in the history
  • Loading branch information
youngyangyang04 committed Jun 10, 2021
1 parent a8bd329 commit 662ef39
Show file tree
Hide file tree
Showing 2 changed files with 261 additions and 143 deletions.
230 changes: 87 additions & 143 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# [中文说明](https://github.com/youngyangyang04/PowerVim/blob/master/docs/README-zh.md)
# [English Version](./docs/README-en.md)

# PowerVim
Make your vim more power and much easer.

使你的vim更加强大易用
```
_____ __ ___
| __ \ \ \ / (_)
Expand All @@ -9,166 +11,108 @@ Make your vim more power and much easer.
| | | (_) \ V V / __/ | \ / | | | | | | |
|_| \___/ \_/\_/ \___|_| \/ |_|_| |_| |_|
```
# Why PowerVim?
* Highly customizble
* Runs everywhere
* Works with many programming language
* Scriptable
# Overview
# 预览
![conv_ops](https://github.com/youngyangyang04/Documents/blob/master/vim/vim_overview.gif)

# Installation
# 安装
```bash
git clone https://github.com/youngyangyang04/PowerVim.git
cd PowerVim
sh install.sh
```
# Feature
* CPP/PHP/JAVA code completion and you can add code keyword list for any language completion
* Taglist for functuon and variables list
* MiniBufList shows the files opened
* Vim syntax highlighting for C++ (including C++11), go, php, html, json and markdown
* Shows a git diff in the 'gutter' (sign column). It shows which lines have been added, modified, or removed.
* Provides an overview of the structure of the programming language files
* Automatically opens popup menu for completions when you enter characters or move the cursor in Insert mode
* Comment stuff out. Use `gcc` to comment out a line (takes a count), `gc` to comment out the target of a motion
* Visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations.
* Search with ack from within Vim and shows the results in a split window
* Syntastic checker for almost every programming language
* Beautiful statusline

# Usage
PowerVim shortcuts start with ;
# 特性
* CPP、PHP代码补全,如果需要其他语言补全,可自行配置关键字列表在dictionary目录下
* 显示文件函数变量列表
* MiniBuf显示打开过的文件
* 语法高亮支持C++ (including C++11), go,java, php, html, json and markdown
* 显示git状态,和主干或分支的添加修改删除的情况
* 显示项目文件目录,方便快速打开
* 快速注释,使用gcc注释当前行,gc注释选中的块
* 项目内搜索关键字和文件夹
* 漂亮的颜色搭配和状态栏显示

# 使用方法
PowerVim的快捷键以;为开始
PowerVim的快捷键以mac的键盘方便性而设计,当然其他键盘也很方便。这里列出的快捷键是PowerVim配置的,vim通用的快捷键就不一一列出。
Shortcuts is designed for mac Keyboard, more convenient and comfortable. Of course normal Keyboard can also use it Conveniently.

```
Normal Model Keyboard Shortcuts
;n // Open directory tree
;m // Open file function and variables list
;w // Save file
;u // Up half screen
;d // Down half screen
;1 // Move cursor to head of line
;2 // Move cursor to end of line
;a // Switch between source files and header files quickly, suport for C, C++
;e // Open a new file
;z // Switch to the shell interface,and "fg" go back
;s // Horizontal separation of window
;v // Vertical separation of window
;fw // Search keyword around the project, make sure you have installed ack
;ff // Search filename around the project
;gt // Jump to the definition of the keyword where the cursor is located, but make sure you have make ctags
;gr // Go back for ";gt"
;tg // Take tags file, make sure already install ctags
;y // Copy content which selected by v to system clipboard
;o // Enable syntastic checker
;t // Align with symbol, for example: ":Tab /|"
;ja // Add setter and getter for jave class
正常模式下的快捷键(非插入模式)
;n // 打开文件目录树显示在屏幕左侧
;m // 打开当前函数和变量目录树显示在屏幕右侧
;w // 保存文件
;u // 向上翻半屏
;d // 向下翻半屏
;1 // 光标快速移动到行首
;2 // 光标快速移动到行末
;a // 快速切换.h和cpp文件,写C++的时候很方便
;e // 打开一个新文件
;z // 切回shell交互命令,输入fg在切回vim,非常实用
;s // 水平分屏,并打开文件目录选取想打开的文件,如果想新建文件,;e 就好
;v // 竖直分屏,并打开文件目录选取想打开的文件,如果想新建文件,;e 就好
;fw // 查找项目内关键字
;ff // 查找项目内文件名
;gt // 跳转到变量或者函数定义的地方,前提是安装ctags,并且在在PowerVim输入 ;tg命令 Jump to the definition of the keyword where the cursor is located, but make sure you have make ctags
;gr // 跳回,对应着;gt
;tg // 对当前目录打ctag
;y // 保存当前选中的目录到系统剪切板,前提是vim支持系统剪切板的寄存器
dsfa;w
// It is useful when you have serval window because of tagbar or neadtree or split the window
;h/l/k/j // Move to the left/right/top/bottom window accordingly
;gg // Traverse window
;h/l/k/j // 光标向左右上下窗口移动,特别是打开多个窗口。使用这个快捷键组合非常实用
;gg // 按顺序光标跳转各个窗口
// Shortcuts without ;
e // Delete word under cursor
tabc // Close tab, of course you should :tabnew a file first.
F1 // Compile cpp code, and make sure there is a diretory named "bin" in current directory.
gc // Comment out the target of a motion
gcc // Comment out a line (takes a count)
{ // Up block of code
} // Down block of code
di+( // Delete the content in the parentheses
e // 快速删除光标所在的词
tabc // 关闭当前tab,可以用:tabnew来打开一个新的tab Close tab, of course you should :tabnew a file first.
F1 // 编译C++代码,自己写的C++例子的时候一键编译。前提手动在当前目录建一个bin文件夹,这是用来存放编译产生的执行文件
gc // 快速注释选中的块(是visual模式下选中的块)
gcc // 快速当前行
{ // 光标向上移动一个代码块
} // 光标向下移动一个代码块
di+( // 删除括号里的内容
```
# 插件
* a.vim [https://github.com/vim-scripts/a.vim](https://github.com/vim-scripts/a.vim)
* minibufexpl.vim [https://github.com/fholgado/minibufexpl.vim](https://github.com/fholgado/minibufexpl.vim)
* statusline.vim [https://github.com/youngyangyang04/PowerVim/blob/master/.vim/plugin/statusline.vim](https://github.com/youngyangyang04/PowerVim/blob/master/.vim/plugin/statusline.vim)
* taglist.vim [https://github.com/vim-scripts/taglist.vim](https://github.com/vim-scripts/taglist.vim)
* ack [https://github.com/mileszs/ack.vim](https://github.com/mileszs/ack.vim)
* autocomplpop [https://github.com/vim-scripts/AutoComplPop](https://github.com/vim-scripts/AutoComplPop)
* commentary [https://github.com/tpope/vim-commentary](https://github.com/tpope/vim-commentary)
* nerdtree [https://github.com/scrooloose/nerdtree](https://github.com/scrooloose/nerdtree)
* vim-gitgutter [https://github.com/airblade/vim-gitgutter](https://github.com/airblade/vim-gitgutter)

# Plugins

* [a.vim](https://github.com/vim-scripts/a.vim)
* [minibufexpl.vim](https://github.com/fholgado/minibufexpl.vim)
* [statusline.vim](https://github.com/youngyangyang04/PowerVim/blob/master/.vim/plugin/statusline.vim)
* [taglist.vim](https://github.com/vim-scripts/taglist.vim)
* [ack](https://github.com/mileszs/ack.vim)
* [autocomplpop](https://github.com/vim-scripts/AutoComplPop)
* [commentary](https://github.com/tpope/vim-commentary)
* [nerdtree](https://github.com/scrooloose/nerdtree)
* [vim-gitgutter](https://github.com/airblade/vim-gitgutter)
* [Tabular](https://github.com/godlygeek/tabular)
* [vim-syntastic](https://github.com/vim-syntastic/syntastic)
* [vim-javacomplete2](https://github.com/artur-shaik/vim-javacomplete2)

# Configuration

Every one can change this config to make PowerVim for youself

* Change shortcuts by modifying .vimrc
* You can add language completion by puting language keyword list file in .vim/dictionary, and modify .vimrc

# FAQ

PowerVim do not install youcompleteme to perfect code completion

* PowerVim basic code completion is enough
* Installing youcompleteme is complicated and is not almost universal, one install successfully do not mean other people can install it successfully in same operation method.
* Open vim will be slow. Because youcompleteme is to large, it load bin file and analyze syntax.
* PowerVim will try it latter, if it is easy to install and use.

# Todo

* Check whether ctags are installed when installing PowerVim
* Check directory bin when Compiling CPP

# Vim inside Shortcuts
## Easy shortcuts

```
u // Undo
r // Relace the character under cursor
ctrl r // Cancel undo
>> // Right Indent
<< // Left Indent
:noh // Cancel highlight
ctrl e // Scroll the window down
ctrl y // Scroll the window up
ctrl f // Scroll down one page
ctrl b // Scroll up one page
ctrl d // Scroll down half of page
ctrl u // Scroll up half of page
H // Move cursor to the top of the window
M // Move cursor to the middle of the window
L // Move cursor to the bottom of the window
G // Go to bottom of file
gg // Go to top of file
:echo // Print variables in vim
:call // Call vimshell function
:%!xxd // View the assembly code for this file
:scriptnames // List all plugin files loaded
:!unix_command // Run Unix commands inside vim
:pwd // The present working directory can be displayed in Vim with
:cd %:p:h // To change to the directory of the currently open file
:reg // Show register
```
# 配置
每个人都可以在这个基础上进行修改,改成一个属于自己的PowerVim
* 改变快捷键的方式在.vimrc
* 可以添加支持代码补全的语言,你可以在.vim/dictionary文件下添加该编程语言的补全关键字文本,并且在.vimrc上添加一下dict

## Complicated shortcuts
# 疑问解答
PowerVim没有安装youcompleteme来完善代码补全,主要有以下方面
* PowerVim已经有很好的代码补全,足够开发使用
* 安装youcompleteme比较麻烦,而且不通用,作者安装成功,用户按照一样的步骤安装并不一定成功
* 安装youcompleteme后,vim会变得比较慢
* PowerVim 后面也会尝试加上youcompleteme,可以让这个插件可以简单的被安装

Comment quickly
# 关于作者

* First, go to the first line you want to comment, press CtrlV. This will put the editor in the VISUAL BLOCK mode.
* Then using the arrow key and select until the last line
* Now press ShiftI, which will put the editor in INSERT mode and then press #. This will add a hash to the first line.
* Then press Esc (give it a second), and it will insert a # character on all other selected lines.
大家好,我是程序员Carl,哈工大师兄,ACM 校赛、黑龙江省赛、东北四省赛金牌、亚洲区域赛铜牌获得者,先后在腾讯和百度从事分布式技术研发。

Relace oldName to newName in Visual model selected
也欢迎与我交流,备注:「个人简单介绍」 + 交流,围观朋友圈,做点赞之交(备注没有自我介绍不通过哦)

<a name="微信"></a>
<img src="https://img-blog.csdnimg.cn/20200814140330894.png" data-img="1" width="175" height="175">

# 公众号

更多精彩文章持续更新,微信搜索:「代码随想录」第一时间围观,关注后回复:666,可以获得我多年总结的算法原创PDF。

**「代码随想录」每天准时为你推送一篇经典面试题目,帮你梳理算法知识体系,轻松学习算法!**,并且公众号里有大量学习资源,也有我自己的学习心得和方法总结,更有上万录友们在这里打卡学习。

**来看看就知道了,你会发现相见恨晚!**

<a name="公众号"></a>

![](https://github.com/youngyangyang04/leetcode-master/blob/master/pics/%E5%85%AC%E4%BC%97%E5%8F%B7.png)

* select block in Visual model, then press :, :'<,'>s/oldName/newName/g

## Neadtree

```
C // The root directory is the directory where the cursor is currently located
go // Previews the file where the cursor is, and the cursor does not jump to the file
m // Open a menu below and you can select from a list of actions, such as create file, delete file, copy file and soon
r // Refresh
x // Close the current nodes parent
```
# NOTIFY

some file is gone, you shuild go origial place to download it.
Loading

0 comments on commit 662ef39

Please sign in to comment.