I have the following two mappings in my vimrc file
nnoremap <C-j> :tabp<CR>
nnoremap <C-k> :tabn<CR>
Ctrlk works, but Ctrlj lands me in insert mode for some reason. If I issue the command :nnoremap <C-j> :tabp<CR> then Ctrlj works correctly.
If I issue the command :map or :verbose map I see the mapping for <C-k> but nothing for <C-j>. Why is this happening?
A plugin, imaps.vim was interfering with the command, most likely unmaping it (thanks to Benoit for pointing it out). If this happens to anyone else, just delete the plugin.
Related
I'm currently developing for a Ruby on Rails application. I am on a windows machine, using ubuntu through WSL. We have rubocop setup to track formatting on git pushes, and I always run into the same issue. When adding this comment to the top of any file, I receive the error Layout/EndOfLine: Carriage return character detected. The issue seems to be talked about here as well Layout/EndOfLine: Carriage return character detected. module TieConnector
# frozen_string_literal: true
The solution here seems to be to disable the warning, or manually convert the files before pushing.
Does anyone know if there is another solution here? I don't believe I can edit the rubocop settings as it is not my project. The converting method does work, but gets a bit tedious to do every time I make a new pull request.
Would there be a way to run the dox2unix convert when running git push while targeting the files staged for commit? Or a way to force my machine to use the unix encoding by default?
Any help is appreciated, thank you
It's a common issue on windows. If you are using vscode you can convert all your files to LF with this shortcut: ctrl + shift + P => 'change all end of line sequence' => Enter => Enter => Enter => 'LF' => Enter Then you can commit and push your code. If it still don't work you might see your git configuration, autocrlf in particular. See this response: stackoverflow.com/a/20653073/7542830
To solve it on a repository level:
git config --local core.autocrlf input (on you project root)
I'm using RubyInstaller2 (MSYS2 backend, not WSL) and ran into the same issue when RuboCop made some fixes (apparently is used CRLF instead of LF).
I fixed all the files in vim with :bufdo %s/\r//, but still got the error as the first character was still a CR (or CRLF).
Had to end up using dos2unix, as recommended in Layout/EndOfLine: Carriage return character detected. module TieConnector
[EDIT]: Error is intermittent on Windows due to missing BOM: https://github.com/rubocop/rubocop/issues/4669
I need to disable the zsh's COMPFIX process to suppress the following warning I see every time I open a terminal window:
zsh compinit: insecure directories and files, run compaudit for list.
The cause of the warning is not the issue here; I have two admin users on the same Macbook who both need to use homebrew. When files in /usr/local have group read/write privileges rather than single user privileges, the COMPFIX process flags them as insecure.
Other solutions suggest adding ZSH_DISABLE_COMPFIX=true to the top of my .zshrc file. I have done this and I still see the error. There are multiple .zshrc-like files in my home directory, including .zshrc.pre-oh-my-zsh and .zshrc~, and have tried adding ZSH_DISABLE_COMPFIX=true to each of these too, without success.
How can I successfully turn off this warning?
Try to add it at the beginning of the .zshrc file,
before sourcing oh-my-zsh
and put it in quotes like: ZSH_DISABLE_COMPFIX="true"
You likley just need to place true in quotes like so:
ZSH_DISABLE_COMPFIX="true"
Then reload your zsh settings with source ~/.zshrc
I had to add ZSH_DISABLE_COMPFIX="true" to my z.sh file (with or without quotes worked). Adding it to .zshrc file gave me an error message.
Hi I am trying to install the emacs rails reloaded mode from https://github.com/dima-exe/emacs-rails-reloaded.
As per the directions I have cloned the repo and added the lines to my .emacs file. However it asks for byte compiling by -
Next bytecompile, press [M-x] and type rails/bytecompile.
However I cant find that function, what do I do ?
Note that you should restart Emacs between the steps
After that add bellow code in your the .emacs file:
(setq load-path (cons (expand-file-name "~/.emacs.d/rails-reloaded")
load-path))
(require 'rails-autoload)
and
Next bytecompile, press [M-x] and type rails/bytecompile.
Also, before restarting, make sure that you have changed "~/.emacs.d/rails-reloaded" to the actual path where the file rails-autoload.el lives. If you cloned the git repository, that path name should almost certainly end in emacs-rails-reloaded (and not just rails-reloaded).
If that path is incorrect, Emacs will report an error when it tries to execute (require 'rails-autoload). If it is correct, M-x rails/bytecompile should work.
I'm going through an RoR guide, and i'm stuck at a problem in topic "Static Pages" and currently I'm using the text editor Sublime Text 2 and whenever i follow instructions and do:
$subl .
or try
$subl public/hello.html
it outputs:
sh.exe" subl: command not found
any help would be very much appreciated..
-Marc
if using ruby version manager (i am only assuming because i had this problem), then the suggested command for the symlink must be modified at the user path:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/.rvm/bin/subl
notice the .rvm directory has been added to the path.
I've had a similar issue, the paths in $PATH were correct, and when I browsed to my local bin folder:
cd /usr/local/bin/
I could see the subl file / shortcut.
After pening this folder in finder with:
open .
I could see the icon looked incorrect (white), perhaps a previous version. Double clicking it also gave an error, so I manually copied the subl file over, after expanding contents of the Sublime Text 2.app.
If you drag the file over, it will create a shortcut, if that doesn't work then first duplicate the subl file in its original position, then drag over the duplicate and rename correctly. Or just give the correct permissions on it.
Hope this helps
I am relatively new to dealing with command line issues, compiling programs, and UNIX. Coming from a PHP background, I just fired off MAMP and never worried about this kind of stuff.
I am diving into Rails, and running into some issues. I tried to create a .bash_profile in my home directory to create some shortcuts for myself. I added /usr/local/git/bin to my .profile file, but it seems to have no effect on my PATH variable inside a new terminal window (i.e. it only lasts the session).
The .bash_profile seemed to persist across logins, but once I had that setup, Rails stopped working as expected! I would run rails server in my application's root directory, and Rails would create a new app called 'server' with another directory tree inside my existing app. It does this even with an empty .bash_profile. But I delete the .bash_profile, and everything works like normal.
I am in over my head here - I have very little understanding of how this all works. Any advice on where to look? Or am I missing something obvious?
Post what you added to your .bash_profile. To pre-pend something to your path the syntax is:
export PATH=/usr/local/bin:$PATH
to append you swap the "/usr/local/bin" and $PATH
export PATH=$PATH:/usr/local/bin
After you make changes to your .bash_profile you can make them available in the current terminal session by running source .bash_profile. Then if you run echo $PATH you can see the updated PATH. You should try running rails --version in your different configurations to see if the version is changing. That may account for your odd behavior.
also checkout:
path-helper as extend PATH is sooo 2010