Run gedit on OSX Mavericks? - macos

The Version of Gedit on the gnome.org site does not seem to run on OSX Mavericks. Is there any way to fix this?

When I tried it, the problem was the version of libxml2 packaged with gedit.
Use the command "brew install libxml2"
then cp /usr/local/Cellar/libxml2/2.9.1/lib/libxml2.2.dylib /Applications/gedit.app/Contents/Resources/lib/.
In the current version of brew, the directory has changed to 2.9.2 so:
then cp /usr/local/Cellar/libxml2/2.9.2/lib/libxml2.2.dylib /Applications/gedit.app/Contents/Resources/lib/.

Having MacPorts installed and comments from above I was able to simply rm /Applications/gedit.app/Contents/Resources/lib/libxml2.2* and it used the system/macports library instead of the bundled one without error.

Just to Revise:
Having macports installed correctly. (If you just updated from e.g. OSX Lion you need to migrate macports to your new Maverics OSX System, https://trac.macports.org/wiki/Migration)
Downloading gedit-3.2.6-3
sudo port install libxml2
and rm /Applications/gedit.app/Contents/Resources/lib/libxml2.2*
Open gedit and start Coding!
For my 13-inch, Early 2011 Macbook pro it worked just fine.
--
If you want to use gedit from Terminal:
add
alias gedit="open -a gedit"
to
~/.bash_profile

Gedit 2.30.2 works.
But your own plugin won't work on Gedit 2.30.2.

I dont know what your goal is, but i found a easier way with another program. If installing all of this starts to get tiersome (that's what i figured out at least, since xcode needed downloading and tampering), i found sublime text 2 to work very nicely.

I found that the version of "libxml2.2.dylib", distributed with Gedit 3.2.6 is outdated.
Install "Xcode" from the App Store (if you have not already done so), then:
$ cp -p /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libxml2.2.dylib /Applications/gedit.app/Contents/Resources/lib/libxml2.2.dylib

One solution (I'm still interested in others) is the following:
The latest version of Gedit (3.2.6-3)for OSX on the Gnome.org website crashes.
The older Gedit 2.30.2 still runs.

try version 2.26.3 of Gedit – it’s working for me on MOJAVE !
http://ftp.gnome.org/pub/GNOME/binaries/mac/gedit/2.26/
Darek

If I am guessing correctly, your aim is a GUI Text editor for convenience.
open /path/to/file
performs the same action as of double clicking on the file from Finder
Also if you want to use it with a specific application like sublime text
open -a 'Sublime Text' /path/to/file

Related

Unable to open terminal in mac

I am unable to open the terminal or iTerm in my Mac OS, since my last update using brew. Not sure what I upgraded using brew :(
Below is the error message I get when I open terminal. Any help is much appreciated.
dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/bin/bash
Reason: image not found
[Process completed]
Thanks in advance!
The problem is two fold:
Upgrade bash from brew, using "brew upgrade bash"
The solution (aka step 1) requires Terminal to be opened, which doesn't.
So this is what I did. As it turns out the old bash version is incompatible with the newer upgrade of readline. So the deal is to hunt the location of readline in finder.
In my case, it is at /usr/local/Cellar/readline
Inside the above readline directory I found two directories: "6.3.8" and "7.0".
I renamed "7.0" to "7.0-old"
Created new directory "7.0" and copied contents of "6.3.8" in it.
Hurray! The Terminal now opens-up.
Now, run "brew upgrade bash" from terminal. And in the mean time, restore the readline directory to previous state like below:
Delete "7.0" directory you created
Rename "7.0-old" to "7.0"
You're now good to go. Cheers!
I found that the above solution did not work in my case.
Here is what did work:
Open the default Terminal app, then click on Preferences
change "Shells open with" to /bin/bash
quit terminal
open terminal again, you should be back to a prompt now
Now, run brew upgrade bash from terminal
Don't forget that you may also need to update your Terminal preferences if you've specified a custom shell path there (which I had totally forgotten about):

installing .net core on mac

I am installing .net core on a mac and hoping to play around with it a bit on vs code. I am following the steps from
https://www.microsoft.com/net/core#macosx.
However, when I run
dotnet new
I get command not found on bash.
I have followed these previous steps
brew update
brew install openssl
brew link --force openssl
I have also downloaded the core package (installed successfully). I do not see any other steps. Wondering if I am missing a step or how to identify what is missing?
Sometimes I am not sure why the installer doesn't add the PATH to your environment.
Run below in terminal and reopen the terminal:
echo 'export PATH="$PATH:/usr/local/share/dotnet"' >> ~/.bashrc
(Note: If you are using zsh or other shells, please change the above ~/.bashrc to the initialize script of your shell, e.g. ~/.zshrc)
I ran into this same problem earlier today. The fix for me was to close out all Terminal windows, open a new one, then re-run the command.

Update OSX Vim using MacVim

I'm trying to update Vim (for use in Terminal) on my Mac. It's currently running version 7.3, but YouCompleteMe requires Vim 7.3.584, and won't run even though it's installed.
I've tried using a Vim alias in my .bash_profile:
alias vim='/Users/Conor/Applications/MacVim.app/Contents/MacOS/Vim'
However none of my Vim plugins are launched when I run Vim like this, any my vimrc file isn't recognised either.
How can I get this alias to recognise my existing Vim settings? Or is there a better way of upgrading Vim for mac?
The *.tbz that you downloaded from the official page contains a mvim script.
Once you have moved that script somewhere in your $PATH you can start the MacVim GUI like this:
$ mvim filename
and the MacVim CLI like that:
$ mvim -v filename
From there the only thing you need is to change your alias to point to mvim:
alias vim='mvim -v'
The original built-in Vim and its runtime files stay untouched, MacVim uses its own runtime files located in the MacVim.app bundle and both honor your personal config (assuming they are located where they should be: ~/.vimrc and ~/.vim/).
Quick, clean and painless.
If you installed MacVim with HomeBrew you can use
brew install macvim --override-system-vim
If you just want pure vim with python support do:
brew install vim --override-system-vim --HEAD
I had the same issue as you, but this worked like a charm. You complete me works perfectly after this.

How do I get autochdir to work on a Mac when running Vim from the terminal?

In MacVim autochdir works without a problem. However, lately I've been running iTerm2 (full screen with split) for coding and the lack of autochdir is really bothering me. Any solutions? Thanks.
What do you mean by "the lack of autochdir"? It works fine both in CLI and in GUI.
If you have set autochdir in your ~/.vimrc this feature will work the same way whether you are in MacVim or iTerm2 or Terminal or whatever.
But I suspect you are changing dirs in an iTerm2 split and expecting Vim to somehow learn about that change and change its pwd accordingly. Am I right? "Unfortunately" Vim doesn't know about the second iTerm2 split and can't react to your cd there.
In the terminal:
> which vim
If it says /usr/bin/vim, you're using the mac base installation. This is an old version of vim and doesn't support autochdir. You'll need a newer version.
Check if you have another installation of vim by running:
> /usr/local/bin/vim
If so, add /usr/local/bin to your $PATH before /usr/bin
If not, install it:
> brew install vim

upgrading console emacs (/usr/bin/emacs) on Mac

I extensively use /usr/bin/emacs in Terminal.
I have Emacs 22 and I'd like to upgrade it to 23. I wonder how to do it.
Googling "emacs download mac" gives me Emacs.app which has its own window and user interface, but I don't want that.
I am not sure how I have /usr/bin/emacs in the first place, maybe it came with Mac OS?
You can run the Emacs.app version in a terminal like this:
/Applications/Emacs.app/Contents/MacOS/Emacs -nw
In my .cshrc file, I use an alias to make this easier to invoke:
alias enw '/Applications/Emacs.app/Contents/MacOS/Emacs -nw'
It is a standard editor included with OS X and a lot of other *nix systems along with vi/vim, and pico. Personally i wouldnt upgrade the pre-installed one. I would install from Macports, Fink, or Homebrew or compile from source myself to a different location (like /usr/local).
Install emacs from macports.
% sudo port install emacs
Then launch it from the terminal
Or you can install Emacs.app, follow the instructions here to create a ~/bin/emacs script and then launch as emacs -nw or any other options.
#!/bin/sh
exec /Applications/Emacs.app/Contents/MacOS/Emacs "$#"
I was on this same search and ended up installing with Homebrew so I could get the latest version along with several libraries, as described in this answer at the Emacs Stack Exchange site:
Nowadays, I use just GNU Emacs snapshot builds. These have reasonably good OS X support, and are by far the easiest to install, and best supported by the community.
I used to get them from Emacs for Mac OS X, but now I use Homebrew, because it supports more libraries, notably GNU TLS for encrypted network connections.
All in all: Use brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick :).
(Note that GNU Emacs is what comes preinstalled on Mac OS X, at least on mine as of 10.10.5)
This added a new Emacs binary at /usr/local/bin/emacs, leaving the existing installation and /usr/bin/emacs in place.
I created a symlink in /usr/local/bin pointing to the new version of emacs which was in Applications/Emacs.app/Contents/MacOS/
For those who installed Emacs from source (or any other way that doesn't overwrite command line called emacs) and want to use this version in the command line, I suggest one of these two approaches:
ln -s ~/path/to/cloned/emacs/src/emacs /usr/local/bin/emacs
make sure /usr/local/bin is in your $PATH and located before /usr/bin, by executing echo $PATH
if it is not, add line export $PATH=/usr/local/bin:$PATH to the file ~/.bash_profile, then refresh $PATH by executing in the terminal source ~/.bash_profile
add ~/path/to/cloned/emacs/src to your $PATH.
for example, add line export $PATH=~/path/to/cloned/emacs/src:$PATH to the file ~/.bash_profile, then refresh $PATH by executing in the terminal source ~/.bash_profile
And yes, MacOS is shipped with many packages pre-installed. But, unfortunately, usually with outdated ones and no official package manager to easily upgrade those libraries. That's actually why we have Homebrew, Macports, maybe others: they serve us as MacOS package managers.

Resources