Open File .h .m from Notepad++

Today, I want to open .h and .m file extension, those are Objective-C file, formerly can only be opened from xcode. I believe that notepad++ can do this..:D, From this source I got this information (written below), thank you so much for your useful Info, now I can open .h and .m file from notepad++ :happy:

========================================

Notepad++ doesn’t list .h, .m and .mm files as Objective-C files (.mm is Objective-C++) by default for some reason.

You can modify your langs.xml file to tell Notepad++ to associate those extensions with Objective-C. Open the file %AppData%\Notepad++\langs.xml, and scroll down to the following area:

<Language name="objc" ext="" commentLine="//" commentStart="/*" commentEnd="*/">
    <Keywords name="instre1">if else switch case default break goto return for while do continue typedef sizeof NULL self super nil NIL</Keywords>
    <Keywords name="instre2">interface implementation protocol end private protected public class selector encode defs</Keywords>
    <Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile id Class SEL IMP BOOL</Keywords>
    <Keywords name="type2">oneway in out inout bycopy byref</Keywords>
</Language>

Then add h m mm to the ext attribute:

<Language name="objc" ext="h m mm" commentLine="//" commentStart="/*" commentEnd="*/">
    <Keywords name="instre1">if else switch case default break goto return for while do continue typedef sizeof NULL self super nil NIL</Keywords>
    <Keywords name="instre2">interface implementation protocol end private protected public class selector encode defs</Keywords>
    <Keywords name="type1">void struct union enum char short int long double float signed unsigned const static extern auto register volatile id Class SEL IMP BOOL</Keywords>
    <Keywords name="type2">oneway in out inout bycopy byref</Keywords>
</Language>

Then restart Notepad++.

If editing the langs.xml file in your %AppData%\Notepad++ folder doesn’t work, you’ll have to open the one in %ProgramFiles%\Notepad++ instead. Make sure to back up the original in case you mess up somewhere.

This is some version of windows? If so you right click the file, select Open With, and in the subsequent dialog, you can select or browse for Notepad++ and ensure the checkbox that says something like “always use this program to open these files” (not sure of exact wording and I’m not on a windows box now).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s