Skip to content

Instantly share code, notes, and snippets.

@yokeshrana
Last active December 13, 2023 09:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokeshrana/a07a9d61f348c9a411f25a069c56ec94 to your computer and use it in GitHub Desktop.
Save yokeshrana/a07a9d61f348c9a411f25a069c56ec94 to your computer and use it in GitHub Desktop.
Customising vim for Mac OS (Big Sur)
1 :: Install Latest Cmake (Using the office dmg )
https://cmake.org/download/
Configure the paths for the cmake using the below command
sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
2 :: Default mac os vim lacks python3 support and many other features ,so we will be compiling vim with full features(can limit if u want)
Verify first if Xcode developers tools are installed or not ,if not this will install it in mac
xcode-select --install
Now lets just move on to compiling vim from source on our distribution.
mkdir -p .vim/src
git clone https://github.com/vim/vim.git .vim/src
cd .vim/src
make distclean
./configure \
--enable-pythoninterp=dynamic \
--with-python-config-dir=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config \
--enable-python3interp \
--with-python3-config-dir=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/config-3.8-darwin \
--with-features=huge \
--with-compiledby="yokeshrana https://github.com/hexnor" \
--enable-fail-if-missing
make
sudo make install
Verify vim installed correctly or not using "vim --version "
3 :: We will be needing a Plugin manager for installing the plugins ,there are many like vundle ,pathogen and others.
Right now we will be using the vundle plugin manager
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
We also need to update the vimrc file. Kindly place the attached vimrc file here ~/.vimrc
4 :: Installing YouCompleteMe for Code Autocompletion .
Just add "Plugin 'ycm-core/YouCompleteMe'" in the plugin section in vundle .
And install the plugin using
vim +PluginInstall +qall
cd .vim/bundle/YouCompleteMe
python3 install.py --all
In some environment there is issue with loading of python3 libs
set pythonthreedll=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/libpython3.8.dylib
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
" All of your Plugins must be added before the following line
" Adding my plugin start
Plugin 'ycm-core/YouCompleteMe'
" Adding my plugin stop
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
syntax on
set nu
set mouse=v
set tabstop=2
set autoindent
set shiftwidth=2
set softtabstop=2
set backspace=indent,eol,start
set t_Co=256
set background=dark
"vim cpp enhance
"
set pythonthreedll=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/libpython3.8.dylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment