From 2986836b9c08f3eafafbddcf2640f4914d5740ef Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Thu, 5 Apr 2018 21:48:28 +0200 Subject: Fixed vim in a pipe behaviour with 'recent files' --- vimrc-full | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vimrc-full b/vimrc-full index cc4114c..a042e91 100644 --- a/vimrc-full +++ b/vimrc-full @@ -811,7 +811,7 @@ let g:lightline = { \ 'right': [] \ }, \ 'active': { - \ 'left': [ [ 'mode', 'paste' ], ['readonly', 'filetype'], [ 'absolutepath' ]], + \ 'left': [ [ 'register', 'mode', 'paste' ], ['readonly', 'filetype'], [ 'absolutepath' ]], \ 'right': [ [ 'lineinfo', 'percent' ], [ 'spell', 'fileencoding', 'fileformat' ] , ['tagbar'] ] \ }, \ 'component': { @@ -823,7 +823,8 @@ let g:lightline = { \ 'sessionname': '%{v:this_session}', \ 'gitbranch': ' %{fugitive#head()}', \ 'tabnumber': " %{tabpagenr()}/%{tabpagenr('$')}", - \ 'readonly': '%{&readonly ? "" : ""}' + \ 'readonly': '%{&readonly ? "" : ""}', + \ 'register': '%{v:register}' \ }, \ 'component_expand': { \ 'buffercurrent': 'lightline#buffer#buffercurrent2', @@ -1056,7 +1057,7 @@ function! ExtendColorTheme() autocmd InsertLeave * set nolist " autocmd InsertLeave * call matchadd('Conceal', ' \+$', -1, 101, { 'conceal': '⟶' }) - autocmd InsertEnter * call matchdelete(101) + autocmd InsertEnter * silent! call matchdelete(101) autocmd InsertLeave * call matchadd('Convention', ' \+$', -1, 101, { 'conceal': '⟶' }) " Show trailing whitepace and spaces before a tab as part of the syntax highlighting @@ -1115,12 +1116,13 @@ autocmd VimEnter,WinEnter * exec ':set scrolljump='.winheight(0)/2 " display highlight group under the cursor map h :echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') -if argc() == 0 +if empty(argv()) " autocmd VimEnter * call setloclist(0, filter(map(copy(v:oldfiles), {_, p->{'filename': expand(get(split(p, "'"), 0))}}), { val -> echo val})) " from the list of recent files: make absolute paths, filter out files not " contained in cwd and finally filter out directories and non-files... - autocmd VimEnter * call setqflist(map(filter(filter( + autocmd StdinReadPre * let s:std_in=1 + autocmd VimEnter * if !exists("s:std_in") | call setqflist(map(filter(filter( \ map(copy(v:oldfiles), {_, p->expand(p)}), 'v:val =~ "'.getcwd().'"'), \ 'filereadable(v:val)'), {_, p->{'filename': fnamemodify(p, ':.')}})) | copen | only endif -- cgit v1.2.3