dotfiles/vimrc/.vimrc

59 lines
1.1 KiB
VimL
Raw Normal View History

2022-07-14 04:21:21 +00:00
" Set
filetype indent plugin on
" Syntax highlighting
2022-03-12 21:38:58 +00:00
syntax on
2022-07-14 04:21:21 +00:00
" 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=.,**
2022-07-31 20:13:01 +00:00
" Plugin stuff
execute pathogen#infect()
" Always show file name
set laststatus=2
2022-08-03 00:07:53 +00:00
" Enter to insert blank line below current, Shift+Enter to insert above
map <Enter> o<ESC>
map <S-Enter> O<ESC>
2022-07-31 20:13:01 +00:00
" Folding (move to python specific vim file?)
set foldmethod=indent
set foldnestmax=2
nnoremap <space> za
vnoremap <space> zf
2022-08-21 00:12:35 +00:00
" 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>
2022-08-23 02:59:38 +00:00
" 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>