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.
Here is a preview of how the name of the attached android device is displayed in lualine.
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' }
}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.
