Easy typing for non-english keyboards vim users [closed] - vim

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
In English or US keyboards keys like \, /, [ and ] are very easily typed with only one key stroke. Usually is not the same for non-english keyboards.
Is there a way to achieve the same easiness of typing for these type of keyboards?
If it is a matter of mapping keys can you please put clear instructions to do it? (Spanish layout example is welcome)
EDIT: Examples by distinct languages are very welcome!

I've suggested something already in the comments. Now, as far as simple mappings go, for normal mode you can always do the simple remapping of main keys.
nnoremap : >>
nnoremap ; >>
for example, for indent (I'm on Croatian keyboard layout here ... where the < and > characters are, I have ; and : ... I'm sure you understand the example). You can analogly remap all your local characters with parenthesis, brackets or any other essential characters.

I personally just use the US keyboard whenever I'm programming cause I need most of these special keys as characters anyways. You could use different keymappings, but I personally don't think this is such a good solution - if you ever have to work on another machine you won't be able to use vim at all. If you need to type spanish characters you can just switch your keyboard layout back when typing.

Related

Do I save time using the h, j, k, l keys? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I've tried using the h, j, k and l keys for a while in Vim, but did not get used to it and fell back to using the arrow keys. My question is: from your experience, is it worth switching to these keys? Did you achieve faster typing/navigating?
When I first used Vim, it seemed very difficult to stick to hjkl after years of maintining a habit of navigating with arrow keys.
Then I learned actual touch typing.
After that, not only did hjkl feel more natural than the arrow keys. Everything computer-related became faster. It's really worth the investment timewise (I'm assuming you're not a touch typer, otherwise you wouldn't have asked this question).
By the way, Vim is incredibly useful when learning to touch type. Just keep a keyboard diagram closer to the screen than to the actual keyboard when learning, ideally a keybord diagram with vim usage on it.
IMHO, no, it's not worth the trouble. I've tried it, and I couldn't get used to it either.
The whole point of those using those keys was that most keyboards, at the time of Vi's creation, did not have arrow keys. I've yet to run across a modern keyboard without those keys.
I could be wrong.
I like it. Having discovered visual mode used with f/F and t/T could cut and replace so quickly, easy access to ; became necessary. And you can go straight to . with the 3rd finger too.

Emacs as an editor (as opposed to VIM) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I recently started using emacs as an everyday environment, half because I always wanted to gain the perspective of "the other side," and half because I'm forced to at work :P. Its been a week and I can definitely see the advantages of using emacs and what it means to "live inside emacs." The buffers are very convenient and just the ability to search through the buffer as if it is an editor is amazing. Emacs has been my "shell" since the day I started it last week.
However, when it comes to editing code, I am still not convinced that I should use emacs as opposed to vim. I don't know if it is because I am too used to vim, but with emacs to move around text I always need an extra key, such as 'M-f' instead of 'w,' or 'C-f' instead of 'l'. Is this just a learning curve that I have to overcome?
I am not trying to start a flame war, I would just like some perspective. Thanks!
I started with vim but left it many years ago for emacs. I can say that it took me much longer to be converted to the baseline editing interaction (key combinations, non-modal, etc.) than it did to recognize the value of "living inside emacs," as you say. So my advice would be to actually do the emacs tutorial (C-h t, yes it's worth it) to be sure you're really using the full power of emacs' baseline editing interactions, and give it a month to see if you're converted organically. If not, then give each vim-mode and viper a try. If you're still not converted then do your code editing in vim. :-)
But the most salient point here is do not jump to vim-mode or viper, give it a good long while to see if you can enjoy emacs editing interaction without introducing more emacs add-ons which might have weird interactions with other emacs add-ons.
One thing that distinguishes vi (and gvim and nvi and all the other vi clones) is that it's modal. That means that when you're not in edit mode, you can use single letters as commands. Other editors, like emacs, don't have modes, so a single letter with no modifier is usually just inserted into the buffer. That's why commands in emacs need to have modifiers.

Why don't more people use emacs with viper-mode? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I've started to use emacs, and I've found out that while the editor-specific features of emacs are better than those of vi, the text-manipulation methods of vi are better than those of emacs (and easier on your control-pinky!).
It seems that viper-mode, a marriage of the two best parts of each editor, is the ideal solution for someone that wants a complete editor.
But before I start investing my time learning the vi commands in the emacs environment, I'd like to know why it doesn't seem like many people use viper-mode. Is there something I'll find out after using it a while that will cause me to switch to plain emacs or vi?
Because you are either a vi person or an emacs person. The same way you're either a dog person or a cat person.
On a more serious note, why would I change? vi offers me all the power I need and I'm pretty certain the emacs people would feel the same way about their editor of choice.
I've used vi for over twenty years and some of its features still surprise me (admittedly, it's usually vim rather than vi nowadays). I don't want to dedicate the next twenty years of my life at becoming adept with emacs. There's no benefit and plenty of cost, and pretty much all of my non-minor decisions are subject to cost/benefit analyses.
Mostly, it comes down to what you're comfortable with. It took years for me to stop trying to use the WordStar 3.3 CTRL-K CTRL-X key sequence to exit from most editors. It had burnt itself into my spinal cord so that all the brain had to do was issue an exit command and the lowest levels of the nervous system would take over.
And, anyway, emacs with its strange command sequence like
CTRL META LEFTSHIFT RIGHTSHIFT WINDOWS OPENAPPLE ALT K
is better suited to aliens with 87 fingers, or elite pianists :-)
People who want vi-like usage use vi, people who want Emacs-like usage use Emacs.
I think you get some vi people moving to Emacs to get functionality like org-mode (or some other "killer" functionality that doesn't exist in vi). And those people probably use viper-mode to ease the transition.
Regarding the actual question of "is there something I'll find out..." - everybody is different. Maybe viper's lack of C-o command (do one command and go back to insert mode (or something like that)) is just too painful to not have. Or, maybe you'll find that the allure of not having to switch between command and insert modes is attractive and go for straight Emacs.
I think the benefit of viper-mode or vimpulse is that it makes the learning curve for vi-users is negligible for 95% of what you'll do. But you have the possibility of using the other parts of Emacs that you can't get in vim (whatever those things are that you find attractive).
I "get" vim, that is a massive investment. I get vimscript, that is another massive investment. I have no desire to learn the wildly complex internals of another editor and the intricacies of emacs-lisp, especially since the only thing I would really want there that I can't have here is better repl support.
Also, viper is nowhere near enough. vimperator comes close, but nothing beats vim.
Because I don't want vi, I want vim with syntax highlighting.

Good guide on VIM Scripting? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've used VIM for 10+ years, but never really into VIM scripting (always subjectively beliving that this was one area where VIM was weaker than Emacs).
Recently, the realization "in a VIM script, I can execute normal mode commands" made my mind go "a-ha" and suddenly start realizing why parts of VIM script is the way it is.
normal ma10jd'a20kp
is much more elegant than
Marker m = currentLocation();
advanceLines(10);
Buffer b = delete(currentLocation(), m);
advanceLines(-20);
insertBuffer(b);
Now question is -- what's a good resource to learn vim scripting from?
Thanks!
The best advice I can give is that you read:
:help usr_41.txt
which will give you a good overview of the basics. Then find some things that you want to do and create functions for them. While you're doing this, make heavy use of:
:help function-list
to get an idea of what all the built in functions are. Most of it is fairly similar to other scripting languages (albeit a harsher syntax), so any experience you have of text manipulation in python or whatever will be useful.
Also, look on the vim scripts page and Google to get examples of existing scripts to help expand your knowledge.
Finally (and probably most importantly), don't be afraid to ask on stackoverflow or the Vim mailing list and there'll be plenty of support for any problems you may have.
Learn Vimscript the Hard Way is worth checking out too.
http://learnvimscriptthehardway.stevelosh.com/
Al gave you a good answer. I'd also add vim.wikia that has a few tips related to your question.
On a side note.
I wouldn't say that ma10jd'a20kp is more elegant. I see the following problems:
it's quite difficult to maintain (what if the number of lines shall become a parameter?),
people like to override keys they never learned to use (this could be fixed with a banged :normal!),
some normal-mode commands have strange behaviour on side-case (like <esc> when the cursor is on the first column),
it messes the mark a, and the unnamed register -- other scripts, or even the user may expect their values to not be altered by your script.
I'm in a similar situation. It's still on my "to read" list, but I just found Scripting the Vim editor today. The articles from IBM's DeveloperWorks are usually very good, so probably worth checking out.

VimL Script language: are there any implementations in other languages? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Problem: One of my favorite aspects of Vim is its flexibility. One of my least favorite is the VimL script language itself. I know everyone has his or her own preference for languages and editors, so I take it for granted that not everyone agrees with me.
Question: If you are a Vim user, and if you have had a similar disaffection for using VimL to extend vim, what alternatives have you used in order to extend Vim while avoiding the default language? I am looking for ideas that may help beyond what I've already tried, including, but not limited to:
recompiling vim with the add-on support for python, ruby, and perl (nice, but it does not help when I am running vim on someone else's machine without that support added in)
never writing a line of VimL script and simply download preexisting add-ons (great, if and only if the existing stuff does exactly what you want it to, not so great if you have to make a change and end up having to look at more VimL script)
Disclaimer: Note, this is not a slam against VimL script or anyone's preferences. If it works great for you, that's great! I'm just asking those who have found a need for an alternative, and a way to fulfill that need to their satisfaction.
Update: This question was updated with a request for specific references to specific tools. No discussion, debate, polling or extended discussion is needed. If there exists a specific tool, please feel free to reference it.
see e.g., https://github.com/luke-gru/riml
I love vim but hate VimL. So I have been trying emacs with the evil plugin. It's a vim-like mode, but with all the benefits of emacs plugins and emacs-lisp as a scripting language. Mostly a win. (It's not 100% like vim — for example, $ isn't a special line column like it is in vim — but close enough.)
Most likely whatever fits your development ecosystem. ie a language you're likely to use outside just vim itself as it has helpful support libraries
I personally used +python in this trac plugin
http://www.vim.org/scripts/script.php?script_id=2147
after extensively using and learning from this awesome debugger script...
http://www.vim.org/scripts/script.php?script_id=1929
As far as working on other machines usually you just live without stuff for small jobs. but you can always use netrw for scp etc if needed..
but really it's whatever you want to learn and can use
There are no alternatives, if we disregard the ones you mentioned.
While in Vim you can use VimL
If you wish to program in Python/Perl/Ruby you can find yourself a pre-made binary, or build Vim to include support for it, and then use one of those, as many people do
you can download plugins, as you said, but more and more of them require support for one of the above (which are often found on *nix boxes, so it's really not that much of a problem)
you can use either one of the above, or other *nix tools outside Vim, but that has no longer anything to do with Vim
I think that covers it.

Resources