Is there a way to mark specific lines in BBEdit and then iterate through them? - bbedit

I often find myself jumping between several parts of a lengthy document, and I've found no streamlined way of handling this. I've previously used TextPad for PC, and it had a great feature called Bookmarks:
Press a keystroke, and the current line is marked. The bookmark shows as an arrow in the gutter.
The same key toggles the marker off again.
Another keystroke sends the caret down to the next bookmark.
Yet another keystroke sends the caret up to the previous bookmark.
Is there anything like this in BBEdit? I loved that feature of Textpad, but I haven't found another editor that has something similar. Currently I use the awkward substitute of typing three slashes /// at a place I want to jump back to, then using Ctrl+F to re-find them, but that's a lot of keystrokes to set/remove markers and to iterate through them.
Thanks!

I think what you are after is BBEdit Markers.
This article is a good place to start: macdrifter.com/2012/01/bbedit-markers.html

Related

Cycle through all history occurrences by typing first word and pressing up arrow without Oh-My-Zsh

Is there a way to use OMZ's most loved feature to cycle through all history occurrences by typing first word and pressing up arrow without Oh-My-Zsh itself? I mean there should be some plugin for pure zsh for this, isn't it?
Like on this GIF
The magic for that behavior lives over in https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/key-bindings.zsh
It works just fine on its own outside of omz
Copy, paste, attribute :)

ms-word object model: custom spellchecking underlines

in making a MS Word add-in spellchecker, i'm faced with the issue of "underlines". I can use the formatting functions of the Word Object Model in order to color the misspelled words or to underline them just how a user would with the U button, but it's not the same as the native ms-word curly underline which doesn't show if you copy-paste the text elsewhere, doesn't get printed or saved and doesn't show in undo actions. I have been searching how to do it, but everyone keeps saying it's not possible.
There is this English spellchecker called Grammarly, they do have a ms-word add-in and they somehow underline the misspelled words (though it's not curly, just a straight thick line) and it works just like MS-Word:
a) it doesn't get copy-pasted when you move the text with the underlines elsewhere, nor does it gets saved when you save the document
b) it doesn't get added in the undo stack.
So from a) and b) I conclude that it's not text formatting
So there must be a way, I was wondering how can I achieve this.
Thank you in advance for any ideas or tips.
Unfortunately, MS Word doesn't provide out of the box functionality that would allow you to implement this. The way how Grammarly and other add-ons with similar functionality do it is they show the transparent window on top of MS Word window using Windows API. Then they identify coordinates of words that need to be highlighted and draw the highlighting (rectangles or underlines) inside of that transparent window on top of those words. This is not an easy solution because it requires to identify the visible range which is currently shown on the screen, find the words in that range that need to be highlighted and also track the user's actions such as scrolling and window resizing so that to redraw the highlighting after those actions. But for sure it's possible because we have recently done it in the product I'm working on. As far as I know, there is no ready open-source solution for this so you will need to implement everything yourself.
You may also consider a much easier solution which is highlighting the words using the Find.HitHighlight functionality. An example of how it works you can see when you search for a simple word in MS Word. Although this is not a very flexible solution because the only thing you can change is the color of the highlighting.
I believe the way Grammarly adds emphasis to words and phrases it wants to flag is to change the document temporarily in a very smart and controlled way. Grammarly only works when one clicks the Open Grammarly button on the Grammarly ribbon. If you do a simple experiment, you may be able to observe how Grammarly controls its temporary changes.
First create an unsaved document with some misspelled words that trigger Microsoft Word to display the wavy red lines. Then click the Open Grammarly button. Notice that the add-in turns off spell checking and replaces Word's wavy red lines with its own web-triggered markings. These are probably generated in the document using code similar to:
myRange.Font.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineThick;
myRange.Font.UnderlineColor = Microsoft.Office.Interop.Word.WdColor.wdColorRed;
After observing this, save the document. If you look carefully at your screen (and if your computer is not super fast), you will see a small blink wherein the red thick underlines disappear for a brief moment. That is the Document.BeforeSave event removing the Grammarly markings before saving the document. By relying on user actions (such as when the user clicks the Grammarly ribbon button), Grammarly controls at what points in time the markings appear. It then uses code and events to make sure the markings are not saved with the document or interfere with other operations. The main events you would want to look at to replicate this behavior for your own spelling checker add-in would be:
Document.BeforeSave Event
Document.BeforePrint Event
Document.BeforeClose Event

Move Cursor Down? VS Code Keyboard Shortcut

I want to move my input cursor down 1 line.
Is there a way to bind cursor movement in the keyboard shortcuts interface?
Update: I have actually found myself in Notepad++ whenever I'm just too tired to wrestle with my text cursor...
So Far
In other software, I use the down arrow. In VS Code, this scrolls auto-fill suggestions.
Formerly, I used a two-key combination: left arrow and down arrow, one to cancel suggestions, one to move the cursor. This no longer works. Suggestions persist.
I've looked everywhere for an answer. There are 0 alternatives, correct? The move cursor down exclusive functionality is simply not available in any way in the current version of VS Code.
Non-configurably eliminated from the software's design.
Inadequate Solutions
I can hit escape, but like the mouse, that means lifting one hand. When editing dozens of lines of index assignations (ugly optimization, don't ask), my arm actually starts to burn from the rapid movements. The process is painfully slow.
I cannot disable suggestions or summon them with ctrl+space, because I use them with every identifier I type (via tab), multiple times per line.

Notepad++: disable auto-complete in comments

I'm using Notepad++ for C coding.
The auto-complete functionality in NP++ seems really naive. No matter where I am in a file, it always tries to give me a list of auto-complete suggestions (most of which are just random words, rather than function or variable names).
It becomes really annoying when I'm trying to write a long multi-line comment, and I keep having to hit escape at the end of lines because the auto-complete pop-up wants to change what I'm typing.
Is there a way to disable auto-complete inside comments?
Alternatively,
Is there a way to disable keyboard interactions with auto-complete? The time it saves by filling in text for me is negligible compared to the time it saves me from having to go and confirm that I'm spelling function or variable names correctly. So, it would be just about as useful if it always made suggestions, but where the arrow keys and enter interacted with the text, rather than the pop-up.
You can go Settings →Preferences → Auto-Completion and from this point you can set whether you have auto-completion on words, functions or both.
At this point, I don't believe there is a way to disable auto-completion within comments.
A workaround is to turn off auto-completion using Ctrl+Enter for your code, and Ctrl+Space for your comments.

is there any eclipse plugin available for writing a memo on any line of code?

Doe anybody know of an eclipse plugin, which can be used to insert short text (in the form of memo) to remember what that line of code does or a block of code does to help me understand the existing code better and i can also refer it back later on.
Just like "Task" can be added on a line of code, although i can use "tasks" for this purpose, but that is not very convenient and intuitive.
If you want to add a short text to "remember what that line of code does or a block of code does to help me understand the existing code better", use comments. That's what they're for, and practically every formal language in the world has them.
If you want the ability to quickly jump to an arbitrary point in the code, using bookmarks is a convenient option - right click the bar immediately left of the text and choose to add a bookmark. You can then easily jump between bookmarks with the "bookmark view", which you can enable from the Window -> Show View menu.
The closest thing I can think of is bookmark support. There is native bookmark support in Eclipse and also several other vendors supply more function.
I'm assuming that there's a very good reason that you don't want to or can't modify the code.