Skip to content

davvid/harpoon-term.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

harpoon-term

Quickly jump to terminals.

Harpoon Term is a friendly fork of the harpoon.term module from harpoon.

harpoon.term was removed in Harpoon v2 (in the harpoon2 branch).

This plugin is a minimalist copy of the core features from harpoon.term for use alongside harpoon2 or standalone.

Installation

You can install this plugin using your favorite vim package manager, eg. vim-plug, Packer or lazy.

Packer:

use({'davvid/harpoon-term.nvim'})

lazy:

{
    'davvid/harpoon-term.nvim'
}

vim-plug

Plug 'davvid/harpoon-term.nvim'

Usage

To bind goto_terminal(1) to <leader><leader>1 and send the current line to terminal 1 using <leader><leader>c1 use:

vim.keymap.set({'n', 'v'}, '<leader><leader>1', function()
    require('harpoon_term').goto_terminal(1)
end)

vim.keymap.set('n', '<leader><leader>c1', function()
    local idx = vim.fn.line('.')
    local cmd = vim.api.nvim_buf_get_lines(0, idx - 1, idx, false)[1]
    if cmd == nil then
        return nil
    end
    require('harpoon_term').send_command(1, cmd)
end)

Development

The Garden file can be used to run lint checks using Garden.

# Run lint checks using "luacheck"
garden check

The documentation is generated using panvimdoc.

garden setup  # one-time setup
garden doc

Use garden fmt to apply code formatting using stylua.

The github repository is a mirror of the main repository on gitlab where you can file issues and submit merge requests.

About

Friendly fork of the harpoon.term module from harpoon for use alongside harpoon2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages