I can not write a html file in Arabic by vim.
Tried to do the following:
:set arabic
:set rl
or
:set rightleft
or
:set arabicshape
The problem I want to write Arabic without any change on my tags. I want her to go from left to right.
How i can do thos?
Vim can be invoked in Arabic mode activated by the following command:
vim -A test1
this will start with the cursor located in the right and ready for Arabic text:
السلام عليكم
-- INSERT Arabic --
source: http://blog.naoar.com/2012/04/vim-and-arabic.html
As vim is not BiDi enabled this should not be possible.
But I've been fiddling around a bit and it seems that vim + Konsole (KDE's terminal emulator) seems to do the job if you enable bidirectional support for Konsole. In vim (NO arabic options enabled) you should be able to write LTR and RTL, but letters will always be in isolated form (no shaping). I've found that setting the 'arabicshape' option then unsetting it seems to fix that. Short vowels are not displayed correctly, even though they seem to be written just fine to the file.
I have not tried with other terminal emulators, I'm not aware of their BiDi capabilities. Gnome-terminal maybe ?
because I can't comment on G.J I post it as an answer
using vim in konsole and putting set arabicshape! in my .vimrc
solved the problem for me
as Arabic moves rtl, not ltr, your requirements are contradictory, which is no doubt why it doesn't work.
Related
The question is self explanatory, but I haven't found a single resource that explains what the difference is after an hour of searching. After poking around a little bit in both, it appears that gVim and gVim easy are identical.
Gvim easy is started and locked in insert-mode (every character you type is printed like a simple notepad).
Standard gvim starts in normal mode and you have to toggle between normal/insert like all other vim.
From help:
Easy mode. Implied for |evim| and |eview|. Starts with
'insertmode' set and behaves like a click-and-type editor.
This sources the script $VIMRUNTIME/evim.vim. Mappings are
set up to work like most click-and-type editors, see
|evim-keys|. The GUI is started when available.
{not in Vi}
gVim-Easy, which is installed with gVim, has all the functionality of
normal gVim but lacks modes. This is especially useful for begginers
and people who do not want to, or do not have the time to, learn how
to use gVim. Users can benefit from gVim's superior syntax
highlighting and auto-indentation while not having to have to learn
the, often deemed complex, command set of gVim in order to edit a
simple document. It is recommended that readers of this tutorial at
least try to learn how to use gVim in normal mode, the learning curve
is steep, but, the benefits in speed and usability this confers is
worth the investment.
Read here
gVim Easy: gvim.exe -y (pass a parameter y)
gVim: gvim.exe
It seems that Insert and Replace are available modes, and command mode is missing. And at first glance it appears to have lost the ability to save a document using keystrokes - the File menu shows only ":w" for Save and without command mode, the command simply isn't there. What isn't shown however is Alt-F followed by S - this works, although also missing is the status line confirmation of the file being written.
When Gary Bernhardt executes a shell command from Destroy All Software, for example this:
:!ls
The command looks as if it had "spawn a new shell" - it takes the whole window, with its own theme. You can see it around 00:36 in the "One-minute demo video" of his homepage.
When I do the same in my macvim, the result is not the same; the command runs in the "bottom of the screen", inside a "small buffer" of around 1/3rd of the screen size, and conserving the theme I use in vim. Inconveniently, it also prints escape codes literally, instead using color codes (this particular bit has been asked in Stack Overflow before, but I want to know how Gary does his stuff).
What I have tried:
I have watched the 3 episodes Gary has about vim configuration: The .vimrc, Some Vim Tips and File Navigation in Vim. Sadly, none of them mention doing something special or installing a plugin relevant to the way the shell script is done.
I have studied Gary's .vimrc and .vim folder. If the relevant configuration option is there somewhere, I could not find it.
Hence, my question: how do I get macvim to display shell commands as in DAS?
Spec: I'm using MacVim, MacOsx 10.8.1, iterm2, zsh and ohmyzsh.
Well, I think I can answer myself now.
Macvim does the console thing very differently in gui mode than in console mode.
In console mode, it works as in DAS. Full screen, color codes.
In gui mode, it ... well, it basically sucks. Bottom of the screen, no color codes.
So, if you want nice shell outputs in macvim, use the non-gui mode. At least for now. (I have not investigated plugins like Conque)
I'm using gVim and I would like to know if there is a way to see the commands I've been typing.
For example, when I pressed the visual mode (v) I've got message -- Visual --, but I don't know which letters I've been pressing so far.
Is there a way to permanent see which characters/commands I've typing?
You can use this setting:
:set showcmd
Type :help 'showcmd' to read more.
You could set this up:
alias vim="vim -W ~/.last_vim_session_key_pressed"
But this file is written only when you exit vim. You can source it with vim -s but beware, with vim gui versions you can have problems.
Check your home directory for a .viminfo file.
This will have, among other things, a history from newest to oldest of recent commands you've typed.
There is a tricky way to show all vim keystrokes which were pressed by using -w parameter which record all the characters that you type in the file. The problem is, that vim writes keystrokes only when you exit Vim as Benoit already said.
To workaround this, Kana Natsuno came up with this single-line patch, which disables buffering of the -w option, so you have access to realtime stream of keystrokes. Then it's a matter of reading them (e.g. tail -f), parsing or you can try to display them in the statusbar (:set statusline).
Check out a custom build of Vim using Drew's live-stream-keystrokes branch of MacVim, to get the realtime stream of keystrokes.
Source: Vimprint - a Vim keystroke parser at Drew Neil blog
This is useful if you'd like to reveal the Vim pressed keystrokes in live video tutorials (or GIFs).
I have installed Janus to improve my vim. All works fine, except for the Ri documentation, that opens on hovering a keyword. On my installation it shows the output of "ri --help" instead of the documentation of the keyword.
I have found a way to disable it, but I'd rather just fix it. I am using gvim on Ubuntu 11.10.
What is the name of the plugin or script that offers these tooltips?
Could it have anything to do with RVM being active?
The problem is a bug in the ruby.vim plugin. That triggers ri with a wrong argument.
There is a bug report for this.
Solving is easy: edit file .../ftplugin/ruby.vim and change line 194: the -f argument should not be simple, but either bs or ansi. I had success with bs.
Does any of these shortcuts (from ri's homepage) work, especially the last two?
,r opens the search/autocomplete window, and will use a horizontal split to display matching documentation
,R opens the search/autocomplete window, and will use a vertical split to display matching documentatoin
,K opens the search/autocomplete window and prefills it with the keyword under the cursor
K is automatically remapped to use ri.vim if the current buffer is a *.rb file
I wanted to add a UTF-8 font in Gvim but I could not find out how to do this.
I tried to follow the step on this manual but it still did not work.
http://www.inter-locale.com/whitepaper/learn/learn_to_type.html (vim section halfway the page)
Can anyone tell me how to add a font in Vim so I can have Japanese characters displayed ?
As others note, you must use a fixed-width font. Vim is a text editor, not a WYSIWYG editor.
If you have a fixed-width font with the characters you need then:
:set guifont=*
Select the font you want to use, the size, etc. Once you're happy with it, do:
:set guifont?
And it will output the current setting of the value. Put the set guifont=foo in your .gvimrc (or in .vimrc with a if has("gui_running") block).
set guifont=<C-R>=&guifont<CR>
That will put the current value into the file.
For Windows, I found using the guifontwide setting provided the expected functionality (i.e. mixed character display: Japanese, Chinese and English in the same file). This is not intuitive or obvious (at least not to me!) from the Vim help files, but having something like this in your startup settings will work:
set guifont=Consolas:h10
set guifontwide=MingLiU:h10 "For windows to display mixed character sets
set encoding=utf-8
Quote from the vim documentation:
For MS-Windows, some fonts have a limited number of Unicode characters. Try
using the "Courier New" font. You can use the Edit/Select Font... menu to
select and try out the fonts available. Only fixed-width fonts can be used
though. Example:
:set guifont=courier_new:h12
So, I guess, unless you find a fixed width font containing the characters you want to display, then you are out of luck.
This is what I use...
set gfn=MingLiU:h16:cDEFAULT
set fenc=utf-8
set encoding=utf-8
Put this in your _vimrc file, exit and reopen. Works like a charm for me.
+T
You have to use a fixed-width font for Gvim under Windows.
There are several relevant pages at the Vim Tips Wiki:
Working with Unicode
Setting the guifont
The perfect programming font