Where can I find all command functions of Atom editor? - atom-editor

I can't find anywhere on the internet. I made some custom key bindings using stuff like:
editor = #getModel()
bufferRow = editor.bufferPositionForScreenPosition(editor.getCursorScreenPosition()).row
if editor.isFoldedAtBufferRow(bufferRow)
editor.unfoldBufferRow(bufferRow)
else
editor.foldBufferRow(bufferRow)
and
atom.workspace.getActiveTextEditor()?.selectAll()
atom.workspace.getActiveTextEditor()?.pasteText()
atom.workspace.getActiveTextEditor()?.save()
But I had to search so much. No list of all functions to use?
PS: Best thing close to it for me was: https://gist.github.com/philipmadeley/1fb35efdf5ab639c12c6

Atom has an abundance of documentation over at https://atom.io/docs/
More specifically, this would be what you were looking for:
https://atom.io/docs/api/v1.16.0/TextEditor

Related

How do you set edge.options in serenity.config file?

I am using serneity bdd (cucumber). In the serenity.config file I am able to set chrome settings like
chrome.switches = """--headless;"""
I can also pass them in through mvn like
-Dheadless.mode=true
But I cannot set any edge options. I think the correct way is to use
edge.options = """ """
But I cannot find what are valid inputs, and I cannot pass anything (that works) into the mvn command.
I can't seem to find answer online, anyone know?

create multicursor in Atom

I use Atom on Ubuntu 17.10 with wayland window manager.
I can create multiple cursors with CTRL+Mousclick or with CTRL+d to select the next same string.
But how can I for example mark some lines and create a cursor at the start of each line?
Also would be great to use search and find-all to select lots of results in a text to create a cursor at all these results.
I used this workaround at the moment by selecting the line-break and use CTRL+d to select the next linebreaks too with extra cursors, then go one left and Pos1 to have the cursors at the start of each line.
I wanted to select a string that repeats about 200 times in a dataset of 3000 text-blocks in a bunch of output and then I wanted to expand the selection to each of those blocks. That would have been really easy with multiple cursors. I solved this another way now, but for the next time I would like to see a complete instruction manual about how to create multiple cursors in the standard atom setting. I couldn't find this. Search-engines give me lots of plugins and solutions in different multicursor plugins.
I found the manual that explains it like in sublime (ctrl alt up and down):
Alt+Shift+Up and Down
see: https://flight-manual.atom.io/using-atom/sections/editing-and-deleting-text/#multiple-cursors-and-selections
What is missing in the manual is also a useful option:
use "find all" with the search tool in Atom (CTRL+F)
press Alt + Enter to create cursors at all the found locations.
see: https://discuss.atom.io/t/how-do-i-create-multiple-cursors-from-search-result/53231/5
I wanted to make it easy so I could just use alt+⬇️ or alt+⬆️ to have multiple cursors. This was my solution and I think its the easiest:
# From Atom -> Keymap add the following lines:
'.editor':
'alt-up': 'editor:add-selection-above'
'alt-down': 'editor:add-selection-below'

AutoIt #ComSpec parameters (/c, /k...)

I'm new to AutoIp and wonder what the parameters that often come with the #ComSpec macro mean. I couldn't find an explanation on the web. So any hint regarding /c, /k and maybe others?
Thanks a lot.
#ComSpec is the value of %COMSPEC%; the specified secondary command interpreter.
(For example: C:\Windows\system32\cmd.exe)
A quick search on "cmd.exe arguments" should give you plenty of info.

Can Aptana find and replace in multiple files?

I have a lot of files that have errors because the imported text uses smart quotes and the export program has replaced these with those crazy symbols. I'd like to just find and replace with Aptana and change all of these in all these files.
It would be useful in a much greater capacity, however, today this is the only thing I need it for. Thanks. Using Aptana 2 if it is different than 3.
Pressing Ctrl + H will allow you to search, find, and replace based on workspace, selected files, and projects.
In Mac it's Cmd + Option + G for the curious.
Small precision, when search result is shown, a right click on one result gives you "Replace Selected" and "Replace All..."

Why do <C-PageUp> and <C-PageDown> not work in vim?

I have Vim 7.2 installed on Windows. In GVim, the <C-PageUp> and <C-PageDown> work for navigation between tabs by default. However, it doesn't work for Vim.
I have even added the below lines in _vimrc, but it still does not work.
map <C-PageUp> :tabp<CR>
map <C-PageDown> :tabn<CR>
But, map and works.
map <C-left> :tabp<CR>
map <C-right> :tabn<CR>
Does anybody have a clue why?
The problem you describe is generally caused by vim's terminal settings not knowing the correct character sequence for a given key (on a console, all keystrokes are turned into a sequence of characters). It can also be caused by your console not sending a distinct character sequence for the key you're trying to press.
If it's the former problem, doing something like this can work around it:
:map <CTRL-V><CTRL-PAGEUP> :tabp<CR>
Where <CTRL-V> and <CTRL-PAGEUP> are literally those keys, not "less than, C, T, R, ... etc.".
If it's the latter problem then you need to either adjust the settings of your terminal program or get a different terminal program. (I'm not sure which of these options actually exist on Windows.)
This may seem obvious to many, but konsole users should be aware that some versions bind ctrl-pageup / ctrl-pagedown as secondary bindings to it's own tabbed window feature, (which may not be obvious if you don't use that feature).
Simply clearing them from the 'Configure Shortcuts' menu got them working in vim correctly for me. I guess other terminals may have similar features enabeld by default.
I'm adding this answer, taking details from vi & Vim, to integrate those that are already been given/accepted with some more details that sound very important to me.
The alredy proposed answers
It is true what the other answer says:
map <C-PageUp> :echo "hello"<CR> won't work because Vim doesn't know what escape sequence corresponds to the keycode <C-PageUp>;
one solution is to type the escape sequence explicitly: map ^[[5^ :echo "hello"<CR>, where the escape sequence ^[[5^ (which is in general different from terminal to terminal) can be obtained by Ctrl+VCtrl+PageUp.
One additional important detail
On the other hand the best solution for me is the following
set <F13>=^[[5^
map <F13> :echo "hello"<CR>
which makes use of one of additional function key codes (you can use up to <F37>). Likewise, you could have a bunch of set keycode=escapesequence all together in a single place in your .vimrc (or in another dedicated file that you source from your .vimrc, why not?).

Resources