Monday, January 27, 2020

How to get the folder from a full file path?

I know %:p %:t thes things. But What I need now is not current folder I get a full file path from a regex match. 

And now I need to get the folder from this full path. 

I already Google a lot but can't find useful things all related about "%:t :p" things so how to make it. 

This is the code I use in the vimrc file. 

function! HandleURL()
  let s
:uri = matchstr(getline("."), '[a-zA-Z]*:\/[^ >,;]*')
  echo s
:uri
 
if s:uri != ""
   
if s:uri =~ '^http'
        silent
exec "AsyncRun chrome ".s:uri.""
   
else
       
""""""""""""""
       
"I want to use the totalcmd64 to run the folder of the s:uri here.
        """"""""""""""
        silent exec "
AsyncRun TOTALCMD64 ".s:uri.""
    endif
  else
    echo "
No URI found in line."
  endif
endfunction

Tnx in advance

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/db445162-2afa-4304-bb7b-6669c942a84c%40googlegroups.com.

No comments: