Is there a canonical/robust way to use cquery with spacemacs?
I recently swiched from vim to spacemacs and am not yet very familiar with emacs/spacemacs configuration/customization.
I have used cquery with vim before.
My projects have a compile_commands.json.
Related
I'm new to coding and I'm using the Express framework in Sublime.
When I create .ejs files, (for example footer.ejs) for some reason Sublime shows these files as Plain Text files, instead of .ejs files, even though I have NPM installed ejs.
Furthermore, when I click on "Plain text" in the bottom right of Sublime, EJS doesn't show up as an option.
My package.json shows that I have ejs installed: "ejs": "^2.5.9".
Does anyone know what I'm doing wrong? And how I can get .ejs files to automatically default to EJS instead of plain text? Thanks!
The short version of the answer to your question is that installing a package via npm doesn't have any effect on Sublime. In order to add support for EJS to Sublime you need to install a package for it in Sublime.
Package Control has a couple of packages, EJS and EJS 2 (and maybe also Hyperloop EJS, if that's a thing; I'm unfamiliar with EJS).
Just at first blush it seems like EJS 2 might be the better first bet; it's been more recently updated and is using the newer sublime-syntax syntax format and seems to support more things. Take that with a grain of salt though, since I have no experience with either one.
You can select the command Package Control: Install Package from the command palette and then select one of those packages to install it. If you're going to try them both, do it one at a time and use Package Control: Remove Package before installing the next one so that they don't compete with each other.
If those commands aren't in your command palette, you don't have Package Control installed yet. In that case you can select Install Package Control from the command palette to install PC first. If that doesn't work there are also instructions on how to install it manually.
Once you have a package installed, you can close and reopen the file to apply the correct syntax, or use the menu as you mention in your question.
Let's make it short and simple.
Syntax highlighting and auto completions are not great if you were to download ejs package.
Instead I recommend you to use html syntax highlighting.
Open Command pallet using ctrl+ shift + P or cmd + shift + P.
Set Syntax: HTML
How do I get Intellij to treat any file without an extension as bash syntax?
I've tried several proposed solutions such as adding bash support module with no luck.
I want to follow from
class ApplicationController < ActionController::Base
to
/home/slavik/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.0.rc6/lib/action_controller/base.rb
and look to commented reference of possible usage this class
Yes, there is at least one way. You can use exuberant ctags in combination with the tags option of Vim. Pratically, you have to execute ctags in the /home/slavik/.rvm/gems/ruby-1.9.2-p290/gems/ like :
ctags -R tags
See ctags --help if you want to dig into tags customization. Then you have to add this file to your tags path in vim. Using something like the following:
:set tag+=/home/slavik/.rvm/gems/ruby-1.9.2-p290/gems/tags
In order to understand how powerful this vim features is take a look at Browsing_programs_with_tags.
There are couple of issues with ctags which has pretty old and ugly parser:
Ctags doesn't deal with: module A::B
Ctags doesn't tag (at least some of) the operator methods like ==
Ctags doesn't support qualified tags, -type=+
Ctags doesn't output tags for constants or attributes.
I would recommend better project ripper-tags based on official Ruby parser called Ripper which is included in Ruby. It is fast and accurate: https://github.com/tmm1/ripper-tags
You can also install gem-ripper-tags to have tags files automatically generated after gem installation: https://github.com/lzap/gem-ripper-tags
Please note that these days, August 2013, there is a big refactoring of ripper-tags which can lead to change of command line options or gem-ripper-tags interface. If things are not working, update both gems in couple of days and read help screen to learn new options.
ripper-tags sounds great but is having issues as of today (November 2013).
I ended up using exuberant ctags (with a few tricks)
1- install exuberant ctags. If you're using osx, this article shows a little trick:
http://www.runtime-era.com/2012/05/exuberant-ctags-in-osx-107.html
2- If you only wish to include the ctags for the files in your directory only, run this command in your directory:
ctags -R
This will create a "tags" file for you.
3- If you wish to include the ctags for your gems (this has been really helpful for me with RubyMotion and local gems that I have developed), do the following:
ctags --exclude=.git --exclude='*.log' -R * `bundle show --paths`
credit: https://coderwall.com/p/lv1qww
(Note that I removed the -e option which generates tags for emacs instead of vim)
4- Add the following line to your ~/.vimrc
set autochdir
set tags+=./tags;
(Why the semi colon: http://vim.wikia.com/wiki/Single_tags_file_for_a_source_tree )
5- Go to the word you'd like to follow and hit ctrl+] . hit ctrl+o to go back (https://stackoverflow.com/a/53929/226255)
Currently Textmate uses Safari's Webkit to render the hmlt outputs for both commands and the live webpreview window.
Unfortunately for one specific project I am working with specific javascript API supported only be Firefox's gecko or Chrome's Webkit, it seems Safari still not supporting it.
Perhaps there's a way to globally change Safari for Chromium or Webkit Nightly?
A support member of TextMate kindly answered my email asking for it by mentioning this url which definitely points to the right solution. I really didn't think it could be done so seamlessly and now I am very happy that it is possible.
Basically there are few steps to follow:
$ cd /Applications/TextMate.app/Contents/MacOS/
$ mv TextMate _TextMate
$ vim TextMate
new TextMate file contains (note that you might want to change the path for the new webkit framework to fit the one you like)
#!/bin/bash
env DYLD_FRAMEWORK_PATH=/Applications/WebKit.app/Contents/Frameworks/10.6/WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES /Applications/TextMate.app/Contents/MacOS/_TextMate
after saving the newly created file:
$ chmod a+x TextMate
Close/Run TextMate :)
Or obvious if you just want to do this for each session you can simply use the bash command right away from terminal like this:
$ env DYLD_FRAMEWORK_PATH=/Applications/WebKit.app/Contents/Frameworks/10.6/ WEBKIT_UNSET_DYLD_FRAMEWORK_PATH=YES /Applications/TextMate.app/Contents/MacOS/TextMate
This is really cool...one thing I've noticed after that is that my themes are no longer being displayed, have no clue about it but I will try to check the cause.
try this - http://wiki.macromates.com/Main/Howtos#SafariPreview
I am using the vim plugin for IntelliJ Idea.
Where should I place the .vimrc for that plugin.
Using Windows XP
The latest version of the plugin will read settings from a file named .ideavimrc in the home directory.
On *nix, the home directory can be accessed at ~.
On Windows, you can use the %HOMEPATH% environment variable. (Normally, "C:\Users\<User Name>" or "C:\Documents and Settings\<User Name>", depending on your Windows version.)
If you rename your .vimrc to _ideavimrc in your ~ directory (/Users/ in windows)
Underscore is used instead of the . in windows for vim apparently
IntelliJ will honour it
Was tearing my hair out for a while getting this to work.
On my mac i simply ran ln -s "$HOME/.vimrc" "$HOME/.ideavimrc" to create a symlink so IntelliJ would use the same .vimrc as my standard vim.
My .vimrc is very simple. However, if there is config that is incompatible between IntelliJ and vim then you might have issues with this approach.
echo %homepath%
gives me my "home directory" on Windows XP,
where I need to put my .vimrc.
Unfortunately, the vim plugin for JetBrains doesn't effectively support the full functionality of a .vimrc. The file that the plugin uses is called .ideavimrc. This is what you should use and it should be placed in your home directory (see this other answer for details, particularly for Windows).
I have a very comprehensive .vimrc that I use. Unfortunately, I had to pare that down quite a bit to work as .ideavimrc. You can look at the gists to see the differences. For what it's worth, it's still provides nice functionality, including buffer switching across tabs and splits.
.ideavimrc
.vimrc
So why not just use the same file (i.e., .vimrc) for both? Well, for one thing, you need some settings in .ideavimrc that give precedence to the vim plugin for certain keyboard shortcuts that conflict with the IDE. See the top of my .ideavimrc for my settings (for example, sethandler <C-B> a:vim). The other thing is that it seemed that when my more complicated .vimrc couldn't be processed, other settings (such as just set noerrorbells) also wouldn't take effect.