set nocompatible               " be iMproved
syntax on
set number
set tabstop=4
set shiftwidth=4
set smartindent
set expandtab
set showcmd
set incsearch
set mouse=a
set completeopt=menu,menuone,longest
set pumheight=15
set wildmenu
set backspace=indent,eol,start
let g:SuperTabDefaultCompletionType = "context"
let g:clang_complete_auto = 1
let g:clang_complete_copen = 0
let g:clang_snippets = 1
let g:clang_snippets_engine = 'snipmate'
let g:clang_use_library = 1
let g:NERDTreeWinPos = "right"
let Tlist_Auto_Open = 1
let Tlist_Use_SingleClick = 1
set bg=dark

map <F2> :previous<CR>          "map F2 to next buffer
map <F3> :next<CR>              "map F3 to next buffer

map <F12> :!cscope -Rqb<CR>:cs kill 0<CR>:cs add cscope.out<CR>

filetype on                   " required!

filetype plugin indent on 

augroup __java__
au!
au BufReadPre,BufNewFile *.java set fileencodings=utf-8 fileencoding=utf-8 encoding=utf-8
au BufRead,BufNewFile *.java set tw=0 foldmethod=indent cindent
au BufRead,BufNewFile *.java set tabstop=4 expandtab
au BufRead,BufNewFile *.java set foldmethod=syntax foldclose=all foldnestmax=1
au BufRead,BufNewFile *.java noremap <F10> :JavaBrowser<CR>
au BufRead,BufNewFile *.java inoremap <F10> <Esc>:JavaBrowser<CR>
au BufRead,BufNewFile *.java noremap <Tab> >>
au BufRead,BufNewFile *.java so ~/.vim/plugin/javabrowser.vim
augroup END

autocmd VimEnter * NERDTree
autocmd VimEnter * wincmd p

nmap <silent> <C-h> :wincmd h<CR>
nmap <silent> <C-l> :wincmd l<CR>
nnoremap <leader>t :ConqueTermSplit bash<CR>
nnoremap <leader>r :ConqueTermSplit 

let g:ConqueTerm_CloseOnEnd = 1
let mapleader = ","

function! MyHelp()
    echo "----------------------------------------------------------"
    echo "^x^n- used for omni completition"
    echo "^p - used for completition of current word (Previous) before cursor"
    echo "^n - used for completition of current word (Next) after cursor"
    echo "^x^f- Completion filename in current directory"
    echo ", t - will call plugin vim-command-t for searching files recursivelly from current directory"
    echo ":TlistAddFilesRecursive for adding files to tag list"
    echo "----------------------------------------------------------"
    echo "\n\n\n"
endfunction

map <F1> :call MyHelp()<CR>

