Troubleshooting
Make Vim Remember The Cursor’s Last Position After Exiting
So you edit a file in vim, you exit vim, and after a while you want to edit the file again. Many times it’s nice to have the cursor placed in the same position you left it. Here’s how to make this happen:
1. Add this to your ~/.vimrc file (or to /etc/vim/vimrc to enable to the feature system-wide):
if has(“autocmd”)au BufReadPost * if line(“‘\”") > 1 && line(“‘\”") <= line(“$”) | exe “normal! g`\”" | endifendif
touch ~/.viminfo
Move Gnome Panel To The Second Monitor – Ubuntu
Say you have two monitors set up as “extended desktop”, and you want to move the gnome-panel from one monitor to the other monitor.
Here is how to do it in Ubuntu (Tested on Ubuntu 10.04):
1. Right click the panel, choose “properties”.
2. In “General” tab, uncheck “expand”.
3. Drag the panel from its left or right edge to the other monitor.
4. Right click the panel, choose “properties”, in “General” tab recheck “expand”.
You’re done. Have fun
Found the tip here.
Update:
An easier way, is just to hold “Alt” key, and drag the panel from one monitor to the other. No need to play with the “expand” setting.
NumPad Problems When Using Vim over Tmux
I use vim as my main text editor, and I usually split the screen to edit a few buffers in parallel. To make resizing the windows faster, I mapped the numpad keys “/*-+” to resize the windows (see original vim tip here).
Recently, I started to use tmux, and opened vim, split the windows as usual, and tried to resize them. It didn’t work
I use Ubuntu 10.04 (Don’t remember the exotic name..), and I found that the latest tmux package in their repo is 1.1-1.
Anyway, version 1.1-1 has a bug with the NumPad. The solution is to download the source of tmux 1.2 and build it. It depends on libevent so you’ll need to get it first:
this is how to make it work:
1. sudo apt-get install libevent-dev
2. Get the source tarball of tmux from here.
3. tar xzf tmux-1.2.tar.gz
4. cd tmux-1.2
5. ./configure
6. make
7. sudo make install
Done. Now your life is better. Have fun
About Me
Tags
Categories
- Algorithms
- Bash
- BlackBerry
- Collaboration
- Command Line
- Cool Tricks
- Easter Eggs
- Ebooks
- Firefox
- Hardware
- Humor
- iPhone
- Linux
- Linux Development
- Linux Kernel
- Networks
- Open Knowledge
- Other
- Productivity
- Programming
- Regular Expressions
- Science
- Security
- Shell Scripts
- Short Posts
- Social Networks
- Thoughts
- Tools
- Vim
- Web Development
- Websites
Popular Posts
Calendar
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| « Sep | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | |||
Archives
- September 2010 (2)
- August 2010 (2)
- July 2010 (5)
- June 2010 (1)
- May 2010 (1)
- April 2010 (3)
- March 2010 (1)
- January 2010 (1)
- December 2009 (2)
- September 2009 (13)
- July 2009 (1)
- June 2009 (6)
- May 2009 (4)
- March 2009 (18)
- February 2009 (10)
- January 2009 (10)
- December 2008 (7)
- November 2008 (8)
- October 2008 (1)
- August 2008 (1)
- July 2008 (1)
- June 2008 (1)
