Slide 1

Slide 1 text

VIM: efficient code search and pretty­ printing Miklós Vajna 2013­09­26

Slide 2

Slide 2 text

2 / 6 LibreOffice Conference 2013 | Miklós Vajna Offline code search ● git grep, of course ● Though ctags / id­utils is better ● 'make tags' after 'make' ● Builds a database of symbols ● A 'string file:lineno' map ↔ ● One­time config in your vimrc

Slide 3

Slide 3 text

3 / 6 LibreOffice Conference 2013 | Miklós Vajna How to use ctags? ● Place the cursor on a symbol: ● Ctrl­] jumps to the symbol (first hit in the db) ● Ctrl­t jumps back in the stack ● Explicit search: ● :ts Class, then you can choose from the results ● :ts Class::Method also works ● So that you can stop remembering file names :­)

Slide 4

Slide 4 text

4 / 6 LibreOffice Conference 2013 | Miklós Vajna fugitive.vim ● Maps ':Gfoo' to 'git foo' ● Most useful: :Gblame ● Runs 'git blame' ● Jumps directly to the line where your cursor was before you ran ':Gblame'

Slide 5

Slide 5 text

5 / 6 LibreOffice Conference 2013 | Miklós Vajna Pretty­printing in general ● XML, RTF ● Tolerate if the input is not well­formed! ● xmllint can't do that ● Provide a general 'prettyprint' tool that does the right thing ● Vim can be configured to run pretty­print in­place ● Can be even combined with in­place ZIP editing

Slide 6

Slide 6 text

6 / 6 LibreOffice Conference 2013 | Miklós Vajna formatxml, formatrtf ● formatxml: ● Initially created by Lubos ● Formats the XML input without parsing it ● Handles not well­formed XML properly ● formatrtf: ● Something similar for RTF ● Instructions: TDF Wiki /Development/Vim