一出禪定凡夫而已

感恩師佛的加持與教導

感恩佛菩薩的加持與教導
----------------------------------
原來,任風吹、任雨打後,心不識很難。

生的雞肉,下油鍋炸後,還是生的雞肉嗎?

投入一個大染缸中,能不被污染,可能嗎?


四力懺悔

感恩根本上師聖尊 蓮生活佛

感恩所有諸佛菩薩護法金剛
--------------------------------------
當一個真佛行者的確不簡單,

感恩這世有緣分皈依師佛,學師佛傳的真佛密法!

雖然我不是一個很精進的弟子,

有時候也會偷懶一下,

但是想到師佛的努力不懈,實在慚愧!

回想當初,是什麼理由來皈依師佛的?

回想當初,是什麼機緣來皈依師佛的?

現在才4~5年而已,心越來越混亂! 真得很慚愧,

11/22這一天晚上,在打坐前,

突然翻師尊的一本書,書名是 "逆風而行",

我隨意翻到一頁,這一頁的標題讓我的心很難過,

標題是:我的業障真的很重!

呼應我這一個禮拜在心裡,一直在圍繞的聲音,

柏雄的業障怎麼那麼重!

修了四五年,越修業障越重!

小孩生了,家庭要顧,工作要顧,小孩要顧、、、

想一想,能修一壇法,能修一座禪定,真是一件很奢侈的幸福!!!

自己的心依舊有太多太多不好的習氣,

師尊的書- - -逆風而行 - - - 提到,四力懺悔!

宗咯巴如是說:

初閉關時,[宗喀巴]大師心想:
  “修行最大的障礙,就是往昔所造的罪障習氣,它覆蓋著清淨心,使深道殊勝功德難以生起,又修行人若無廣大的福德資糧,任他如何勤修智慧,也無法證得清淨的佛位。因此,修行的基礎,首重淨治罪障,積集福德資糧。
  “開示四法經雲:‘慈氏,若諸菩薩摩訶薩,成就四法,則能映覆諸惡已作增長。何等為四?謂能破壞現行(拔除力)、對治現行(對治力)、遮止罪惡(防護力)及依止力。所以淨治罪障,須依四力懺悔。
  拔除力
  修行人要對自己無始以來所造的種種罪障,一一髮露,痛加懺悔,決心改過。好比病人犯了絕症,急求離病一樣。
  依止力
  修行人要念念皈依上師三寶,須臾不離,以上師三寶為真實救護處;又應發廣大菩提心,誓願學習諸大菩薩的廣大心行,擔負眾生無知所犯的罪障。好比患病的人,若想治好病症,必須依靠高明的醫生,和對症下藥的藥方一樣。
  對治力
  修行人要想除去罪障,必須依靠種種方法,如:
   依止甚深經典,勝解空義,了知眾生本來就有清淨的心,和罪性本空的道理,並相信只要如法痛加懺悔,罪障絕對可以清淨。
   依照儀軌如法持誦百字明咒,或其他殊勝陀羅尼,並深信本尊有清除罪障的力量。
   供養諸佛、造立佛像,把所有功德回向一切眾生,願眾生一切痛苦罪障永遠枯竭。
   聽聞受持諸佛名號、諸大佛子所有名號,以及念佛之身口意功德,深心嚮往,一意向學。
  這些方法,就好像患病的人,若想除去疾苦,必須服藥、打針、針灸一樣。
  防護力
  修行人,須嚴謹守護六根,靜息十種不善,寧死不再重犯。這好比患病的人,雖然病好了,仍須注意飲食起居,小心防護,才不致誤犯一樣。
  “雖然淨治惡障的方法有很多,但如能具足以上所說的四力,則能事、理不偏廢,圓滿一切對治。”
  因此大師與諸弟子們,一開始閉關,就同依此四力門,勵力懺悔業障,不敢懈怠。
  (當時西藏有些修學佛法的人,由於誤解經義,往往對於最根本的事懺不屑一顧,而專騖理懺,認為只要不思善不思惡,或只念過去心不可得、現在心不可得、未來心不可得,就可消除一切罪障。結果有許多人,一旦業果來臨時,無不捶胸頓腳,悔恨交加,但為時已晚矣!)

感恩 師佛的教誨

阿彌陀佛

Vim (or MacVim) as a C/C++ IDE

This post is meant to be a little guide to setting up Vim (or MacVim) as your next favorite C/C++ IDE. Vim is probably the most powerful text editor that humans have ever created, so you should consider using it even if its learning curve is a bit steep.

MacVim


First, let’s install MacVim. MacVim adds a graphical interface to Vim that can help newcomers (only for OSX users, others should consider GVim). Skip the next steps if you want to use the regular Vim instead.
  • Get the latest snapshot of MacVim from here (make sure you have the correct OSX version).
  • Decompress it (double click) and drag MacVim.app to your Applications folder.
  • Open the Terminal (commonly located in /Applications/Utilities/Terminal.app, but I suggest you put it in your Dock) and go to the MacVim Snapshot folder you just downloaded. In my case, I had to type the following:
    cd ~/Downloads/MacVim-snapshot-73/
  • Copy the mvim binary to your PATH so that you can open MacVim from any directory in your computer. Like this (you will have to enter your machine password):
    sudo cp mvim /usr/bin
  • Now you should be able to start a new document with MacVim by typing:
    mvim hello.c
    (Type :w to quit).

.vimrc


Now that you have Vim (and/or MacVim) installed in your system, the next thing you should do is to set it up to adapt it to your needs. The rest of the instructions work for Vim and MacVim, so I will use Vim to refer to both (simply replace vim for mvim if you want to use MacVim). Vim is highly configurable, but here I will describe what I believe is the most useful setup for new users and C/C++ developers.
The Vim (or MacVim) configuration file is located in ~/.vimrc. Therefore, type vim ~/.vimrc to start editing your configuration. You might see a blank file if you have never edited Vim’s configuration before. You can copy and paste the following. There’s a comment for the most important commands, so that you can understand what these lines do if you are interested.
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
" Enables highlight syntax
syntax enable
set nofoldenable
" Sweet colorscheme
" colorscheme codeschool
set background=dark
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf-8
"" Display line numbers on the left
set number
"" Use mouse (only for resizing!)
set mouse=a
" Set the focus to the correct screen (ok, no more mouse thingies)
set mousefocus
" No more annoying sounds
set visualbell
" Do not scroll sideways unless we reach the end of the screen
set sidescrolloff=0
" highlight the status bar when in insert mode
if version >= 700
    if has("gui_running")
        au InsertEnter * hi StatusLine guifg=black guibg=green
        au InsertLeave * hi StatusLine guibg=black guifg=grey
    else
        au InsertEnter * hi StatusLine ctermfg=235 ctermbg=2
        au InsertLeave * hi StatusLine ctermbg=240 ctermfg=12
    endif
endif
" Infere the case-sensitivity
set infercase
" Need to set this flag on in order to have many cool features on
set nocompatible
" Indent properly based on the current file
filetype indent plugin on
filetype plugin on
" Pathogen load
"filetype off " Makes syntax non-working on office box
call pathogen#infect()
call pathogen#helptags()
" Switch between files in buffer
nnoremap :bn
nnoremap :bp
" Change default fontsize to fit MacBook Pro 13'
set guifont=Monaco:h11
" Don't select first Omni-completion option
set completeopt=longest,menuone
"set completeopt=menuone,longest,preview
set tabstop=4     " a tab is four spaces
set backspace=indent,eol,start
                  " allow backspacing over everything in insert mode
set autoindent    " always set autoindenting on
set copyindent    " copy the previous indentation on autoindenting
set shiftwidth=4  " number of spaces to use for autoindenting
set shiftround    " use multiple of shiftwidth when indenting with '<' and '>'
set incsearch     " show search matches as you type
set expandtab
set shiftwidth=4
set softtabstop=4
" Always set the current file directory as the local current directory
autocmd BufEnter * silent! lcd %:p:h
" Enable folding
nnoremap @=(foldlevel('.')?'za':"\")
vnoremap zf
set history=1000         " remember more commands and search history
set undolevels=1000      " use many levels of undo
" Tabs in command line mode behave like bash
set wildmode=longest,list,full
set wildmenu
" Highlight the entire word when searching for it
set hlsearch
"====[ Make tabs, trailing whitespace, and non-breaking spaces visible ]======
exec "set listchars=tab:\uBB\uBB,trail:\uB7,nbsp:~"
set list
" Move line by line even when the line is wrapped
map j gj
map k gk
" Persistent undo
set undofile                " Save undo's after file closes
set undodir=$HOME/.vim/undo " where to save undo histories
set undolevels=1000         " How many undos
set undoreload=10000        " number of lines to save for undo
" YouCompleteMe
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py"
nnoremap g :YcmCompleter GoToDefinitionElseDeclaration

Plugins


Now it’s time to install some plugins. We will start with Pathogen, a script to make the installation of other scripts extremely easy. To install Pathogen, just type:
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim > ~/.vim/autoload/pathogen.vim
Using Pathogen, we will install Syntastic, a wonderful plugin to identify errors in your code (linting) in the most popular programming languages. To install it, just type:
cd ~/.vim/bundle && \
git clone https://github.com/scrooloose/syntastic.git
Now restart Vim and type :Helptags. Linting should be working now for C/C++.
The next plugin to install is MiniBufExplorer, which will make our life easier when dealing with multiple files in Vim. To install it, simply type:
cd ~/.vim/bundle && \
git clone https://github.com/fholgado/minibufexpl.vim.git
We also want to have some auto complete options when developing our C/C++ programs. The best plugin I’ve found is called YouCompleteMe, which is compatible with basically all the most popular programming languages to date. Type the following to install it:
cd ~/.vim/bundle && \
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
./install.sh --clang-completer
Note: You might need to install Homebrew to install YouCompleteMe. To install it, type:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
You will need to do some additional setup in order to get the plugin working. As you may see in the second to last line of the .vimrc above, we set up the default configuration file in ~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py. You can simply copy my .ymc_extra_conf.py in this folder. To do so, simply type:
curl http://urinieto.com/drop/.ycm_extra_conf.py > ~/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py
Finally, the last plugin to install is the C Plugin, which will help us when navigating through C/C++ files, debugging, etc. This plugin does not support Pathogen installation, so we will have to do it manually. Go to the official plugin page: http://www.vim.org/scripts/script.php?script_id=213 and download the latest cvim.zip. Copy the zip file to your ~/.vim/folder and type:
unzip cvim.zip
Before we are done, you should configure the template file with your name and affiliation. To do so, edit the template file and edit the user macros, like this:
vim ~/.vim/c-support/templates/Templates
My User Macros look like this:

§ ==========================================================
§ User Macros
§ ==========================================================
SetMacro( 'AUTHOR', 'Oriol Nieto' )
SetMacro( 'AUTHORREF', '' )
SetMacro( 'COMPANY', 'New York University' )
SetMacro( 'COPYRIGHT', '' )
SetMacro( 'EMAIL', 'oriol@nyu.edu' )
SetMacro( 'LICENSE', '' )
SetMacro( 'ORGANIZATION','New York University' )
If you’ve done everything correctly, you will be able to create a new .c file (e.g. vim hello.c and a nice template will be included in the top of the file. Moreover, you should be able to open multiple files (e.g. :e otherfile.c) and they will appear in the MiniBufferExplorer. And finally, if you make some errors while coding, Syntastic will tell you. As an example, see the following screenshot:
MacVim with the following plugins: Syntastic, YouCompleteMe, C.vim, and MiniBufExplorer
MacVim with the following plugins: Syntastic, YouCompleteMe, C.vim, and MiniBufExplorer

Please, let me know if you have any questions. I hope you enjoy your new IDE!

虹光大成就-密教灌頂(一)