added upwards search

This commit is contained in:
Stefan Friese 2024-10-11 08:42:00 +02:00
parent 031f2d876b
commit 66cf829ee3
1 changed files with 17 additions and 1 deletions

View File

@ -337,9 +337,25 @@ let g:fzf_colors =
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
function! FzfSearchUpwards()
let l:dir = getcwd()
while !isdirectory(l:dir . "/.git") && l:dir != "/"
let l:dir = fnamemodify(l:dir, ":h")
endwhile
execute "Files " . l:dir
endfunction
nnoremap <leader>fu :call FzfSearchUpwards()<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" Functions to base64 encode/decode the exact selected text and replace it
" without a newline
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" xnoremap <leader>c <esc>=:'<,'>:w ! base64<C-M>p
" Function to base64 encode the exact selected text and replace it without a newline
function! Base64EncodeSelection()
normal! gv"vy
let l:selected_text = getreg('"')