All Projects → Furkanzmc → firvish.nvim

Furkanzmc / firvish.nvim

Licence: GPL-3.0 license
WIP

Programming Languages

lua
6591 projects
Vim Script
2826 projects

Projects that are alternatives of or similar to firvish.nvim

Acid.nvim
Asynchronous Clojure Interactive Development
Stars: ✭ 147 (+374.19%)
Mutual labels:  nvim, neovim-plugin
awesome-neovim
Awesome Configurations for C/C++,Zig,Web and Lua development in NeoVim
Stars: ✭ 54 (+74.19%)
Mutual labels:  nvim, neovim-plugin
Lualine.nvim
A blazing fast and easy to configure neovim statusline written in pure lua.
Stars: ✭ 198 (+538.71%)
Mutual labels:  nvim, neovim-plugin
code runner.nvim
Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
Stars: ✭ 234 (+654.84%)
Mutual labels:  nvim, neovim-plugin
nvim-todoist.lua
Todoist plugin for Neovim in pure Lua, inspired by https://github.com/romgrk/todoist.nvim, which you should use instead
Stars: ✭ 22 (-29.03%)
Mutual labels:  nvim, neovim-plugin
Nvim Hlslens
Hlsearch Lens for Neovim
Stars: ✭ 55 (+77.42%)
Mutual labels:  nvim, neovim-plugin
Coc.nvim
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Stars: ✭ 18,268 (+58829.03%)
Mutual labels:  nvim, neovim-plugin
Packer.nvim
A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config
Stars: ✭ 418 (+1248.39%)
Mutual labels:  nvim, neovim-plugin
modes.nvim
Prismatic line decorations for the adventurous vim user
Stars: ✭ 299 (+864.52%)
Mutual labels:  nvim, neovim-plugin
nvim-config
My neovim config
Stars: ✭ 63 (+103.23%)
Mutual labels:  nvim, neovim-plugin
Semshi
🌈 Semantic Highlighting for Python in Neovim
Stars: ✭ 758 (+2345.16%)
Mutual labels:  nvim, neovim-plugin
cargo-limit
Cargo with less noise: warnings are skipped until errors are fixed, Neovim integration, etc.
Stars: ✭ 105 (+238.71%)
Mutual labels:  nvim, neovim-plugin
Chadtree
File manager for Neovim. Better than NERDTree.
Stars: ✭ 653 (+2006.45%)
Mutual labels:  nvim, neovim-plugin
Nvim Bqf
Better quickfix window in Neovim, polish old quickfix window.
Stars: ✭ 120 (+287.1%)
Mutual labels:  nvim, neovim-plugin
Nvim Compe
Auto completion plugin for nvim that written in Lua.
Stars: ✭ 433 (+1296.77%)
Mutual labels:  nvim, neovim-plugin
Lsp Status.nvim
Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline
Stars: ✭ 201 (+548.39%)
Mutual labels:  nvim, neovim-plugin
neogen
A better annotation generator. Supports multiple languages and annotation conventions.
Stars: ✭ 339 (+993.55%)
Mutual labels:  nvim, neovim-plugin
Iron.nvim
Interactive Repl Over Neovim
Stars: ✭ 265 (+754.84%)
Mutual labels:  nvim, neovim-plugin
qf helper.nvim
A collection of improvements for the quickfix buffer
Stars: ✭ 70 (+125.81%)
Mutual labels:  nvim, neovim-plugin
tabby.nvim
A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!
Stars: ✭ 232 (+648.39%)
Mutual labels:  nvim, neovim-plugin

firvish.nvim

This plug-in is heavily inspired by vim-dirvish.

firvish.nvim is a buffer centric job control plug-in. It provides mappings for handling buffer list, history, NeoVim and external commands. All the output of these commands are streamed to a dedicated buffer.

The main goal of firvish.nvim is to provide a single way of interacting with external commands, and internal commands of NeoVim through the use of buffers. They are used to interact with the output of commands, and the input is sent to external commands to interactively communicate with them.

See the documentation for more details.

Installation

Install using your favorite plugin manager. There's no required dependencies. Optionally, you can install option.nvim for customization. If it's not installed, you'll see a warning but you can ignore it.

Example Use Cases

Use as an asynchronous git command

lua << EOF
function _G.run_git(args, is_background_job)
    local cmd = fn.split(args, " ");
    table.insert(cmd, 1, "git")
    require "firvish.job_control".start_job({
        cmd = cmd,
        filetype = "job-output",
        title = "Git",
        is_background_job = is_background_job,
        cwd = vim.fn.FugitiveGitDir(),
        listed = true
    })
end
EOF

command! -bang -complete=customlist,fugitive#Complete -nargs=* -range FGit :lua _G.run_git(<q-args>, <q-bang> ~= '!')

Set up a CMake build system

function G.setup_cmake(opts)
    if vim.o.loadplugins == false then return end

    opts.env = opts.env or {}

    assert(opts.env, "env is required.")
    assert(opts.name, "name is required.")
    assert(opts.program, "program is required.")
    assert(opts.cwd, "cwd is required.")
    assert(opts.project_path, "project_path is required.")
    assert(opts.build_dir, "build_dir is required.")

    opts.test_cwd = opts.test_cwd or ""

    require"dap".configurations.cpp = {
        {
            type = "cpp",
            request = "launch",
            name = opts.name,
            program = opts.program,
            symbolSearchPath = opts.cwd,
            cwd = opts.cwd,
            debuggerRoot = opts.cwd,
            env = opts.env
        }
    }

    local functions = {}
    functions.build_project = function(output_qf)
        require"firvish.job_control".start_job({
            cmd = {"cmake", "--build", opts.build_dir, "--parallel"},
            filetype = "log",
            title = "Build",
            listed = true,
            output_qf = output_qf,
            is_background_job = true,
            cwd = opts.project_path
        })
    end

    functions.run_tests = function(output_qf)
        require"firvish.job_control".start_job({
            cmd = {"ctest", "--output-on-failure"},
            filetype = "log",
            title = "Tests",
            listed = true,
            output_qf = output_qf,
            is_background_job = true,
            cwd = opts.test_cwd
        })
    end

    local configure_opts = {"cmake", "-DCMAKE_BUILD_TYPE=Debug", opts.project_path}
    if opts.generator ~= nil then
        table.insert(configure_opts, "-G")
        table.insert(configure_opts, opts.generator)
    end

    functions.run_cmake = function(output_qf, cmake_options)
        local cmd = configure_opts
        if cmake_options ~= nil then table.extend(cmd, cmake_options) end

        require"firvish.job_control".start_job({
            cmd = cmd,
            filetype = "log",
            title = "CMake",
            listed = true,
            output_qf = output_qf,
            is_background_job = true,
            cwd = opts.build_dir
        })
    end

    functions.run_project = function(output_qf, args)
        local cmd = {opts.program}
        if args ~= nil then table.extend(cmd, args) end

        require"firvish.job_control".start_job({
            cmd = cmd,
            filetype = "log",
            title = "Run",
            listed = true,
            output_qf = output_qf,
            is_background_job = true,
            cwd = opts.cwd
        })
    end

    _G.cmake_functions = functions

    cmd [[command! -bang CMake :lua _G.cmake_functions.run_cmake("<bang>" ~= "!")]]
    cmd [[command! -bang Run :lua _G.cmake_functions.run_project("<bang>" ~= "!")]]
    cmd [[command! -bang Build :lua _G.cmake_functions.build_project("<bang>" ~= "!")]]
    cmd [[command! -bang RunTests :lua _G.cmake_functions.run_tests("<bang>" ~= "!")]]
end

-- In .nvimrc file
_G.setup_cmake({
    env = {},
    name = "CMake Project",
    program = vim.fn.expand("$PROJECT_BUILD_DIR"),
    cwd = vim.fn.expand("$PROJECT_BUILD_DIR"),
    project_path = vim.fn.expand("%:p:h"),
    build_dir = vim.fn.expand("$PROJECT_BUILD_DIR"),
    test_cwd = vim.fn.expand("$PROJECT_BUILD_DIR") .. "/test/",
    generator = "Ninja"
})

Now you can run any of the following commands:

  • :CMake
  • :Build
  • :RunTests
  • :Run

The output of each command will be redirected to the quickfix list.

Run the server for a Django project

command! RunServer :lua require"firvish.job_control".start_job({
            \ cmd={"python", "manage.py", "runserver"},
            \ filetype="firvish-job",
            \ is_background_job=true, " So that we only see the job out put in :FirvishJobs window.
            \ listed=false,
            \ cwd="/path/to/project",
            \ title="Server"})
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].