GlobalAutoCompletion (Linux (?))

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

GlobalAutoCompletion (Linux (?))

Post by AZJIO »

GlobalAutoCompletion

Download: yandex upload.ee

Image

1. Enter text
2. Select text (Ctrl+Shift+Left)
3. Hotkey call (Add a call to this program using a hotkey)
4. The program will copy the selected text and offer to find it in some way (See the menu in the screenshot). Since I'm working with PureBasic files, I chose the "pb" file type. Up/Down arrows to move the cursor through the list.
5. I press Enter and I get a list box that matches the selected text.
6. I click on the list item and it is inserted into the active window. The selected text is replaced. If I selected "files", a code snippet will be inserted.

You can create your own lists and your own code snippets.
Place the folder with lists in ~/.config/GlobalAutoCompletion/.
Place the program in /usr/bin/.
You can make multiple hotkeys using different options (-s, -c, -f, -t) to get the list of items by skipping the selection menu.
You must have xdotool and xsel installed.
You can work with any type of file, but for this you need to create lists of functions yourself.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

You can also try my similar Windows projects:
Text Correction - there is a function to replace abbreviations to the right of the cursor using a hotkey. Detailed, Video.
NPP_AutoCompletion - Plugin for Notepad++ (Detailed)
Panel_Function - function list popup panel (screenshot, Detailed)
AutoCompletion - auto-completion by passing a word through the command line from the IDE (screenshot, Detailed)
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: GlobalAutoCompletion (Linux (?))

Post by #NULL »

I'm having trouble trying it.
can't read ReadMe, it's not English.
I selected text in the IDE and tried to run the tool from a terminal:

Code: Select all

[user]~/Downloads/GlobalAutoCompletion>./GlobalAutoCompletion_x64_En_Arch 
./GlobalAutoCompletion_x64_En_Arch: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./GlobalAutoCompletion_x64_En_Arch)

[user]~/Downloads/GlobalAutoCompletion>ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27

[user]~/Downloads/GlobalAutoCompletion>arch
x86_64
My current Ubuntu 18.04 only supports up to glibc 2.27, so I can't try it in this form.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

#NULL
can't read ReadMe, it's not English.
translate.google.com or Crow Translate
I selected text in the IDE and tried to run the tool from a terminal:
You change the active IDE window to the terminal. What's your DE? Cinnamon, Mate, XFCE, KDE?
You need to open the keyboard section in the DE settings, open the hotkey section, add a hotkey, specify the executable file.
`GLIBC_2.29'
Compile the file on your OS.
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: GlobalAutoCompletion (Linux (?))

Post by #NULL »

Ok, I compiled it, installed xdotool and xsel. Now I can run it with a hotkey (xfce here), but I don't understand it yet :)

Code: Select all

var = 123
n = 2 + var + 2
Debug var
I select 'var' somewhere in the code and do my hotkey. After the message and options window I get an empty window with some 'var ...' results in the window title, but the actual gadget in the window is always empty.
I used the source GlobalAutoCompletionEn.pb
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

#NULL
I select 'var'
Is there a function that has "var" at the beginning of the name?

It is necessary to change the behavior, if nothing is found, then issue a message or quietly stop, depending on the setting in the ini-file. It makes no sense to show an empty list.
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: GlobalAutoCompletion (Linux (?))

Post by #NULL »

I thought it was a general autocompletion including variables etc. You should have started with a description of what it does :wink:
But if I select 'Event' or 'EventUser' in 'Procedure EventUser()' in GlobalAutoCompletionEn.pb then I still get an empty window.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

1. The program works in a browser, in any editor, so it initially does not know the object where it gets the text from and cannot get all the text in order to analyze it.
2. You can add any function names you like. For example, you have a module for working with sound, you can add its functions to the list (~/.config/GlobalAutoCompletion/pb/1.txt).

AutoCompletionIDE

Download: yandex upload.ee

This is a video ad for keyword auto-completion.
video2
screenshot-Windows
Linux: screenshot1, Calque

Made individually for the IDE.
command line for the tool: -w:%WORD %CURSOR
the number at the end of the file indicates the search method.
The number of the list depends on the number of lst files.
The title indicates the search time, fast enough (4 ms).
____________________________________________
Updated AutoCompletionIDE.
Now works in Windows
Now works in AkelPad and Notepad++. In the ini-file you need to specify the class of the window, three parameters. Default PureBasic.
Added a field where you can edit the text you are looking for to find another text without closing the window.
I added a folder with English-language examples, previously there were only Russian comments.
Added 2 lists with WinAPI, you can choose which lists you don't need.

For Notepad++
AppData\Roaming\Notepad++\shortcuts.xml

Code: Select all

<Command name="AutoCompletionIDE" Ctrl="no" Alt="yes" Shift="no" Key="113">&quot;$(NPP_DIRECTORY)\Tools\AutoCompletionIDE.exe&quot; &quot;-w:$(CURRENT_WORD)&quot;</Command>
For AkelPad menu item:

Code: Select all

"AutoCompletionIDE" Exec(`"%a\AkelFiles\Tools\AutoCompletionIDE\AutoCompletionIDE.exe"`, "-w:%d") Icon("%a\AkelFiles\Tools\AutoCompletionPB\AutoCompletionIDE.exe")
Last edited by AZJIO on Sat May 11, 2024 2:43 pm, edited 19 times in total.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

Updates AutoCompletionIDE
Added by the menu called by right click (Open ini, LST, folder, and found in the clipboard). In Linux - menu at the list headers, in Windows - on the "Find" button.
Added a hint to the list headers about the number of items in the list.
Axolotl
Enthusiast
Enthusiast
Posts: 797
Joined: Wed Dec 31, 2008 3:36 pm

Re: GlobalAutoCompletion (Linux (?))

Post by Axolotl »

AZJIO wrote: Tue Sep 28, 2021 5:05 pm Updates AutoCompletionIDE
.....
Hi AZJIO
I just wanted you to know that your link on upload.ee is no longer available. Acc. to their FAQs It seems that the files are deleted several (50 or 120) days after the last download. Maybe thats the reason.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

Axolotl wrote: Sat May 11, 2024 1:20 pm upload.ee is no longer available
fixed the link.
By the way, I updated it not long ago without announcing it. Added automatic selecting of words to the left of the cursor. Now you don't need to press Ctrl+Shift+Left Arrow
Axolotl
Enthusiast
Enthusiast
Posts: 797
Joined: Wed Dec 31, 2008 3:36 pm

Re: GlobalAutoCompletion (Linux (?))

Post by Axolotl »

Thank you AZJIO.
I really appreciate your work. but I probably won't get used to the cyrillic letters anymore. Luckily there are these automatic translation tools.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

Axolotl wrote: Sat May 11, 2024 2:06 pm but I probably won't get used to the cyrillic letters anymore
You don't need to get used to the Cyrillic alphabet. You can change everything in the program. The column names are in LST lists. You can create your own snippets. It’s hard for me to create two sets, and for other countries English will also not be the preferred language, which means I’ll still have to redo it. I showed in the video how to do this.
My code snippets will not necessarily satisfy your needs. Everyone has their own level of knowledge and everyone makes their own code fragments. You add new things from time to time and this is how you form your own knowledge base, your own fragments.
AZJIO
Addict
Addict
Posts: 2141
Joined: Sun May 14, 2017 1:48 am

Re: GlobalAutoCompletion (Linux (?))

Post by AZJIO »

Download

The update was performed due to the purchase of a new computer and the installation of Windows 11. Some automation programs became unstable due to the high speed.

Added files for the English language: AutoCompletionIDE-Black-En.pb and AutoCompletionIDE-x64-Black-En.exe

AutoCompletionIDE-x64-Black(-En).exe - added a delay after #WM_COPY, before GetClipboardText(), because on fast computers, the buffer didn't have time to fill up before the capture was triggered, causing the buffer to remain empty. Additionally, the #MB_SYSTEMMODAL flag has been added to ensure that dialogs appear on top of the IDE rather than below it. The Delay10, Delay30, and Delay90 delays have been moved to the ini file to allow for better stability and responsiveness. It is recommended to adjust the values as a percentage, for example, to reduce them by 2 times, but keep in mind that this may not be visually noticeable and may reduce stability.
User avatar
Piero
Addict
Addict
Posts: 862
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: GlobalAutoCompletion (Linux (?))

Post by Piero »

Talking about """autocompletion""":
In PB (scintilla) the best "text expander" is the one that lets you see the autocompletion popup after expanding text…
…but you can use another text editor like TextMate (as an IDE tool) for GREAT completions, and even get fuzzy completions directly in PB, if you have a Mac…

PS:
The message was: GET A MAC! :P
Post Reply