Last active
December 26, 2015 11:09
-
-
Save rhowardiv/7142092 to your computer and use it in GitHub Desktop.
Add length sorting to selecta inputs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff HEAD^ | |
diff --git a/vimrc b/vimrc | |
index cada33f..18f0b56 100644 | |
--- a/vimrc | |
+++ b/vimrc | |
@@ -275,15 +275,15 @@ endfunction | |
" Find all files in all non-dot directories starting in the working directory. | |
" Fuzzy select one of those. Open the selected file with :e. | |
-nnoremap <leader>f :call SelectaCommand("find * -type f \| lsort", "", ":e")<cr> | |
+nnoremap <leader>f :call SelectaCommand("find * -type f", "", ":e")<cr> | |
function! SelectaIdentifier() | |
" Yank the word under the cursor into the z register | |
normal "zyiw | |
" Fuzzy match files in the current directory, starting with the word under | |
" the cursor | |
- call SelectaCommand("find * -type f \| lsort", "-s " . @z, ":e") | |
+ call SelectaCommand("find * -type f", "-s " . @z, ":e") | |
endfunction | |
nnoremap <leader>g :call SelectaIdentifier()<cr> | |
-nnoremap <leader>t :call SelectaCommand("cut -f1 tags \| uniq \| lsort", "", ":tj ")<cr> | |
+nnoremap <leader>t :call SelectaCommand("cut -f1 tags \| uniq", "", ":tj ")<cr> | |
$ cat $(which lsort) | |
#!/bin/bash | |
cat | awk '{ print length($0),$0 }' | sort -n | sed 's/^[0-9]\+ //' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment