Blog Archives
#MacOsX : vimrc
If you are looking to configure Vim you find the default configuration file in:
/usr/share/vim/vimrc
Copy and rename it in your home directory:
cp /usr/share/vim/vimrc ~/.vimrc
However it is bare minimal so it is better if you personalize it a bit. One very simple example is the following:
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
" Use Vim defaults instead of 100% vi compatibility
set nocompatible
" more powerful backspacing
set backspace=2
" Display line numbers on the left
set number
" Allow intelligent auto-indenting for each filetype
" and for "plugins that are filetype specific.
filetype indent plugin on
" Fallback when no filetype-specific indenting is enabled
set autoindent
" Enable syntax highlighting
syntax on
" Display the cursor position
set ruler
" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup
#MacOsX : Enable Quicklook Text Selection [OUTDATED]
Quicklook is a beautiful and powerful feature of Mac Os X (take a look here to know what is capable of) but it is somewhat weird that it doesn’t allow text selection.
To enable text selection in Quicklook:
defaults write com.apple.finder QLEnableTextSelection -boolean YES
killall Finder
NOTE: this trick stopped working with Mac OS X 10.11 and later.
#MacOsX : How Cut & Paste Works in Mac OS X
Yep, Mac world is only about Drag & Drop but if you feel nostalgic of PC’s world you can move files the old way, just do this:
- selct file/files and hit
Command + C
- move to another location an hit
Command + Option + V
#MacOsX : Disable Auto-Save and Versions in Mac OS X
Auto-Save and Versions are excellent features in Mac OS X, but some advanced users are annoyed by them as they often don’t want to save intermediate versions of their work.
Moreover some apps write lots of data on disk (e.g. iMovie and iBooks Author) and this can shorten the life of SSD (look here for more tuning for SSDs).
If you know the name of the app plist you want to disable auto-save and Versions for, you can just plug the name into the defaults write command:
defaults write app-plist ApplePersistence -bool no
If you don’t know it then you can find it with the following command:
osascript -e 'id of application "NAME OF APP"'
Now if you enter the Versions window, auto-save list will be empty and there are no versions to restore to. You’ll probably want turn off File Locking too.
NOTE: some sandboxed apps require another command in addition:
defaults write app-plist AutosavingDelay -int 0
This is expecially true for TextEdit as it is the only Apple app that uses “old-style” autosaving and this causes issues with the sandbox in Lion/Mountain Lion.
NOTE2: It seems that the preference can be set globally but it may cause the login process to become very slow and possibly cause other unexpected behaviour:
defaults write -g ApplePersistence -bool no
#MacOSX : Customize Launchpad with Launchpad-Control
Quoting from developer’s site:
Already upgraded to Mac OS X Lion? Yes? Well then you certainly know Launchpad, the “home for your apps” like Apple says.
A huge disadvantage of Launchpad is that every app located in your /Applications folder is shown. That means that you will see little helper programs like uninstallers or updaters, too.
These apps can’t be hidden from Launchpad easily because Apple does not provide any preference pane or tool to do so.
Launchpad-Control is a small tool which allows you to easily hide/unhide apps (and groups) from Launchpad in Mac OS X Lion.
NOTE: it is free, but be kind and make a donation to the developer, he will appreciate it very much. 😉
#MacOSX : Change Launchpad Background
If you do not like default background of Launchpad you can easily change it:
- Go to Launchpad
- Hit Ctrl + Alt + Cmd + B
- Hit more if you want
That’s All. 🙂