You are not logged in.
My .vimrc file
set expandtab
set number
syntax on
set autoindent shiftwidth=4
set smartindent
set tabstop=4
set smartcase
colorscheme elflord
set incsearch
set hlsearch
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :20 : up to 20 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
function! ResCur()
if line("'\"") <= line("$")
normal! g`"
return 1
endif
endfunction
augroup resCur
autocmd!
autocmd BufWinEnter * call ResCur()
augroup END
On some files, I get this error http://i.imgur.com/lKFvm.png at the bottom of vim . Please note that I get the error not on all files. Its driving me crazy!
Last edited by shadyabhi (2011-09-11 02:41:52)
My blog:-
http://blog.abhijeetr.com
Offline
Have you tried commenting out e.g.
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
this line or maybe that ResCur() function?
Last edited by karol (2011-09-11 02:04:42)
Offline
Replace this:
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
with this:
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent execute "!chmod a+x <afile>" | endif | endif
If the above doesn't work for you (though it should in Vim > 7), try a different way of doing the same thing:
function ModeChange()
if getline(1) =~ "^#!"
if getline(1) =~ "/bin/"
silent !chmod a+x <afile>
endif
endif
endfunction
au BufWritePost * call ModeChange()
Last edited by bohoomil (2011-09-11 02:29:58)
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
Replace this:
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
with this:
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent execute "!chmod a+x <afile>" | endif | endif
Doing this solved the issue. Thanks.
My blog:-
http://blog.abhijeetr.com
Offline