pageUp and pageDown used to move caret - textmate2

How to move the page together with the caret?
In TM1 it was possible to specify this in
~/Library/KeyBindings/DefaultKeyBindings.dict
However it seems not to work in TM2.

It seems like this option is now implemented in the lastest version of textmate2 , released on 2012-02-18, version 9064, as mentioned in the release notes.
Implement option page up/down (for moving caret).

Related

VSCode Vim multiple cursors

I have looked everywhere and I am still unable to switch off this 'feature'!
I've been using vi and, later, vim, since the 80's and I have never had need of multiple cursors, nor can I see a use for them.
:<range>s/search/replace/ does everything I need so this new feature is infuriating beyond words, especially as I've no idea how to switch it off when it seemingly-randomly appears.
Would someone be wonderful enough as to tell me how to banish, remove, consign-to-history the multiple cursors feature in VSCode Vim 1.12.4, please?
I believe this issue is specific to the plugin. I experienced it with the HTML plugin recently, and I'm assuming you have the same problem with HTML files, but the same principle should apply to other plugins as well. You just have to find the setting.
In the VS Code settings, there is an option that reads:
HTML: Mirror Cursor On Matching Tag
You can uncheck the box there to disable the feature. Or you can go to the settings.json in your local repo (inside the .vscode directory), or the equivalent global file, and add/modify the following field like so:
"html.mirrorCursorOnMatchingTag": false
That should take care of it for you.

How to delete aui.css from pages in Liferay 7

How to disable aui.css for custom pages in Liferay 7. Is it possible to do this somehow via portal-notmal.ftl
aui.css is coming in through the unstyled theme, which typically is the basis for every theme there is. That being said, you can override it and remove it this way. It's refined in the styled theme, and also in the classic theme (in the same github repo, you'll find it).
If you do so, note that you'll still have to deal with a lot of formatting on your own - the classes and other DOM elements will be generated, but it looks like aui now includes the Lexicon CSS that you'll have to simulate if you get rid of it. Why you'd want to do so, instead of accepting the defaults and overriding what you don't like, is beyond me.
Edit, answering to your comment:
You'd simply create your own theme (Linking to 7.1 here, see below) with any overrides that you'd like to have. There's not a single file with an option, as this configuration file would be too complex and unmanageable.
Also, you sound like you've just started building your site - my recommendation would be to always go with the latest release and use 7.1 (at this time) and note that 7.2 is around the corner, Beta 3 has just been released

Restoring old version to current writable in Visual SourceSafe

I am working on an ASP.NET application in VS2010; the repository is still VSS-2005. I am going to abandon the changes made to one of the pages and revert back to the version that existed two checkins ago (which is the current production code). My problem is that I haven't worked with VSS much and I've never done this particular thing before. I can't find any "How to" literature on VSS that tells how to do it, and when I try to do it using the intuitive thing (do a "Get" on the version I want to revert to), it does nothing.
I can View that older version using Notepad, and so I could check out the page and replace the code with the Viewed Notepad version, but this doesn't seem proper somehow.
I've been wondering about the Rollback button, but when I click it, it gives me an ominous message that I am not sure I like: "Rollback cannot be undone; some versions will be lost irretrievably! Continue anyway?"
Well, apparently there are no SourceSafe gurus out there, so I'll answer my own question. I bought a book! And it told me how to do it.
Overview:
Check out the current version manually
"Get" the version we want to revert to
Check in the older version as a newer version
Details:
Check out the current version, then use the View History command to show the History dialog and select the version that is desired to be reverted to.
After selecting/highlighting this version, click on the Get button. The Get dialog shows where the specific file version will be placed along with several options. By default the path in the To text box points to the file in our workspace, which is what we want. Don't select the "Make writable" option since the file in question is already under source control. Leave everything as defaulted, and click OK. In the next dialog, choose "Replace". SourceSafe gets the older verison and overwrites the one in the workspace.
Now that you have the older base version, all you have to do is check in the version and obtain a new version that is identical to the old one.
I got this information from the book "Visual Source Safe 2005 - Software Configuration Management in Practice" by Alexandru Serban, published by Packt Publishing Ltd. I bought the book used, but found you can still get it new from the publisher for a lot less than the list price -- $20 less! I don't know who might need a book about an obsolete source control system, but don't pay full price, get it from the publisher direct! Amazon charges the full list price on new copies (astonishing).

How to add gvim icon to openwith menu

I have installed gvim in windows 7. When I right click on a file, I get list of editor to be opened with. I see a icon for notepad++, 7zip and beyond compare, but not for vim. it is tough to search "Edit with Vim" in the big list. Is it possible to add icon to "Edit with Vim". I tried setting ICON in registry to gvim.exe path, but that didn't work
I am currently having a crack at coding this up "for real" (but no success yet).
In the meantime, here's what I did on my machine as a sort of workaround:
Create a new text file and call it (for example) vim.reg
and paste this into the file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Edit with Vim]
"Icon"="\"C:\\Program Files (x86)\\Vim\\vim74\\gvim.exe\""
[HKEY_CLASSES_ROOT\*\shell\Edit with Vim\command]
#="\"C:\\Program Files (x86)\\Vim\\vim74\\gvim.exe\" \"%1\""
and then right-click on the file and select Merge.
Or just manually add those keys directly in RegEdit if you're comfortable with that.
You may need to restart Explorer.exe (eg. log out and back in) for it to take effect.
This will add a new "Edit with vim" entry, with the icon, to the context menu for every filetype.
If you want it only for text files, for example, then change the two occurrences of "*" in the file to "txtfile".
The other vim context menu entries (eg. open with existing vim session) will not be affected - they will still not have icons.
UPDATE:
From the bug report that Christian mentioned, it looks like someone else has now implemented this, in version 7.4.724.
Vim.org reports that the currently release is 7.4.729, so it should include that.
The only trouble is that the Windows binaries available for download from the site are from 2013.
But vim.org also suggests a way to get the latest version, precompiled for Windows:
For the latest version with all patches included see Cream below.
These versions are unofficial, but the download number is high and
complaints are few.
And
For an unofficial version that does include all the latest patches and
optionally a bit more: Cream.
The "one-click installer" mentioned includes the Cream changes.
For the "real Vim" use the "without Cream" version listed further down.
As far as I know, this is not possible yet. There is a whishlist bug that requests this feature, but no one has contributed code yet.

snippet in vim - any option to go back to the previous parameter?

I am using neocomplcache along with neosnippet and honza's vim-snippets. They are great, except that when I press Ctrl-k, I can go to the next parameter, but I have no way to go back to the previous parameter.
So for example, if I inserted 'for' snippet and made a typo on the index variable, but I already pressed Ctrl-k, am I screwed? Must I go through modifications of all the parameters and then come back to do replace operation? Or is there mapping for select mode that I can help me in this situation? Currently Tab and S-Tab do not do anything.
Lastly, are all snippet plugins like this? Or is neocomplcache just missing this feature (out of the box, at least)?
I encourage you to try UltiSnips. It is much more powerful and mature than vim-snippets or neosnippet. For instance, since UltiSnips is based on Python, it is very extensible. Concerning your problem: yes, you can jump back and forth with UltiSnips. Finally, be sure to check out screencasts (listed in the link) to see all the fancy stuff you can do with it.
For example, I use the following configuration:
let g:UltiSnipsSnippetsDir = '~/.vim/snippets/'
let g:UltiSnipsSnippetDirectories = ['UltiSnips', 'snippets']
let g:UltiSnipsExpandTrigger = '<C-CR>'
let g:UltiSnipsJumpForwardTrigger = '<A-d>'
let g:UltiSnipsJumpBackwardTrigger = '<A-a>'
NOTE: ~/.vim/snippets/ is my directory for custom snippets.
As I've already mentioned UltiSnips uses Python extensively, and therefore requires Vim to be built with Python support. If you are on Windows (especially x64), that might be a trouble, the one I've run into quite some time ago. To save yourself precious time and avoid frustration you may consider downloading my Vim for Windows. Both x86 and x64 architectures are provided, and it supports both Python 2 and Python 3 simultaneously. I can assure you that it is stable. To install properly just follow the instructions. These builds are updated frequently.
The original SnipMate and its fork (the plugins for which vim-snippets is actually meant to be) both allow you to go back to the previous placeholder with <S-Tab>. I believe UltiSnips does too.
Neocomplcache doesn't support snippet expansion out of the box anymore. AFAIK, you need another plugin by the same author called neosnippet which is the one responsible for the <C-k> mapping. A quick look at the doc shows no "reverse jump" mapping, function or command. You can probably create a new issue on neosnippet's Github page.

Resources