Code Monkey home page Code Monkey logo

neotags.lua's Introduction

neotags.lua

successor of https://github.com/c0r73x/neotags.nvim

ScreenShot

Default Configuration

neotags.setup({
    enable = true, -- enable neotags.lua
    ctags = {
        run = true, -- run ctags
        directory = vim.env.HOME .. '/.vim_tags' -- default directory where to store tags
        verbose = false -- verbose ctags output
        binary = 'ctags', -- ctags binary
        args = { -- ctags arguments
            '--fields=+l',
            '--c-kinds=+p',
            '--c++-kinds=+p',
            '--sort=no',
            '-a'
        },
    },
    ft_conv = { -- ctags filetypes to vim filetype
        ['c++'] = 'cpp',
        ['moonscript'] = 'moon',
        ['c#'] = 'cs'
    },
    ft_map = { -- combine tags from multiple languages (for example header files in c/cpp)
        cpp = { 'cpp', 'c' },
        c = { 'c', 'cpp' }
    },
    hl = {
        minlen = 3, -- dont include tags shorter than this
        patternlength = 2048, -- max syntax length when splitting it into chunks
        prefix = [[\C\<]], -- default syntax prefix
        suffix = [[\>]] -- default syntax suffix
    },
    tools = {
        find = nil, -- tool to find files (defaults to running ctags with -R)
        -- find = { -- example using fd
        --     binary = 'fd',
        --     args = { '-t', 'f', '-H', '--full-path' },
        -- },
    },
    ignore = { -- filetypes to ignore
        'cfg',
        'conf',
        'help',
        'mail',
        'markdown',
        'nerdtree',
        'nofile',
        'readdir',
        'qf',
        'text',
        'plaintext'
    },
    notin = { -- where not to include highlights
        '.*String.*',
        '.*Comment.*',
        'cIncluded',
        'cCppOut2',
        'cCppInElse2',
        'cCppOutIf2',
        'pythonDocTest',
        'pythonDocTest2'
    }
})

Add new language

neotags.language('filetype', require'path/to/filetype')

Filetype config

example using C language

return {
  order = 'guesmfdtv', -- string with ctags kinds
  kinds = {
    g = {
      group = 'neotags_EnumTypeTag', -- highlight
      prefix = [[\%(enum\s\+\)\@5<=]] -- override default prefix
      minlen = 2, -- dont include tags shorter than this
    },
    ...
    t = {
      group = 'neotags_TypeTag',
      suffix = [[\>\%(\.\|->\)\@!]] -- override default suffix
    },
    v = {
      group = 'neotags_GlobalVarTag'
    }
  }
}

Toggle neotags

neotags.toggle()

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.