From 742fc19c2f019f62bf0c5422f1787b10d8a4eae3 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 7 Dec 2015 13:35:29 -0500 Subject: [PATCH] Copy from Artur, not sorted. --- vim/vimrc | 268 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 222 insertions(+), 46 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 38a4bac..f42c52d 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -82,6 +82,8 @@ set cino+=N-s " lines. set cino+=(0 +" enable omni completion +set omnifunc=syntaxcomplete#Complete @@ -172,6 +174,9 @@ if &t_Co > 2 || has("gui_running") set hlsearch endif +" Highlight searched string as typed. +set incsearch + " Enable syntax highlighting highlight DiffAdd cterm=none ctermfg=Black ctermbg=Green gui=none guifg=Black guibg=Green highlight DiffDelete cterm=none ctermfg=Black ctermbg=Red gui=none guifg=Black guibg=Red @@ -207,7 +212,10 @@ else endif " Configure coloring on command line terminals. if &term=="xterm" - set t_Co=8 + " enable 256 colors + set t_Co=256 + " set t_Co=8 + set t_Sb=[4%dm set t_Sf=[3%dm endif @@ -219,7 +227,12 @@ endif +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" vimdiff +" +" ignore whitespaces +set diffopt+=iwhite @@ -301,6 +314,28 @@ if has("autocmd") endif " has("autocmd") +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugins +" + +" +" Vundle experimental stuff here. +" +if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) + filetype off + set rtp+=~/.vim/bundle/Vundle.vim + call vundle#begin() + Plugin 'VundleVim/Vundle.vim' + call vundle#end() + filetype plugin indent on +endif + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Commands +" + +"command! -nargs=* PFdiff :!p4 diff %' + " Convenient command to see the difference between the current buffer and the " file it was loaded from, thus the changes you made. " Only define it when not defined already. @@ -309,47 +344,12 @@ if !exists(":DiffOrig") \ | wincmd p | diffthis endif + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Key Mappings " -" F4 grep the word under cursor. -"map :execute "grep " . expand("") . " -r *.h *.cpp *.c *.f" cw -map :execute "grep " . expand("") . " -r --include \*.h --include \*.cpp --include \*.c --include \*.f ." cw -" Create a new tab. -map :tabnew -" -"command! -nargs=* PFdiff :!p4 diff % -" -" Loads CF5Compile -" Compile and run file if Ctrl-F5 is pressed. -" -if !exists('*CF5Compile') - runtime plugin/cf5-compiler.vim -endif -map :call CF5Compile(1) -map :call CF5Compile(0) -" -" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, -" so that you can undo CTRL-U after inserting a line break. -" -inoremap u -" -" Move through wrapped lines instead of buffer lines. -" -noremap gk -noremap gj -imap gk -imap gj -" -" Working with tabs especially if using console version. -" -nnoremap th :tabfirst -nnoremap tj :tabnext -nnoremap tk :tabprev -nnoremap tl :tablast -nnoremap tm :tabm -nnoremap td :tabclose + " " .gvimrc content here. " @@ -375,14 +375,190 @@ if has("gui_running") else endif +" open ctag definition in new tab +map :tab split:exec("tag ".expand("")) + +" Create a new tab. +map :tabnew + " -" Vundle experimental stuff here. +" F4 grep the word under cursor. " -if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) - filetype off - set rtp+=~/.vim/bundle/Vundle.vim - call vundle#begin() - Plugin 'VundleVim/Vundle.vim' - call vundle#end() - filetype plugin indent on +map :execute "grep " . expand("") . " -r --include \*.h --include \*.cpp --include \*.c --include \*.f ." cw + +" +" Loads CF5Compile +" Compile and run file if Ctrl-F5 is pressed. +" +if !exists('*CF5Compile') + runtime plugin/cf5-compiler.vim +endif +map :call CF5Compile(1) +map :call CF5Compile(0) +" +" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, +" so that you can undo CTRL-U after inserting a line break. +" +inoremap u +" +" Move through wrapped lines instead of buffer lines. +" +noremap gk +noremap gj +imap gk +imap gj +" +" Working with tabs especially if using console version. +" +nnoremap th :tabfirst +nnoremap tj :tabnext +nnoremap tk :tabprev +nnoremap tl :tablast +nnoremap tm :tabm +nnoremap td :tabclose + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Experimental staff +" + +if 0 = 1 +"-------------- +" Plugins +"-------------- +"Plugin 'Rip-Rip/clang_complete' +"Plugin 'altercation/vim-colors-solarized.git' +"Plugin 'flazz/vim-colorschemes' +"Plugin 'Valloric/YouCompleteMe' +"Plugin 'rhysd/vim-clang-format' +Plugin 'vim-scripts/Mark' +Plugin 'bling/vim-airline' +Plugin 'danro/rename.vim' +Plugin 'gmarik/Vundle.vim' +Plugin 'kana/vim-operator-user' +Plugin 'kien/ctrlp.vim' +Plugin 'majutsushi/tagbar' +Plugin 'mattn/emmet-vim' +Plugin 'mileszs/ack.vim' +Plugin 'nanotech/jellybeans.vim' +Plugin 'scrooloose/nerdtree' +Plugin 'scrooloose/syntastic' +Plugin 'tmhedberg/matchit' +Plugin 'tpope/vim-commentary' +Plugin 'tpope/vim-dispatch' +Plugin 'tpope/vim-eunuch' +Plugin 'tpope/vim-fugitive' +Plugin 'tpope/vim-unimpaired' +Plugin 'vim-scripts/Align' +Plugin 'vim-scripts/Buffergator' +Plugin 'vim-scripts/a.vim' +Plugin 'vim-scripts/taglist.vim' +Plugin 'vim-scripts/DoxyGen-Syntax' +Plugin 'vim-scripts/DoxygenToolkit.vim' +Plugin 'msanders/snipmate.vim' +Plugin 'vim-scripts/xml.vim' +Plugin 'junegunn/vim-easy-align' +Plugin 'ntpeters/vim-better-whitespace' +Plugin 'airblade/vim-gitgutter' +"Plugin 'eiginn/netrw' +"Plugin 'vim-scripts/TagHighlight' +"Plugin 'gcmt/taboo.vim' + +Plugin 'xterm-color-table.vim' + +" All of your Plugins must be added before the following line +call vundle#end() " required +filetype plugin indent on " required +" To ignore plugin indent changes, instead use: +filetype plugin on + +" - - - - - - - - - - - - - - +" NERDTree settings +" - - - - - - - - - - - - - - +map :NERDTreeToggle +map :NERDTreeFind + +"map :Explore +"map :Explore %:p:h +let g:NERDTreeQuitOnOpen = 1 +let g:NERDTreeDirArrows = 1 +let NERDTreeIgnore = ['\.o$', '\.so$', '\.tsk$'] + +" - - - - - - - - - - - - - - +" tagbar settings +" - - - - - - - - - - - - - - +map :TagbarToggle +let g:tagbar_autoclose = 1 +let g:tagbar_autofocus = 1 +let g:tagbar_autoshowtag = 1 +let g:tagbar_compact = 1 +let g:tagbar_indent = 1 +let g:tagbar_sort = 1 +let g:tagbar_width = 60 +let g:tagbar_ctags_bin = "/opt/swt/bin/ctags" + +" - - - - - - - - - - - - - - +" powerline +" - - - - - - - - - - - - - - +let g:Powerline_symbols = "unicode" + +" - - - - - - - - - - - - - - +" CtrlP +" - - - - - - - - - - - - - - +let g:ctrlp_root_markers = ['.ctrlp'] +let g:ctrlp_custom_ignore = { + \ 'file': '\v\.(o|d|dd)$', + \ } + +" - - - - - - - - - - - - - - +" Buffergator +" - - - - - - - - - - - - - - +let g:buffergator_viewport_split_policy = "L" + +" - - - - - - - - - - - - - - +" syntastic +" - - - - - - - - - - - - - - +"let g:syntastic_cpp_compiler_options = ' -std=c++1y' +let g:syntastic_mode_map = { + \ "mode": "active", + \ "active_filetypes": ["ruby", "php"], + \ "passive_filetypes": ["c", "cpp"] } + + +" - - - - - - - - - - - - - - +" vim-colorschemes +" - - - - - - - - - - - - - - +colorscheme jellybeans +let g:jellybeans_use_lowcolor_black = 0 + +" - - - - - - - - - - - - - - +" Ack +" - - - - - - - - - - - - - - +let g:ack_default_options = " --ignore-file=is:tags -s -H --nocolor --nogroup --column" +let g:ack_highlight = 1 + +" - - - - - - - - - - - - - - +" a +" - - - - - - - - - - - - - - +let g:alternateExtensions_h = "cpp,c" +let g:alternateExtensions_cpp = "h" +let g:alternateExtensions_c = "h" + +" - - - - - - - - - - - - - - +" netrw +" - - - - - - - - - - - - - - +let g:netrw_altv = 1 +let g:netrw_fastbrowse = 2 +let g:netrw_keepdir = 0 +let g:netrw_liststyle = 3 +let g:netrw_retmap = 1 +let g:netrw_silent = 1 +let g:netrw_special_syntax= 1 + +" - - - - - - - - - - - - - - +" taboo vim +" - - - - - - - - - - - - - - +"let g:taboo_tab_format = "[%m:%N:%W] %f" + +let g:strip_whitespace_on_save = 1 + endif