]> git.nbdom.net Git - nb.git/commitdiff
/etc/vim/source/functions.vim
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 28 Jul 2026 08:11:15 +0000 (10:11 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 28 Jul 2026 08:11:15 +0000 (10:11 +0200)
etc/vim/source/functions.vim

index 8cf927d5f4fbf14925360eed8b696d85d864d6bc..79e8c0eb1f6cb742ac82677642a472d330cefde2 100644 (file)
@@ -35,23 +35,27 @@ endfunc
 
 func! FileCheckSyntaxe()
 
-       if ( g:mimeCheck->get(FileType()) == '0')
-         echoerr "Unknown filetype: ".&filetype
-         let cmd = 'xargs -IZ sh -c "ls -ahl Z && wc Z|sed' 
-               \ .' -e \"s/^ */lines=/\"'
-               \ .' -e \"s/ \+/,words=/\"'
-               \ .' -e \"s/ \+/,bytes=/\"'
-               \ .' -e \"s/ \+\/.*$//\"'
-         \ .'" <<<'
-         "let cmd = 'xargs -IZ sh -c "ls -ahl Z && wc Z|cut -d\" \" -f3-6" <<<'
+       let fname = shellescape(expand('%:p'))
+       let ftype = FileType()
+
+       " NB 28.07.26 if ftype == 'vim'
+               " NB 28.07.26 so %
+               " NB 28.07.26 return
+       " NB 28.07.26 endif
+
+       if ( g:mimeCheck->get(ftype) == '0')
+         echo "Unknown filetype: ".&filetype
+         let cmd = 'ls -ahl '.fname.' && wc '.fname.'|sed' 
+               \ .' -e "s/^ */lines=/"'
+               \ .' -e "s/ \+/,words=/"'
+               \ .' -e "s/ \+/,bytes=/"'
+               \ .' -e "s/ \+\/.*$//"'
        else
-               let cmd = g:mimeCheck->get(FileType())
+               let cmd = g:mimeCheck->get(ftype).fname
+               echo cmd
        endif
 
-       let cmd = cmd . ' "' .expand('%:p') . '"'
-       echo cmd
-
-       exec '!'.cmd
+       echo system(cmd)
 
 endfunc