Wednesday, September 28, 2011

Re: function to get word under cursor

Thanks, John! I probably should check 'vimwiki' first)

2011/9/28 John Beckett <johnb.beckett@gmail.com>
> 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



--
Best regards
Golubev Mikhail

--
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: