Sublime GDB for Sublime 3 doesn't work: You have not configured the plugin correctly - sublimetext3

I've googled this issue and haven't seen any useful advice. My understanding is that the default settings should work; I can't see any information about mandatory modifications to the default settings.
You have not configured the plugin correctly, the default configuration file and your user configuration file will open in a new window
when I try to open the debugger, then it opens the user settings (an empty file) and the sublimeGDB settings file, which seems like it's the default. The setup tutorial on https://github.com/quarnster/SublimeGDB doesn't mention needing to modify any files, only that doing so is possible if you want to change your preferences.
Also, I do not understand the following instruction:
Open up the default settings via the command palette and begin typing GDB and select the default.
When I open the command palette, there is no "default" option when I type in GDB, only a list of SublimeGDB features (all of which lead to the titular error)
I installed SublimeGDB with package control.

If you look at your SublimeGDB.sublime-settings and you read some properties you can see that their values are set to "notset"
As the very minimum you have to set those:
"workingdir": "${folder:${file}}",
"commandline": "gdb --interpreter=mi --args ./${file_base_name}",
"env": {"DISPLAY": ":100"},
The working dir is the directory of the current open file.
This will launch the executable file that is named like the file you have currently open (without extension)
There are many others settings and options.
You need to read and learn how to configure them in order that they fit your needs.

Related

Location-dependent vim settings

I work on multiple software projects that have different style conventions. Is it possible for vim to automatically change its settings (e.g. indentation) depending on the directory a particular file lives in?
No
Vim doesn't have any settings appropriate for what's described.
But there's a plugin for that
However, you may find a plugin that does what you want for example vim-independence:
The plugin is automatic, if the file .vimrc exists in your git project root - it will load it.
(full disclosure: I wrote that script)
you can create some file with settings in each project. .vim_setting for example. and append source .vim_settings to your .vimrc. if you run vim from project directory, settings will be picked up

SublimeText3 setting (configuration) manner

I am new to SublimeText, use SublimeText3.
Along with the daily usage, I'm developing some plug-in, so I'd like to understand the manner deeply.
What I found strange is opening Preferences > Settings - Default,
a file Preferences.sublime-settings located at Library/Application Support/Sublime Text 3/Packages/Default.
However, there is actually no such a directory, so I assume this is a binary hardcoded Virtual directory/File.
Also, I noticed, there is a (non virtual) User directory and Preferences.sublime-settings where we can edit.
I think this is a very smart method to let the user preserve the default setting and override the configuration.
So far I just guessed like this, and I'd like to confirm my understandings here.
When a plugin is developed, the default setting is placed in the plugin folder, and a user-setting file is automatically created in the User folder. Am I correct?
Packages are run directly from the *.sublime-package files, located in the executable path I believe. These are simply renamed zips. You can override files by creating the proper folder and file name in the packages folder. Settings are loaded in the following order. First the Default package, then any plugins installed (in alphabetical order), finally the User directory. So anything specified in the Userdirectory will override/merge with anything preceding it.
With that out of the way, yes you should map the default settings to your plugins directory and the user ones to the user directory. The user setting file is not automatically created. For example, the following is an entry from Main.sublime-menu
{
"command": "open_file", "args":
{
"file": "${packages}/User/Preferences.sublime-settings",
"contents": "// Settings in here override those in \"Default/Preferences.sublime-settings\",\n// and are overridden in turn by file type specific settings.\n{\n\t$0\n}\n"
},
"caption": "Settings – User"
}
So when you first select the menu, it will try to create the file. If it doesn't exist, it should fill it with specified content.

How to avoid .bzr.log (bazaar log file) being created or configure it to be in ~/.bazaar/ instead of ~/?

Is there a way to tell bzr not to log everything into ~/.bzr.log or alternatively configure it to drop the log file into ~/.bazaar/` instead?
The environment variable BZR_LOG allows to
suppress the creation of the log file by setting it to /dev/null on unixoid systems and NUL on Windows.
create the log file in an alternative path by pointing it to that path, e.g. export BZR_LOG=$HOME/.bazaar/bzr.log on a Linux.
Configuration:
In Linux and other unixoid systems you can either use the system-wide setting under /etc/profile or $HOME/.profile (or $HOME/.bash_profile and $HOME/.bashrc.
In Windows you can set the variable by right clicking Computer then Properties on the desktop, then choosing Advanced system settings in the left pane and from there the button Environment variables. The dialog which pops up (screenshot below) allows you to set new variables or edit existing ones. Here's how it looks on Windows 7:
Rationale: it took me a while to figure it out and the search term .bzr.log, even when quoted, would end up with pointers to bzr log or this question: Where is the format of the file `.bzr.log` documented? None of this was particularly helpful, so I thought I'd share the found fact Q&A style for future internauts researching that same topic.

How to set the working directory of WinGHCi

I just installed WinGHCi. When I try to load an .hs file with Ctrl+L, it opens the file browser in C:\Program Files (x86)\Haskell Platform\2012.2.0.0\winghci which is where I installed this. I don't want it to go there by default, I keep my code files in a different directory on a different drive and I don't want to have to navigate to D:\MyPath\Haskell every time I load a file.
I tried to set the "Start in" field of the shortcut I use to launch WinGHCi but it changed nothing.
How can I make WinGHCi look in my own directory by default?
It opens in the last directory you opened a .hs or .lhs from.
Try opening something from the folder you want, exit, restart.
Did it restart where you were?
Try working like that for a while, and if you like it (I do) then you're fine.
If you really do want to go to the same place every time, perhaps there's a way.
I can't find any setting to control this, but the information is stored in the registy.
Mine is at
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Haskell\WinGHCi 1.0.6]
"WorkingDir"="D:\\Files\\Andrew\\prog\\haskell"
You can save your version of that as resetghci.reg:
To make your own, open regedit and first try the same location. If not, search for WinGHCi.
You can export that subtree but you get the whole lot including recent expressions etc, which I don't think you should reset. Save that as ghcioriginal.reg just in case. Edit away all the lines except WorkingDir and save as resetghci.reg
When you double-click it it will ask you if you're sure you want to add that info to the registry. Yes you are.
Untested:
What follows works on older versions, but Microsoft seem to be going off .pif files and the start command, and I'm not able to test this in Windows 7.
Make a text file called ghci.bat in the same folder as the .reg you made. In it put
#echo off
regedit resetghci.reg
start WinGHCi
You might need to specify the full path to WinGHCi.
The start command is the windows equivalent of making a background process from a shell prompt, so this should terminate immediately.
Make a shortcut to ghci.bat (it will be called ghci.pif) and set it to open minimised and put a nice lambda icon on it (nick it from the winghci executable).
Pop that on your desktop, start menu or shortcut bar, and when you use it, you'll be popped back to your standard location.

Is it possible to call an application selection window (Right click->Open With->Other) from the linux console?

On Gnome/KDE you can select in which application you want to open file (Right click on file -> Open With -> Other). Is it possible open file that way, but from console?
For example: you print " file.ext" and instead of opening in concrete application, there are that application selection window forced and then users chooses - starts selected program.
I tried to figure out that myself, but not found anything like that.
"edit file.ext" doesn't fits my needs, because it starts preferred application and you cannot choose which. And also on my desktop it says:
"Error: no "edit" mailcap rules found for type "image/jpeg"
So, am I able to forse that "open with" window from console? If yes, can you say how?
Both on windows and mac you can do such things.
//edit at 2009-02-10 14:17
Thank you very much for answers. Command will be used in program code, so unfortunately probably I would not be able to make some extra bash scripts.
For GNOME:
gnome-open <file>
For KDE:
kfmclient exec <file>
These commands should open up the <file> in the preferred application in GNOME or KDE respectively, although I don't have an installation of either to test on.
Take a look at man run-mailcap, you can change or add selected applications for each mimetype modifying the /etc/mailcap, ~/.mailcap files and some others.
Traditionally, on Unix systens (and therefore Linux, too), you start applications from the console (and not from a UI). The command line (or console) expects you to enter the name of the application and then the filename (plus some options).
This allows to use applications (or commands) in shell scripts.
On Windows, there is no real console (the DOS box is just a reminiscence of the dark ages of MS DOS). So the MS developers came up with the idea to have the OS treat anything as a command. If it's not a real command or application, the OS will determine the file type (by extension on Windows and by some header information on Mac). For each file type, there will be an associated application in a look up table.
This is why on Windows, it appears that you can enter the name of a file on the console and you will get the application to edit that file.
If you want a quick way to fix this in the Unix console, create a script called "open" or "o" and use the file command with the option --mime to identify the file type. You can then use a case statement to launch your favorite editor.
As for the error about "mailcap rules": There is a file called "mailcap" on Unix where you can define abstract "commands" (open, edit, view, print) for file types. See the mailcap man page.

Resources