I pretty much only use VI(M) for coding and CTAGS is essential to increase productivity – It makes it easier to jump through files when I need to look at a function or where some variable has been declared, amongst other things. I have been using CTAGS for years when I was coding in C, Java and most recently PHP, Python and Erlang.
This list is for discussing the use and development of Vim on the Mac OS. To Subscribe: email vim-mac-subscribe@vim.org: To Post: email vim-mac@vim.org; you must be subscribed to post! To Unsubscribe: email vim-mac-unsubscribe@vim.org: Help: See the vimmac Google Groups page. Comments: This is for Mac-specific questions about using, compiling.
Here are the steps to enable CTAGS for Erlang on Mac OS X:
You need to install “Exuberant Ctags” which is an enhanced CTAGS implementation of the GNU CTAGS.
Exuberant ctags make it possible to jump to the definition of a class, method, variable and any other language object (e.g. C, C++, Python, PHP, Erlang) in vim. ‘ctags’ is able to generate an index file (a.k.a tags file) for one of 41 supported programming languages. Index can be used by editors like vim to quickly find related keyword.
sudo port -v install ctags
ctags --version
which tags
It should show:
/opt is where Macports install bundles
Download taglist.zip and unzip the files to the $HOME/.vim
cd /projects/my_erlang_root_project_dir
ctags --file-scope=no -R --languages=erlang .
let Tlist_Use_Right_Window=1
let Tlist_Enable_Fold_Column=0
let Tlist_Show_One_File=1 ' especially with this one
let Tlist_Compact_Format=1
let Tlist_Ctags_Cmd='/opt/local/bin/ctags'
set updatetime=1000
nmap ,t :!(cd %:p:h;ctags *)& ' Maps the updates of tags to key ,t.
set tags=tags; ' The ';' at the end will cause the ctags plugin to search for current dir and above dirs until it find a tag file.
Belkin usb smart card reader mac. This websitewas developed and is personally maintained by This website was created because of thelack of information available to show how to utilize Common AccessCard (CAC)s on Personal Computers. MilitaryCAChas been online since 9 November 2007 and has over 121individual pages of information and support.
' Add the following below if you want to generate ctags upon saving a file
' Auto-generate ctags upon making changes to a file
autocmd BufWritePost *.erl :silent !(cd %:p:h;ctags *)&
' If you want to auto compile (erlc) upon saving a file, then add that one as well
' Run erlc on the file being saved
autocmd BufWritePost *.erl :!erlc <afile>
Basic usage boils down to 3 commands:
Additional resources:
http://ctags.sourceforge.net/faq.html#15
http://www.zalas.eu/jumping-to-a-class-function-and-variable-definitions-in-vim-with-exuberant-ctags
http://www.thegeekstuff.com/2009/04/ctags-taglist-vi-vim-editor-as-sourece-code-browser/
http://linux.byexamples.com/archives/385/vim-with-ctags-for-multi-level-directory-hierarchy/
http://ctags.sourceforge.net/
I use a gentags.sh script that I have customized a bit and put in my ~/bin – It generates tags in individual directories and I just run it initially to create all the tags, then I use ,t key in vim to update the tags for a directory where I have modified/added/removed content in a source file or have it done automatically using the ‘autocmd’ explained above. If you want the gentags.sh file, let me know and I can make it available.
Happy Erlang Tagging! 🙂
Vim
is a very powerful text editor and is available in almost all modern computing platforms. It is bundled in the default installation of almost Linux
distribution, though Ubuntu
ships with the minimal version of Vim
which lack features such as syntax highlighting making it less powerful or useful as it could be.
Even so, Ubuntu
still provides the more feature-rich version on Vim
in its default apt
repository.
You can install full version of Vim
on Ubuntu
via apt
at the terminal.
Install full version of Vim on Ubuntu
terminal
from the application launcher or via the <ctrl>
+ <alt>
+ <t>
keyboard shortcut. Vim
.vim-tiny
which is the default installation package. Vim
.Guide compatibility:
Operating System |
---|
Ubuntu 16.04 LTS (Xenial Xerus) |
Ubuntu 16.10 (Yakkety Yak) |
Ubuntu 17.04 (Zesty Zapus) |
Ubuntu 17.10 (Artful Aardvark) |
Ubuntu 18.04 LTS (Bionic Beaver) |
Ubuntu 18.10 (Cosmic Cuttlefish) |
Ubuntu 19.04 (Disco Dingo) |
Comment anonymously. Login not required.