Set path to applications for vim on mac capitan - macos

I have used vim to make small scripts in python and typesetting things in LaTeX. So it is very useful to run applications from vim by typing :!python or :!pdflatex etcetera. But after upgrading to el capitan, this seems not to work anymore, get message like /bin/bash: pdflatex: command not found. But the funny thing is that it is possible to run the applications directly from terminal. Anyone that know how to set the correct that for vim as well?

$PATH variable not properly set in gvim/MacVim when it is opened from the finder
first check :!echo $SHELL and see if SHELL is set to bash or not
then try to set your path in your ~/.bash_profile?
export PATH=<dir_contains_pdflatex>:$PATH

Related

Running Octave-cli on Iterm/Zsh/Omgzsh in Mac OSX

It feels impossible to get it to run on any custom terminal. I know that octave-cli.app is there but it always opens in the standard terminal. Any ways to execute octave scripts like a compiler (or) run it interactively like an interpreter from Iterm?
Using Mac OSX 10.9+
Edit:
I know how to export path variables. But having searched the web can't find a way to do it. Is it even possible? I even tried it using homebrew to no avail.
You can see the content of octave-cli.app, it's a script. Mine goes like this
open -a Terminal.app /usr/local/octave/3.8.0/bin/octave | logger 2>&1
It specify the terminal application used to open octave. This is the reason of your problem, as I think.
The solution is linking octave-cli in system path, better locates at "/usr/local/bin". like
ln -s /usr/local/octave/3.8.0/bin/octave-cli /usr/local/bin/octave-cli
Finally, octave can be accessed via any terminal(like iTerm) or shell(bash, zsh) by just type "octave-cli" command, which will be searched in system path and found to executed directly.

Catch-22 UNIX Shell Zsh

I was fooling around with .zshrc files, and now I am locked out of my terminal with "No such shell function 'accept-line'".
It would be easy to just go and undo the change in the .zshrc file, but my terminal autoloads into zsh, so there is no way to edit the dotfile.
I have looked all around for a way to edit hidden files in El Capitan, but to no avail.
From your mention of 'El Capitan' I infer that you might be on OS X and using Terminal.app? If so, please add a tag for that, or state that clearly.
If so, you could duplicate a Terminal profile in the preferences and under Settings->Shell / Startup set e.g. /bin/bash as the command and untick "run inside shell". That should give you a bash which will ignore .zshrc.
Otherwise, look for similar settings in your terminal emulator. Most should have such a setting somewhere.

Setting the default terminal editor on a Mac running Yosemite or El Capitan

I have read any number of posts explaining how to set the default editor for the terminal on a mac o stackoverflow. They all describe the same thing inserting a line in .bash_profile (or sometimes .bashrc) like:
export EDITOR='/Applications/TextWrangler.app'
or:
export EDITOR='/Applications/TextWrangler.app/Contents/MacOS/TextWrangler'
Nothing works. The terminal continues to default to TextEdit.
Has apple set this profile somewhere else in a way that overrides .bash_profile?
Can someone help me with this?
According to the man page for open:
-e Causes the file to be opened with /Applications/TextEdit"
In any case, open is an OS X command which will use the associations that are set for the file, the same as Finder does. The only things that will obey EDITOR are command line programs designed to run in a Unix environment.

Can't seem to change default editor in OSX Lion terminal

I can't seem to change the default bash editor in OSX Lion terminal.
I've tried setting:
export EDITOR='<editor symlink with parameter>'
in both ~/.bashrc & ~/.bash_profile . The symlink is subl, and the parameter is -w.
from the prompt it is:
subl -w
I have restarted terminal after each but every time I enter:
edit test-file.md
it opens TextWrangler (not the editor I've set). I've tried opening the symlink from the command line with no problem. I realize that I should probably just get used to typing the symlink, but the anal side of me wants to know why I can't set the default editor.
Any help with this trivial problem would be appreciated, thanks in advance!
I'm not even sure what edit command is. i don't have in on my Mac OS X Lion. Whatever it is, sounds like it ignores the EDITOR env variable and uses your MacOS X application settings.
What you want can be accomplished with the alias shell command though:
alias edit=/path/to/vim

Weird character zsh in emacs terminal

When using the terminal in emacs (M-x term) under MacOS for some reason it always posts the characters 4m before every line in zsh and always prints 2 lines containing the user info such as
4m--(jesus#laptop:/dir)----
4m--(jesus#laptop:/dir)----
prompt>
It's more of an annoyance than anything but I was just wondering if there's a way to fix this. I also seem to have issues in Zsh in Mac OS emacs terminal mode when a lot of output is written to it it seems to reduce it all to one line and constantly overwrite the same line (may be related as the 4m is possibly just a special character that emacs is treating differently which can affect formatting).
If need be I can post my .zshrc and .emacs files.
You don't have eterm-color terminfo.
First, you try to add following S-exp in your configuration file and evaluate.
;; Use Emacs terminfo, not system terminfo
(setq system-uses-terminfo nil)
If problem is not resolved previous setting, you should create eterm-color terminfo
by using following command. (terminfo path may different from your system)
# If you use Cocoa Emacs or Carbon Emacs
tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti
I needed to set the following environment variables in my ~/.zshrc
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export TERM=xterm-256color
This installed eterm-color.ti for me on OSX Mavericks 10.9.5:
Upload eterm-color.ti to /tmp on the remote OSX server.
Run the command sudo tic -o /usr/share/terminfo /tmp/eterm-color.ti on the server.
In my case, this put a file eterm-color in the directory /usr/share/terminfo/65/

Resources