GithubHelp home page GithubHelp logo

aosp.nvim's Introduction

aosp.nvim

Plugin with support for building AOSP targets easily from Neovim. Supports building an pushing targets to a connected device.

Getting Started

Get this pluggin with you plugin manager of choice. Beware, you will need NeoVim nightly (V0.5) and Telescope (along with its dependencies). If you want to show colors in the aosp_console, then make sure to add as well the norcalli/nvim-terminal.lua plugin.

Using vim-plug:

Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'norcalli/nvim-terminal.lua'
Plug 'javier-varez/aosp.nvim'

Using packer:

use 'nvim-lua/popup.nvim'
use 'nvim-lua/plenary.nvim'
use 'nvim-telescope/telescope.nvim'
use 'norcalli/nvim-terminal.lua'
use 'javier-varez/aosp.nvim'

Usage

You can set remaps to build a target, build and push and toggle the aosp console.

build_target can be use to fuzzy search all targets described by the module-info.json and built the selected target.

vim.api.nvim_set_keymap('n', '<leader>ab', '<Cmd>lua require("aosp_nvim").build_target()<CR>', {
    noremap = true,
    silent=true
})

build_and_push also fuzzy searches the targets defined in module-info.json, but additionally it runs adb root, adb remount and adb push to install the target in the device:

vim.api.nvim_set_keymap('n', '<leader>ap', '<Cmd>lua require("aosp_nvim").build_and_push()<CR>', {
    noremap = true,
    silent=true
})

To show/hide the AOSP console you can use the following shortcut:

vim.api.nvim_set_keymap('n', '<leader>at', '<Cmd>lua require("aosp_nvim").toggle_display()<CR>', {
    noremap = true,
    silent=true
})

If you want to fuzzy search a particular subtree of the aosp project, you can also use any of the following extensions of telescope:

vim.api.nvim_set_keymap('n', '<leader>ag', '<Cmd>lua require("aosp_nvim.telescope").live_grep()<CR>', {
    noremap = true,
    silent=true
})

vim.api.nvim_set_keymap('n', '<leader>af', '<Cmd>lua require("aosp_nvim.telescope").find_files()<CR>', {
    noremap = true,
    silent=true
})

This will show a picker with the available subtrees. More subtrees can be defined specifically for your project by creating a file named .aosp_nvim.json in the root of the AOSP tree with the following contents:

[
    {
        "display_name": "Someother subtree name",
        "directory": "path/to/the/desired/subtree"
    }
]

To generate the compilation database and symlink it to the top directory you can add the following mapping:

vim.api.nvim_set_keymap('n', '<leader>ac', '<Cmd>lua require("aosp_nvim").compdb()<CR>', {
    noremap = true,
    silent=true
})

Rebuild the module info with:

vim.api.nvim_set_keymap('n', '<leader>ar', '<Cmd>lua require("aosp_nvim").rebuild_module_info()<CR>', {
    noremap = true,
    silent=true
})

aosp.nvim's People

Contributors

javier-varez avatar

Stargazers

 avatar

Watchers

 avatar  avatar

aosp.nvim's Issues

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.