[off topic] Darn good quote
It's so much easier to suggest solutions when you don't know too much about the problem.
-- Malcolm Forbes
It's so much easier to suggest solutions when you don't know too much about the problem.
-- Malcolm Forbes
Posted by
Ihar Filipau
at
11:43 PM
0
comments
Simple Vim intro by Linux Magazine.
Posted by
Ihar Filipau
at
2:07 PM
0
comments
Another upgrade, another OS, another update... Well, new home directory - consequently new .vimrc.
Here is N hours into coding minimalistic usable .vimrc:
filetype plugin off
syntax on
imap <Insert> <Nop>
set bs=2 ruler title comments= nowrap
set cindent cinkeys-=: cinkeys-=0#
colo torte
let loaded_matchparen = 1
au BufReadPost * if line("'\"") > 0 &&
\ line("'\"") <= line("$") | exe "normal g'\"" | endif
I hope this time, Blogger/BlogSpot hadn't eaten any characters.
The set comment= creeped in before I have realized that filetype plugin is still on.
Posted by
Ihar Filipau
at
12:56 PM
0
comments
Always forget the very useful shortcut which is apparently intended for "Vim Easy":^O
When in insert mode (and, by definition, in easy vim you are always in the mode) to insert command from Normal mode, you press first ^O and then start typing the command.
e.g. to delete to the end of line press ^O followed by Shift-d. Pressing : you can also access all the ex commands too - but that will leave insert mode.
Posted by
Ihar Filipau
at
3:00 PM
2
comments
How would I use a vim function to insert the output of these commands at the current cursor position?
Well, that would look like a crude hack, yet here it goes:
:function InsertCmd( cmd )
: exe ':silent !'.a:cmd.' > /tmp/vim.insert.xxx 2>/dev/null'
: let l = readfile( '/tmp/vim.insert.xxx', '', 1 )
: exe "normal a".l[0]
: redraw!
:endfunction
:imap <silent> <F5> <Esc>:call InsertCmd( 'hostname' )<CR><Insert>
:map <silent> <F5> :call InsertCmd( 'hostname' )<CR>
Posted by
Ihar Filipau
at
4:40 AM
3
comments
Accidentally came across new (at least to me) monospace font called "Droid Sans Mono."
Since I'm droid coder already, there is no real danger of using the font - with such terribly sounding name.
Link
Posted by
Ihar Filipau
at
12:43 PM
1 comments
Labels: droid sans mono monospace font
Posted by
Ihar Filipau
at
12:12 PM
0
comments
Labels: link
Lack of shortcut to minimize current window had bothered me for very very long time.
But finally I found a solution. There is a wonderful program for M$Windows called AutoHotkey. Main purpose of program is to allow you to override particular shortcuts to perform custom action. Program is pretty cryptic, but allow for some automation of Windows what is definitely progress. (For example I have bunch of shortcuts to retrieve information from Firefox in half-automatic fashion.)
Now the magic to put into AutoHotkey.ahk (default) configuration file:#x::
WinMinimize, A
return
"#x" is "Win-X" shortcut (hold the (otherwise worthless) key with Windows flag on it and press X). "WinMinimize, A" command tells to minimize active ("A") window. "return" tells to stop further script processing.
Edit1.
Bit of additional magic to disable the single-Alt menu silliness and to emulate Mac OS X input of German umlaut characters:Alt::
return
>!u::Send {ASC 0252}
>!o::Send {ASC 0246}
>!a::Send {ASC 0228}
+>!u::Send {ASC 0220}
+>!o::Send {ASC 0214}
+>!a::Send {ASC 0196}
Posted by
Ihar Filipau
at
10:29 AM
0
comments
While wonders of KDE's VIM components are not new, that stroke me as ... funny.
Vimplugin and viPlugin allow one to use VIM editor as replacement of standard text editor of Eclipse SDK.
Funny.
P.S. Thanks God I'm safe from Java programming. For now.
Posted by
Ihar Filipau
at
2:36 PM
0
comments
The tip was found in VIM's help under :help color-xterm and works for HP-UX and Solaris. I conditionally exclude Linux to be unaffected by workaround, since F/LOSS folks - compared to the Unix old farts - have managed somehow to ship decent terminfo/termcap boasting color support out of box.
if &t_Co > 0
" Linux/etc has proper terminfo
else
if &term =~ "xterm"
if has("terminfo")
set t_Co=8
set t_Sf=^[[3%p1%dm
set t_Sb=^[[4%p1%dm
else
set t_Co=8
set t_Sf=^[[3%dm
set t_Sb=^[[4%dm
endif
endif
endif
~/.vimrc. The '^[' needs to be replaced by real escape character - ^V<Esc>.
Posted by
Ihar Filipau
at
7:36 AM
0
comments
Labels: broken terminal