How I

Artur Shaikhullin

Software engineer

Bishkek, Kyrgyzstan

Who are you and what do you use Vim for?

I am a software developer, working in a private company engaged in reception of payments and payment services. On this job, I have a wide range of technical duties. Begin with configuration of the servers, ending with the modification of the payment system code.

Perhaps not surprisingly, I use vim in the work, because it is always in my hand. And what is most remarkable is the fact that the entire stack development and support I produce in vim.

At work I write in such languages as java, c++, python, javascript, bash.

I am a big fan of free and open source software.

I have been using Linux as the primary operating system about 8 years, and with vim I met almost immediately, although the first meeting was in the spirit of “wtf… how to get out of here?!”. But frequent configuration server via the command line become to the fact that I learned basic commands. So I use vim for about 6 years. But work with it closely I began 2 years ago.

I use vim for all my daily tasks. I have not had to choose from other similar editors, historically, as I said, I started using vim forced. In addition to vim I use a lot of console applications with vi-like navigation method. Therefore, I have no need for a GUI text editor. In the war of Vim vs. Emacs, the winner became vim :).

Working closely with this editor made me vim addicted. Now keys of most applications that I use, have similar combinations as vim. I use a tiled window manager - bspwm, mutt as the mailer, weechat with vi-mode plugin as a messenger, elinks for fast surfing and qutebrowser for javascript heavy sites and etc. In the terminal, I always run tmux, and zsh operates in vi mode. Many applications do not have ability to setup vi like hotkeys, so I did a system wide vi mode, in this mode hjkl converted to the arrow keys. In my dotfiles I accumulate configurations for applications used by me. I use console vim 7.4.

Introduce us to your Vim config.

I try not to change my configuration frequently. Reading the blogs or watching screencasts and bumping into interesting solution, I try them, sometimes keeping. One of the latest: nnoremap g= gg=Gg`` corrects the indentation of all file from any position.

I often use third-party extensions, I have about 60 plugins. Sometimes I check the list and remove plugins that I do not use. I think now is the time to do it :).

One of the most popular and actively used is vim-easymotions. My space key triggers the plugin and I can jump fastly wherever I need, workflow is super cool, sometimes I want to use it in other applications which has vi mode.

To navigate through the file system I use vifm, and plugin vifm.vim. I like to use this file manager, because it looks like a continuation of my editor, there I can use commands such delete, yank, and navigation as well as in vim and, while having a great set of features. The work is a more holistic.

I also like to use startify. It gives joy to my editor and makes it easier to continue editing the files.

Certainly, unite. This is probably the most commonly used plugin. Search files, navigate buffers, menu design, etc. For example, for my main project, I created a menu with commands to run maven, I can now quickly choose from menu to compile the application, start the server, do deploy applications, run test, etc.

For completion I use YCM, in general, I happy with it, it works well with C++ projects, and in my case with Qt.

As a manager of plugins I use NeoBundle.

Of course, I changed my leader to , but to be honest I do not really like to use it. Also I reversed ; and ‘:’, I often use the command line, and this change is unloaded my little finger.

My color palette is adjusted by my terminal (urxvt), in which I use two colorschemes based on my desktop wallpaper colors - dark and light one. Vim colorscheme in this case, only configuring colors for different elements of the text using system’s 16 colors.

I do not use plug-ins for the statusline. It’s pretty simple, I found it configuration in some blog. In the beginning, I added vim logo, using powerline patched font, below the cursor position in the line, file name, file status, dev branch, file format, and the current position in the file.

What have been the most useful resources for you to learn Vim?

My first serious resource was A Byte Of Vim. Most of the information I got from there. Then, various blog posts, screencasts, now from time to time I’m reading Practical Vim. To deal with VimScript I read Learn Vimscript the Hard Way. And of course :help.

What’s the most recent thing you’ve learned about Vim?

I just figured out that zz move screen line to the middle. And why I did not know this before.

How did you get started writing Vim plugins?

The first plugin I started writing out of despair. When I did not want to run java IDE, to make small changes in the project, but would like to have at least the minimum operating completion. I had to fix errors in the original plugin vim-javacomplete, that was stopping to work time to time. When such corrections have accumulated quite a lot, I have decided to release an updated plug-in.

Java often requires to be verbose, so the code generation in the IDE keeps many from switching to vim.

As soon as I switched completely to develop java applications in vim, of course, I wanted to have more features. Such as code generation and simple refactoring. I will continue to work on functionality, as I will have free time. Also in the plans to revise the documentation, there is now a mess, in which hard to navigate. Work on the plug-in stability also priorities.

The main inspiration of vimscript code is probably given by the author of the original plugin vim-javacomplete. As well as mattn, and other experienced VimScript developers who have done a lot of useful PR, after the publication of the plugin.

Are you involved in a local Vim community?

Honestly, I am not sure that such communities exist here.

Share a snippet of Vim script you’ve written and talk about what it does.

I often use renaming the word under the cursor around the file:

nnoremap <Leader>s :%s/\<<C-r><C-w>\>/<C-r><C-w>/g<Left><Left>

My unite menu for maven execution:

    let g:unite_source_menu_menus.mvnee = {
        \ 'description' : 'Maven project with glassfish',
    let g:unite_source_menu_menus.mvnee.command_candidates = [
        \[' mvn clean', 'make clean'],
        \[' mvn compile', 'make compile'],
        \[' mvn package', 'make package'],
        \[' mvn clean package', 'make clean package'],
        \[' mvn deploy', 'make -pl project-ear asadmin:deploy'],
        \[' mvn undeploy', 'make -pl project-ear asadmin:undeploy'],
        \[' mvn restart-domain', 'make -pl project-ear asadmin:restart-domain'],
        \[' mvn stop-domain', 'make -pl project-ear asadmin:stop-domain'],
        \[' mvn test', 'make test'],
    nnoremap <silent> <space>m :Unite -direction=botright -silent -buffer-name=mvnee menu:mvnee<CR>

What have you been working on recently in Vim?

I try to do everything in vim. Development, writing an email, writing this text. As almost all the system functions I perform with the same keys combinations as in vim, it fairly easy to switch between tasks. And all the work is a single hands’ flight over the keys of the keyboard. It is the most important advantage of my switch to vim for the development. And it is fast enough to run.