• Stars
    star
    1,116
  • Rank 40,204 (Top 0.9 %)
  • Language
    Vim Script
  • License
    GNU General Publi...
  • Created almost 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Make your vim more power and much easer.

English Version

PowerVim

这套vim配置我已经打磨了将近四年,不断调整优化,已经可以完全满足工业级打开的需求了。所以我给它起名为PowerVim,一个真正强大的vim。

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

预览

来感受一下PowerVim的使用体验,看起来很酷吧!注意这些操作都不用鼠标的,一波键盘控制流!所以我平时写代码是不碰鼠标的!

conv_ops

安装

PowerVim的安装非常简单,我已经写好了安装脚本,只要执行以下就可以安装,而且不会影响你之前的vim配置,之前的配置都给做了备份,大家看一下脚本就知道备份在哪里了。

安装过程非常简单。如下三行命令:

git clone https://github.com/youngyangyang04/PowerVim.git
cd PowerVim
sh install.sh

在按照的过程中 ubuntu 操作系统 会出现 这样的问题Syntax error: "(" unexpected,是系统语言问题,看本项目上方issue,已经给出解决办法

特性

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

使用方法

PowerVim的快捷键以;为开始 这里列出的快捷键是PowerVim配置的,vim通用的快捷键就不一一列出。

正常模式下的快捷键(非插入模式)
;n              // 打开文件目录树显示在屏幕左侧
;m              // 打开当前函数和变量目录树显示在屏幕右侧
;h              // 光标移动到左窗口 
;l              // 光标移动到右窗口
;k              // 光标移动到上窗口
;j              // 光标移动到下窗口 以上四个快捷键特别是打开多个窗口情况下。使用这个快捷键组合非常实用
;w              // 保存文件
;u              // 向上翻半屏
;d              // 向下翻半屏
;1              // 光标快速移动到行首
;2              // 光标快速移动到行末
;a              // 快速切换.h和cpp文件,写C++的时候很方便
;e              // 打开一个新文件
;z              // 切回shell交互命令,输入fg在切回vim,非常实用
;s              // 水平分屏,并打开文件目录选取想打开的文件,如果想新建文件,;e 就好 
;v              // 竖直分屏,并打开文件目录选取想打开的文件,如果想新建文件,;e 就好 
;fw             // 查找项目内关键字,前提是你的系统已经按照了ACK 
;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支持系统剪切板的寄存器
;gg             // 按顺序光标跳转各个窗口

// 一下快捷键是不用;的,直接在 非插入模式 下输入
e               // 快速删除光标所在的词 
tabc            // 关闭当前tab,可以用:tabnew来打开一个新的tab Close tab, of course you should :tabnew a file first. 
F1              // 编译并运行C++文件,自己写的C++例子的时候一键编译。前提手动在当前目录建一个bin文件夹,这是用来存放编译产生的执行文件 
F1              // 编译Java文件
F2              // 运行Java编译的class文件,一般如果要编译并运行Java文件 按F1编译,在按F2运行
gc              // 快速注释选中的块(是visual模式下选中的块) 
gcc             // 快速当前行
{               // 光标向上移动一个代码块
}               // 光标向下移动一个代码块
di(             // 删除括号里的内容
di{             // 删除花括号里的内容

插件

配置

每个人都可以在这个基础上进行修改,改成一个属于自己的PowerVim

  • 改变快捷键的方式在.vimrc
  • 可以添加支持代码补全的语言,你可以在.vim/dictionary文件下添加该编程语言的补全关键字文本,并且在.vimrc上添加一下dict

疑问解答

PowerVim没有安装youcompleteme来完善代码补全,主要有以下方面

  • PowerVim已经有很好的代码补全,足够开发使用
  • 安装youcompleteme比较麻烦,而且不通用,就是我安装成功,你按照一样的步骤安装并不一定成功
  • 安装youcompleteme后,vim会变得比较慢
  • PowerVim 后面也会尝试加上youcompleteme,可以让这个插件可以简单的被安装

关于作者

大家好,我是程序员Carl,哈工大师兄,《代码随想录》作者,先后在腾讯和百度从事分布式技术研发工作。

More Repositories

1

leetcode-master

《代码随想录》LeetCode 刷题攻略:200道经典题目刷题顺序,共60w字的详细图解,视频难点剖析,50余张思维导图,支持C++,Java,Python,Go,JavaScript等多语言版本,从此算法学习不再迷茫!🔥🔥 来看看,你会发现相见恨晚!🚀
Shell
38,350
star
2

Skiplist-CPP

A tiny KV storage based on skiplist written in C++ language| 使用C++开发,基于跳表实现的轻量级键值数据库🔥🔥 🚀
C++
1,424
star
3

TechCPP

【C++面试&C++学习指南】 这里整理了C++后端研发工程师面试和工作必备的知识点 。
1,321
star
4

Markdown-Resume-Template

BAT程序员自己的简历模板分享出来了 。技术简历追求简单明了,避免没有必要的花哨修饰,大家可以fork到自己仓库中,基于这个模板进行修改。
684
star
5

NoSQLAttack

NoSQLAttack is an open source Python tool to automate exploit MongoDB server IP on Internet and disclose the database data by MongoDB default configuration weaknesses and injection attacks.
Python
286
star
6

DesignPattern

This repository is built for design pattern in C++
C++
187
star
7

youngyangyang04

147
star
8

fileHttpServer

A simple file HTTP server, written in golang, that include get, put, post method to upload files
Go
130
star
9

Gomoku

五子棋对战游戏,支持多个client同时在线对战,由于游戏性质,使用典型的同步阻塞IO模型,多进程提供服务
C
74
star
10

NoSQLInjectionAttackDemo

NoSQLInjectionAttackDemo is website demo for test NoSQL Injection. There are two website demos in this project and all databases are mongoDB
CSS
40
star
11

PowerSqlgen

Generate sqls to test mysql database
Shell
20
star
12

interview-master

面试大师
9
star
13

algorithm-interview-course

算法面试通关精讲
C++
8
star
14

Backend-Developer-Interview-Tutorial

史上最全的后端开发面试攻略
7
star
15

CS-Books

📚 计算机技术类书籍 PDF 最强总结
6
star
16

vssue

4
star
17

planeGame

my plane game
Java
3
star
18

codestyle

尽量不要写重复的代码
C++
3
star
19

RPC-Java

【代码随想录知识星球】项目分享-手撕RPC框架
2
star
20

KVstorageBaseRaft-cpp

【代码随想录知识星球】项目分享-基于Raft的k-v存储数据库
1
star
21

youngyangyang04.github.io

Carl Sun's BLOG
CSS
1
star
22

APPbackendFramework

A simple APP backend framework
PHP
1
star
23

Documents

This repository is for sharing my documents
1
star
24

test2

C
1
star
25

fileScan_1

Part of the OMS infrastructure. generates xml file by scan the local project, analyze the xml and download the bundle that the system need by scan properties file that include the many websites infomation.
Java
1
star