Here I post a small snippet with the vimrc I am using.
" Syntax highlighting
syntax on
" Use spaces instead of tabs
set expandtab
" Set numbering
set numberwidth=5
set number
" Set autoindentation with 4 space indentation
set autoindent
set shiftwidth=4
" Set the ruler
set ruler
" Set the CUDA filetype
au BufNewFile,BufRead *.cu set ft=cu
"au BufNewFile,BufRead *.gnu set ft=gnuplot
" Set the searc highlight
set hlsearch
" Set syntax automatic folding
set foldmethod=syntax
" Set foldcolumns
set foldcolumn=3
" Set colorscheme to desert
colorscheme desert
" Instructions to print
" Courtesy of http://vim.wikia.com/wiki/Print_to_a_Postscript_file
let &printexpr="(v:cmdarg=='' ? ".
\"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)".
\". ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error".
\" : system('mv '.v:fname_in.' '.v:cmdarg) + v:shell_error)"
In order to paste the date in command or insert mode, simply add the following lines in the .vimrc file:
ReplyDelete" Add command to put timestamp (in command or insert mode)
" Extracted from http://vim.wikia.com/wiki/Insert_current_date_or_time
nnoremap "=strftime(" - %a %d %b %Y - ")P
inoremap =strftime(" - %a %d %b %Y - ")
Hello,
ReplyDeleteI was trying to add the syntax highlighting functionality to my vim for CUDA files. I Copied the cu.vim to the dir /usr/share/vim/vim*/syntax and then added the line mentioned in your blog i.e.
au BufNewFile,BufRead *.cu set ft=cu
to my ~/.vimrc file in home. When i try to refresh the vimrc using
$. .vimrc
it gives me the following error,
bash: au: command not found
Can you help me with this ?
Thanks