Skip to content
Hans Chen edited this page Dec 5, 2020 · 4 revisions

Tips and snippets shared by users

This is a collection of tips and configuration snippets shared by users. Note that anyone can edit this page, so make sure you understand what the commands do before you add them to your .vimrc.

Open IPython in the current working directory

These settings will make Vim set its global current directory to match the location of the current buffer, and map <Leader>st (<Leader> is \ by default) to launch IPython in the current working directory.

" Change automatically current directory to open file directory
autocmd BufEnter * silent! lcd %:p:h

" map to start ipython in current file directory
nnoremap <Leader>st :execute 'SlimeSend1 cd 'fnameescape(expand('%:p:h')):execute 'SlimeSend1 clear':SlimeSend1 ipython3
Clone this wiki locally