2011-09-21 08:26:27 +10:00
|
|
|
syntax on
|
|
|
|
|
|
|
|
" Visual
|
|
|
|
set ruler
|
|
|
|
set guioptions=ce
|
2013-11-06 18:40:07 +11:00
|
|
|
set showmatch " Briefly jump to a paren once it's balanced
|
2011-09-21 08:26:27 +10:00
|
|
|
set linespace=2
|
|
|
|
set background=dark
|
2012-01-10 10:40:00 +11:00
|
|
|
set laststatus=2
|
2011-11-08 17:28:32 +11:00
|
|
|
colorscheme molokai_mac
|
2011-09-21 08:26:27 +10:00
|
|
|
|
2013-11-12 15:05:10 +11:00
|
|
|
set rtp+=~/.config/vendor/powerline/powerline/bindings/vim
|
|
|
|
|
|
|
|
|
2011-09-21 08:26:27 +10:00
|
|
|
" Tabs/Whitespace
|
2013-11-06 18:40:07 +11:00
|
|
|
set tabstop=2 " a Tab take up 2 spaces
|
|
|
|
set shiftwidth=2 " (un)indent 2 spaces at at ime
|
|
|
|
set autoindent " preserve previous indent level when inserting new line
|
|
|
|
set smarttab " insert/delete a tab's work of spaces at a time
|
|
|
|
set expandtab " insert actual spaces, not tabs
|
|
|
|
set nowrap " don't wrap long lines
|
2011-09-21 08:26:27 +10:00
|
|
|
set backspace=indent,eol,start " allow backspacing over everything in insert mode
|
|
|
|
|
2011-11-08 17:29:00 +11:00
|
|
|
" Toggle show tabs and trailing spaces (,c)
|
2013-11-06 18:40:07 +11:00
|
|
|
set list
|
2011-11-08 17:29:00 +11:00
|
|
|
set listchars=tab:▸\ ,trail:·,eol:¬,nbsp:_
|
|
|
|
set fillchars=vert:\ ,fold:-
|
2013-11-06 18:40:07 +11:00
|
|
|
nnoremap <Leader>c :set list!<CR>
|
2011-11-08 17:29:00 +11:00
|
|
|
|
2011-09-21 08:26:27 +10:00
|
|
|
" Misc
|
|
|
|
set switchbuf=useopen " Don't re-open already opened buffers
|
|
|
|
set nostartofline " Avoid moving cursor to BOL when jumping around
|
|
|
|
set virtualedit=all " Let cursor move past the last char
|
|
|
|
set whichwrap=b,s,h,l,<,>,[,]
|
2013-11-06 18:40:07 +11:00
|
|
|
let mapleader = ',' " comma as leader key
|
|
|
|
" but be nice to people who are used to backslash:
|
|
|
|
nmap \ <Leader>
|
2011-09-21 08:26:27 +10:00
|
|
|
set autoread " watch for file changes
|
2013-11-06 18:40:07 +11:00
|
|
|
set mouse=a " mouse can be handy sometimes
|
2012-01-10 10:38:48 +11:00
|
|
|
set ttymouse=xterm2 " Needed to get mouse working when in Tmux/screen
|
2011-09-21 08:26:27 +10:00
|
|
|
set fileformats=unix
|
2012-01-07 04:41:39 +11:00
|
|
|
set history=1000
|
2013-11-06 18:40:07 +11:00
|
|
|
set nohidden " unload a buffer when abandoned, please
|
2012-01-07 04:41:39 +11:00
|
|
|
set title " Show title in Terminal
|
2013-11-06 18:40:07 +11:00
|
|
|
set shortmess=atI " abbreviate messages
|
2011-09-21 08:26:27 +10:00
|
|
|
|
|
|
|
" Bells
|
2013-11-06 18:40:07 +11:00
|
|
|
set novisualbell " No blinking
|
|
|
|
set noerrorbells " No noise.
|
|
|
|
set vb t_vb= " disable any beeps or flashes on error
|
2011-09-21 08:26:27 +10:00
|
|
|
|
|
|
|
" Searching
|
2013-11-06 18:40:07 +11:00
|
|
|
set hlsearch " highlight search matches and keep them highlighted
|
|
|
|
set incsearch " start matching search before hitting enter
|
|
|
|
set ignorecase " case-insensitive searching by default
|
|
|
|
set smartcase " but if searching with multiple cases, treat it as case-sensitive
|
2011-11-24 09:54:11 +11:00
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
" center current search result in middle of screen
|
2011-11-24 09:54:11 +11:00
|
|
|
nnoremap n nzz
|
|
|
|
nnoremap N Nzz
|
|
|
|
nnoremap * *zz
|
|
|
|
nnoremap # #zz
|
|
|
|
nnoremap g* g*zz
|
|
|
|
nnoremap g# g#zz
|
|
|
|
|
2012-03-14 04:48:00 +11:00
|
|
|
" Work around bug that leaves cursor in middle of line
|
|
|
|
nnoremap dd ddI<Esc>
|
|
|
|
|
2011-09-21 08:26:27 +10:00
|
|
|
" Tab completion
|
|
|
|
set wildmode=list:longest,list:full
|
|
|
|
set wildignore+=*.o,*.obj,.git,*.rbc,*.swp
|
|
|
|
|
|
|
|
" Directories for swp files
|
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
" Navigate cursor up/down by lines on screen, not lines in file
|
2011-09-21 08:26:27 +10:00
|
|
|
nmap j gj
|
|
|
|
nmap k gk
|
|
|
|
|
|
|
|
" Reselect visual block after adjusting indentation
|
|
|
|
vnoremap < <gv
|
|
|
|
vnoremap > >gv
|
|
|
|
|
|
|
|
" Nicer splitting
|
|
|
|
set splitbelow
|
|
|
|
set splitright
|
|
|
|
|
|
|
|
" Emacs-like keys for the command line
|
|
|
|
cnoremap <C-A> <Home>
|
|
|
|
cnoremap <C-E> <End>
|
|
|
|
cnoremap <C-K> <C-U>
|
|
|
|
|
2011-11-08 17:27:57 +11:00
|
|
|
" Always show cursorline, but only in current window.
|
2011-11-24 09:55:32 +11:00
|
|
|
set scrolloff=3
|
|
|
|
set scrolljump=10
|
2011-11-08 17:27:57 +11:00
|
|
|
set cursorline
|
|
|
|
autocmd WinEnter * :setlocal cursorline
|
|
|
|
autocmd WinLeave * :setlocal nocursorline
|
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
set number " line numbers
|
2012-01-10 10:38:48 +11:00
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
" I keep deleting words when I want to switch windows
|
|
|
|
imap <C-w> <Esc><C-w>
|
2012-03-29 06:31:02 +11:00
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
set clipboard=unnamed " OS X clipboard when yanking/pasting
|
2011-12-29 14:00:49 +11:00
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
" May only work in iTerm2 and may have other bad effects,
|
|
|
|
" but this shows a block in normal mode, and vertical bar
|
|
|
|
" in insert mode.
|
|
|
|
if exists('$TMUX')
|
|
|
|
" https://github.com/sjl/vitality.vim/issues/8#issuecomment-7664649
|
|
|
|
let &t_SI = "\<Esc>[3 q"
|
|
|
|
let &t_EI = "\<Esc>[0 q"
|
|
|
|
else
|
|
|
|
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
|
|
|
|
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
|
|
|
|
endif
|
2012-01-07 04:41:39 +11:00
|
|
|
|
2013-11-06 18:40:07 +11:00
|
|
|
runtime macros/matchit.vim
|