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
From the command line run
bash <(curl "https://raw.githubusercontent.com/salcode/ironcode-vim/master/install-ironcode-vim.sh")
From within Vim type :PlugInstall
Plugins and detailed settings are listed as comments within init.vim
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
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.
- Exuberant CTags:
brew install ctags
- Ag:
brew install the_silver_searcher
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 are an index of your project.
- 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)
- 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
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.
<leader>gm
will display the commit for the current line (see rhysd/git-messenger.vim for further features):Gblame
will display git blame information alongside the file (see tpope/vim-fugitive)
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.