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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github billyvg / tigris.nvim / rplugin / node / tigris.js / src / index.js View on Github external
eval: 'expand("")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',
    eval: 'expand("")',
  })
  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("")',
  })
  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("")',
  })
  onTextChangedI(args) {
    this.flyParse(args);
  }

  @Autocmd('TextChanged', {
    pattern: '*.js,*.jsx',
    eval: 'expand("")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',
    eval: 'expand("")',
  })
  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("")',
  })
  onTextChangedI(args) {
    this.flyParse(args);
  }

  @Autocmd('TextChanged', {
    pattern: '*.js,*.jsx',
    eval: 'expand("")',
  })
  onTextChanged(args) {
    this.flyParse(args);
  }
  @Autocmd('BufEnter', {
    pattern: '*.js,*.jsx',
    eval: 'expand("")',
  })
  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("")',
  })
  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("")',
  })
  onTextChangedI(args) {
    this.flyParse(args);
  }

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

neovim

Nvim msgpack API client and remote plugin provider

MIT
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis