Code Monkey home page Code Monkey logo

atags.vim's Introduction

atags.vim is a Neovim plugin that helps you creating and updating your tag files.

Installation

Using vim-plug

Plug 'fntlnz/atags.vim'

Customization

Customize the generation command

The generation command is a list of commands that will be executed to generate your tags.

This is the default generation command:

let g:atags_build_commands_list = [
    \"ctags -R -f tags.tmp",
    \"awk 'length($0) < 400' tags.tmp > tags",
    \"rm tags.tmp"
    \]

Use cases

Generate tags with <Leader>t

map <Leader>t :call atags#generate()<cr>

Generate tags everytime a file is being written.

autocmd BufWritePost * call atags#generate()

Generation examples

Generate tags using stags within a Docker container

let g:atags_build_commands_list = [
    \"docker run --rm -v $PWD:/project -w /project fntlnz/pfff:latest stags -lang php -o tags -vim ."
    \]
]

Generate tags only for files that are not in .gitignore

let g:atags_build_commands_list = [
    \ 'ag -g "" | ctags -L - --fields=+l -f tags.tmp',
    \ 'awk "length($0) < 400" tags.tmp > tags',
    \ 'rm tags.tmp'
    \ ]

Generate tags only for PHP files that are not in .gitignore

let g:atags_build_commands_list = [
    \ 'ag --php -g "" | ctags -L - --fields=+l -f tags.tmp',
    \ 'awk "length($0) < 400" tags.tmp > tags',
    \ 'rm tags.tmp'
    \ ]

Work in progress

  • Support for different tag generators. At the moment this supports only ctags.
  • Use tpope/vim-dispatch to be compatible with vim that doesn't have jobstart
  • Write the docs

atags.vim's People

Contributors

fntlnz avatar gcollura avatar hexchain avatar yannham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

atags.vim's Issues

error opening neovim

Let me preface this with sorry, this is a horrible vague issue. I'm running a release neovim build, which doesn't produce logs.

I get a "Error detected while processing [...] #generate:" when I open neovim without args (nvim). More text flashes afterwards, but it's too quick to see. There might be the string "command_list" and "on_stdout" somewhere.

If I open a file directly, I do not get an error.

awk division by zero error

When I use any of the example atag build command lists, including the default, I get an awk: division by zero error. It also happens when I try to run the commands manually.

Versions

OS: OS X 10.10.5
Neovim: 0.1.4
Ctags: 5.8
Shell: Bash 4.3.46(1)-release (x86_64-apple-darwin14.5.0)
Awk: awk version 20070501

Thanks!

Output of :call atags#generate() does strange visual things with neovim+tmux

Here's me calling atags#generate() in neovim inside a terminal:

2017-04-12-23 31 31_maim

The same, but inside tmux:

2017-04-12-23 31 44_maim

It seems to bump everything up a line in the window and skip a few letters on the word "generated." Neovim then doesn't know that things are messed up, so your cursor location is a line below where you think it is. If you do something like scroll down a bit:

2017-04-12-23 31 50_maim

things get very strange. This is fixable by changing the window size in tmux, forcing neovim to redraw itself, by doing something like making a new split and then closing it.

I'm not sure why this would be happening, or if you think this is better suited for tmux or neovim's issue trackers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.