diff --git a/vim/vimrc b/vim/vimrc index 4d1d3c9..a987044 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -90,11 +90,13 @@ colorscheme railscasts " Function that returns tab if called on an "empty" line " C-N elsewhere function! CleverTab() - if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' - return "\" - else - return "\" - endfunction + if &ft=="text" + return "\" + elseif strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$' + return "\" + else + return "\" + endfunction " map the function to Tab " inoremap =CleverTab() inoremap =CleverTab() @@ -234,9 +236,11 @@ else endif " Map Ctrl-T to new tab and Ctrl-W to close tab +" Map Ctrl-S to save if !(has('mac') || has('macunix')) nnoremap :tabnew nnoremap :tabclose + nnoremap :w endif " hh opens my help file @@ -245,7 +249,7 @@ nnoremap hh :help akmap " Vim5 comes with syntaxhighlighting. If you want to enable syntaxhightlighting " by default uncomment the next three lines. if has("syntax") - syntax on " Default to no syntax highlightningendif " has("syntax") + syntax on " Default to no syntax highlightningendif " has("syntax") endif if has("autocmd")