Coder Social home page Coder Social logo

hop.nvim's Introduction

                                          __
                                         / /_  ____  ____
                                        / __ \/ __ \/ __ \
                                       / / / / /_/ / /_/ /
                                      /_/ /_/\____/ .___/
                                                 /_/
                                  · Neovim motions on speed! ·

Hop is an EasyMotion-like plugin allowing you to jump anywhere in a document with as few keystrokes as possible. It does so by annotating text in your buffer with hints, short string sequences for which each character represents a key to type to jump to the annotated text. Most of the time, those sequences’ lengths will be between 1 to 3 characters, making every jump target in your document reachable in a few keystrokes.

This is a fork of the original hop.nvim repo

Features

  • Go to any word in the current buffer (:HopWord).
  • Go to any camelCase word in the current buffer (:HopCamelCase).
  • Go to any character in the current buffer (:HopChar1).
  • Go to any bigrams in the current buffer (:HopChar2).
  • Make an arbitrary search akin to / and go to any occurrences (:HopPattern).
  • Go to any line and any line start (:HopLine, :HopLineStart).
  • Go to anywhere (:HopAnywhere).
  • Go to treesitter nodes (:HopNodes).
  • Paste text in the hinted position without jumping (:HopPaste).
  • Yank the text between two hinted position without jumping (:HopYankChar1).
  • Use Hop cross windows with multi-windows support (:Hop*MW).
  • Use it with commands like v, d, c, y to visually select/delete/change/yank up to your new cursor position.
  • Support a wide variety of user configuration options, among the possibility to alter the behavior of commands to hint only before or after the cursor (:Hop*BC, :Hop*AC), for the current line (:Hop*CurrentLine), change the dictionary keys to use for the labels, jump on sole occurrence, etc.
  • Extensible: provide your own jump targets and create Hop extensions!

Installation

Using lazy.nvim

{
    'smoka7/hop.nvim',
    version = "*",
    opts = {
        keys = 'etovxqpdygfblzhckisuran'
    }
}

Using packer

use {
  'smoka7/hop.nvim',
  tag = '*', -- optional but strongly recommended
  config = function()
    -- you can configure Hop the way you like here; see :h hop-config
    require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
  end
}

Supported Neovim versions

Hop supports latest stable release and nightly releases of Neovim. However, keep in mind that if you are on a nightly version, you must be on the last one. If you are not, then you are exposed to compatibility issues / breakage.

Important note about versioning

This plugin implements [SemVer] via git tags. Versions are prefixed with a v. You are advised to use a major version dependency to be sure your config will not break when Hop gets updated.

Usage

See the wiki.

Keybindings

Hop doesn’t set any keybindings; you will have to define them by yourself.

If you want to create a key binding from within Lua:

-- place this in one of your configuration file(s)
local hop = require('hop')
local directions = require('hop.hint').HintDirection
vim.keymap.set('', 'f', function()
  hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
end, {remap=true})
vim.keymap.set('', 'F', function()
  hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
end, {remap=true})
vim.keymap.set('', 't', function()
  hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
end, {remap=true})
vim.keymap.set('', 'T', function()
  hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
end, {remap=true})

Other tools like hop.nvim

hop.nvim's People

Contributors

hadronized avatar smoka7 avatar yehuohan avatar aznhe21 avatar felipelema avatar dsabadie-datadog avatar spamwax avatar henry-hsieh avatar iago-lito avatar runiq avatar ii14 avatar blakejc94 avatar ehllie avatar voldikss avatar dreomite avatar clason avatar christianchiarulli avatar kyran-c avatar maaslalani avatar mhinz avatar matts966 avatar tssm avatar ckafi avatar ysy avatar firstmover avatar afterlook avatar delphinus avatar itepechi avatar jackwiseman avatar johnlevidy avatar

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.