Terminal not recognizing vim as a command, batch file etc - windows

So I was watching a tutorial on laravel and the tutor in the vid enters the command on the terminal as shown in the picture. He said we can use touch command on mac but to keep compatible on windows he's using vim. I don't believe he has vim.exe on his laravel project folder. Project name is freecodeGram as in pic. How do i get my computer to understand the vim command. Thanks in advance, I'm on windows.
Command was: vim database/database.sqlite

You need to add the path to vim.exe to your system PATH. This would allow you to type vim ..... in the CLI and would execute vim directly. Otherwise, prefix vim database/database.sqlite with c:/path/to/vim database/database.sqlite

Related

Read only for open directories in vim

Then I open vim from terminal and open an directory like vim ., my starts in Read Only Mode.
I cant figure out why this happen and how I can change it.
If I start MacVim everything is fine. But then I start vim from the terminal and open a directory this screen comes. I can navigate one dir up and back again, and I have write access.
EDIT
I installed all my vim settings on Ubuntu 15.04. Now I can use
Does anybody know how to change this behaviour of vim?
Now I can use netw with the command vim . like I always used.
As you can see, there is no RO (read only) mark. How can
I have this in Mac on iTerm too?
What you see is exactly what you are supposed to see when doing $ vim .: the built-in netrw plugin displays a listing of the current directory that you can use to navigate your project.
If you don't want that listing, don't ask for it:
$ vim
or:
$ vim file
ctrl-p is not mapped by netrw; on my system, its set up by the yankring plugin. If vim is doing something other than going up one line, then you have a plugin involved. Try using :map to see what its mapped to; then do a search for that in your plugins directory.
The netrw way of opening a file in the same window is to use the <enter> key, although the g:netrw_browse_split variable may be used to change that default behavior.
Netrw opens in read-only mode, and that's not going to change. The file being opened should not be in read-only mode, however, if that's what you meant. If you're having a problem of that sort, please update your netrw; the most up-to-date version is at http://www.drchip.org/astronaut/vim/index.html#NETRW .
After I installed macvim 7.4 Every thing works!

How to run mysqldump under XAMPP on Mac OS

I want to run the mysqldump command in Mac OS, I am able to find the location of the file as "/Application/XAMPP/xamppfiles/bin".
But don't know how to exec the same from command prompt, as it says command not find, by simply typing it and executing it from the prompt/
The trick on *NIX systems when executing things is that you have to tell the shell exactly where the file is, or it must be in your $PATH.
This should work:
/Application/XAMPP/xamppfiles/bin/mysqldump
This would also work:
cd /Application/XAMPP/xamppfiles/bin/
./mysqldump
If you want to make it so you can just type the command without giving the location, add it to your PATH variable:
export PATH=$PATH:/Application/XAMPP/xamppfiles/bin
And then just run it!
mysqldump
Also on Mac you can simply drag and drop the file from finder right into the terminal. This will automatically type the path for you.

Can I open the ruby app from Rubymine terminal

I just got Rubymine and getting used to ruby on rails on mac. I'm wondering if there is any command to open a ruby app on Rubymine 7, from terminal.
Would there be a command like this?
$ Rubymine /Path/to/RubyApp
RubyMine has a special menu item for that. In ver. 8, 'Tools' > 'Create command-line launcher ...' Previous versions should keep the item somewhere around.
Once you've created command-line launcher (Tools > Create Command-Line Launcher), you can use the command mine via the command line..
e.g. If you have navigated to a folder via the command line, that you then want to open with Rubymine, you can run mine .
The standard way to do it on bash/OSX from the JetBrains site:
$<RubyMine> <path1> --line<number> <path2>
That's the launcher, the path to the project, the line you want the file to open to and the path to the file in order. An example would be: /Applications/RubyMine.app/Contents/MacOS/rubymine ~/RubyMineProjects/untitled45 --line 1 ~/RubyMineProjects/untitled45/sample.sass These can be pretty long commands, but you can create a symlink to shorten the launcher at least.
Keep in mind that launching from the command line launches with the ruby version you have set there as well as any other command line configs. If you want to keep configurations from the editor you should open the project the conventional way.
it's enough to append the following line into your ~/.bashrc or ~/.zshrc
alias rubymine="open -a rubymine"
reference Use Typora from Shell or Cmd
For RubyMine 2017.1.5, just type Alt + F12 for local terminal
Just go to folder where Rubymine is download.Then go to Rubymine bin folder. And run command from console. In my case
kashif#kashif-HP-ProBook-4520s:~/Downloads/RubyMine-2017.1.6/bin$ ./rubymine.sh
Previous answers didn't help me (using RubyMine 2020.1)
Instructions for Mac (different OSs also described on rubymine docs):
Create a script:
You can create a shell script with this command in a directory from your PATH environment variable. For example, create the file /usr/local/bin/rubymine with the following contents:
#!/bin/sh
open -na "RubyMine.app" --args "$#"
Tada! Assuming that script is executable (in case not - run chmod +x /usr/local/bin/rubymine) Now you are able to navigate to proper directory and run rubymine . to run RubyMine for that directory
If you want to play around with different args passed while starting RubyMine, check rubymine docs.

Yeoman returns 'env: node\r: No such file or directory'

I've followed these instructions to
installing Yeoman. Everything is fine until I cd into the directory and execute yo webappfrom the terminal (Also tried sudo yo webapp). It returns env: node\r: No such file or directory and I never reach the step to choose the kind of web app. Any ideas? On Mac Os 10.9. Updated Ruby, Node.js, Git. And from what I've read Yeoman installs Grunt and Bower.
I just came across this for a different project. I fixed it by opening the executing .js file (/usr/local/lib/node_modules/[project_name]/bin/[executing.js]) in vim and using the following command
:set ff=unix
Looks like the version of Yeoman you had back when this was asked used windows newlines \r\n. Because of this, at the top of the file, #!/usr/bin/env node actually resulted in the shell trying to run a command called node\r. (Note the carriage return on the end).
This is probably fixed by now, but this isn't a node issue, it's a windows-newlines-in-osx issue. The carriage returns should be replaced with \n newline characters.
open the script with vim.
:set ff=unix to modify the format of the file.
:wq! to save and exit.

Problem running smlnj under OSX 10.6

I downloaded and installed the SML NJ implementation using the DMG for x86 from here :
http://smlnj.cs.uchicago.edu/dist/working/110.72/index.html
However when I open a terminal window and go to /usr/local/smlnj-110.72/bin and run sml i get a bash command not found.
I am not very familiar with UNIX so I guess I am doing something wrong.
Thanks for the help!
Add the following line to your ~/.bash_profile
export PATH=$PATH:/usr/local/smlnj/bin
Then open a new terminal window and run sml.
After going to the /usr/local/smlnj-xxx/bin directory, you need to run ./sml
(as opposed to sml) because the current directory (.) is not on the default path on Unix.

Resources