πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3953

Re: "Brief" keymap emulation

#3953
From: Thomas Baruchel
Date: Thu, 18 May 2000 00:00
70 lines
2933 bytes
Le Wed, 17 May 2000 16:37:59 -0700, Ted Wang <ted.wang@attws.com> a οΏ½crit :
>Hello everyone,
>
>I've been using CodeWrite for a while and loved it's various highly
>customizable possibilities.  Recently I am transitioning to a Linux
>programming environment and found out that the most popular programmer
>editor of choice were VI and EMACS (each with it's own flavor of GUI).
>What I need to find out is which one supports the "BRIEF" keymap ?

I don't know what is this "BRIEF". Anyway, I have found once a small package
for vim called brief.vim, which remaps the "Home"and "End" keys. I found it
great and I can't work anylonger without it:

<End>: First press  --> end of the current line
       Second press --> end of the last line of the screen
       Third press  --> end of the last line of the file

Have a look at it. It may interest you.
==========================================================

" File: Brief.vim
"
" Purpose: Emulate the behaviour of the keys <Home> and <End> of the editor
"	   Brief
"
" Authors: Ron Aaron, Vince Negri (posted to Vim mailing list)
"	   (including some annotations by Ralf Arens)
" Last Modified: 2000-03-10 13:08:04 CET


" emulate <Home> key
func! BriefHome()
	" if we are on the first char of the line, go to the top of the screen
	if (col(".") == 1)
		" if on top of screen, go to top of file
		normal maH0
		if (line(".") == line("'a"))
			" we did not move! so ...
			normal 1G
		endif
	else
		" goto beginning of line
		normal 0
	endif
endfunc


" emulate <End> key
func! BriefEnd()
	" if we are on the last char of the line, go to the bottom of the screen
	if (col(".") == strlen(getline(".")))
		" if on top of screen, go to top of file
		normal maL$
		if (line(".") == line("'a"))
			" we did not move! so ...
			normal G$
		endif
	else
		" goto end of line
		normal $
	endif
endfunc


" map keys accordingly
map <Home> :call BriefHome()<cr>
map <End>  :call BriefEnd()<cr>


" vim:set noet:ts=8:sw=8:sts=8
Technical Details
Message-ID: <8g0426$sb8$1@news2.isdnet.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39232D56.F480D8E8@attws.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 102b9a,aa9c8647e2f0a005
X-Google-Attributes: gid102b9a,public
X-Google-Thread: 103b8b,aa9c8647e2f0a005
X-Google-Attributes: gid103b8b,public
X-Google-Thread: 107393,aa9c8647e2f0a005
X-Google-Attributes: gid107393,public
From: baruchel@libertysurf.france (Thomas Baruchel)
Subject: Re: "Brief" keymap emulation
Date: 2000/05/18
Message-ID: <8g0426$sb8$1@news2.isdnet.net>
X-Deja-AN: 624870658
Content-Transfer-Encoding: 8bit
References: <39232D56.F480D8E8@attws.com>
Content-Type: text/plain; charset=iso-8859-1
X-Complaints-To: abuse@isdnet.net
X-Trace: news2.isdnet.net 958632838 29032 213.36.44.65 (18 May 2000 06:53:58 GMT)
Mime-Version: 1.0
User-Agent: slrn/0.9.5.3 (UNIX)
Reply-To: baruchel arrobas libertysurf point fr
NNTP-Posting-Date: 18 May 2000 06:53:58 GMT
Newsgroups: comp.editors,gnu.emacs.help,comp.emacs