diff --git a/vimrc b/vimrc index 99c64d6..77ef326 100644 --- a/vimrc +++ b/vimrc @@ -32,7 +32,7 @@ set history=50 " keep 50 lines of command line history set nonumber " set relativenumber set langmenu=en_UK -let $LANG = 'en_UK' +let $LANG = 'en_GB.UTF-8' source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim set guioptions-=r @@ -178,6 +178,43 @@ endfun command! -nargs=1 FTSnippet call s:insert_ft_snippet(&filetype, ) command! -range -nargs=1 FTMkSnippet call s:make_ft_snippet_range(&filetype, , , ) +function! RangeChooser() + let temp = tempname() + + if has("gui_running") + exec 'silent !xterm -e ranger --choosefiles=' . shellescape(temp).' '.expand("%:p:h") + else + exec 'silent !ranger --choosefiles=' . shellescape(temp).' '.expand("%:p:h") + endif + + if !filereadable(temp) + redraw! + return + endif + + let names = readfile(temp) + + if empty(names) + redraw! + return + endif + + 1,$argd + for name in names + exec 'argadd ' . fnameescape(name) + endfor + rewind + redraw! +endfunction + +command! -bar RangerChooser call RangeChooser() + +if has("unix") + nnoremap :RangerChooser +elseif has("win32") + nnoremap :e %:p:h +end + " --- AUTO CLOSE --- function! s:autoClose_HelperOpen(open, close) @@ -466,9 +503,6 @@ nnoremap e nnoremap m :marks abcdefghijklmnopqrstuvwxyz nnoremap M :marks ABCDEFGHIJKLMNOPQRSTUVWXYZ -" --- Windows, Tabs and More -- -nnoremap :e %:p:h - " --- modes --- nnoremap