Wednesday, November 18, 2009

Color highlight in Vim

First of all we'll edit or create ~/.vimrc file:

Code:" Set syntax highlighting to always on
syntax enable

" Set the background to dark and the colorscheme to murphy
set background=dark
colorscheme murphy

" Set automatic filetype detection to on
filetype on


From now, by default highlight would be enabled and the colorscheme we'll be "murphy". If we wanted to use another color highlight we can download it from this site:

http://www.cs.cmu.edu/%7Emaverick/VimColorSchemeTest/index-pl.html

After downloaded the file, save it in ~/.vim/colors/ directory.

Sources:
http://www.linuxquestions.org/questions/linux-software-2/color-highlight-in-vim-howyoudothat-565358/

Saturday, November 7, 2009

Hide the windows command prompt

To execute a program in a hidden windows command prompt, we can create a JScript file (.js extension) and then execute it:

JScript code
var WindowStyle_Hidden = 0
var objShell = WScript.CreateObject("WScript.Shell")
var result = objShell.Run("cmd.exe /c putty.exe 192.168.1.14 -l tv", WindowStyle_Hidden)


In this case, this script we'll execute putty.exe in a hidden cmd prompt.

Source:
http://www.geekstogo.com/forum/Hide-command-prompt-windows-t56092.html