Sublime Text 3 Literal Dollar Sign with Stata - sublimetext3

I started using Sublime Text 3 for Stata with Improved Stata Editor for MacOS. I need to use $ (literal dollar sign) to call global variables, but whenever I try to type in $ (shift+4) ${} with a line break between two parentheses.
I found some posts about snippets, but I am not sure how to go about this. May I get some help on this?

Related

Vim treats unicode characters as a separate text object from english alphabets

I use both of vim and neovim, but just found that both editors treat unicode characters (such as Korean characters) as a different text object from english alphabet separately.
For instance, if there is a text, my_str = 'ABC가나다', vim only removes ABC if I type dw at A.
Of course I would be able to use di' instead, but it's getting annoying with using surrounding.vim plugin.
Typing ysw[ only surrounds ABC because Vim recognizes 가나다 as a separate text object even tough there is no space between the two.
Will there be any solution for this?
Thank you so much.
June

How to use Regular expression to surround all number with a $ sign? Sublime Text 3

I have a table in latex, I am using sublime text. The question is simple, I have numbers say
Input:
3.3 & 42.32 & 123
Is there a way using regular expression to replace numbers with the same numbers in addition to $ sign wrap such that the
Output:
$3.3$ & $42.32$ & $123$
I have found an answer. However, I honestly advise everyone who does not know Regular expression to watch the first four series
https://www.youtube.com/watch?v=c9HbsUSWilw
The answer to my question is that I am using regular expression in Sublime text 3 editor. Therefore, the answer is to put in the find (ctr+F)
Find: (\d+\.\d*)
Replace with: \$$1\$ (after pressing on the regler expression key in sublime text 3)

What does "Inconsistent use of tabs and spaces in indentation" mean?

I'm trying to create an application in Python 3.5 and i use spaces all the time for indentation, but the editor print out "inconsistent use of tabs and spaces in indentation" when it comes to
print("This car has "+str(self.odometer_reading)+" miles on it.")
How can i solve this problem? I'm a beginner in programming. I would be glad if i could get some overall tips on my code.
class Car():
def __init__(self,make,model,year):
#初始化描述汽车的属性
self.make=make
self.model=model
self.year=year
self.odometer_reading=0
def read_odometer(self):
#打印一条指出汽车里程的消息
print("This car has "+str(self.odometer_reading)+" miles on it.")
my_new_car.read_odometer()
It means that some of your code you've indented by pressing space and some of the code has been indented by pressing tab. You can tell which one is in use for a certain line by pressing backspace on the insert and if it deletes approx 4 characters worth of space it was an indent, otherwise it was a space. I would recommend that you either pick space or tab to indent your code then be consistent. To get your code working I would recommend you simplify remove all indentation then use either space or tab to indent.
Many editors support the display of the indentation mark and spaces.
Turn them on, you will see what the interpreter is talking about.
Its not possible to tell from your code displayed here. They have all be converted to spaces by syntax highlighter.

Use char-codes in strings

I'm working on a terminal program under Linux. I consider adding colorized output.
The task is not really hard, so I succeeded with the following:
[3]> (format t "~a[1;31mred text~a[0m" #\escape #\escape)
red text ; this text is really red and bold in terminal ;-)
NIL
But the code is ugly: I don't know how to put char #\escape (decimal value 27) into a string in 'inline' fashion. For example C++ code from this thread:
cout << "\033[1;31mbold red text\033[0m\n";
Here is #\Escape as \033 (octal). Is there something similar in Common Lisp?
My effort naïf doesn't work as intended:
[4]> (format t "#\escape1;31mred test#\escape[0m")
#escape1;31mred test#escape[0m
NIL
You can type the characters manually…
You don't have to do anything special to have the control characters (or other "unusual" characters) in your strings. You just need to be able to type them into the editor. How easy it will be will depend on your editor. In Emacs, and in at least some terminal emulators, you can press Ctrl-Q followed by another character to insert that character literally. Thus, you can press Ctrl-Q followed by Escape to insert a literal #\escape character. How it appears will depend on the terminal emulator or editor. In my terminal, the literal Escape character is displayed as ^[. Thus, I end up with:
(format t "^[[1;31mhello^[[0!")
; ** **
; result of C-Q Esc
This gives me some red text, as in your example:
…or use a library to make it easier!
If you don't want your source to contain characters that might not be easily readable, you might look into something like Edi Weitz's CL-INTERPOL:
CL-INTERPOL is a library for Common Lisp which modifies the
reader so that you can have interpolation within strings similar to
Perl or Unix Shell scripts. It also provides various ways to insert
arbitrary characters into literal strings even if your editor/IDE
doesn't support them. Here's an example:
* (let ((a 42))
#?"foo: \xC4\N{Latin capital letter U with diaeresis}\nbar: ${a}")
"foo: ÄÜ
bar: 42"
Using CL-INTERPOL, this becomes easy:
* (interpol:enable-interpol-syntax)
* (format t #?"\e[1;31mhello\e[0m!")
hello! ; there's color here, honest!
NIL

Vim $$ automatically adds <++>

For some reason, whenever I type $$ in Vim, it automatically adds <++> right after it, and positions my cursor between the $ symbols.
So I get something this in the end (| indicates cursor position):
$|$<++>
I am using vim-latex package, but I am not sure if that has something to do with it.
I am using $$ a lot for the math environment, so it really gets old fighting vim on this.
Does anyone know what this thing is and how do I disable it (or use it properly)?
EDIT: Just for clarification, I actually want the double dollar sign, to make a multi-line math environement:
$$
x+ y
$$
As Benoit wrote, you can use Ctrl-J to jump to the next <++>. These are called place holders and are explained in chapter 3 of the vim-latex documentation: Latex-Suite Macros.

Resources