59 lines
1.1 KiB
VimL
59 lines
1.1 KiB
VimL
" Set
|
|
filetype indent plugin on
|
|
|
|
" Syntax highlighting
|
|
syntax on
|
|
|
|
" Add number rows
|
|
set number
|
|
|
|
" 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 <Enter> o<ESC>
|
|
map <S-Enter> O<ESC>
|
|
|
|
" Folding (move to python specific vim file?)
|
|
set foldmethod=indent
|
|
set foldnestmax=2
|
|
nnoremap <space> za
|
|
vnoremap <space> zf
|
|
|
|
" F9 execute current Python file
|
|
autocmd FileType python map <buffer> <F9> :w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>
|
|
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:exec '!clear;python' shellescape(@%, 1)<CR>
|
|
|
|
" Cycle through buffers
|
|
map [b :bp<CR>
|
|
map ]b :bn<CR>
|
|
map db :bd<CR>
|
|
|
|
" Toggle Nerd tree
|
|
map <F4> :NERDTreeToggle<CR>
|
|
|
|
" Save, Save and quit
|
|
map <F1> :w<CR>
|
|
map <F2> :wq<CR>
|
|
|
|
|
|
" Lint
|
|
autocmd FileType python map <buffer> gl :w<CR>:exec '!python -m black' shellescape(@%, 1)<CR>
|