Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tonyho/vim

Vim[contain configuration files]:can used in both in windows MacOS and linux.
https://github.com/tonyho/vim

Last synced: 3 days ago
JSON representation

Vim[contain configuration files]:can used in both in windows MacOS and linux.

Awesome Lists containing this project

README

        

Vim/Gvim/MacVim
===

I found this vim package in[ Here](http://www.oschina.net/code/snippet_574132_13357 "OSChina") and I modify some of the configurations and Add two registry file to add two entry (`open in gvim tab` and `Open with gvim`) in Windows right click context menu.

----------

# For Windows: #
1. After clone the this repo, move this repo directory to where you want to place.
2. Add the path to system environment variable[path], if you want to using the ctags and cscope.
3. Modify the path string where store the gvim.exe in registry file `EditWithVim-tab.reg` and `EditWithVim.reg`. The default is `D:\\software\\gVimPortable\\vim73\\gvim.exe\`
4. Double click the registry files to merge them to system. As the registry file name imply, each of them will add a enty in right click context menu.

# For Linux #

1. Clone this repo. eg:

`mkdir ~/github`

`cd ~/github`

`git clone https://github.com/tonyho/VIM.git`

2. Install the vim(or gvim) using the proper commands, for example in Ubuntu:

`sudo apt-get install vim`

3. Install the cscope, ctags and taglist plugin. eg:

`sudo apt-get install ctags cscope`

4.Symbol link the .vimrc and .gvimrc. Or make a soft link to it:

`cd ~ && ln -s ~/github/VIM/_vimrc ~/.vimrc`

`cd ~ && ln -s ~/github/VIM/_gvimrc ~/.gvimrc`

5. Move the vimfiles directory to you home directory, and rename it to .vim,or make a soft link to it:

`ln -s ~/github/VIM/vimfiles/ .vim`

then clone the vundle:

`git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle`

# For Cygwin #

These is no much different between cygwin and linux to use vim.

# For MacOS #
Clone this repo. eg:

mkdir ~/github
cd ~/github
git clone https://github.com/tonyho/VIM.git

Install the macvim, for someone using the homebrew, use below commands:

brew install macvim

Install the cscope, ctags:

brew install ctags
brew install cscope

Move the _vimrc file to you home directory, and rename it to .vimrc. Or make ln to it `cd ~ && ln -s ~/github/VIM/_vimrc .vimrc`

Move the vimfiles directory to you home directory, and rename it to .vim,or ln it `ln -s ~/github/VIM/vimfiles/ .vim` ;then clone the vundle:

Add the macvim's executive files' path to environment variable PATH by appending the below line to the end of file ~/.bash_profile file:
export PATH=$PATH:/usr/local/opt/macvim/bin/

# Post clone, we should install the plugins and fonts#
## Plugins
Since we use the vundle to manage the plugins, we should install the plugins. Open a terminal, then open the vim:
`vim`
In Vim, we just call the PluginInstall to let the vundle install all the needed plugins:
`:PluginInstall`
After do this, the vundle will auto install the plugins.

If error occurs, use the `l` to see the logs, or save it the a file. Usually, there're 2 kinds of error:

1. Git repo not existed anymore: for this situation, we need to search in github to a new repo, see the _vimrc content for reference.
2. Plugin directory already existed in vimfiles/vundle, so just delete it.

## Install Fonts
Install fonts placed in user_fonts directory, or install all the powerline fonts:

```shell
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
```

About the vundle, you can refer this artcle: [How To Use Vundle to Manage Vim Plugins on a Linux VPS](https://www.digitalocean.com/community/tutorials/how-to-use-vundle-to-manage-vim-plugins-on-a-linux-vps)

## Install YouCompeleteMe
If you have golang installled use following:
` ~/.vim/bundle/YouCompleteMe/install.py --go-completer`

Otherwise, install it without golang support:
` ~/.vim/bundle/YouCompleteMe/install.py`

# Some plugins' KeyBinding: #
## SrcExpl:

1. F5--> Open the source explorer window
1. F3--> Previous Definition
1. F4--> Next Definition
1. F6--> Goto definition
1. SPACE --> Back from the Definition

## TagList and Tagbar
1. tl--> taglist, list the tag generated by ctags
1. tb--> tagbar, like the taglist

## NerdTree
1. F2--> Nerd Tree sidebar

## Switch buffers
### In Gvim
1. Ctrl+Tab--> Switch to next buffer
1. Ctrl+Shift+Tab--> Switch back to previous buffer

### In vim
1. :bnext--> Switch to next buffer
1. :bprev--> Switch back to previous buffer

## Python indent
1. =--> indent the selected(visual mode) python code

## CtrlP
1. Ctrl + p--> Ctrlp plugin for search

## Others
1. cM--> Remove the ^M string at the end of line
1. cS--> Remove the space string at the end of line
1. :ToggleWhitespace: Display or hide the highlight for the training space
1. :StripWhitespace--> Remove the space string at the end of line

## tabular
See the [tabular plugin vimcast](http://vimcasts.org/episodes/aligning-text-with-tabular-vim/)

## ScreenShot
A MacVim screenshot:

![ScreenShot](https://raw.githubusercontent.com/tonyho/VIM/master/docs/MacVimScreenCast.jpg?raw=true "MacVim")
----------

----------

## Reference
Ref config [Reference config](https://github.com/ashfinal/vimrc-config)

PowerLine fonts [PowerLine Fonts](hhttps://github.com/powerline/font)

Markdown CheatSheet [Markdown cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)

## ChangeLog
### 2017-12-28
1. Change the PowerLine to airline with buffer file list at status bar
1. Add Gvim rc
1. Change fonts to RobotoMono
1. Replace Syntastic with YouCompelteMe
1. Add python relatives
1. Using PaperColor color theme for Gvim/VIM, for this theme support many other plugins
1. Add golang plugin: 'fatih/vim-go'
1. Add ctrlp plugin