Home Explore Blog CI



neovim

2nd chunk of `runtime/doc/arabic.txt`
4dc554d0f379f4b1296ea8213add7e02e794ab505e98df400000000100000fa3

------------------------------------------------------------------------------
Font Installation

o  Installation of fonts for X Window systems (Unix/Linux)

   Depending on your system, copy your_ARABIC_FONT file into a
   directory of your choice.  Change to the directory containing
   the Arabic fonts and execute the following commands:

     %	mkfontdir
     %	xset +fp path_name_of_arabic_fonts_directory


------------------------------------------------------------------------------
Usage

Prior to the actual usage of Arabic within Vim, a number of settings
need to be accounted for and invoked.

o  Setting the Arabic fonts

   +  For Vim GUI set the 'guifont' to your_ARABIC_FONT.  This is done
      by entering the following command in the Vim window.
>
		:set guifont=your_ARABIC_FONT
<
      NOTE: the string 'your_ARABIC_FONT' is used to denote a complete
	    font name akin to that used in Linux/Unix systems.
	    (e.g. -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1)

      You can append the 'guifont' set command to your vimrc file
      in order to get the same above noted results.  In other words,
      you can include ':set guifont=your_ARABIC_FONT' to your vimrc
      file.

   +  Under the X Window environment, you can also start Vim with
      '-fn your_ARABIC_FONT' option.

o  Setting the appropriate character Encoding
   To enable the correct Arabic encoding the following command needs
   to be appended,
>
		:set encoding=utf-8
<
   to your vimrc file (entering the command manually into your Vim
   window is highly discouraged).  In short, include ':set
   encoding=utf-8' to your vimrc file.

   Attempts to use Arabic without UTF-8 will result the following
   warning message,

								*W17*  >
     Arabic requires UTF-8, do ':set encoding=utf-8'

o  Enable Arabic settings [short-cut]

   In order to simplify and streamline things, you can either invoke
   Vim with the command-line option,

     % vim -A my_utf8_arabic_file ...

   or enable 'arabic' via the following command within Vim
>
		:set arabic
<
   The two above noted possible invocations are the preferred manner
   in which users are instructed to proceed.  Barring an enabled 'termbidi'
   setting, both command options:

     1. set the appropriate keymap
     2. enable the deletion of a single combined pair character
     3. enable rightleft    mode
     4. enable rightleftcmd mode (affecting the command-line)
     5. enable arabicshape  mode (do visual character alterations)

   You may also append the command to your vimrc file and simply
   include ':set arabic' to it.

   You are also capable of disabling Arabic support via
>
		:set noarabic
<
   which resets everything that the command had enabled without touching
   the global settings as they could affect other possible open buffers.
   In short the 'noarabic' command,

     1. resets to the alternate keymap
     2. disables the deletion of a single combined pair character
     3. disables rightleft mode

   NOTE: the 'arabic' command takes into consideration 'termbidi' for
	 possible external bi-directional (bidi) support from the
	 terminal ("mlterm" for instance offers such support).
	 'termbidi', if available, is superior to rightleft support
	 and its support is preferred due to its level of offerings.
	 'arabic' when 'termbidi' is enabled only sets the keymap.

	 For vertical window isolation while setting 'termbidi' an LTR
	 vertical separator like "l" or "𝖨" may be used.  It may also be
	 hidden by changing its color to the foreground color: >
		:set fillchars=vert:l
		:hi WinSeparator ctermbg=White
<	Note that this is a workaround, not a proper solution.

   If, on the other hand, you'd like to be verbose and explicit and
   are opting not to use the 'arabic' short-cut command, here's what
   is needed (i.e. if you use ':set arabic' you can skip this section) -

   +  Arabic Keymapping Activation

      To activate the Arabic keymap (i.e. to remap your English/Latin
     

Title: Arabic Language Support in Vim: Font Installation, Encoding, and Enabling Arabic Settings
Summary
This section details how to install Arabic fonts for X Window systems and configure Vim for Arabic language support. It covers setting the 'guifont', character encoding to UTF-8, and enabling Arabic settings using the ':set arabic' command. It also explains the effects of the 'arabic' and 'noarabic' commands, including keymap adjustments, RTL mode, and interaction with 'termbidi' for external bi-directional support. For users who prefer not to use the 'arabic' shortcut, the section outlines the individual steps required for Arabic keymapping activation and other necessary configurations.