$ brew install vim
$ git clone https://github.com/oliverxchen/vim-config.git ~/vim-config
$ cd ~/vim-config
$ ./setup_vim.sh
$ brew install grip
- Slime: open a new pane in terminal along with vim, start a named screen session (eg
screen -S vim_out
), back in vim select text and<Ctrl-cc>
will send text to the screen session. If you don't select text, the whole paragraph will be sent. - CtrlP:
<Ctrl-p>
for a fuzzy file finder. - NERDTree: to open a folder explorer,
:NERDTree
within vim. - Markdown preview: When editing a markdown file,
<Ctrl-m>
. Preview will appear in Chrome.<Ctrl-m>
to refresh. - There will be an error on startup of vim 8 if you don't follow these steps:
- Find out what python version vim is using:
:pythonx import sys; print(sys.path)
- Note that path. As of this writing it was:
/opt/homebrew/opt/[email protected]/
. - In a terminal, pip install pynvim to that python version (which is not the global python version):
PATH="/opt/homebrew/opt/[email protected]/bin:$PATH" pip3 install pynvim
- Find out what python version vim is using:
Execute the following command in a terminal to allow holding a direction to scroll:
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
For cursor, find the app address:
cd /Applications
mdls -name kMDItemCFBundleIdentifier Cursor.app
And then use the output with the defaults write
command.
Add the following to VSCode's settings.json
to be able to yank into the system clipboard:
"vim.useSystemClipboard": true
Go to the command pallete cmd+shift+P and select: "Preferences: Open Keyboard Shortcuts (JSON)" add to the keybindings.json file
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+j",
"command": "workbench.action.terminal.focus"
},
{
"key": "cmd+j",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "cmd+r",
"command": "workbench.action.terminal.runSelectedText"
},
{
"key": "shift+enter",
"command": "-python.execInREPL",
"when": "config.python.REPL.sendToNativeREPL && editorTextFocus && !accessibilityModeEnabled && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && editorLangId == 'python'"
},
{
"key": "shift+enter",
"command": "-python.execSelectionInTerminal",
"when": "editorTextFocus && !findInputFocussed && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'"
}
]