Vim's comment line leaking is annoying!
Friday, January 25. 2013
Is it just me or is vim's automatic comment continue to the next line completely unnecessary? Every time I copy/paste anything into vim it makes the smart choice and completely messes up the code. And this is enabled as a default! WTF?
Something like this will help:
:set formatoptions-=cro
This reads, disable following:
- c
- Auto-wrap comments using textwidth, inserting the current comment leader automatically
- r
- Automatically insert the current comment leader after hitting <Enter> in Insert mode
- o
- Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode
After that copy/paste works as it should.
Is it just me or is vim's automatic comment continue to the next line completely unnecessary? Every time I copy/paste anything into vim it makes the smart choice and completely messes up the code. And this is enabled as a default! WTF?
Something like this will help:
:set formatoptions-=cro
This reads, disable following:
- c
- Auto-wrap comments using textwidth, inserting the current comment leader automatically
- r
- Automatically insert the current comment leader after hitting <Enter> in Insert mode
- o
- Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode
After that copy/paste works as it should.
vim modelines
Tuesday, January 22. 2013
My weapon-of-choice in Linux CLI is vim. However, out-of-the-box it acts very stubbornly when editing files with modeline. The nice modelines seem to have zero effect. WTF!?
To my amazement, it appears that modelines are turned off as a default. It can be verified with a simple echo command from vim:
:echo &modeline
will yield 0 as an answer. So step 1 is to enable them in ~/.vimrc, if the file does not exist, create it. If it does exist, make sure that it contains following:
set modeline
Then confirm that echo will display 1 to indicate that modeline is enforced. What a great idea to not enable them! Nice going suckers!
To create your own modeline, put something like this into your file:
# vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab:
It reads:
- tabstop=4
- The width of a TAB is set to 4. Still it is a \t. It is just that vim will interpret it to be having width of 4.
- shiftwidth=4
- Indents will have a width of 4
- softtabstop=4
- Sets the number of columns for a TAB
- expandtab
- Expand TABs to spaces
My weapon-of-choice in Linux CLI is vim. However, out-of-the-box it acts very stubbornly when editing files with modeline. The nice modelines seem to have zero effect. WTF!?
To my amazement, it appears that modelines are turned off as a default. It can be verified with a simple echo command from vim:
:echo &modeline
will yield 0 as an answer. So step 1 is to enable them in ~/.vimrc, if the file does not exist, create it. If it does exist, make sure that it contains following:
set modeline
Then confirm that echo will display 1 to indicate that modeline is enforced. What a great idea to not enable them! Nice going suckers!
To create your own modeline, put something like this into your file:
# vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab:
It reads:
- tabstop=4
- The width of a TAB is set to 4. Still it is a \t. It is just that vim will interpret it to be having width of 4.
- shiftwidth=4
- Indents will have a width of 4
- softtabstop=4
- Sets the number of columns for a TAB
- expandtab
- Expand TABs to spaces
MagicISO leftovers after uninstall
Wednesday, January 9. 2013
MagicISO is ancient ISO-image editing app. If you want to install it and see the ancient look it has and notice that the trial versio is hugely crippled, you may choose to uninstall it like I did.
Guess what! It does not remove the shell extension and the DLL-file associated with it. The software is gone and there is very little you can do to get rid of the context menu.
I found that NirSoft's ShellExView is the tool for that job. Just pick the MagicISO context menu and disable it. The menu does not disappear from the context menu automatically. Explorer needs to be reloaded for that. I simply killed the process with Windows Task Manager and restarted it.
Done!
MagicISO is ancient ISO-image editing app. If you want to install it and see the ancient look it has and notice that the trial versio is hugely crippled, you may choose to uninstall it like I did.
Guess what! It does not remove the shell extension and the DLL-file associated with it. The software is gone and there is very little you can do to get rid of the context menu.
I found that NirSoft's ShellExView is the tool for that job. Just pick the MagicISO context menu and disable it. The menu does not disappear from the context menu automatically. Explorer needs to be reloaded for that. I simply killed the process with Windows Task Manager and restarted it.
Done!
Bacula vchanger Fedora 17 binary
Sunday, January 6. 2013
Fedora 17 does come with pre-built Bacula, but the important virtual tape-changer software is a separate SourceForge project and Fedora-people don't seem to include it.
I found a SPEC-file for vchanger and built binaries. The src-RPM is also there, go get them if you need'em. The goodies are at http://opensource.hqcodeshop.com/Bacula/.
Fedora 17 does come with pre-built Bacula, but the important virtual tape-changer software is a separate SourceForge project and Fedora-people don't seem to include it.
I found a SPEC-file for vchanger and built binaries. The src-RPM is also there, go get them if you need'em. The goodies are at http://opensource.hqcodeshop.com/Bacula/.
Serendipity blog
Saturday, January 5. 2013
My weapon of choice for this blog is Serendipity Weblog System.
The criteria were simple:
- Written in PHP
- Not WordPress
- Must support PostgreSQL
- Not WordPress
- Enough popularity / reputability, that one will want to run the software
- and finally: Not WordPress
Serendipity seems to have all 6 of the above. It is a pain to install the way I did it. I'm mod_rewriting the /serendipity/ directory away and it causes a ton of pain. I managed to do that, but it is obvious that the authors did not plan this software to be (ab)used like that.
My weapon of choice for this blog is Serendipity Weblog System.
The criteria were simple:
- Written in PHP
- Not WordPress
- Must support PostgreSQL
- Not WordPress
- Enough popularity / reputability, that one will want to run the software
- and finally: Not WordPress
Serendipity seems to have all 6 of the above. It is a pain to install the way I did it. I'm mod_rewriting the /serendipity/ directory away and it causes a ton of pain. I managed to do that, but it is obvious that the authors did not plan this software to be (ab)used like that.