Skip to content
Browse files

Working tab stop adjustment shortcut in PHP

Based on <http://unix.stackexchange.com/a/41864/3645> (PHP override) and <http://vimdoc.sourceforge.net/htmldoc/repeat.html#:runtime> (everywhere else without duplication).
  • Loading branch information...
1 parent 2012177 commit 5d980834ba9e06f1f2d84678c31fc97581fe0506 @l0b0 committed Jul 5, 2012
Showing with 4 additions and 2 deletions.
  1. +1 −0 .vim/after/ftplugin/php.vim
  2. +2 −0 .vim/plugin/adjust-tabstop.vim
  3. +0 −2 .vimrc
  4. +1 −0 Makefile
View
1 .vim/after/ftplugin/php.vim
@@ -0,0 +1 @@
+runtime plugin/adjust-tabstop.vim
View
2 .vim/plugin/adjust-tabstop.vim
@@ -0,0 +1,2 @@
+nnoremap <silent> <buffer> ]] :setlocal tabstop+=1<CR>:set tabstop?<CR>
+nnoremap <silent> <buffer> [[ :setlocal tabstop-=1<CR>:set tabstop?<CR>
View
2 .vimrc
@@ -54,8 +54,6 @@ set tabstop=4
set shiftwidth=4
set expandtab
autocmd FileType ruby,eruby,yaml set autoindent shiftwidth=2 softtabstop=2 expandtab
-nmap <silent> ]] :let &tabstop += 1 <CR> :echo 'tabstop =' &tabstop <CR>
-nmap <silent> [[ :let &tabstop -= &tabstop > 1 ? 1 : 0 <CR> :echo 'tabstop =' &tabstop <CR>
" Switch between tabs and spaces for indentation
nmap <silent> <S-t> :set expandtab! | if &expandtab | retab | echo 'spaces' | else | retab! | echo 'tabs' | endif<CR>
View
1 Makefile
@@ -6,6 +6,7 @@ DOTFILES = $(wildcard .*rc) \
.imapfilter \
.signatures \
.subversion \
+ .vim \
.Xresources
.PHONY: all

0 comments on commit 5d98083

Please sign in to comment.
Something went wrong with that request. Please try again.