Monday, September 19, 2016

vim (gVim 8.0+ on Windows) configuration notes and settings

1. In Windows, drag and drop OLE (:drop) functionality will be disabled if the program is launched as an Administrator. So remember to NOT set launch as administrator in the app's properties dialog box so drag and drop will continue to work. This also allows the right click context menu to work for 'edit with vim' and 'edit with vim (existing)' commands to open files properly. Windows won't allow drag and dropped files to escalated programs or at least it didn't work with vim.

2. As a side effect of #1, not launching as admin, means the program might not have write rights to the vimrc config file (c:\Program Files (x86)\Vim\_vimrc) so even doing :w! didn't work. E212 Can't open file for writing was the error.

Also,
cmap w!! w !sudo tee % >/dev/nul
didn't work. What DID work was going to the _vimrc file in Windows file properties security dialog and change the file permissions to allow users full access.

3. colorscheme (filename without .vim) only read from c:\Program File (x86)\Vim\Vimfiles\colors and not the default %HOME%\vimfiles\colors folder. Solution: copy the filename.vim to the program files folder.

4. Airline not showing patched font properly. Out of the prepatched fonts available the OTF fonts didn't seem to work. One font that did work that I like is Inconsolata-g.

set guifont=Inconsolata-g_for_Powerline:h11

with
set guioptions-=e "guitabs off

and
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1

turned on it worked fine. I had to make sure the following WASN'T set as this killed the special symbols.

"if !exists('g:airline_symbols')
"  let g:airline_symbols = {}
"endif
" unicode symbols
"let g:airline_left_sep = '»'
"let g:airline_left_sep = '▶'
"let g:airline_right_sep = '«'
"let g:airline_right_sep = '◀'
"let g:airline_symbols.linenr = '␊'
"let g:airline_symbols.linenr = '␤'
"let g:airline_symbols.linenr = '¶'
"let g:airline_symbols.branch = '⎇'
"let g:airline_symbols.paste = 'ρ'
"let g:airline_symbols.paste = 'Þ'
"let g:airline_symbols.paste = '∥'
"let g:airline_symbols.whitespace = 'Ξ'

and to have it show properly with airline updating the status line and tab line upon starting gvim:

autocmd VimEnter * silent AirlineRefresh | wincmd p | wincmd p

That seemed to fix it to get working right at startup.


Tuesday, September 13, 2016

Disable UAC prompts on Windows 10 and still have metro apps working

Not from me but from http://www.tenforums.com/software-apps/12065-cant-open-any-windows-app-uac-disabled-2.html#post557465

04 Feb 2016 #11
Greg R

This fix worked for me

Hello,
I disabled UAC and when I try to open Edge, Calculator, etc I get a window message that says that I cant open it with UAC disabled, I find it something very annoying that makes me think about going back to Windows 7, is there any around this?
In Windows 7 for example, I was able to open the calculator with UAC disabled.
Thanks!
I have a fix that will allow you to still keep UAC enabled, provide no prompting for a user, while still being able to run all Metro apps - calculator, Edge, weather, news, calendar, etc
Either through Group Policy or Local Security Policy
Computer Configuration\Policies\Windows Settings\SecuritySettings\Local Policies\Security Options
User Account Control: Admin Approval Mode for the Built-in Administrator account = Enabled

User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode = Prompt for Credentials
Next, make some registry changes ....
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
Make the following changes
ConsentPromptBehaviorAdmin 0x00000003 becomes 0x00000000

ConsentPromptBehaviorUser 0x00000003 becomes 0x00000000

EnableLUA 0x00000001 stays at 0x00000001
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\UIPI
Change (Default) from the (value not set) to 0x00000001(1)
Reboot your Windows 10 machine and enjoy all the metro apps that require UAC/escalation without the nags

 Remember to reboot first!