Tag: vim ¦ Atom ¦ RSS

Vim: checking PHP code (and Python and...)

Do you hate it as much as I do when you are writing some PHP (or Python or whatever) code in your favorite editor, hit 'save', reload the page in the browser in the hopes that you will see the new most awesome feature you ever wrote, but instead you are greeted by an unfriendly PARSE_ERROR_YOU_FORGOT_A_CLOSING_BRACKET_YOU_STUPID-error? Right, it feels like you just built a rocket, but upon launch you discover you didn't foresee a doorknob and can't get in anymore...

Luckily, if you are using Vim there is a nice plugin to quickly catch these errors (and more). The plugin I'm talking about is Syntastic. The plugin is built as a generic framework to run and process the result of a syntax checker. The syntax checkers themselves are specific for each language. Most of the syntax checkers start an external syntax checker or linter and return the output to Syntastic, telling it how to parse it.

By default Syntastic will automatically run the correct checker every time you save the …

Belgian Vim user group for meetups

A while ago, after reading about some of the meetups organized by VimBerlin and VimLondon, I started wondering if there would be any interest in a similar group for Belgium / Antwerp. Today I asked the question on Twitter and I'd like to ask it here again:

Would there be any interest in a Belgian or Antwerp usergroup for Vim with regular meetups?

Since there are already some good communities for Vim online, such as the vim_use mailinglist, I don't want to start an online community. The idea would be to organize a meetup every once in a while. At first 2 or 3 months, to avoid rushing stuff. During such a meetups we can organize to have a few people give short (15 - 30 minutes) talks about a specific topic related to Vim. These talks can cover a very wide range of topics. such as:

  • core Vim commands (for new users)
  • more exotic commands (such as advanced :g-usage)
  • a presentation of a specific plugin
  • how to efficiently navigate code …

My vim configuration on Github

Ever since I started using Vim as my preferred text editor I have been keeping my configuration under source control. At first I kept my config for all the various applications + some useful scripts in one Git repository. But after I had given a (very) short presentation at work, I started to think about splitting of my vim-configuration into a separate repository. I have already learned a lot of useful tricks and settings about vim by studying other peoples vimrc-files, so I feel like it's only fair to also put mine out in the wild.

So first I did a little Git magic to split of my vim subdirectory into a separate Git repository, without losing any of the history. The answer on how to do this can be found on StackOverflow: Detach subdirectory into separate Git repository.

Then I created a repository on Github and pushed my entire vim configuration. Feel free to explore it and use pieces from it. (Or use it in it's entirety, but I don't …

VIM: working with "light-projects"

While VIM certainly isn't an IDE, there are a lot of plugins in existence to make it more IDE-like. Although I have been working a lot inside IDE's the past few years, I don't really need all those fancy IDE features (and the bloat that comes with it). That's one of the many things I like so much about Vim, I can just add the features I need to the editor. So while there are certainly at least a few plugins to work with projects inside Vim, I came up with my own system for working with "projects" (call them "light-projects" if you wish). One small note: For the moment this method suits my needs, but since I'm only using Vim for about two months as my main editor, this might change obviously.

Basically, my solutions is based on an autocommand for every 'project' and the command-t plugin. Oh, and sessions as well. The autocommand detects when a file is read (or created) inside the project-directory. In this case, it …

Using your Bash and Vim config on multiple computers

Not long after I switched to Linux I started modifying my .bashrc file. In a .bashrc file you can set options for Bash, add aliases, configure your Bash prompt etc. When I decided to start using Vim as my main editor a few weeks ago, I also started tinkering with the .vimrc file. The .vimrc file is, similar to the .bashrc file, the place-to-be to configure Vim.

Obviously I wanted to share all these config-files between my work machine and my personal computer. That is why I set up a Git repository on my Dreamhost webspace. With most of your important config-files in a Git repository you can easily share your config between multiple computers and you get a history of your modifications as a free bonus.

Because I want to keep it clear which files are in the Git repo and which files are not, I just created a directory in my homedirectory called 'scripts' (so at ~/scripts/). Everything in that directory is in Git, everything outside the directory …

Learning Vim

When I started working on my first PHP project at Inuits I had to decide which editor or IDE to use. Obviously while I was still working in the .NET-world I used Visual Studio, just as almost everybody else. However I also used jEdit at home for PHP, Ruby etc. I always felt that learning a general purpose editor, and learning it very well, is more interesting than learning an IDE for one specific platform (VS.NET in this case).

One of my new colleagues recommended me to use NetBeans for PHP development, so I had a look at it. While I'm sure it has a lot to offer, it just didn't feel like the tool I wanted to use. Obviously I had also installed jEdit. While I have always loved jEdit, somehow I wasn't convinced anymore. I also had a look at gEdit, which certainly has potential if you install some extra plugins and configure it, but compared to other editors and IDE's it seems to be rather limited …