From 6e4ae53cf4de6aa433d900f1f1780697ba092f0d Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 30 Jan 2014 10:53:39 +0000 Subject: [PATCH] Show search direction in the statusline. Show an up arrow indicator if v:searchforward is 0, indicating that the last search was backwards. --- .vimrc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index fe6ad8e..d29cc40 100644 --- a/.vimrc +++ b/.vimrc @@ -778,13 +778,28 @@ fun! Show_Bind() "{{{2 return "" endfun "}}}2 +" Helper for status line. +" Show marker if searchforward is unset. +fun! Show_SearchForward() "{{{2 + if version >= "702" + if ! v:searchforward + if Has_Unicode() + return "∆" + else + return "^" + endif + endif + endif + return "" +endfun "}}}2 + " Show the status line. fun! Show_StatusLine() "{{{2 if ! has("statusline") return endif call Iain_Vars() - let l:sl1='%2n\:\ %<%1*%f%0*\ [%{Show_List()}%{Show_Bind()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%{Show_VirtualEdit()}%{Show_Undo()}%Y%M%R]%{Show_Alt()}\ ' + let l:sl1='%2n\:\ %<%1*%f%0*\ [%{Show_List()}%{Show_Bind()}%{Show_Case()}%{Show_Tabstop()}%{Show_Paste()}%{Show_VirtualEdit()}%{Show_Undo()}%Y%M%R%{Show_SearchForward()}]%{Show_Alt()}\ ' let l:sl3='L:%1*%4.6l%0*/%-4.6L\ C:%1*%3.6c%V%0*\ \|\ %P' let l:hexformat='%b' if b:iainhex -- 2.20.1