Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:58:15+00:00 2026-06-16T02:58:15+00:00

I have a very simple Vim syntax file for personal notes. I would like

  • 0

I have a very simple Vim syntax file for personal notes. I would like to highlight people’s name and I chose a Twitter-like syntax @jonathan.

I tried:

syntax match notesPerson "\<@\S\+"

To mean: words beginning with @ and having at least one non-whitespace character. The problem is that @ seems to be a special character in Vim regular expressions.

I tried to escape \@ and enclose in brackets [@], the usual tricks, but that didn’t work. I could try something like (^|\s) (beginning of line or whitespace) but that’s exactly the problem that word-boundary tries to solve.

Highlighting works on simplified regular expressions, so this is more a question of finding the right regex than anything else. What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:58:16+00:00Added an answer on June 16, 2026 at 2:58 am

    @ is a special character only if you have enabled the “very magic”
    mode by having \v somewhere in the pattern prior to that @.

    You have another problem here: @ does not start a new word. \< is
    not just “word boundary” like perl/PCRE’s \b, but “left word
    boundary” (in help: “beginning of the word”) meaning that \< must be
    followed by some keyword character. As @ is not normally a keyword
    character, pattern \<@ will never match. (And even if it was like
    \b, it would match constructs like abc@def which is definitely not
    what you want for the aforementioned reasons.)

    You should use \k\@<!@\k\S* instead: \k\@<! ensures that @ is not preceded by any keyword character, \k\S* makes sure that first character of the name is a keyword one (you could probably also use @\<\S\+).

    There is another solution: include @ into 'iskeyword' option and leave the regex as is:

    :setlocal iskeyword+=@-@
    

    See :help 'isfname' for the explanation why @-@ is used here.
    (The 'iskeyword' option has exactly the same syntax and will,
    in fact, redirect you there for the explanation.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have very simple form, with input like this: <input id=my_id multiple=true type=file name=image_name[]
I have a very simple fxml file, with a checkbox: ... <AnchorPane id=AnchorPane xmlns:fx=http://javafx.com/fxml
This should be a very straightforward problem. I have a simple .vimrc file. It
I have very simple persistance.xml file: <?xml version=1.0 encoding=UTF-8?> <persistence version=1.0 xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence
I have very simple web page example read from html file using python. the
I have very simple data model like this: create table Company ( id int
I am very new to JAVA. I have written simple program (in Linux -VIM
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have very simple piece of code. The goal is when i input four-digit
I have very simple OpenGL ES example similar to Hehe's example : http://nehe.gamedev.net/tutorial/ios_lesson_02__first_triangle/50001/ As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.