-
-
Save expelledboy/20d2b1a63d8d44e95016 to your computer and use it in GitHub Desktop.
vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !filereadable(expand('~/.vim/plugin/source.vim')) | |
silent !curl -fLo ~/.vim/plugin/source.vim --create-dirs https://raw.githubusercontent.com/suderman/source.vim/master/plugin/source.vim | |
endif | |
" load config from gists :D | |
runtime plugin/source.vim | |
Source https://gist.githubusercontent.com/expelledboy/20d2b1a63d8d44e95016/raw/cbe125eb002ccbca86f74474510219b03ddf590a/backups.vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" automatically save before commands like :next and :make | |
set autowrite | |
" automatically read a file if changed outside of vim | |
set autoread | |
" you can accidently delete entire repos, so vcs are not a catch all | |
set backup | |
" persistent undos | |
set undofile | |
" use to keep all temporary and backup files in one place | |
let vh=$HOME.'/.vim' | |
let &backupdir=vh.'/backup' | |
let &directory=vh.'/tmp' | |
let &undodir=vh.'/undo' | |
let s:tempdirs = [ &directory, &backupdir, &undodir ] | |
" if needed create directories | |
for s:file in s:tempdirs | |
if !isdirectory(expand(s:file)) | |
echo "creating " . s:file | |
call mkdir(expand(s:file), "p") | |
endif | |
endfor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" hit "u" in visual mode when I mean to "y", use "gu" instead | |
vnoremap u <nop> | |
vnoremap gu u | |
" heavy shift | |
command! -bang E e<bang> | |
command! -bang Q q<bang> | |
command! -bang W w<bang> | |
command! -bang QA qa<bang> | |
command! -bang Qa qa<bang> | |
command! -bang Wa wa<bang> | |
command! -bang WA wa<bang> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" quick save (remember to disable flow control) | |
nnoremap <C-s> :update<cr> | |
inoremap <C-s> <esc>:update<cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inoremap <C-b> <Left> | |
inoremap <C-f> <Right> | |
inoremap <C-e> <End> | |
inoremap <C-a> <Home> | |
cnoremap <C-a> <Home> | |
cnoremap <C-e> <End> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd FileType erlang setlocal shiftwidth=2 tabstop=8 | |
autocmd FileType erlang ab <= =< | |
" autocmd FileType erlang setlocal foldmethod=indent | |
" autocmd FileType erlang setlocal foldnestmax=1 | |
autocmd FileType erlang setlocal commentstring=%%%s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if system('uname -s')=~'Darwin' | |
if has('gui_running') | |
let macvim_skip_cmd_opt_movement = 1 | |
no <M-Left> <C-Left> | |
no! <M-Left> <C-Left> | |
no <M-Right> <C-Right> | |
no! <M-Right> <C-Right> | |
no <D-Up> <C-Home> | |
ino <D-Up> <C-Home> | |
no <M-Up> { | |
ino <M-Up> <C-o>{ | |
no <D-Down> <C-End> | |
ino <D-Down> <C-End> | |
no <M-Down> } | |
ino <M-Down> <C-o>} | |
ino <M-BS> <C-w> | |
ino <D-BS> <C-u> | |
" copy iterms behaviours | |
noremap <D-Right> :tabnext<cr> | |
noremap <D-Left> :tabprevious<cr> | |
" moving in splits | |
nnoremap <silent> <D-]> <c-w>l | |
nnoremap <silent> <D-[> <c-w>h | |
endif | |
" so that we can use vim with crontab | |
set backupskip=/tmp/*,/private/tmp/* | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" improve massive macro performance | |
set lazyredraw | |
" quick macros | |
nnoremap Q @@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" logial home and end mappings | |
noremap H ^ | |
noremap L $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" use space for leader | |
nnoremap <space> <nop> | |
let g:mapleader = "\<space>" | |
let mapleader = "\<space>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" evaluate viml in current instance | |
autocmd FileType vim vnoremap <buffer> <leader>S y:execute @@<cr>:echo 'Sourced selection.'<cr> | |
autocmd FileType vim nnoremap <buffer> <leader>S ^vg_y:execute @@<cr>:echo 'Sourced line.'<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment