Wednesday, September 28, 2011

RE: function to get word under cursor

> Is there any standard function to get the word under cursor (
> as */# search commands do ) or I should write it by myself
> using getline('.')?

Use <cword> or <cWORD>. Some examples:
http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches
http://vim.wikia.com/wiki/Search_all_files_in_project_quickly
http://vim.wikia.com/wiki/Search_for_current_word_in_new_window

John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: