Skip to content

Biplab-Dutta/nvim-android-device

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-android-device

A minimal neovim plugin that displays the connected android device's model name in the status line when working on a flutter project. Designed for Flutter developers who use neovim.

Note

This plugin is to be used if and only if you are using nvim-lualine.

Screenshot

Here is a preview of how the name of the attached android device is displayed in lualine.

Installation

Since the plugin is intended for use with nvim-lualine, we can add it as a dependency when installing nvim-lualine.

Plug 'nvim-lualine/lualine.nvim'
Plug 'biplab-dutta/nvim-android-device'
use {
  'nvim-lualine/lualine.nvim',
  requires = { 'biplab-dutta/nvim-android-device' }
}
{
    'nvim-lualine/lualine.nvim',
    dependencies = { 'biplab-dutta/nvim-android-device' }
}

Usage

Important

Users must have adb installed on their system to use this plugin.

In the lualine config file,

local device = require 'nvim_android_device'
require('lualine').setup {
    sections = {
        lualine_a = {} -- Some config
        lualine_b = {} -- Some config
        lualine_c = {} -- Some config
        lualine_x = {
          {
            'diagnostics',
            sources = { 'nvim_diagnostic' },
            sections = { 'error', 'warn' },
            symbols = { error = '', warn = '', info = '', hint = '' },
            colored = false,
            update_in_insert = false,
            always_visible = false,
            cond = hide_in_width,
          },
          {
            'diff',
            colored = false,
            symbols = { added = '', modified = '', removed = '' },
            cond = hide_in_width,
          },
          { 'encoding', cond = hide_in_width },
          { 'filetype', cond = hide_in_width },
          { device.android_model, cond = hide_in_width }, -- Invoke the function `android_model()` from nvim_android_device plugin
        },
    },
}

Note

The position of the device model text can be customized based on the user's preference. In this example, it is placed at the bottom right of the screen, as shown in the screenshot above.

About

A minimal nvim plugin that displays connected android device's model name in lualine. Developed for flutter devs.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages