Skip to content

Commit

Permalink
insert mode <Tab> indents or completes
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Aug 29, 2013
1 parent 32aca06 commit 2864ae9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions vimrc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ let g:ackprg = 'ag --nogroup --nocolor --column'
" In command-line mode, C-a jumps to beginning (to match C-e) " In command-line mode, C-a jumps to beginning (to match C-e)
cnoremap <C-a> <Home> cnoremap <C-a> <Home>
" <Tab> indents if at the beginning of a line; otherwise does completion
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
inoremap <s-tab> <c-n>
" ignore Rubinius, Sass cache files " ignore Rubinius, Sass cache files
set wildignore+=tmp/**,*.rbc,.rbx,*.scssc,*.sassc set wildignore+=tmp/**,*.rbc,.rbx,*.scssc,*.sassc
" ignore Bundler standalone/vendor installs & gems " ignore Bundler standalone/vendor installs & gems
Expand Down

0 comments on commit 2864ae9

Please sign in to comment.