diff options
author | mjfernez <mjf@mjfer.net> | 2021-12-22 17:50:34 -0500 |
---|---|---|
committer | mjfernez <mjf@mjfer.net> | 2021-12-22 17:50:34 -0500 |
commit | 864ce0cff6ad530cdbe0bee133204c114d1905da (patch) | |
tree | 428b2c46ceeda798fda1f5c637f11118aac3135f /.vimrc.min | |
download | dotfiles-master.tar.gz |
Diffstat (limited to '.vimrc.min')
-rw-r--r-- | .vimrc.min | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/.vimrc.min b/.vimrc.min new file mode 100644 index 0000000..b8aad21 --- /dev/null +++ b/.vimrc.min @@ -0,0 +1,97 @@ +set list +set spell +hi SpellBad ctermfg=000 guifg=#000000 + +let g:python3_host_prog = '/usr/bin/python3' +" URL: http://vim.wikia.com/wiki/Example_vimrc +set nocompatible +filetype indent plugin on +filetype plugin on +syntax on +set hidden +set wildmenu +set showcmd +set hlsearch +set ignorecase +set smartcase +set backspace=indent,eol,start +set autoindent +set nostartofline +set ruler +set laststatus=2 +set confirm +set visualbell +set mouse=a +set cmdheight=2 +set number +set notimeout ttimeout ttimeoutlen=200 +set pastetoggle=<F11> +"------------------------------------------------------------ +"----- CUSTOM MAPPINGS +map Y y$ +" Map <C-L> (redraw screen) to also turn off search highlighting until the +" next search +nnoremap <C-L> :nohl<CR><C-L> + +" From https://github.com/theicfire/dotfiles/blob/master/vim/.vimrc +" With a map leader it's possible to do extra key combinations +" like <leader>w saves the current file +let mapleader = " " +" auto indent for brackets +inoremap {<CR> {<CR>}<Esc>O +" shortcut for search without highlight +nnoremap <leader>sh :nohlsearch<Bar>:echo<CR> +" paste from outside buffer (i.e. outside of vim) +nnoremap <leader>p :set paste<CR>"+p:set nopaste<CR> +vnoremap <leader>p <Esc>:set paste<CR>gv"+p:set nopaste<CR> +" copy to outside buffer +vnoremap <leader>y "+y +" select all +nnoremap <leader>a ggVG +" paste from 0 register +" Useful because `d` overwrites the <quote> register +nnoremap <leader>P "0p +vnoremap <leader>P "0p + +" Easy quoting from: +" https://stackoverflow.com/questions/2147875/what-vim-commands-can-be-used-to-quote-unquote-words +nnoremap <leader>qq ciW""<Esc>P +nnoremap <leader>'' ciW''<Esc>P + +"------------------------------------------------------------ +" ----- DEFAULT SPACING/INDENTATION OPTIONS +" Indent with spaces by default like a sane person +set shiftwidth=4 +set softtabstop=4 +set expandtab + +" b/c it fits half screen nicely +set textwidth=72 + +" ------------------------------------------------------------ +" ----- FILE TYPE CONFIGS + +set fileformat=unix + +" Enable x86 custom highlight +au BufNewFile,BufRead *.asm + \ set syntax=nasm + +" auto PEP8 for python +au BufNewFile,BufRead *.py + \ set tabstop=4 | + \ set softtabstop=4 | + \ set shiftwidth=4 | + \ set smartindent | + +" 8 spaces for c, per Linus +au BufNewFile,BufRead *.c + \ set tabstop=8 | + \ set softtabstop=8 | + \ set shiftwidth=8 | + \ set cindent | + +" For the one absolute mad lad +au BufNewFile,BufRead Makefile + \set noexpandtab + |