Can't find gtags layer default key bindings - key-bindings

I was trying to include the Gtags layer to make use of it in my spacemacs setup like I learned to do with vim+ctags in a given project.
Followed the instructions from: https://www.spacemacs.org/layers/+tags/gtags/README.html and included the layer in my ~/.spacemacs 'dotspacemacs-configuration-layers'. But even after restarting it I could not find the 'SPC m' key bindings to use its features.
I also tried setting (gtags :variables gtags-enable-by-default t) to have it enabled by default but apparently it did not work as well.
How do I get access to those 'SPC m' key bindings?
No 'm' option

Did not find a way to solve my gtags issue, but found another solution using etags-select.
As long as I do generate my TAGS file using the "-e" flag to be Emacs compatible, then I can navigate using tags.
cd /path/to/my/project
ctags -e -R .
It solved the my issue :)

Related

Why do I get different runtimepaths depending on which API I use?

I'm trying to run Neovim 0.8.1. on a Windows 11 environment.
My setup is really minimal:
I downloaded nvim-win64.zip (of version 0.8.1) from Neovim's releases page on Github.
Extracted it and moved it to a folder at C:\test\nvim-win64
Started up Neovim by executing C:\test\nvim-win64\bin\nvim.exe
Not using any custom config.
When inspecting my runtimepath, there are 2 ways of doing this:
Using :set runtimepath? (the Vimscript way). This gives me:
runtimepath=~\AppData\Local\nvim,~\AppData\Local\nvim-data\site,C:\test\nvim-win64\share\nvim\runtime,C:\test\nvim-win64\share\nvim\runtime\pack\dist\opt\matchit,C:\test\nvim-win64\lib\nvim,~\AppData\Local\nvim-data\site\after,~\AppData\Local\nvim\after
Using :lua print(vim.inspect(vim.api.nvim_list_runtime_paths())) (the Lua way). this gives me:
{ "C:\\test\\nvim-win64\\share\\nvim\\runtime", "C:\\test\\nvim-win64\\share\\nvim\\runtime\\pack\\dist\\opt\\matchit", "C:\\test\\nvim-win64\\lib\\nvim" }
As you can see, it seems like using the Lua way I'm missing the local config directories in my runtimepath (the ~\AppData\Local\* paths).
Why am I seeing this difference? This is blocking me from using XDG_CONFIG_HOME to use my own config that I typically use, because it seems like it does not get included in the nvim_list_runtime_paths list, but it does appear in :set runtimepath?.
Nvim api function filters out non-existent directories. So there's a difference.
My issue was that my employer had decided to put ( and ) characters in my %USERPROFILE% environment variable, which ended up breaking a bunch of stuff (including the list I got from nvim_list_runtime_paths).
Putting those characters in %USERPROFILE% is a bad idea for many reasons, so I moved all of my files and folders out of any (sub)directory in %USERPROFILE% and right in C:\.
I also had to define XDG_CONFIG_HOME, XDG_DATA_HOME and XDG_STATE_HOME to point to a different location than the default location (which default within %USERPROFILE%).
This made all of my troubles go away!

Source env variables from bitbake-made sdk using Fish

When you compile a SDK using bitbake and have to source like :
source /opt/poky/.../environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
It can't be accomplished through fish, which is expected as the export sintaxe is different (i.e. set -x ...). I tried even to add #!/bin/bash on the first line, which also doesn't work. Does anyone knows a good way for it?
Workaround: Nowadays I run a bash inside the fish prompt to be able to compile binaries, which is not the best way but works. Don't let those small things push oyu away from fish :)
#charego mentioned some good ideas, thanks! :)
Fish-bax
So you can run it as:
bax 'source /opt/poky/.../environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi'
The only down side is that the auto completion does not work inside quotes, so one will need to write the whole path to the file. Although it's still better to have a fish running on top of a bash.
Bass
Bass did not worked, as it crashs with: Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings'
Foreign-env
Foreign-env also didn't work. It's possible to to set the variable, although it threw warning:
warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]
and it does not compiles, probably it misses a few variables to export.
TL;DR Go with Fish-bax, at least it works :)

Ubuntu 20.04 mate marco hard coded key binding

I use ubuntu 20.04 with mate (then marco). Up to now (pre-20.04) I could bind Mod4+S to my liking (Win+S). After 20.04 upgrade I discover that this Key shortcut Mod4+S is kinda 'hard-coded' to run mate-search-tool, and my explicit binding from [ControlCenter][Keyboard shortcuts] is not honored (ignored).
The problem exhibit itself as marco spitting the following message
"Failed to execute child process mate-search-tool (No such file or directory)"
Or if I install mate-utils (that I don't need) it run mate-search-tool.
I double checked the decong editor (gsettings) for any hidden 'run-command' mapped on key Mod4+S key but could not find any.
So at the moment I call it an hard-coded key binding.
I'd like to bind Mod4+S, any pointers appreciated.
Cheers
The key seems to be /org/mate/marco/keybinding-commands/command-6.
I didn't find a way to completely disable it but at least if I set the command I want in place of mate-search-tool it works.
It looks, there are multiple keybindings in mate which are not exposed in control center / keyboard shortcuts config. For me, most of them are unwanted. To change or remove them install dconf-editor and go to /org/mate/marco/global-keybindings/ path, where you can find multiple run-command-X keys. To disable them just set disabled string instead of existing keybinding.

How to get Swagger UI to use my titles?

I am using Swagger-php and Swagger-UI and it all works just fine but for one annoyance. The UI that Swagger-UI creates has the expected click-to-expand sections for my API routes, but the title of each one appears to be the JSON file generated and not any name I can give it. After the title, the description is the one I give in my annotation, but the title I seem to have no control over.
So if I have routes that begin with a resourcePath of /foo, and a description that says "Foo API Functions," the UI looks like:
foo.json : Foo API Functions
I don't want "foo.json" I'd much rather specify what this says. Like just "Foo" or even "Foo Functions" and then change my description to something more meaningful like, "This is where you find the foo functions."
Am I missing which annotation to use for this?
If you manually edit the api-docs.json file. You can replace the .json with .{format} and all will display correctly and function correctly. Not sure why the .{format} is not inserted by default. Slightly annoying.
I too ran into this problem, but I couldn't find anything on either theswagger-php or swagger-ui github pages mentioning this. So, I wrote a short build script (assuming a Unix-like OS) as a work around, which will first build all the docs using swagger.phar and then run sed to do an inline string replace on the problematic string. Here is what I did below:
#!/bin/bash
# write API documentation from "src" directory to the "docs" directory
/usr/bin/php swagger.phar src -o docs
# replace instances of "json" with "{format}" to fix swagger-php formatting issue
sed -i -e 's/json/{format}/g' docs/api-docs.json
Fixed in swagger-php 0.9.1
I don't know why swagger-ui strips out ".{format}" but not ".json"
The .{format} was not inserted by default because it might be confusing. It suggests the presence of different formats and swagger-php only supports the json format.

How to get the rails.vim-command :Rview working with .js.erb-views?

I want Rview to jump to .js.erb-views as well.
It always says "Can't find file "app/views/examples/foo".
The help says:
rails-template-types
Commands like :Rview use a hardwired list of
extensions (erb, rjs, etc.) when searching for files. In order to
facilitate working with non-standard template types, several popular
extensions are featured in this list, including haml, liquid, and mab
(markaby). These extensions will disappear once a related
configuration option is added to rails.vim.
Since the view ends with .erb, i would suggest it should work.
Any Ideas?
This is strange, I just checked in my vim and it works fine. I use Janus, but I think that the standard vim + rails.vim should work well.
Maybe you need to update rails.vim?
And you can tell the sequence of your actions: the current file, typed commands, etc.

Resources