From 20f44bf13a43456f37245c9d4d76e9be193ecd60 Mon Sep 17 00:00:00 2001
From: Max Christian Pohle
Date: Wed, 20 Jun 2018 23:03:55 +0200
Subject: Fixed code folding bug

also added some Git menu enties
improved the recently used files startup screen
improved the foltext by removing double white spaces
improved contextual statusline
---
 after/syntax/c.vim |  4 ++--
 doc/shortcuts.txt  |  3 +++
 vimrc-full         | 15 +++++++++++----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/after/syntax/c.vim b/after/syntax/c.vim
index 75170cf..9ffe0ae 100644
--- a/after/syntax/c.vim
+++ b/after/syntax/c.vim
@@ -15,8 +15,8 @@ syntax match   Comment "//.*"  contains=Todo
 syn clear cBlock
 syn region cBlock start=/{/ end=/}/ transparent
 
-" multiple single line comments in a row
-syn region myCComment start="/\*" end="\*/" fold keepend transparent
+" multiple single line comments in a row " broken!
+" syn region myCComment start="/\*" end="\*/" fold keepend transparent
 
 
 " let b:current_syntax    = "c"
diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt
index 6cdebec..4d58590 100644
--- a/doc/shortcuts.txt
+++ b/doc/shortcuts.txt
@@ -124,6 +124,9 @@ zE              = eliminates all folds
 :b <tab>         = switch buffer by name (use <tab> and <return>)
 :set nobuflisted = hide buffer in buffer list (great for neovim's terminal)
 
+[args]
+:n **/*.c        = opens all files with that name or type in buffers and also fills the argument list
+
 
 [special]
 g CTRL-g        = display file properties including word and char count
diff --git a/vimrc-full b/vimrc-full
index d049e85..ca36df7 100644
--- a/vimrc-full
+++ b/vimrc-full
@@ -240,7 +240,7 @@ set foldopen=block,hor,search | " when do we unfold?
 " set foldtext=Foldtext()       | "
 " set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\v^/[/*]\','','g')
 " set foldtext='⊞\ '.substitute(getline(v:foldstart),'^[\ '.printf(&cms,'').']*','','').'↵'.getline(v:foldstart+1).'↵'.getline(v:foldstart+2)
- set foldtext='⊞\ '.substitute(join(getline(v:foldstart,v:foldend),'↵'),'\[*\/\]','','g')
+set foldtext='⊞\ '.substitute(substitute(join(getline(v:foldstart,v:foldend)),'\\s\\s\\+\\\|\[\*\/\]','\ ','g'),'\^\\s\\+','','g')
 
 " vim window behaviour
 set splitbelow                | " open new windows below the current one (i find that more intuitive)
@@ -512,6 +512,8 @@ if has("autocmd")
               \ :call setloclist(0, map(systemlist("git show --name-only --pretty=''"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR>
         menu &Git.&Display\ last\ changes
               \ :let g:signify_vcs_cmds={'git': 'git diff --no-color --no-ext-diff -U0 HEAD^ -- %f'}<CR>:SignifyRefresh<CR>
+        menu &Git.&Display\ unmerged\ files\ in\ location\ list
+              \ :call setloclist(0, map(systemlist("git diff --name-only --diff-filter=U \| uniq"), {_, p->{'filename': fnamemodify(p, ':.')}}))<CR>:lopen<CR>
         menu &Git.&Display\ significance\ of\ changes
               \ :!git diff --stat HEAD~1..HEAD
         menu &Git.&Display\ Changed\ files\ compared\ to\ master
@@ -1042,9 +1044,14 @@ if empty(argv())
   " 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 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
+  autocmd VimEnter * if !exists("s:std_in") | call setqflist([], 'r',
+        \ {
+        \   'title':'Recently used files in directory: '.getcwd(),
+        \   'items':map(filter(filter(
+        \               map(copy(v:oldfiles),
+        \                   {_, p->expand(p)}), 'v:val =~ "'.getcwd().'/"'), 'filereadable(v:val)'),
+        \               {_, p->{'filename': fnamemodify(p, ':.')}})
+        \ }) | copen | only
 endif
 
 command Vimls
-- 
cgit v1.2.3