Skip to content

Instantly share code, notes, and snippets.

@micrub
Created April 17, 2020 19:19
Show Gist options
  • Save micrub/c21af533f41db1a526793b05ff270aa4 to your computer and use it in GitHub Desktop.
Save micrub/c21af533f41db1a526793b05ff270aa4 to your computer and use it in GitHub Desktop.
.vimrc
" @version 0.0.1
" Set spell check to US English for now.
"set spell spelllang=en_us
set nospell
hi clear SpellBad
hi SpellBad cterm=underline,bold ctermfg=white ctermbg=red
set autoread
set nocompatible " be iMproved, required
filetype off " required
set tabpagemax=100
" Emphasize white space characters,
" like space's,tab's,etc.
set list
set listchars=tab:>.,trail:.,extends:#,nbsp:.
filetype plugin indent on
set expandtab
set number
set nowrap
set nowritebackup
set noswapfile
set nobackup
set hlsearch
set ignorecase
set smartcase
" save all
nmap <leader>s :wa<CR>
" quit
nmap <leader>q :qa!<CR>
" quit and save all
nmap <leader>x :wa<CR>:qa!<CR>
" Ctrl+p in insert mode pastes last yanked register
imap <C-P> <C-R>"
" λ char keybinding
imap <C-l> <C-k>l*
" on move down maximize split
" on move up maximize split
nmap <leader>w <C-w>w<C-w>_
" Quit with :Q
command -nargs=0 Quit :qa!
" format Json with python json tool command
command! -range -nargs=0 -bar JsonTool <line1>,<line2>!python -m json.tool
" vim-airline appear all the time
set laststatus=2
" Remember info about open buffers on close
set viminfo^=%
"Always show current position
set ruler
" History
set history=5000
" Every time the user issues a :w command,
" Vim will automatically remove all
" trailing whitespace before saving.
autocmd BufWritePre * :%s/\s\+$//e
" toggle paste mode... but no indication...
set pastetoggle=<leader>p
" Hight light column 72
set cc=80
" enable mouse
set mouse=a
" Improve syntax highlighting & formating "
"
au BufRead,BufNewFile *.md set filetype=markdown
au BufNewFile,BufRead .babelrc set filetype=javascript
au BufNewFile,BufRead .eslintrc set filetype=javascript
" associate *.boot with lisp filetype
au BufRead,BufNewFile *.boot set filetype=clojure
au BufRead,BufNewFile *.hy set filetype lisp
au BufRead,BufNewFile *.dt set filetype lisp
au BufNewFile,BufRead *.phn set filetype=clojure
au BufNewFile,BufRead *.cljc set filetype=clojure
" custom: cljabel
au BufNewFile,BufRead *.cljb set filetype=clojure
"
" YML
"
"
au BufNewFile,BufRead *.yml set filetype=yaml
autocmd Filetype yaml setlocal ts=2 sts=2 sw=2
autocmd Filetype yaml setlocal nospell
au BufNewFile,BufRead *.ejs set filetype=html
autocmd Filetype html setlocal ts=2 sts=2 sw=2
autocmd Filetype html setlocal nospell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment