DDCODE

Share programming skills from Magic Oriental

upArrow

How does% in vim compare to strings?

 May 11, 2019   question, vim

I want to be inifThe conditional statement determines whether the suffix of the current file is equal to a suffix, but%:t:e=="cpp"It seems that it is not the correct grammar. What is the correct grammar?

You need to use expand

if expand('<afile>:t:e') == "cpp"

Related Posts:

  • How do you compare variables that store Chinese…
  • Why do 1 and 2 compare true and 3 and 4 compare false?
  • How does JAVA use regular expressions to extract…
  • Java splits strings by bytes and then assembles them…
  • Java strings are separated by spaces, but do not…
  • I think 98% of the code I write is about…
  • There are now 1,000 strings and a MYSQL dictionary.…
  • Vim pathogen installation plug-in is invalid under.…
  • How does vim replace partial matching strings
<< How does vim map keys according to the file suffix? What is the color scheme and plug-in of gVIM in this video? >>

Related Posts:

  • How do you compare variables that store Chinese…
  • Why do 1 and 2 compare true and 3 and 4 compare false?
  • How does JAVA use regular expressions to extract…
  • Java splits strings by bytes and then assembles them…
  • Java strings are separated by spaces, but do not…
  • I think 98% of the code I write is about…
  • There are now 1,000 strings and a MYSQL dictionary.…
  • Vim pathogen installation plug-in is invalid under.…
  • How does vim replace partial matching strings

Tags

Android android-studio apache c c++ centos Css css3 Database Docker Eclipse Express Front end git GitHub golang Html html5 Ios java javascript Jquery Laravel linux macos mongodb mysql Nginx node.js npm objective-c php Programmer python redis ruby shell Spring Sql Swift ubuntu vim vue.js Web xcode

Powered by MyWiki WordPress Theme