" Set filetype indent plugin on " Syntax highlighting syntax on " Add number rows set relativenumber set scrolloff=999 " No swap file set noswapfile " Incremental search & highlight set incsearch set hls " Runtime path let $RTP=split(&runtimepath, ',')[0] let $RC="$HOME/.vimrc" " Set default path set path=.,** " Plugin stuff execute pathogen#infect() " Always show file name set laststatus=2 " Enter to insert blank line below current, Shift+Enter to insert above map o map O " Folding (move to python specific vim file?) set foldmethod=indent set foldnestmax=99 set foldlevelstart=99 nnoremap za vnoremap zf " F9 execute current Python file autocmd FileType python map :w:exec '!clear;python' shellescape(@%, 1) autocmd FileType python imap :w:exec '!clear;python' shellescape(@%, 1) " Cycle through buffers map [b :bp map ]b :bn map db :bd " Toggle Nerd tree map :NERDTreeToggle " Save, Save and quit map :w map :wq " Lint autocmd FileType python map gl :w:exec '!python -m black' shellescape(@%, 1) " Automatically open NERDTree autocmd VimEnter * NERDTree | wincmd p " Exit Vim if NERDTree is the only window remaining in the only tab. autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif " If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree. autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif " Open the existing NERDTree on each new tab. autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif " Show hidden let NERDTreeShowHidden=1 " colorscheme moonfly " colorscheme onenord " colorscheme gruvbox-baby " colorscheme tender