Is there an Om Writer-style front end for gvim or macvim - macos

Here's my dilemma: I love the features of vim, but I also like using Om Writer for its' approach to enhancing relaxation and creativity. For those unfamiliar, Om Writer blanks out all other programs, fills the screen with a complete blank page and has music and sounds that play. It even has the _ character as the cursor to avoid the wall style | character at the end of the line!
So I use Om Writer for some things, but I sure miss all of the neat things you can do from the keyboard in vim. Om Writer requires a lot of mousing around. So I have looked around and found nothing, but I was wondering if there might be such a thing as an Om Writer-style front end for Vim?
And if not, how difficult might such a thing be to program for MacVim on Snow Leopard? (I am at the kindergarten level as a programmer, but I would considering paying someone to do it if the job wasn't terribly involved.)

I remembered one plugin but a quick google returned two other projects. Playing music, though, is kind of the absolute opposite of Vim's philosophy but nothing stops you from launching a playlist in iTunes.
And I'll spare you my rant about those "distraction-free" editors.

I second romainl's recommendation of vimroom; I've tried it and found it quite nice. Additionally, the shell.vim plugin has a fullscreen mode that blanks out window title, taskbar, etc.

Related

Keyboard shortcut for a repetitive sentence

I'm currently saving 200/300 PDFs a day (work related), they all have a sentence in that's the same, I'm unable to use Ctrl C/V as I have to copy other parts before saving.
Is there a way for me to have a keyboard shortcut that puts the sentence in for me when saving the file?
(Windows 7 and limited admin access)
Many Thanks,
L
You could use a Macro editor which records keystrokes and repeats them.
This one is a free portable example (doesn't require an installation).
https://portableapps.com/apps/utilities/tinytask_portable
On windows 7 you can only have one Item in the Copy&Paste Memory, so there is no other easy way than to simulate keyboard input. You can also "Drag and Drop" the sentence from somewhere else (like a website) by selecting it and then clicking on it and dragging it into the Document.
Maybe that works better for you.
I'm not sure I've understood completely your problem, but in all likelihood a clipboard manager would suit your case.
They don't (usually) allow you to have a sentence inserted automatically before saving, but they let you save many instances of "clippings" and paste them conveniently.
There are a lot of them, I personally like Clip and used also ClipX and Ditto.
Many of these clipboard managers include features to associate a specific hot key to insert a specific snippet of text.
There also programs that are focused specifically on that HotKey -> specific snippet functionality, or that include it among others.
Also, if clarified what software you're using to do these "pdf savings", it would help (it's possible that it does include facilities to include a sentence before saving).
And in any case you can almost for sure do what you want with a macro/scripting utility such as AutoHotKey (but it would usually be pretty complex if you're not already familiar with it).

Is there a standard public-friendly keyset available for vim?

I've seen several bits of documentation on how to do ad-hoc vim key bindings.
Since I'm trying to pitch vim (or, to be more accurate, the idea of free 'nix text editors in general) to a coworker, I'm hoping to make it as painless for them as possible.
In contract to that ad-hoc approach, is there a wholesale block of widely accepted text I can throw into a .vimrc file in order to make most "standard" mac or windows keyboard shortcuts behave roughly the way they would on those systems? (For example, ctrl-s for save, ctrl-f to bring up a search, ctrl-v to "put" a string, ctrl-w to close, ctrl-q to quit, or some subset/superset of those ...)
Thanks for any help. I'm happy to build these on my own if needed, but I figured that if I'm documenting it for future use, I might as well link out instead of rebuilding the wheel.
I did a bit of looking around before asking, but if this is a duplicate, feel free to merge.
mswin.vim provides many typical Windows keybindings, so that any Notepad user will feel almost comfortable with Vim. You enable that by putting
source $VIMRUNTIME/mswin.vim
into your ~/.vimrc, cp. :help mswin.vim.
:set insertmode
(or starting via evim) almost turns Vim into Notepad by defaulting to insert mode :-)
The downside is similar to training wheels for bikes: It allows for some quick successes, but overall takes longer to become proficient. (I personally started out with mswin.vim, and gradually reduced the mappings.)
There is cream. It's a vim plugin that starts in insert mode and rebinds ctrl-c to copy, ctrl-v to paste etc...
http://cream.sourceforge.net/home.html
It's intended to make things easier for people used to editing in more conventional editors. That said I never used it. I learned vim the hard way and don't regret it.

Configuring TextMate to add empty scroll-space at bottom of document view?

I've been using BBEdit for years, but I've just started using TextMate because I find it has better support for Ruby on Rails than BBEdit (please don't start a flame-war over this!).
One thing I really miss is that BBEdit can add 1/2 or 1/1 page of empty space below the document (without adding lines to the actual document). This means that I will never have to write code at the very bottom of the window/screen, but I can always scroll the page to get the current line at a comfortable hight on the screen, even if it is the last line in the document.
Now, this might seem minor, but after using TextMate for a few days, missing this feature is really starting to bug me.
On the off chance that there is a setting I missed, or that there is a plugin or something out there, I thought I'd throw the question out here. If you know of any way to replicate this behaviour in TextMate, please share!
There is now an option in TextMate 2 to scroll past the end of the document.
This might be rather a late answer but i am posting b/c this question is high in google. Looking for the same issue i found:
PageFeed
PageFeed is a TextMate plugin that allows one to scroll past the last line of a document.
Its not perfect but for most cases its all you need: https://github.com/ampt/PageFeed
I don't think I've ever witnessed a flame war involving BBEdit.
No, TextMate doesn't allow that.
You could create a macro/snippet to add a bunch of \n at the bottom of the file.
Vim, Emacs and Sublime Text all allow this and have better RoR support than BBEdit.
Lacking a scrolling margin, especially at the bottom, when searching in text, is the most frustraing thing in Notepad, Word, Excel, etc. and is enough by itself to make me hate the products on almost a daily basis. EDT, TPU, etc, were great text editors which had this feature (maybe they introduced it) and, now that I've found Emacs emulates them, I use it all the time, and text editing life is good again. I can't understand how most of the world accepts the crazy situation of using a text editor that is worse than those in vogue 20 years ago.
For those who aren't clear about the concept or benefits of a scrolling bottom margin, it is not just about adding empty space below the document, but it also lets you see the context of text found in a search. Without a scrolling margin, the cursor is almost invariably positioned at the bottom line of the screen on the item found, and then to see what comes next you have to manually scroll further down. With a scrolling margin, the cursor and found text are repositioned above the bottom of the screen by the margin amount, letting you see the found text and all the text surrounding it. With repeated searches of the same text, this is a huge timesaver.

Is there a programmer's text editor for OS X with narrowing?

I think the title is essentially self-explanatory except for a necessary clarification and caveat:
Clarification
I'm not entirely sure if 'narrowing' is the universal term for the feature I'm referring to. What I mean is something like Emacs' 'narrow buffer', ie. the ability to select a region and quickly narrow the editor window to show only that region, and then after some edits to be able to quickly zoom out to see/edit the full file again. It's a feature I like, and find far more useful than code folding.
Caveat
Of course the answer is 'yes -- (X)Emacs' (and possibly vim?). But I'm looking for something other than vim or Emacs; almost certainly a more GUIsh one (think Textmate, TextWrangler etc).
My researches seem to suggest that the straightest answer is just 'no'. I haven't been able to find an editor that runs on OS X that supports narrowing, other than emacs.
I have however figured out a workaround that might be of interest for some scenarios, which is to use Hog Bay Software's QuickCursor in conjunction with one or more editors.
For example, I've tried setting up QuickCursor to fire up TextMate. So now when working in XCode, I can select the text I want to narrow to, hit the global hotkey I have set up, and the selected text pops up in a TextMate window. That can be edited, then a save and dismiss window pops the edited text back in XCode.
This also works if you're just working in TextMate (or, I imagine, one of the other editors that QuickCursor can control); ie. you can select select test in the editor, trigger QuickCursor to open the selected text in a new window, and later pop that text back to the original window.
I'm guessing this is not what you want, but you didn't specifically say so: Aquamacs? It's an emacsen with good integration with OS X (cut, paste, menus, toolbars, etc).

What's the point of viEmu plugin for Visual Studio?

This may sound a bit provocative but it actually is a real question. Feel free to edit if you don't like the tone.
Now, as much as I understand vi from my short experience with it like 10 years ago, it's a primitive text editor with one editable line at the bottom of the screen created before the scrollbars were invented, with some crazy shortcuts to overcome this limitation.
Can somebody explain me how one can be more productive with it than with, say normal VS.NET editor? Moreover, why would anybody want to use viEmu which supposedly turns your VS.NET into an ancient vi?
I'm willing to give it a try but I need some motivation to overcome the learning curve.
It honestly sounds like you have never seen someone use Vi who is truly proficient in it. When you normally use Visual Studio you frequently will move your hand over to your mouse, click through options, dialogs, classes, etc.
With ViEmu your hand never leaves the keyboard. You are compiling, switching files, highlighting groups of text, fixing indentation, performing complex motions on your code and running regular expression searches in seconds. For people who are fast typists it allows you to achieve a speed for tasks you would not be able to otherwise.
Many people will counter this by saying things like, "Most of my development time is spent thinking. The extra speed I gain from using tools like these is negligible.".
That is a non-argument in my opinion. It is true, for most large programming tasks you spend far more time planning and thinking then you do actually slinging code. But that doesn't mean that being able to express yourself through your IDE 2x faster doesn't have an impact on your productivity as a programmer.
The viEmu page itself has a pretty good article that might help to answer your question: Why, oh WHY, do those #?#! nutheads use vi?
I've spent the last couple months trying to teach myself to use vim "properly" and now I can hardly stand using other editors because they seem underpowered and clunky. For a random example, imagine you have a line of code that looks like this:
$welcomeMessage = "Welcome to SiteName!"; // shows at the top of homepage
In a normal editor, how would you change the string? You'd probably have to reach over and grab your mouse and carefully select it, or you'd move your cursor inside the first quotation mark, and hold down Shift and the right-arrow until you got to the closing quotation mark.
In vim, with my cursor anywhere in-between the quotes, I type ci" and it erases everything inside the quotation marks and puts me into insert-mode so I can type the new value I want. My hands didn't even have to move from my normal typing position.
There are so many things like this, I think you really have to spend a while using the editor to understand how powerful it is. It's very slow and hard to use at first, that's why a lot of people try it for a short time and think "this is dumb, everything is way harder", but after a while you start thinking in terms of the motions, it all starts to become automatic and it's much, much faster than using a "normal" editor. As I said, I can't go back now.
I've also had trouble understanding why people choose vim as their editor, even though I was using it from time to time, until I've finally "got it". I think most explanations of "why?" fails, because they fail to show couple crucial points. To explain those points, first you need to understand that in vim you are manipulating text primarily being in command mode. Ie by default your key presses are commands, and do not usually insert any text, unless those commands (like append, insert, change) switch to insert mode. This lets you navigate and edit your text easily without ever touching your mouse or moving your hands away from "editing pose".
Now the crucial points are:
Vim commands are divided into nouns, verbs and modifiers.
Editing is performed by combining them.
And this is what gives vim the power. To ilustrate the point, here are some most used commands:
Nouns: word, sentence, block, quotes and braces.
Verbs: cchange, insert, visual, delete
Modifiers: inside, around, till
And to ilustrate how you can mix them:
Want to change a word? cw
Same, but cursor in the middle of the word? caw
Change text inside quotes? ci", also change quotes? ca"
Delete function body? di{
Delete up till first comma? dt,
Delete up till second comma? d2t,
Jump to first comma? t,
Select word? viw
Also notice how all commands nicely translate into natural language:
delete word
change inside {
In vim if you learn a new verb, noun or modifier, you can easily mix and match with what you already know. So basically learning just one thing, you learn how to do a lot of different things.
Another great thing is that vim remembers what commands you have used, and you can repeat the sequence just by pressing .. For this post I've had to surround a lot of letters with <kbd> tag. But I've did that only once, and then just went over each letter and pressed ..
And that's basically the thing you "need to get" to understand the power of vim and become advanced user overnight.
P.S. if you don't like vim because it's console based and want a modern text editor, then I suggest looking into Sublime Text editor, which is a great editor and also supports vim mode.
P.S.2. I also recommend to map Esc key to jj and kk, which makes things a lot easier.
You are wrong about "one editable line at the bottom of the screen." All the text in the window is editable. And it does scroll (all versions) and in the case of gvim, has scrollbars.
Maybe you inadvertently put it in "ex mode". This is easily done and can be confusing.
Another answer got me thinking that watching some skilled editing using vim would be pretty revealing so I dug up this video showing basic and more advance motions while coding. This person could get even a bit efficient using some marks, etc but it gives an idea.
http://www.youtube.com/watch?v=FcpQ7koECgk&feature=related
If you need inspiration or want to see someone who really knows what they are doing with Vim, check out Gary Bernhardt's String Calculator Kata In Python, look at him go! http://vimeo.com/8569257
I think they have a long and acceptable answer for your question on the viEmu hompage:
One other even more powerful example: let's take the 'ce' command, which is composed of 'c' and 'e'. The 'c'hange command deletes the range specified by the next motion command, and also enters insert mode. It's the same as 'd', but with the distinction that it enters insert mode, instead of staying in normal mode. The boon is that the text you type in the next (short) input session is also part of the command. So if you do 'ceHello>', what you do is replace from the cursor to the end of the word by 'Hello', and the '.' command afterwards will work exactly like that: replace up to the end of the word with 'Hello'.
From:
http://www.viemu.com/a-why-vi-vim.html
I have viEmu installed ~half year ago. But I have to say (maybe without strong linux experiences) I've never used it. Too alien, too far, too complex.
So IMHO viEmu it's a great technical&historical challenge but no more for the 95% of the developers.
Basically with Vi (or ViM) you get faster because you don't need to touch the mouse and the key-map is improved (this represent learning curve cost but worth the effort) for do any text manipulation in a very easy way once that the fundamentals are learned.
Top 10 things Vi user need to know about Vim
I have not experience with VS.Net but I guess it has the same features that any other IDE has.
I have found that learning the all the key commands of the editor in my IDE was a sufficient replacement for Vi. Things like renaming, indenting, formatting, moving lines and that kind of stuff.
So I guess the major win would be for someone who already know Vi to be productive without having to learn VS.Net.
But then again, Vi has some truly esoteric but powerful features that probably can't be matched by you standard IDE editor.
I think you really should give Vim a try.
If you quickly tried Vi ten years ago, I may understand you didn't appreciate it. It's not really user-friendly at first sight. Actually its real power is revealed when you start feeling comfortable with the movements and start making it your own with customisation.
Once Vim is familiar to you you may understand why it deserves to be learnt.
I actually use VS only for debugging these days. Coding with vim (real vim, not viemu) is just a better experience.
Now, I am not going to claim that using one over another makes any difference in productivity - after all I spend most of my time trying to figure out how to solve a problem - entering the code is the easy part.

Resources