Search code examples
sublimetext3

How to add quote marks to string in Sublime?


In Sublime text editor, I have a text as below (taking notes for nodejs in markdown format)

In Nodejs, command-line arguments will be stored in the process object and in the process object there is a property called argv(argument vector) and arguments will be stored in the form of array

If I want to search all process words and add markdown back-ticks quotes(`) around them, How can I do this in sublime ?


Solution

  • If there are no places where the string "process" is in the middle of a word, such as "subprocess", I would do:

    1. Press Ctrl+f to open search.
    2. Enter process in the search field.
    3. Press Alt+Enter to select all coincidences.
    4. Edit accordingly.

    If I wanted to check each coincidence to avoid adding the quote marks erroneously I would instead do:

    1. Press Ctrl+h to open search and replace.
    2. Enter process in the search field.
    3. Enter `process` in the replace field.
    4. Click Find to see the next coincidence.
    5. Click Replace or Find as necessary.