I'm working in vim and having a problem. On my primary macbook pro, I have vim running in iterm via macvim terminal mode. Normally, I can have multiple tabs open ie, tab1 is rails app a and tab 2 is rails app b, and I can yank y lines from tab1 and paste p them into tab2. On my macbook air, I can't seem to paste between tabs. I'm sharing the bundle dire and bash_profile between the two computers via dropbox so the configuration should be good. The one problem I think I'm noticing is that when I run vim --version on the correctly functioning machine, I get
VIM - Vi Improved 7.3 (date)
MacOs X (unix) version
Included patches: 1-754
compiled by usr#usr-macbook-pro.local
Huge version with MacVim GUI
and when I run vim --version on my mac book air, the non correctly functioning machine I get
V
IM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 23 2012 13:50:52)
Compiled by root#apple.com
Normal version without GUI. Features included (+) or not (-):
and I notice that in the correctly functioning machine the features list has +clipboard and in the non functioning machine the feature list has -clipboard. how do I change this to reflect the proper configuration on the macbook air?
Try running
brew install macvim --override-system-vim
followed by
brew link macvim
However, it looks like the version of vim you are using on your macbook air is not the macvim version you are looking for. It's the standard version of vim. What is the output of which -a vim? You may have to add macvim to your path on your macbook air before the builtin vim. What does echo $PATH output?
i just uninstalled macvim via homebrew and reinstalled it making careful to connect the symlink to the application folder correctly. everything now works.
Related
On my local PC I am running Ubuntu 20.10 with Vim:
:version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 11 2020 17:00:59)
Included patches: 1-716
In this version I can undo text with Ctrl + u open a file explorer with :Explore which is fine.
On another (remote) linux/ubuntu machine (where I don't have permission to install anything):
$ cat /proc/version
Linux version 4.15.0-1111-azure (buildd#lcy01-amd64-016) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)) #123~16.04.1-Ubuntu SMP Sat Mar 20 01:52:07 UTC 2021
and:
$ cat /etc/os-release
NAME=Buildroot
VERSION=2014.02
ID=buildroot
VERSION_ID=2014.02
PRETTY_NAME="Buildroot 2014.02"
I cannot use those Vim commands. E.g. if I:
:Explore
'Explore' is not implemented
and Ctrl + u does not work either. Further:
:help compatible
'help' is not implemented
I can get the version:
:version
1.22.1 2014-09-13 22:15:30 PDT
Its definitely another version of Vim(vi?) compared to the one on my host system.
Is it some vanilla/old/minimal version of Vi that's on this machine?
How do I know if its Vi or Vim (pretty limited info from :version)?
I can use the arrow keys to navigate so I expect its some minimal version of Vim.
Also on the remote machine:
$ which vi
/bin/vi
$ which vim
$ whereis vim
sh: whereis: not found
What you have on that host is neither Vim nor the original vi. It is "BusyBox vi", a partial reimplementation of vi that is part of the BusyBox project.
If you want Vim, you will have to install it yourself in your $HOME or ask the administrator of that machine to do it for you.
As a side note, the ubiquity of Vim (and vi) is a sadly common misconception.
POSIX-certified systems must have a vi command that follows the specs but how that command is actually implemented is left to the vendor. On some systems it might be the original vi, on other systems it might be a minimal Vim, or a maximal Vim, or nvi, etc. Then you have Linux vendors, who generally try to follow the spec but are not bound to it. Then you have VM/container-oriented distributions that tend to strive for minimalism and may not even have a vi command to begin with. And then you have Vim itself, which can be built with or without this or that feature and has never stopped evolving anyway so two Vims are rarely the same.
Outside of the world of containers, it is relatively safe to assume the presence of a vi command on a Unix-like system, but where the behaviour of that command lies on a spectrum from the vi spec to a complete GUI build of the latest Vim is pretty much a game of roulette.
In the world of containers, it is best to not assume anything.
I'm trying to figure out how to copy-and-paste between a file edited with Vim and the macOS Clipboard. Most instructions say to start by installing Vim using Homebrew as it will be installed with the clipboard option enabled (vim --version will display "+clipboard"). However, when I installed Vim using brew, the clipboard option was still set to "-clipboard". Can I force brew to reinstall Vim and turn this option on in the process? I'm using Homebrew 1.1.2 which installed VIM 7.4.
Because Homebrew no longer takes package specific options on the command line you need to edit the formula to add support for the clipboard back and then tell brew to install from source and not from a bottle.
brew uninstall vim
brew edit vim
# Add `"--enable-clipboard",` after the `./configure` in the list of other options.
brew install -s vim
Summarized from this solution:
https://coderwall.com/p/avmotq/gain-clipboard-support-for-vim-on-os-x
Expanding on Andy Ray's comment…
MacVim is a GUI program but it also comes with a TUI executable that can be run in a terminal emulator. Because that TUI executable has all the features of the GUI program, installing MacVim is by far the easiest and safest way to have a full-featured and well optimized Vim on Mac OS X:
Download the latest release.
Mount the disk image.
Drag and drop MacVim.app to /Applications/ or ~/Applications.
Put the mvim scriptsomewhere in your$PATH`.
[OPTIONAL] Add alias vim='mvim -v' to your shell's init script.
From your shell, you can do:
$ mvim foo.txt
to edit foo.txt in the MacVim GUI,
$ mvim -v bar.txt
to edit bar.txt in the MacVim TUI. Or, if you added the alias:
$ vim bar.txt
Now, to address your comment…
If you connect to your Mac from your Linux box, iTerm.app doesn't come into play and you can use whatever TUI program is installed on the Mac, including the Macvim TUI.
If you connect to your Linux box from your Mac, whether it is via iTerm.app or Terminal.app, the vim you are going to run will be the vim on your Linux machine so… what programs you install on your Mac doesn't matter at all as you won't have access to them anyway.
I'm trying to use slimv, which is recommended in the answer for another question of mine, under macOS Sierra. However, when I installed this plugin into ~/.vim/plugin, and ran vi test.lisp, I got the following error. The beautiful "Slimv" menu was also not shown.
sunqingyaos-MacBook-Air:plugin sunqingyao$ vi ~/.vimrc
Error detected while processing /Users/sunqingyao/.vim/plugin/ftplugin/clojure/slimv-clojure.vim:
line 196:
E117: Unknown function: SlimvInitBuffer
Press ENTER or type command to continue
Note that currently I don't have Clojure installed on my MacBook Air. All what I want to do is to debug some mit-scheme programs inside vim.
Here is the relevant part of ~/.vimrc:
let g:slimv_swank_cmd = '!osascript -e "tell application \"Terminal\" to do script \"mit-scheme --load ~/.vim/plugin/slime/start-swank.lisp\""'
Version information for vim:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2016 21:22:16)
Included patches: 1-898
Compiled by root#apple.com
I'm a vim newbie who don't know much about vim script, so please explain it in detail to me.
You shouldn't install it into ~/.vim/plugin, you should install it into ~/.vim because slimv has files in other vim directories outside plugin (e.g ftplugin, indent, syntax etc).
I am following the inspiring example here to setup Vim for R development. One difference is that I am running Vim and R on a remote server via ssh session. And this ssh starts byobu, which has tmux started automatically whenever I login. What I want is to make an Vim-R-Dev command/alias so that:
After logging in with the ssh and tmux is already running, I can type Vim-R-Dev to open up a window with panes look like in the attached image:
Illustration of sending R code from several vim viewports (in middle)
to an R session (on top right). The vim session can run on a local
computer, while the R session can run on the same or a remote system.
The snapshot also illustrates the omni completion utility of the
vim-r-plugin (purple box), viewing of an R function help document in a
separate tmux pane (bottom right) and the NERDTree file browser
(left).
After a while of fumbling with Vim and R, I decided to quit this approach. My feeling was that the combination is not mature enough for production. So I tried to find and found EMACS + ESS. Yes, emacs is the rival to Vim as a programmer/geek editor. And it seems I am a traitor of Vim jump to Emacs when the two are at war :-) It doesn't have to be that way.
At first I installed emacs and ess plugin/package and tried to learn the basics. I was very happy about how ESS is much more mature than vimR. And the way emacs works with packages and configuration make me much more happy than when I used Vim. This is partly because I have some basic background and was willing to deal with ELISP, the LISP programming language variant that is made for Emacs. An advice for some one have Vim skills though: You'd better off install Evil package from the beginning so you have the power of quick editing in Vim but the whole pack of other wonderful things, i.e. robustness, fine customization, in-place documentation. I have discussed many things about Emacs and ESS here on stackoverflow.com and at emacs.stackexchange.com too. The essential setup for R programmer is:
Emacs, ESS, Evil, Helm*, auto-complete, auctex, polymode, r-autoyas. Following are full list of additional packages that I installed. The one that allows me to edit and run code on remote server is called tramp with X forwarding. I will post more on this if there are requests.
ac-ispell 0.7 installed ispell completion source for auto-complete
async 1.3 installed Asynchronous processing in Emacs
auctex 11.88.6 installed Integrated environment for *TeX*
auto-complete 1.5.0 installed Auto Completion for GNU Emacs
auto-complete-e... 0.0.7 installed Exuberant ctags auto-complete.el source
auto-complete-pcmp 0.0.2 installed Provide auto-complete sources using pcomplete results
auto-dictionary 1.1 installed automatic dictionary switcher for flyspell
auto-package-up... 1.4 installed Automatically update Emacs packages.
auto-yasnippet 0.3.0 installed Quickly create disposable yasnippets
bash-completion 2.0.0 installed BASH completion for the shell buffer
bind-key 20140601 installed A simple way to manage personal keybindings
bog 1.0.0 installed Extensions for research notes in Org mode
bongo 1.0 installed play music with Emacs
boon 0.1 installed Ergonomic Command Mode for Emacs.
bug-hunter 0.5 installed Hunt down errors in elisp files
calfw 1.4 installed Calendar view framework on Emacs
column-enforce-... 20140902.949 installed Highlight text that extends beyond a column
column-marker 20121128.843 installed Highlight certain character columns
company 0.8.12 installed Modular text completion framework
ctable 20140304.1659 installed Table component for Emacs Lisp
ctags 1.1.1 installed No description available.
ctags-update 0.2.0 installed (auto) update TAGS in parent directory using exuberant-ctags
cython-mode 0.23.2.2 installed Major mode for editing Cython files
d-mode 2.0.6 installed D Programming Language mode for (X)Emacs
dash 2.11.0 installed A modern list library for Emacs
diminish 0.44 installed Diminished modes are minor modes with no modeline display
discover 0.3 installed discover more of Emacs
el-autoyas 0.5 installed Automatically create Emacs-Lisp Yasnippets
elpy 1.8.1 installed Emacs Python Development Environment
epl 71.4.8098 installed Emacs Package Library
ess 20150810.826 installed Emacs Speaks Statistics
ess-R-data-view 20130509.458 installed Data viewer for GNU R
ess-R-object-popup 20130302.336 installed popup description of R object
ess-smart-equals 20150201.2201 installed better smart-assignment with =-key in R and S
ess-smart-under... 20131229.1851 installed Ess Smart Underscore
evil 20150810.426 installed Extensible Vi layer for Emacs.
evil-leader 20140606.543 installed let there be <leader>
evil-org 20150513.1610 installed evil keybindings for org-mode
expand-region 20150804.2210 installed Increase selected region by semantic units.
f 20150605.927 installed Modern API for working with files and directories
find-file-in-pr... 20150722.2347 installed Find files in a project quickly.
flx 20140921.739 installed fuzzy matching with good sorting
flx-ido 20140821.2033 installed flx integration for ido
ggtags 20150718.2227 installed emacs frontend to GNU Global source code tagging system
gh 20150126.1125 installed A GitHub library for Emacs
git 20140128.241 installed An Elisp API for programmatically using Git
git-auto-commit... 20150404.751 installed Emacs Minor mode to automatically commit and push
git-commit 20150805.2024 installed Edit Git commit messages
git-commit-mode 1.0.0 installed Major mode for editing git commit messages
git-messenger 20150314.602 installed Pop up last commit information of current line
goto-chg 20131228.1459 installed goto last change
helm 20150805.54 installed Helm is an Emacs incremental and narrowing framework
helm-ack 20141030.526 installed Ack command with helm interface
helm-core 20150805.206 installed Development files for Helm
helm-github-stars 20150625.1523 installed Helm integration for your starred repositories on github
helm-mode-manager 20140224.1504 installed Select and toggle major and minor modes with helm
highlight-inden... 20150307.208 installed Minor modes for highlighting indentation
hippie-expand-s... 20130907.132 installed Hook slime's completion into hippie-expand
imenu-list 20150804.705 installed Show imenu entries in a seperate buffer
key-chord 20150808.1705 installed map pairs of simultaneously pressed keys to commands
latex-extra 20150806.1521 installed Adds several useful functionalities to LaTeX-mode.
latex-pretty-sy... 20150409.240 installed Display many latex symbols as their unicode counterparts
latex-preview-pane 20150519.1244 installed Makes LaTeX editing less painful by providing a updatable preview pane
let-alist 1.0.4 installed Easily let-bind values of an assoc-list by their names
log4e 20150105.505 installed provide logging framework for elisp
logito 20120225.1255 installed logging library for Emacs
magit 20150807.401 installed A Git porcelain inside Emacs
magit-gh-pulls 20150723.1144 installed GitHub pull requests extension for Magit
magit-popup 20150730.1344 installed Define prefix-infix-suffix command combos
makey 20131231.630 installed interactive commandline mode
markdown-mode 20150727.855 installed Emacs Major mode for Markdown-formatted text files
markdown-toc 20150715.914 installed A simple TOC generator for markdown file
monokai-theme 20150521.2257 installed A fruity color theme for Emacs.
org-ac 20140302.413 installed Some auto-complete sources for org-mode
org-autolist 20150118.1837 installed Improved list management in org-mode
pcache 20150125.1653 installed persistent caching for Emacs
php-auto-yasnip... 20141128.1411 installed Creates snippets for PHP functions
php-mode 20150729.213 installed Major mode for editing PHP code
pkg-info 20150517.443 installed Information about packages
polymode 20150729.734 installed Versatile multiple modes with extensive literate programming support
popup 20150626.711 installed Visual Popup User Interface
popup-complete 20141108.1908 installed completion with popup
popwin 20150315.600 installed Popup Window Manager.
powerline 20150628.1957 installed Rewrite of Powerline
powerline-evil 20140517.1 installed Utilities for better Evil support for Powerline
projectile 20150807.620 installed Manage and navigate projects in Emacs easily
pyvenv 20150503.941 installed Python virtual environment interface
r-autoyas 20140101.710 installed Provides automatically created yasnippets for R function argument lists.
real-auto-save 20150701.815 installed Automatically save your all your buffers/files at regular intervals.
rtags 20150804.2337 installed No description available.
s 20140910.334 installed The long lost Emacs string manipulation library.
scala-mode2 20150617.2350 installed Major mode for editing Scala >= 2.9
scala-outline-p... 20150702.937 installed scala file summary popup
seq 20150709.1040 installed Sequence manipulation functions
session 20120510.1700 installed use variables, registers and buffer places across sessions
skeletor 20150228.1557 installed Provides project skeletons for Emacs
sx 20150718.625 installed StackExchange client. Ask and answer questions on Stack Overflow, Super User, and the likes
twilight-anti-b... 20140810.34 installed A soothing Emacs 24 light-on-dark theme
undo-tree 20140509.522 installed Treat undo history as a tree
use-package 20150731.2330 installed A use-package declaration for simplifying your .emacs
which-key 20150803.1211 installed Display available keybindings in popup
window-purpose 20150715.439 installed Purpose-based window management for Emacs
with-editor 20150710.252 installed Use the Emacsclient as $EDITOR
yaml-mode 20141125.37 installed Major mode for editing YAML files
yasnippet 20150804.1120 installed Yet another snippet extension for Emacs.
yatemplate 20150305.1526 installed File templates with yasnippet
yaxception 20150105.652 installed Provide framework about exception like Java for Elisp
zygospore 20140703.152 installed reversible C-x 1 (delete-other-windows)
I installed Vim 7.4 in a Windows 8 machine and it was working fine. After installing all plugins in my .vimrc, GVIM crashed and it wouldn't open again. I could manage to use VIM from cmd but not without some errors. My first try was to reeinstall GVIM completely. After reinstalling, it worked fine but if I also reinstall my plugins it would crash and not open again. What should I do?
I removed all plugins and installed one by one until I got the error, which was with the Ultisnips plugin. I happen to know that this plugin requires VIM with Python support, which my VIM probably wouldn't have. To test this, run vim --version and look for a +python (or run echo has("python") from inside GVIM and look for a output of 1). In my case, it was -python, which was confusing, since I have Python installed. According to this answer, you need to install Python after installing VIM, so I did it and it worked.