Slide 1

Slide 1 text

A day in the life of a (ordinary) Vimmer Presented by OKURA Masafumi At VimConf 2018, 2018/11/24

Slide 2

Slide 2 text

VimConf

Slide 3

Slide 3 text

All of us use (Neo)Vim everyday.

Slide 4

Slide 4 text

Question: What’s a typical day of (ordinary) Vimmers?

Slide 5

Slide 5 text

pp self • Name: OKURA Masafumi • Profession: Rubyist for 5 years • Vim experience: 5 years • Vim ability: Ordinary Vimmer <= Important!

Slide 6

Slide 6 text

About this presentation: • What: I’ll show you how I use Vim in three cases. • For whom: Beginner to intermediate, but experts will also take something away. • How long: 20 minutes including demos.

Slide 7

Slide 7 text

Three use cases of (Neo)Vim • Daily local development (in my case, Rails development) • Code Reading • Editing/viewing files in remote servers

Slide 8

Slide 8 text

Morning: Daily local development

Slide 9

Slide 9 text

Why not modern editors? • Atom is a great editor, but its Vim plugin doesn’t work as expected most of the time. • VSCode is also a great editor, which I’d like to use if Vim doesn’t exist. However, default features are just too much. • Emacs is just too difficult for me :(

Slide 10

Slide 10 text

Why not IDEs? • I am a Ruby developer and there is only one relevant Ruby IDE: RubyMine. • RubyMine is not open source or free. (However I’m interested in its unique features such as type annotations.) • For other languages, it’s a matter of choice. (However vim-go is so awesome that you might not need IDEs for go development.)

Slide 11

Slide 11 text

Daily startup routine • Upgrading Vim and NeoVim • Upgrading all Vim plugins with :PlugUpdate by vim-plug • Seeing cow’s quote by startify

Slide 12

Slide 12 text

Plugins I use everyday • vim-rails, must have for rails developer • deoplete and UltiSnips for auto completion and high speed editing • ale for on-the-fly lint

Slide 13

Slide 13 text

Plugins I use everyday (cont.) • vim-test for agile testing • fugitive, gitgutter and GV for Git operations • fzf and fzf.vim for fuzzy search

Slide 14

Slide 14 text

Demo1

Slide 15

Slide 15 text

Afternoon: Code reading

Slide 16

Slide 16 text

Vim as a code reader? • Vim is a great tool to jump through files to files, code to code. • With ctags, Vim gets the functionality to jump to method definitions. • Vim has a rich set of search tools including internal grep, but you can use external tools like ag (the silver searcher).

Slide 17

Slide 17 text

Goodies for code reading • fzf.vim provides us a handy command to search tags (:Tags) and do arbitrary search with ag (:Ag) • * command (asterisk) searches string under a cursor, which is useful to find private methods. • Ctrl-] command guides us to the tag under a cursor

Slide 18

Slide 18 text

Demo2

Slide 19

Slide 19 text

Remote servers

Slide 20

Slide 20 text

Notes about remote servers • Vim is mostly installed in environments such as CentOS and Ubuntu. • If we’d like to use NeoVim, first we need to build it in most cases which makes it hard to maintain. • Vim version is often 7, or not the latest, but there is no problem. • Sometimes it’s impossible to install plugins.

Slide 21

Slide 21 text

Using Vim’s native features • . command lets us repeat trivial editing such as inserting/changing/deleting objects. • For more complex operations, there is a macro feature with q and @ command. • :argdo and similar commands are used to do bulk modification to files.

Slide 22

Slide 22 text

Useless tip: vi='vim -N -u NONE -U NONE --noplugin --cmd "filetype indent on"'

Slide 23

Slide 23 text

Demo 3

Slide 24

Slide 24 text

Recap • (Neo)Vim is a power tool for all kinds of software engineers. • For local development, there are tons of useful plugins to help development. • Vim’s native features are so powerful that without plugins we can do so much in unfamiliar places.

Slide 25

Slide 25 text

Learn once, use anywhere.

Slide 26

Slide 26 text

References • My dotfiles is here: https://github.com/ okuramasafumi/dotfiles • Links to the plugins I mention in this slide are here: https://gist.github.com/ okuramasafumi/ 5544889f4ddc711d1e0b108cf72e4e79