Code Monkey home page Code Monkey logo

vim's Introduction

Vim/NeoVim setup

This repository contains my vim/neovim config that I use as a PHP IDE.

NeoVim Setup

Quick installation (ppa)

Download and execute this shell script

Manual installation (LinuxBrew)

See below 'Additional steps for manual installation'

Install LinuxBrew

git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew
// add to .zshrc
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
source ~/.zshrc

Install NeoVim from LinuxBrew

brew install neovim/neovim/neovim

Install and symlink vim and nvim configs

git clone --recursive https://github.com/johgh/vim .vim
ln -s ~/.vim ~/.config/nvim
nvim +PlugInstall +qall

Vim Setup

Quick installation

Download and execute this shell script

Manual installation

See below 'Additional steps for manual installation'

Download .vim dir & symlink .vimrc

cd ~

# clean Vim files
rm -Rf .vim .vimrc .viminfo .vimbackup .vimswap .vimundo .vimviews

# get .vim dir
git clone --recursive https://github.com/johgh/vim .vim

# install plugins from command line
vim -E -u NONE -S ~/.vim/bundles.vim +PluginInstall +qall

# symlink .vimrc to $HOME
ln -s $HOME/.vim/.vimrc .

Additional steps for manual installation

Fzf installation (required by plugin fzf.vim)

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
# include in .zshrc, for terminal completion:
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

Install the "silversearcher" (required by Ag plugin)

sudo apt-get install silversearcher-ag

Install and configure PHPCodeSniffer (required by Syntastic plugin)

sudo apt-get install php-codesniffer

On file /etc/php-codesniffer/CodeSniffer.conf put this for PSR2 support (PHP code style standard):

<?php
$phpCodeSnifferConfig = array (
        'default_standard' => 'PSR2',
        )
?>

Nerd-fonts Install

cp -R ~/.vim/fonts/* ~/.local/share/fonts
fc-cache -f ~/.local/share/fonts

Vim 7.4.X Installation (Required By YCM plugin for "silent" completion)

# purge current vim version (if any)
sudo apt-get purge vim-*

# add this repo
echo 'deb http://ppa.launchpad.net/pkg-vim/vim-daily/ubuntu UBUNTU_VERSION_HERE main' | sudo tee -a  /etc/apt/sources.list
# or this other one
echo 'deb http://ppa.launchpad.net/pi-rho/dev/ubuntu UBUNTU_VERSION_HERE main' | sudo tee -a  /etc/apt/sources.list

# update and install gvim
sudo apt-get update && sudo apt-get install vim vim-gnome

Ycm Plugin Installation

# Vim 7.3.584 with python2 support required
# e.g.: https://launchpad.net/~kalakris/+archive/ubuntu/vim

# install with Vundle

# install build packages and compile
# (repeat this step if some YCM update requires it in the future)
sudo apt-get install build-essential cmake python-dev
$HOME/.vim/bundle/YouCompleteMe/install.sh

Wmctrl Installation

sudo apt-get install wmctrl

Bundles management (with Pathogen) => NOW USING VIM-PLUG

Setup Pathogen

mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

# put these on .vimrc
execute pathogen#infect()
call pathogen#helptags()
syntax enable
filetype plugin indent on

Add Plugins as git submodules

git submodule add <github url>
  • Add 'ignore = dirty' on your .gitmodules file for submodules that generate internal files

Update Config (to main repository)

cd ~/.vim
# update repository files
git pull
# update submodules
git submodule update --init --recursive

# pull in the changes from main repo and submodules (same as the 2 above)
git pull --recurse-submodules

Upgrade Config (on main repository)

# upgrade specific plugin
cd bundle/<plugin>
git pull origin master

# upgrade all plugins
git submodule foreach git pull origin master

Remove Submodule

# delete the relevant section from the .gitmodules file at the root of the parent project
git add .gitmodules
# delete the relevant section from the config file located in the .git directory at the root of the project
git rm --cached path/to/submodule
rm -rf .git/modules/submodule_name
git commit -m "Removed <vendor> submodule." # only necessary if submodule was comitted
rm -rf path/to/submodule

Eclipse (Kepler) and Eclim installation

  • Download third party software
$ cd ~
$ git clone https://github.com/johgh/thirdparty
  • Download and install Eclipse Kepler

  • Install PDT on Eclipse: Open Eclipse and go to Help > Install New Software... > Add... > Archive... > and select pdt-Update-3.2.0.201306051924.zip file from thirdparty repository

  • Install Eclim into Eclipse

$ cd thirdparty/
$ java -Dvim.skip=true -Declipse.home=/opt/eclipse -jar eclim_2.3.4.jar install

Check if PDT feature is installed on eclim startup, if not, reinstall in GUI mode (double click .jar file) then select 'do not install Vim files' and install pdt features when asked

vim's People

Contributors

johgh avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.