This question already has answers here:
80-characters / right margin line in Sublime Text 3
(2 answers)
Closed 1 year ago.
I tried to add a ruler through View>Ruler but it adds to the current file only.
How to make a specific ruler with the size of 79 characters in sublime and make it appear in every file?
If you want to make a ruler appear in every file, then go to Preferences: Settings from the command palette and add the setting "rulers": [79] to your user preferences. This will make the ruler appear at column 79 for every file.
The reason why View -> Ruler -> <Some value> applies only for the current file is because, behind the scenes, it uses a command called set_setting, which sets the given setting (here it's rulers) and it's value only for the current view (Just try to apply a ruler value to a file using View -> Ruler, close the file, open it again and see that it doesn't persist. It's just temporary). Hence, the rulers value is not applied to any other file
Related
This question already has answers here:
Remove all arbitary spaces before a line in Vim
(9 answers)
Closed 5 years ago.
I'm new to the vim editor.
How can I adjust all lines to the left? I have many lines which are indented and I want to arrange them so they all abut the left side of the file (no spacing at the start of the lines).
Select all line in visual mode and then type :left . Hope this helped.
keerthan
The simple key sequence :%left will do the trick, it basically applies the left command to all lines in the file.
This question already has an answer here:
Wrong default syntax highlighting in sublime text 3
(1 answer)
Closed 6 years ago.
As AIML syntax isn't available for Sublime Text (which is normal because AIML is basically XML), is there a way to automatically convert all .aiml files opened by Sublime Text 3 to XML syntax highlighting (some sort of script to do this)? Whenever I have to reopen Sublime Text syntax highlighting restarts and I need to set highlighting from plain text to XML on every file.
With an .aiml file open in ST3, and the syntax highlighting set to XML:
(Build 3118 onwards:) From the Preferences menu -> Syntax Specific:
(Build 3114 and older:) From the Preferences menu -> Settings - More -> Syntax Specific - User
Paste in or type the following, so that the contents of the file look like:
{
"extensions": ["aiml"]
}
And save it, and all .aiml files opened from now on should be highlighted as XML automatically.
This question already has answers here:
Indenting entire file in Vim without leaving current cursor location
(5 answers)
Closed 8 years ago.
How can I reformat the whole buffer in Vim, the same way as I am doing using gg=G keys, without going the the top (which is caused by the gg)?
You can mark the current position with m<letter> command and then go back with `<letter>.
mzgg=G`z
The referenced duplicate uses more effective variant of this approach using the fact that double backtick goes to the last cursor position so you don't actually need to mark the current position:
gg=G``
Or you can install a plugin for text object of entire buffer (e.g. https://github.com/kana/vim-textobj-entire) and then do
=ae
(or equivalent with another plugin).
Is there a way in Vdebug to expand all the "variable trees" without manually going through each and expanding them?
A picture to explain what I mean by variable trees (the arrow is the top of a tree).
I didn't know about Vdebug, but from the help file:
4.2.2 The watch window *VdebugWatchWindow*
:
:
To open a closed tree, navigate to a line with a closed tree (right arrow) and
press <enter> (<cr>) or double-click if you have mouse-support enabled. This
will open the tree, and show all the children.
:
:
*VdebugOptions-marker_closed_tree*
g:vdebug_options["marker_closed_tree"] (default = '▸')
Sets the marker used for a variable in the watch window that does have
children, but the tree is currently closed. A "+" symbol is used if multi
byte support is not enabled.
So you could use the :global command to hit enter on every line containing a closed tree marker:
:exe 'g/'.g:vdebug_options["marker_closed_tree"]."/ normal \<cr>"
I was not able to get mMontu's answer to work for all occurrences but it did work for the first occurrence. I also changed it a tad to make it so I didn't have to hit return to actually execute it.
exe 'g/'.g:vdebug_options["marker_closed_tree"]."/normal \<cr><cr>"
It also works for "open" markers, which is what I wanted. For some reason mine are all open by default which makes for hard reading. So, conversely to OP (Kyle) wanted (all open by default) I wanted all closed by default.
exe 'g/'.g:vdebug_options["marker_open_tree"]."/normal \<cr><cr>"
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What does <++> mean in vim (latex-suite), and how do I jump there?
My default editor is vim but I shifted to gvim for the latex suite. Whenever I type $$ in quick succession it adds a <++> after the second $ symbol. What does that mean and how do i disable that?
From the Vim-Latex FAQ:
Q: What are those annoying «» characters whenever I invoke a
mapping?
Those are called placeholders and when you get used to them, they
will prove invaluable. They are essentially markers left in the text
file to tell latex-suite where the next point of interest is. This
lets you directly go to the next placeholder with a single key-press.
Consider a working example. Pressing EFI will insert the following
micro template:
\begin{figure}[h]
\centerline{\psfig{figure=«eps file»}}
\caption{«caption text»}
\label{fig:«label»}
\end{figure}«»
The text «eps file» will be selected and vim will be left in
select-mode so that the user can continue typing straight away. After
having typed in the file name, she can press Control-J (while still in
insert-mode). This will take her directly to the next "place-holder".
i.e, «caption text» will be visually selected with vim in select
mode again for typing in the caption. This saves on a lot of key
presses.
If you still do not feel like using placeholders, include let g:Imap_UsePlaceHolders = 0
in your .vimrc.