]> git.rmz.io Git - dotfiles.git/blobdiff - vim/vimrc
vim: add sort operator
[dotfiles.git] / vim / vimrc
index 4d72ff3b6d27171cd885195850f1133b7053162d..0e533cf4f69e8eea87d6f83a66fb49406cfccf6b 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -653,6 +653,7 @@ if executable('ag')
     let g:unite_source_rec_async_command = 'ag --follow --nocolor --nogroup --hidden -g ""'
 end
 nnoremap <silent> [unite]f :<C-u>Unite -start-insert file_rec/async<CR>
+call unite#custom#source('file_rec/async', 'sorters', 'sorter_selecta')
 
 " unite-buffer {{{3
 call unite#custom#default_action('buffer', 'open')
@@ -735,6 +736,12 @@ if !exists(":DiffOrig")
                   \ | wincmd p | diffthis
 endif
 
+" sort operator {{{2
+function! SortLinesOpFunc(...)
+  '[,']sort
+endfunction
+nnoremap <silent> gs :<C-U>set operatorfunc=SortLinesOpFunc<CR>g@
+
 " edit configs  {{{2
 function! EditConfig(what)
     let l:dir = split(&runtimepath,',')[0]