Now that i have been using windows regularly thought of moving over the setup to my windows desktop. I was initially skeptical about how octopress and ruby will pan out.
Here are my setup steps:
install github for windows (makes ssh key management easier)
install ruby & ruby devkit
gem install bundler
copied over my blog directory from linux box (for new users it would be installing octopress)
bundle install in blog directory
rake new_post["post title"]
rake deploy - this will populate _deploy directory
Ideally rake deploy should work out just fine otherwise you could always push generate site thru github for desktop.
To get rake deploy working start git shell installed with github for desktop. This should launch a powershell window.
test out connection to github from gitshell as detailed here
D:\blog\nullptr [source +0 ~2 -0]> ssh -T [email protected]Warning: Permanently added 'github.com,126.96.36.199'(RSA) to the list of known hosts.
Hi sarangbaheti! You've successfully authenticated, but GitHub does not provide shell access.
Google drive while a great service lacks the capability of showing the folder/file sizes. I guess it helps a lot to know the hogs, given you get only 15GB for free.
I have been looking around for solution to this problem recently and found some discussion on Google Product Forum.
To cut the chase: you can browse to this link: https://drive.google.com/drive/quota and it should list the the files sorted by size.
Well it is still missing the folder size information, but I feel better using this than some third party plugins.
These days most of the editors have some sort of facility to make same edit in multiple lines. With Visual Studio it is Alt + down-arrow, similarly other decent text editors (sublime-text, atom and brackets) have some built-in support for multiple-cursors.
I was wondering if vim has something of this goodness. Well vim has this support, you just need to check if your copy of vim was built with visualextra option or not.
checking vim information
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 92014 17:36:18)Included patches: 1-488
Modified by [email protected]Compiled by buildd@
Huge version without GUI. Features included (+) or not (-):
+conceal +libcall +profile +visualextra
We are looking for presence of +visualextra option here, if present you can go into visual mode and add multiple cursors.
To get this going open a file in vim, and position the cursor from where you want to start doing multiline edits.
I would my cursor over to < at first line and then press Ctrl+V (assuming it is not mapped to paste) to move to block selection mode. Then press j key 10 times (i want to comment 10 lines) or press down-arrow key so many times. While doing all this vim will show that i am in VISUAL BLOCK selecion mode:
vim with file multiple-cursors-demo.rb open
<title>MSXML3: A Comprehensive Guide</title>
<description>The Microsoft MSXML3 parser is covered in
detail, with attention to XML DOM interfaces, XSLT processing,
SAX and more.</description>
-- VISUAL BLOCK -- 1,1 All
Once you have 10 lines highlighted, press I character to go into insert mode (-- VISUAL BLOCK -- should change to -- INSERT --) and enter # character and then hit Esc key.
All lines will be commented out, now you can do multiline comment in ruby with =begin and =end, so this was contrived example- but there are many situations where you want to append or prepend some text to existing variable- there it comes handy.
Note: vim can insert multiple cursors anywhere (as you specify with motion commands).
That’s all for now
vim what an editor! I am yet to find someone who used this editor but is neutral. Either folks love it or hate it. I think that is sign of a truly remarkable product, in sense it connects to core- evoking emotional reaction. It was not long ago i was in vim WTF camp. But had to spend a few weeks on linux and re-discovered vim. After about a month of usage vim is one of my preferred editors for code browsing- even on windows. :)
Learning and getting used to vim took some time- especailly it was learning not to fight normal and insert mode. One my left little finger developed flesh memory of hitting esc key every now and then- life became much better with vim.
The other thing that makes vim awesome is plugin support and number of plugins available. I have been using ctags for quite some time- but started using cscope recently and love it. For mid sized projects it is quite fast and snappy and the code database makes all sorts of queries possible. Now that i found that it integrates well with vim. This post is about getting cscope hooked up in vim.
Now that I moved my blog to github-pages generated by octopress, using git is the only way to make progress. Rather than digressing about my experiences @migrating from wordpress to octopress- I would rather keep this post as my notes on git
I find it interesting to learn by jumping-in rather than reading tons of volumes first. To get started you need to let git know that you are going to be setting a repository, this needs to happen in a particular directory- which contains stuff you want to manage.
The command is:
git init .
Initialized empty Git repository in /home/sarangb/learn-git/.git/
Once an empty git repo is initialized now the next step is to add some content for git to track. Lets start by adding a a script that fetches weather information (just for fun). Once I have the script the next step is to let git know about it.
git add *.sh
git commit -m 'initial commit'
This will add all sh files to git, this is two step process:
git add will add the files to a staging area, more on that shortly
git commit will commit files in git repo
Now that scripts have been added. Say you need to tweak the script and recommit the changes.