Search This Blog

06 August, 2015

Turning off expandtab in VIM for editing makefile

if you had set the .vimrc to change the tab to spaces for C programming, it will be difficult to edit or create makefiles,

 i had trouble creating makefile , i was getting the below error

Makefile:18: *** missing separator.  Stop.


after googled little and  found the  solution, edit the .vimrc file like below



let _curfile = expand("%:t")
if _curfile =~ "Makefile" || _curfile =~ "makefile" || _curfile =~ ".*\.mk"
set noexpandtab
else
set expandtab
set tabstop=4
set shiftwidth=4
endif

07 July, 2015

Using arrow keys in insert mode shows characters in vi editor

while using vi in Oracle virtual box with Ubuntu 12.04 as the guest OS with Windows 7 as the host, when we press arrow keys in insert mode, it used to print B, A, D, C

to fix this add the below line to the .vimrc file, if  it is no file create it

set nocompatible

after this setting if you open the vi , the problem should not come

20 June, 2015

installing datastax cassandra cpp-driver package for Ubuntu



1) Install cassandra cpp-driver from
http://downloads.datastax.com/cpp-driver/ubuntu/

select the ubuntu version properly

For Ubuntu 12.04

sudo wget http://downloads.datastax.com/cpp-driver/ubuntu/12.04/cassandra-cpp-driver_2.0.1-1_amd64.deb
sudo wget http://downloads.datastax.com/cpp-driver/ubuntu/12.04/libuv_1.4.2-1_amd64.deb

For Ubuntu 14.04

sudo wget http://downloads.datastax.com/cpp-driver/ubuntu/14.04/cassandra-cpp-driver_2.0.1-1_amd64.deb
sudo wget http://downloads.datastax.com/cpp-driver/ubuntu/14.04/libuv_1.4.2-1_amd64.deb


sudo dpkg -i libuv_1.4.2-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver_2.0.1-1_amd64.deb

done

11 June, 2014

reverting the applied patch

for reverting the patch we applied using the patch command

patch -p1 < diff.patch

use
patch -R -p1 < diff.patch


26 May, 2014

vim showing all opened files using sp/vsp


showing all opened files in vim
in vimrc file paste the below line
map <F4> :ls<CR>:buffer<space>

after opening the files in vim, type F4 and you can see the files and jump by pressing the corresponding the number

tmux enabling mouse interaction

Add the below line to the ~/.tmux.conf setw -g mouse on save the file and exit from the tmux shell, you should be able to use your mouse to ...