How to use the neovim.Autocmd function in neovim

To help you get started, we’ve selected a few neovim examples, based on popular ways it is used in public projects.

github billyvg / tigris.nvim / rplugin / node / tigris.js / src / index.js View on Github external
eval: 'expand("<afile>")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  async onBufEnter() {
    const filename = await this.nvim.buffer.name;
    console.log(`[${filename.split('/').pop()}] Handle buffer enter`);
    this.parse({ filename, clear: true });
  }

  @Autocmd('InsertLeave', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onInsertLeave(filename) {
    this.parse({ filename, clear: true });
  }

  highlight(buffer, id, name, lineStart, columnStart, columnEnd, isDebug) {
    // Save highlighting group for console.logging
    if (isDebug) {
      _.range(columnEnd - columnStart + 1).forEach((num) => {
        const key = `${lineStart + 1},${columnStart + num}`; // [lineStart, columnStart + num];
        if (!DEBUG_MAP.has(key)) {
          DEBUG_MAP.set(key, []);
        }
        const groups = DEBUG_MAP.get(key);
github billyvg / tigris.nvim / rplugin / node / tigris.js / src / index.js View on Github external
console.log('Error with highlight debug, position doesnt exist');
      }
    } else {
      this.nvim.command('echomsg "[tigris] console.log mode not enabled: `let g:tigris#console.log=1` to enable"');
    }
  }

  @Autocmd('TextChangedI', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onTextChangedI(args) {
    this.flyParse(args);
  }

  @Autocmd('TextChanged', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  async onBufEnter() {
    const filename = await this.nvim.buffer.name;
    console.log(`[${filename.split('/').pop()}] Handle buffer enter`);
    this.parse({ filename, clear: true });
  }
github billyvg / tigris.nvim / rplugin / node / tigris.js / src / index.js View on Github external
@Autocmd('TextChangedI', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onTextChangedI(args) {
    this.flyParse(args);
  }

  @Autocmd('TextChanged', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  async onBufEnter() {
    const filename = await this.nvim.buffer.name;
    console.log(`[${filename.split('/').pop()}] Handle buffer enter`);
    this.parse({ filename, clear: true });
  }

  @Autocmd('InsertLeave', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onInsertLeave(filename) {
    this.parse({ filename, clear: true });
  }
github billyvg / tigris.nvim / rplugin / node / tigris.js / src / index.js View on Github external
const group = DEBUG_MAP.get(key);
        this.nvim.command(
          `echomsg "[tigris] position: ${key} - Highlight groups: ${[group.join(', ')]}"`
        );
      } else {
        this.nvim.command(
          'echomsg "[tigris] Error, position doesn\'t exist"'
        );
        console.log('Error with highlight debug, position doesnt exist');
      }
    } else {
      this.nvim.command('echomsg "[tigris] console.log mode not enabled: `let g:tigris#console.log=1` to enable"');
    }
  }

  @Autocmd('TextChangedI', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onTextChangedI(args) {
    this.flyParse(args);
  }

  @Autocmd('TextChanged', {
    pattern: '*.js,*.jsx',
    eval: 'expand("<afile>")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',

neovim

Neovim client API and neovim remote plugin provider

MIT
Latest version published 10 months ago

Package Health Score

64 / 100
Full package analysis

Similar packages