Skip to content

cantrepro/nvim-ctagtap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

nvim-ctagtap

A Neovim plugin that enables click-to-navigate functionality for ctags, allowing you to jump to symbol definitions by simply clicking on them instead of using Ctrl-]. And then navigating back by clicking on the same symbol again instead of using Ctrl-T.

This is mainly good for reading code on Android using Termux. It normally takes many clicks on Android to do Ctrl-] or Ctrl-T, or to exit and open files -- with this plugin it's just a single tap, which makes the code reading experience much smoother.

Features

  • Single-click navigation to tag definitions
  • Smart back navigation - click the same symbol to go back
  • Navigation history stack
  • Easy enable/disable commands
  • Lightweight and fast

Installation

Just clone the repository and put this in your init.vim file (edit the repository path):

set runtimepath^=/path/to/repo/nvim-ctagtap
lua require("nvim-ctagtap").setup()

Other installation methods like package managers might work but are not officially supported (yet).

Configuration

The plugin can be set up with minimal configuration:

require("nvim-ctagtap").setup()

Or with custom maximum history size:

require("nvim-ctagtap").setup({
  max_history = 100,  -- Maximum number of navigation entries to keep (default: 100)
})

Commands

  • :CtagTapEnable - Enable click-to-navigate functionality
  • :CtagTapDisable - Disable click-to-navigate functionality
  • :CtagTapToggle - Toggle click-to-navigate functionality
  • :CtagTapHistory - Show navigation history
  • :CtagTapClearHistory - Clear navigation history

Auto-enable

By default, the plugin auto-enables when Neovim starts. To disable auto-enable, set:

vim.g.nvim_ctagtap_auto_enable = false

Then manually enable with :CtagTapEnable when needed.

Requirements

  • Neovim 0.7.0 or later
  • ctags installed and configured
  • A tags file generated (e.g., ctags -R .)

How It Works

  1. When you click on a symbol, the plugin moves the cursor to that position
  2. It navigates using ctags (equivalent to Ctrl-])
  3. The navigation is saved in a history stack
  4. Clicking on the same symbol at the destination navigates back to the source (equivalent to Ctrl-T)

License

MIT

About

Neovim plugin for tap-to-navigate ctags functionality, enabling single-click symbol navigation and smart back-navigation - optimized for touch-based code reading on mobile devices like Android/Termux.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages