[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Vim tip (was Re: Suspend/Resume issues - Custom scripts notrunning? Mouse frozen?)

But why should we do all these handy..

when we have plugins already. check it out.

On Mon, Mar 2, 2009 at 5:52 PM, Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> wrote:
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


Reply to: