CtagsSourceNavigator
Reworked Ctags Source Navigator plugin based on source code v0.93 beta compatible with Far3
Install / Use
/learn @EugeneManushkin/CtagsSourceNavigatorREADME
Ctags Source Navigator
This is a Far Manager plugin for browsing source code indexed by Ctags utility.
Useful links
Features
- Jump to name declaration
- Code completion
- Searching name in entire repository
- Searching name in currently edited file
- Search and open files by name
- Remember your most visited names and files
- Listing class members
- Source code browsing history
- Creating Ctags database for selected repository root
- Reindexing single file or repository.
- Hotkeys macro
What's new
2.1.106.x
- Versioning has been changed. The last number in the version string is moved on 3-rd place and became a revision number. Now the last number in the version string corresponds to incremental counter of the release pipeline #111
- Supported platform language in search tags menu. This feature is experimental and may affect performance in some environments. You may always disable this feature in configuration menu (see "Enable platform language in search menu"). Only single byte charsets (e.g. cp1251) are supported. Platform language is enabled only if file names or paths are displayed #123
- Enhanced matching line numbers when searching compiler like warning/error strings. Just open file search menu and
Ctrl+V string like following:
\src\tags.cpp(1831,10): error C2143: syntax error: missing ';' before 'return'. Plugin will detect file tags.cpp with line number 1831 #139 - Insertions in search menu are trimmed from both right and left sides #140
- Fixed bugs: #122, #129, #143, #145
2.1.100.599
- Go back command moves editor position to last followed tag #98
- Ctrl+Enter shortcut in search menu navigates Far Manager to file where selected item is located #99
- Limit total search list to 1500 (may be configured or disabled) for short filters #103
- Fixed bugs: #101, #107
2.1.0.92
- Opening a repository in "Manage Repositories" menu moves you to last visited directory #93
- Navigation history is reworked. "Go back" and "Go forward" options become more convinient #94
- Plugin become more stable. Fixed bugs: #95, #96, #97
Installation
- Download latest release from release page
- Extract downloaded archive to FarManager/Plugins folder
- Install hotkeys macro by copying ctags_hotkeys.lua script to %FARPROFILE%\Macros\scripts folder:
After copying hotkeys macro restart Far Managercopy ctags_hotkeys.lua "%FARPROFILE%\Macros\scripts"
Use custom ctags utility
You may either install Universal Ctags, Exuberant Ctags or use ctags utility from Cygwin project. Go to F9->Options->Plugins configuration->Ctags Source Navigator, put the full path to ctags.exe in 'Path to ctags.exe' edit box, press OK button.
BTW if you are Lua developer check out Yet Another Lua TAgs
It easily integrates with the plugin. Just download latest release, unzip it and put full path to ctags_wrapper.bat script located in <unpacked_release_folder>\yalta\ctags_wrapper.bat to 'Path to ctags.exe' in plugin configuration menu.
How to use
Navigate to source code in not indexed files
You may use the plugin in an opened file even if it is not indexed by ctags utility. Plugin will automatically index currently edited file and let you search names in it
Index your repository
If you want to search names and files in entire repository you should index it with the ctags utility. Use ctags plugin to do this: goto your repository folder, navigate cursor to folder you want to index by ctags or navigate to top folder ("..") if you want to index entire repository folder. Press F11->Ctags Source Navigator->Index selected directory. Tags file will be created inside selected folder and all symbols will be automatically loaded in plugin. If you already have a repository indexed by ctags you may load index file ('tags') to tell the plugin that you want to browse this repository. Do either:
- Just start using plugin. On attempt to search a name plugin will suggest to load one of the 'tags' files found in parent directories or suggest to index your git or svn repository.
- Navigate cursor to the 'tags' file, and just press Enter.
- Navigate cursor to the 'tags' file, press #F11->Ctags Source Navigator->Load tags file#.
- Load recent 'tags' file from 'Manage repositories' menu: #F11->Ctags Source Navigator->Manage repositories#.
Now plugin 'knows' about symbols in your repository and you can browse it's source code and search names.
Reindex file or entire repository
Plugin does not do anything in background. If you noticed that plugin cannot find something too often then you may reindex your repository. Press F11->Ctags Source Navigator->Reindex repository in main menu or in editor menu and then plugin will suggest you to select one of the tags files which you may reindex. If something goes wrong while reindexing (e.g. reindexing is canceled) plugin will rollback on old tags file. You may also reindex currently editing file. Press F11->Ctags Source Navigator->Reindex this file in editor menu.
Permanent repositories
By default plugin does not allow to search names from places that are not belong to a certain repository. However this behaviour may be changed by making a repository permanent. Navigate to a repository folder and press F11->Ctags Source Navigator->Add permanent repository. Plugin will suggest you to select one of the tags files which corresponds to a selected repository. To unload permanent repository open menu F11->Ctags Source Navigator->Manage repositories, select permanent repository and then press Ctrl+Del.
Go to declaration/definition (Ctrl+F)
Open a file inside your repository folder, navigate to a name you want to search definition/declaration of. Press F11->Ctags Source Navigator->Go to and plugin will automatically move the cursor to declaration of that name. If a name has multiple declarations (e.g. in C++ definition of a name is also a name declaration) plugin will suggest to load one of the declaration
Search names in entire repository (Ctrl+Shift+T)
This option works in plugin main menu and in editor menu. Press F11->Ctags Source Navigator->Search name in entire repository and begin typing (or insert by Ctrl+V or Shift+Ins) a name you want to search.
Search names in opened file (Ctrl+Shift+X)
Press F11->Ctags Source Navigator->Search name in opened file and begin typing (or insert by Ctrl+V or Shift+Ins) a name you want to search.
Search file by name (Ctrl+Shift+R)
This feature is available from main and editor menu: press F11->Ctags Source Navigator->Search file by name and begin typing a file name you want to open. You may specify a partial path to file with a filename to filter search result by location: tests\tags_cache\main.cpp.
You may also specify a line number after a colon symbol like my_file.h:1234
Open include file (Ctrl+F)
Open a file inside your repository folder, set cursor to an include file inside angle brackets or to any quoted file path. Press F11->Ctags Source Navigator->Go to and plugin will open the file
Autocomplete name (Ctrl+Space)
Start typing name in editor and then press F11->Ctags Source Navigator->Complete symbol
Return cursor to previous position (Ctrl+G)
Press F11->Ctags Source Navigator->Go back to return cursor to previous position
Return to current position from previous position (Ctrl+D)
If you moved the cursor to a previous position by using "Go Back" option you may return the cursor back. To do this press F11->Ctags Source Navigator->Go forward
List all class members
Set cursor on class name and then press F11->Ctags Source Navigator->Class members
