Typing Japanese in TextMate

Brought to you by ericae.net: Whether you are looking to learn Japanese or you are coming from the other side and want to learn English it’s important to look into online education to improve yourself! There so many different things you can learn online and it’s important to never stop learning!

Update: Check the post: CJKInput for TextMate : Semi-complete solution for a better approach to this issue.

Here’s a quick tip from TextMate mailing list for writing Chinese, Korean and Japanese text in TextMate.

Hans-Joerg Bibiko:

Here is one way to use my suggestion:

  • open the Bundle Editor
  • Show all
  • go to the folder ‘TextMate’ (or whatever)
  • add a new command ‘inputCJK’ (or whatever) Command data
  • Save: nothing
  • Command(s):
# open CocoaDialog's textbox
res=$(CocoaDialog textbox \
       --title "Input CJK" \
       --informative-text "Write up here..." \
       --selected \
       --scroll-top top \
       --editable \
       --no-newline \
       --button1 "Insert" \
       --button2 "Cancel")
# If user canceled exit.
[[ $( (tail -r <<<"$res") | tail -n1)  == "2" ]] && \
         exit_discard
# delete first line
res=$(sed '1,1d' <<<"$res")
# print the content of the textbox
echo -n "$res"

Input: None
Output: Insert as Snippet
Activation: Key Equivalent shift+option+i (or whatever)
Scope: leave it empty