{"id":132,"date":"2014-10-26T00:00:19","date_gmt":"2014-10-25T22:00:19","guid":{"rendered":"http:\/\/kurt.www.pinboard.jp\/blog\/?p=132"},"modified":"2014-09-14T11:48:58","modified_gmt":"2014-09-14T09:48:58","slug":"search-options","status":"publish","type":"post","link":"https:\/\/kurt.www.pinboard.jp\/blog\/kurt\/132\/","title":{"rendered":"search options"},"content":{"rendered":"<p>Searching in vim with <span style=\"color: green;\">\/<\/span> <span style=\"color: green;\">?<\/span> <span style=\"color: green;\">n<\/span> <span style=\"color: green;\">N<\/span> should be well known to all users. How searches behave can be controlled by several options.<!--more--><\/p>\n<h4>highlighting<\/h4>\n<pre style=\"background-color: lightyellow; color: green;\">:set hlsearch \" highlight all search results<\/pre>\n<p>With the <span style=\"color: green;\">hlsearch<\/span> turned on, all matches to your search are highlighted. From time to time, however, having too much highlighted after you&#8217;ve found your desired match can be distracting. The current highlighting can be cleared without turning off hlsearch by simply using<\/p>\n<p style=\"background-color: lightyellow; color: green;\">:nohl<\/p>\n<h4>case<\/h4>\n<pre style=\"background-color: lightyellow; color: green;\">:set ignorecase \" ignore case when searching\r\n:set smartcase  \" do not ignore case for search terms with upper case letters<\/pre>\n<p>With <span style=\"color: green;\">ignorecase<\/span> the search is performed in a case insensitive manner, with <span style=\"color: green;\">noignorecase<\/span> searches are always case sensitive. There is also a mode which brings together the best of both settings. When, in addition to <span style=\"color: green;\">ignorecase<\/span>, the option <span style=\"color: green;\">smartcase<\/span> is also activated, then searches are done in a case insensitive manner unless the search term contains one or more upper case letters, in which case the matching is case sensitive.<\/p>\n<h4>incremental<\/h4>\n<pre style=\"background-color: lightyellow; color: green;\">:set incsearch \" incremental search<\/pre>\n<p>Usually the whole search string must be typed after <span style=\"color: green;\">\/<\/span> or <span style=\"color: green;\">?<\/span>. With <span style=\"color: green;\">incsearch<\/span> the search is done incrementally. As soon as you type the first character of the search string, vim highlights the possible matches (provided <span style=\"color: green;\">hlsearch<\/span> is set) and temporarily moves the cursor to the first match. The more letters you type, the further you narrow down the possible matches. <span style=\"color: green;\">ESC<\/span> will cancel the search and return the cursor to the position where it was when you started searching, <span style=\"color: green;\">ENTER<\/span> completes the search and moves the cursor to the first match.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Searching in vim with \/ ? n N should be well known to all users. How searches behave can be controlled by several options.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[18],"_links":{"self":[{"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/posts\/132"}],"collection":[{"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":7,"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kurt.www.pinboard.jp\/blog\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}