Skip to content

Instantly share code, notes, and snippets.

@mclehman
Created October 31, 2016 11:32
Show Gist options
  • Save mclehman/02d60465c7dc3b1051c5023a21be8139 to your computer and use it in GitHub Desktop.
Save mclehman/02d60465c7dc3b1051c5023a21be8139 to your computer and use it in GitHub Desktop.
" My keyboard is programmable and heavily customized. Many key combos here
" thus make little to no sense on a regular keyboard.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'jiangmiao/auto-pairs'
Plugin 'wlangstroth/vim-racket'
Plugin 'kovisoft/slimv'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
let mapleader=" "
" Jump to tag under cursor.
:nnoremap <leader>t <c-]>
" Navigate the tag stack.
map <F5> :pop<CR>
map <F6> :tag<CR>
" Append semicolon to line.
:nnoremap <leader>; $a;<esc>
" Regenerate ctags.
:nnoremap <leader>c :!ctags * &<CR><CR>
" Stop highlighting last search's matches.
:nnoremap <leader>/ :nohlsearch<CR>
" Paste last yanked text.
:nnoremap <leader>p "up0p
" Navigate buffers.
:nnoremap <F7> :bprevious<CR>
:nnoremap <F8> :bnext<CR>
:vnoremap <leader>f :pyf ~/.cf/clang-format.py<CR>
:nnoremap <leader>f mtggVG:pyf ~/.cf/clang-format.py<CR>`t
:nnoremap <leader>s :so $MYVIMRC<CR>
:nnoremap <leader><up> <C-A>
:nnoremap <leader><down> <C-X>
" My minimal syntax theme based loosely on Overwatch colors.
colorscheme unsyntax
syntax on
set cursorline
" Sane splitting behavior.
set splitbelow
set splitright
" Don't close buffers I'm almost certainly not done with.
set hidden
" Show me when my leader timeout hits.
set showcmd
" Mouse support
set mouse=a
" Numbering is essential, and if I keep relative numbering on, I'm more likely
" to start navigating more efficiently.
set number
set rnu
set backspace=indent,eol,start
" Anything else would be heresy.
set expandtab
" Indenting is 4 spaces. No more. No less. Unless someone else wrote the
" yacc file. Then all bets are off.
set shiftwidth=4
set softtabstop=4
" turns it on
set autoindent
" Does the right thing (mostly) in programs.
set smartindent
" stricter rules for C programs
set cindent
" Highlight matches and show incremental matches when searching.
set hlsearch
set incsearch
" This seems to keep my autocomplete happy.
set shortmess+=c
" As does this. Pretty sure this is bad practice though.
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 0
" Keep selection when indenting/outdenting.
vnoremap > >gv
vnoremap < <gv
" Visual lines, not file lines. Usually not an issue.
noremap <Up> gk
noremap <Down> gj
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
" Hide away backup and swap files.
set backupdir=~/.vim/backup
set directory=~/.vim/backup
" Assist with entering the date.
iabbrev ddate <C-r>=strftime("%D")<CR>
" Treat racket files as scheme files to assist slimv
if has("autocmd")
au BufReadPost *.rkt,*.rktl set filetype=scheme
" Let me quote things easily in scheme files.
autocmd filetype scheme let g:AutoPairs = {'(':')', '[':']', '{':'}','"':'"', '`':'`'}
endif
" Hopefully fix lisp indentation when inserting newlines.
let g:paredit_electric_return=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment