Home Download Buy Blog Forum Support

[solved]: automated replacement for latex

[solved]: automated replacement for latex

Postby markus.falk on Wed Aug 31, 2011 2:15 pm

Howdy,

I'm pretty new to sublime and am still trying around.

I have created a custom completion list for latex which looks like this:

Code: Select all
{
   "scope": "text.tex - source - meta.tag, punctuation.definition.tag.begin",

   "completions":
   [
      { "trigger": "ä", "contents": "\\\"a" },
      { "trigger": "ö", "contents": "\\\"o" },
      { "trigger": "ü", "contents": "\\\"u" }
      
   ]
}


For german latex documents it is best to have all special characters escaped. But I can't get this to work like I want it to.

The completion however does what it does which is complete ä on tab with \"a. The problem is that I don't want to hit tab after every letter. this just doesn't fit into the flow of typing. Is there a way of automagically trigger this withouth tab? I just want this to change whenever I type a special character.

:shock:

thanks
Last edited by markus.falk on Mon Sep 05, 2011 5:39 pm, edited 1 time in total.
markus.falk
 
Posts: 18
Joined: Wed Aug 31, 2011 2:10 pm

Re: automated replacement for latex

Postby markus.falk on Fri Sep 02, 2011 1:49 pm

Now I think I have found out that it must work somehow. While writing CSS I noticed that after typing ":" sublime automtically adds ";" to the text. this works without any tab trigger. Thats the kind of functionality I am looking for ... do you guys have any idea how to get this into latex?

thanks :P
markus.falk
 
Posts: 18
Joined: Wed Aug 31, 2011 2:10 pm

Re: automated replacement for latex

Postby markus.falk on Fri Sep 02, 2011 4:31 pm

thanks I will try that. No I don't use any alt or shift or options keys ... they are on the german keybord. also hitting alt wouldn't fit into the flow of typing :)
markus.falk
 
Posts: 18
Joined: Wed Aug 31, 2011 2:10 pm

Re: automated replacement for latex

Postby markus.falk on Fri Sep 02, 2011 6:23 pm

sorry but it just won't work

I used this just to try if it is working:

Code: Select all
<binding key="q,q" command="save"/>


saved it under Default.sublime-keymap in my User directory ... then i get the following error:

Error trying to parse file: Expected value in ~/Library/Application Support/Sublime Text 2/Packages/User/Default.sublime-keymap:1:1

heeeelp :)
markus.falk
 
Posts: 18
Joined: Wed Aug 31, 2011 2:10 pm


Re: automated replacement for latex

Postby markus.falk on Mon Sep 05, 2011 5:37 pm

ahh ... thanks. Working solution now is:

Code: Select all
[
   [
   { "keys": ["ö"], "command": "insert", "args": {"characters": "\\\"o"} },
   { "keys": ["ü"], "command": "insert", "args": {"characters": "\\\"u"} },
   { "keys": ["ä"], "command": "insert", "args": {"characters": "\\\"a"} },
   { "keys": ["Ä"], "command": "insert", "args": {"characters": "\\\"A"} },
   { "keys": ["Ü"], "command": "insert", "args": {"characters": "\\\"U"} },
   { "keys": ["Ö"], "command": "insert", "args": {"characters": "\\\"O"} },
   { "keys": ["ß"], "command": "insert", "args": {"characters": "{\\ss}"} }
]
]


is there a way to set the scope to LATEX?
:D

now I can finally use Sublime for Latex
markus.falk
 
Posts: 18
Joined: Wed Aug 31, 2011 2:10 pm

Re: [solved]: automated replacement for latex

Postby mandaly on Mon Mar 26, 2012 3:28 am

Now I think I have found out that it must work somehow. While writing CSS I noticed that after typing ":" sublime automtically adds ";" to the text. this works without any tab trigger. Thats the kind of functionality I am looking for ... do you guys have any idea how to get this into latex?!











---------------------------------------------------------------------------------------------
Trumpet Wedding Dresses|Column Wedding Dresses|Wedding Dresses with Sleeves|New Style Wedding Dresses
mandaly
 
Posts: 3
Joined: Mon Mar 26, 2012 3:22 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 6 guests