FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

LinkBack Thread Tools
Old 03-02-2009, 11:22 AM
"Andrew McGlashan"
Default Vim tip (was Suspend/Resume issues - Custom scripts notrunning? Mouse frozen?)

Chris Bannister wrote:

If you use vim for your editing, put this in your .vimrc file:

" automatically give executable permissions if file begins with #! and
" contains '/bin/' in the path

function ModeChange()
if getline(1) =~ "^#!"
if getline(1) =~ "/bin/"
silent !chmod a+x <afile>

au BufWritePost * call ModeChange()

Excellent Chris, I put them into my /etc/vim/vimrc.local file along with the
following useful mods:

map <F10> :set paste<CR>
:map <F11> :set nopaste<CR>
:imap <F10> <C-O>:set paste<CR>
:imap <F11> <nop>
:set pastetoggle=<F11>

" Added this setting for swp file location, so as not to adjust
" date/times of actual directory holding the file(s) being edited
" reference: http://www.vim.org/tips/tip.php?tip_id=20
" - this works even if the working directory is writeable..
set directory=/vim-temporary-swp-files

Now I want to find some more gems like this... you have inspired me.

Kind Regards

Andrew McGlashan
Broadband Solutions now including VoIP

To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Thread Tools

All times are GMT. The time now is 09:19 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org