Skip to content

salcode/ironcode-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iron Code Vim Configuration

A Vim Configuration focused on WordPress development and predominantly used on a Mac with Neovim

This project is a fork of Curtis McHale's excellent WPTT Vim Config

Lazy Installation

From the command line run

bash <(curl "https://raw.githubusercontent.com/salcode/ironcode-vim/master/install-ironcode-vim.sh")

Updating Plugins

From within Vim type :PlugInstall

Plugins and Detailed Settings

Plugins and detailed settings are listed as comments within init.vim

Detailed Installation

Run the following steps

git clone https://github.com/salcode/ironcode-vim.git
~/ironcode-vim/install.sh

This will

  • copy your current Vim configuration to .gvimrc.bkup, .vimrc.bkup, and .vim.bkup/
  • create symbolic links to the /ironcode-vim configuration files
  • run vim and trigger an install of all plugins defined for Vim Plug

Recommended Utilities

There are a few recommended utilities that don't come with this repository. This configuration works fine without these but they are nice. I recommend both of them and my preferred installation method is homebrew.

Once homebrew is installed

  1. Exuberant CTags: brew install ctags
  2. Ag: brew install the_silver_searcher

Problems with Git Commit Messages

On a Mac, if you're getting the message

error: There was a problem with the editor 'vi'.
Please supply the message using either -m or -F option.

when you try to create a Git commit message with Vim, the issue is an incorrect error code being returned.

You can fix this problem by running git config --global core.editor /usr/bin/vim

Ctags

Ctags are an index of your project.

Generating Ctags

  • From the command line navigate to root of your project/git repo
  • Run ctags --tag-relative -Rf.git/tags --exclude=node_modules --exclude=.git --languages=-javascript,sql this will create a file called tags in your /.git/ directory
  • You can re-run this command to generate new Ctags at any time (see below for details on automating this)

Using Ctags

  • In Vim, when your cursor is over a function or method hit Ctrl+] to jump to where it is defined.
  • Ctrl+t will jump back to where you started your tag lookup

Automate Ctag Generation

You can automate the generation of Ctags. Tim Pope discusses generating Ctags based on Git hooks in his post Effortless Ctags with Git. This behavior is integrated in another project of mine, Iron Code Studio Git Enhancements.

Git in Vim

PHP Docblock Generation

Place the cursor on the beginning of one of the following definition lines:

  • class
  • constant
  • attribute
  • function (method)
  • interface
  • trait

Then in normal mode type <leader>db, this will generate a template for the php docblock.

Credits

@salcode, @curtismchale, @mkoppmann, @andrey-starodubtsev

About

A Vim Configuration focused on WordPress development and predominantly used on a Mac with Neovim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5