From 957dea8117e63fc8c5e6a24536b8aab09d259939 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Tue, 8 Dec 2015 09:36:58 -0500 Subject: [PATCH 01/30] BB: .gitconfig --- config/.gitconfig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 config/.gitconfig diff --git a/config/.gitconfig b/config/.gitconfig new file mode 100644 index 0000000..58cb9a1 --- /dev/null +++ b/config/.gitconfig @@ -0,0 +1,23 @@ +[user] + name = Vahagn Khachatryan + email = vahagn.khachatryan@gmail.com +[color] + diff = auto + status = auto +[push] + default = simple +[alias] + tree = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold cyan)<%an>%Creset' --abbrev-commit --date=relative + drqs = "!f(){ git checkout -b feature/DRQS$1; }; f" + svnsync = "!f(){ git co master && git pull && ssh devgit svnsync $(git config --get remote.origin.url | cut -d : -f 2 );}; f" + st = status + br = branch + co = checkout + ci = commit +[merge] + tool = vimdiff + conflictstyle = diff3 +[mergetool] + prompt = false +[include] + path = ~/.gitconfig.local From 742fc19c2f019f62bf0c5422f1787b10d8a4eae3 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 7 Dec 2015 13:35:29 -0500 Subject: [PATCH 02/30] 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 From 6d4489bf657686acfd52088b4fabeadb653a1d71 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Tue, 8 Dec 2015 13:17:00 -0500 Subject: [PATCH 03/30] BB: vim-airline and xterm-color-table is added through vundle. --- vim/vimrc | 298 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 157 insertions(+), 141 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index f42c52d..b970154 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -210,6 +210,9 @@ if has("gui_running") else colors vahagn_black_terminal endif + +" enable 256 colors +set t_Co=256 " Configure coloring on command line terminals. if &term=="xterm" " enable 256 colors @@ -326,8 +329,162 @@ if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' + + " + " Adds nice status and tabline. + " + Plugin 'bling/vim-airline' + let g:airline#extensions#tabline#enabled = 1 + let g:airline#extensions#tabline#left_sep = ' ' + let g:airline#extensions#tabline#left_alt_sep = '|' + " + " Color table and picker. + " :XtermColorTable + " press: # to yank, t to toggle, f to set text color + " + Plugin 'xterm-color-table.vim' + + " call vundle#end() filetype plugin indent on + filetype plugin on +endif + +if exists("dddd") + +"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 configuration +" + +" - - - - - - - - - - - - - - +" 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 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -421,144 +578,3 @@ 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 From 6cc5c8f3377c0434a6ddc30599118064f9b32630 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 10 Dec 2015 11:19:43 -0500 Subject: [PATCH 04/30] Fixed re-entrance guard in local-vimrc. --- vim/plugin/local-vimrc.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/plugin/local-vimrc.vim b/vim/plugin/local-vimrc.vim index 54b0b23..b4a32f8 100644 --- a/vim/plugin/local-vimrc.vim +++ b/vim/plugin/local-vimrc.vim @@ -18,7 +18,7 @@ " " loaded_local_vimrc is set to 1 when initialization begins, and 2 when it " completes. -if exists('g:loaded_locl_vimrc') +if exists('g:loaded_local_vimrc') finish endif let g:loaded_local_vimrc=1 From 01da9b2f04a00b411d243fe4d9940f21e015a643 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 10 Dec 2015 11:22:58 -0500 Subject: [PATCH 05/30] 256 color support mode is added in .tmux.conf --- config/.tmux.conf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/.tmux.conf b/config/.tmux.conf index b8ad2f0..f39cab7 100644 --- a/config/.tmux.conf +++ b/config/.tmux.conf @@ -8,13 +8,15 @@ set -g status-keys vi setw -g mode-keys vi set -g status-position top +set -g default-terminal "screen-256color" +set -g mode-mouse off + +#bind p paste-buffer bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R -set -g mode-mouse off - bind m \ set -g mode-mouse on \;\ set -g mouse-resize=pane on \;\ From 7f8f4b86882f1d519cb6e5273e19cf725e5a6c56 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 10 Dec 2015 13:29:23 -0500 Subject: [PATCH 06/30] More plugins are added. --- vim/vimrc | 138 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 86 insertions(+), 52 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index b970154..361a4d0 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -38,7 +38,7 @@ set shiftwidth=4 " blanks according to softtabstop. set smarttab " Don't expand tabs. -set noexpandtab +set expandtab if has('autocmd') " Unset expandtab for make files in any case. autocmd FileType make setlocal noexpandtab @@ -113,6 +113,45 @@ set notimeout ttimeout ttimeoutlen=200 " Display " +" Configure coloring on command line terminals. +if &term=="xterm" + " enable 256 colors + set t_Co=256 + " set t_Co=8 + + set t_Sb=[4%dm + set t_Sf=[3%dm +endif +" +" Configure color theme, fonts and other graphics. +" +if has("gui_running") + " set color scheme + colorscheme darkblue + "set guioptions-=m + "set guioptions-=T + set lines=50 + set columns=85 + + " Set the font. + if has("win32") || has("win64") + "set guifont=FreeMono:h14:cANSI + "set guifont=Courier\ AM:h12 + else + "set guifont=Bitstream\ Vera\ Sans\ Mono\ 12 + set guifont=Monospace\ 12 + endif +else + colorscheme vahagn_black_terminal +endif + +" Switch syntax highlighting on, when the terminal has colors +" Also switch on highlighting the last used search pattern. +if &t_Co > 2 || has("gui_running") + syntax on + set hlsearch +endif + " wrap text at window edge without modifying buffer set nowrap " Scroll this much chars when scrolled horizontally. @@ -150,8 +189,10 @@ if exists('&number') set number endif " Turn on spell check. -if exists("+spell") +if exists("+spell") && &diff=="nodiff" set spell + highlight clear SpellBad + highlight SpellBad cterm=underline ctermfg=red endif " Show 80th column. if exists("+colorcolumn") @@ -167,13 +208,6 @@ set wildmode=longest:full " remember more history set history=1000 -" Switch syntax highlighting on, when the terminal has colors -" Also switch on highlighting the last used search pattern. -if &t_Co > 2 || has("gui_running") - syntax on - set hlsearch -endif - " Highlight searched string as typed. set incsearch @@ -186,42 +220,6 @@ highlight DiffText cterm=none ctermfg=Black ctermbg=Magenta gui=none guifg=Black set list set listchars=tab:>-,trail:ยท - - -" -" .gvimrc content here. -" -if has("gui_running") - " set color scheme - colorscheme darkblue - "set guioptions-=m - "set guioptions-=T - set lines=50 - set columns=85 - - " Set the font. - if has("win32") || has("win64") - "set guifont=FreeMono:h14:cANSI - "set guifont=Courier\ AM:h12 - else - "set guifont=Bitstream\ Vera\ Sans\ Mono\ 12 - set guifont=Monospace\ 12 - endif -else - colors vahagn_black_terminal -endif - -" enable 256 colors -set t_Co=256 -" Configure coloring on command line terminals. -if &term=="xterm" - " enable 256 colors - set t_Co=256 - " set t_Co=8 - - set t_Sb=[4%dm - set t_Sf=[3%dm -endif " In many terminal emulators the mouse works just fine, thus enable it. if has('mouse') " set mouse=n @@ -230,12 +228,21 @@ endif + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " vimdiff " -" ignore whitespaces -set diffopt+=iwhite +" Turn on spell check. +if &diff=="diff" + + "turn off spelling + set nospell + + " ignore whitespaces + set diffopt+=iwhite + +endif @@ -344,6 +351,38 @@ if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) " Plugin 'xterm-color-table.vim' + " :A switches to the header file (or vise versa) + " :AS splits and switches + " :AV vertical splits and switches + " :AT new tab and switches + " :AN cycles through matches + " :IH switches to file under cursor + " :IHS splits and switches + " :IHV vertical splits and switches + " :IHT new tab and switches + " :IHN cycles through matches + " ih switches to file under cursor + " is switches to the alternate file of file under + " cursor (e.g. on switches to foo.cpp) + " ihn cycles through matches + Plugin 'vim-scripts/a.vim' + + " + " :set syntax=cpp.doxygen to highlight doxygen comments. + " + Plugin 'vim-scripts/DoxyGen-Syntax' + " + " In vim, place the cursor on the line and + " :DoxLic - generates license comment. + " :DoxAuthor - skeleton and leave the cursor just after @author tag. + " :Dox - generates function/class comment. + " :DoxUndoc(DEBUG) - if you want to ignore all code fragment ifdefed with + " DEBUG. + " :DoxBlock - + " + Plugin 'vim-scripts/DoxygenToolkit.vim' + + " call vundle#end() filetype plugin indent on @@ -358,9 +397,7 @@ if exists("dddd") "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' @@ -377,10 +414,7 @@ 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' From d9d53bba213df9ed5bb80b11891ef373ffb62665 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 10 Dec 2015 22:40:45 +0000 Subject: [PATCH 07/30] General bashrc. --- config/.bashrc | 360 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 360 insertions(+) create mode 100644 config/.bashrc diff --git a/config/.bashrc b/config/.bashrc new file mode 100644 index 0000000..e0c2805 --- /dev/null +++ b/config/.bashrc @@ -0,0 +1,360 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# ~/.bashrc skeleton +# ~/.bashrc runs ONLY on non-login subshells! (different from ksh) +# add lines here very carefully as this may execute when you don't i +# expect them to +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#echo "BASHRC has run" + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth +# append to the history file, don't overwrite it +shopt -s histappend +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -lAF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# +# Source global definitions +# +if [ -f /etc/bashrc ]; then + . /etc/bashrc +else + # are we an interactive shell? + if [ "$PS1" ]; then + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' + # Turn on checkwinsize + shopt -s checkwinsize + [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " + fi + + if ! shopt -q login_shell ; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + if [ "$PS1" ]; then + . $i + else + . $i &>/dev/null + fi + fi + done + unset i + fi +fi + +umask 002 + +# +#alias dirs='dirs -v' +#alias ack='ack --ignore-file=ext:d,dd' +# +#alias dirtree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' " +#alias currgit='cd /bb/mbig/mbig1205/devgit/s_tktapi2/src; echo -e "I am here $(pwd)"' +#alias tktapi='cd /bb/mbig/mbig1205/devgit/tktapi/src; echo -e "I am here $(pwd) \n $(ls)"' +#alias bastest='/bbsrc/abin/basclient' +#alias bas_codegen='/bb/shared/bin/bas_codegen.pl' +#alias metasymfind="cat - | awk '{ print \$1 }' | xargs symfind | awk 'BEGIN{FS=\"[\"} { print \$1 }' | sort | uniq | tr '\n' ' ' | sed -e 's/\(\b\S\)/-l\1/g' && echo \"\"" +# +#alias git-robo='ssh devgit svnsync $(git remote -v | grep "(fetch)" | cut -d ":" -f2 | cut -d "(" -f1); git fetch origin; git pull; git merge robo/trunk; read -p "!!!!! PUSH the merged version back !!!!! ? [Y] / Ctrl+C to stop"; git push' +#alias intuorcreate=/bbsrc/internal/isystest/uorcreate/intuorcreate +# +# +#export EDITOR=/opt/swt/bin/nedit +#export TERM=xterm +# +#export BIGHOME=/bb/mbig/mbig1205 +#export PLINK_PARALLEL_BUILD=true +#export EDITOR=/opt/swt/bin/nedit +#export PAGER=less +#export GROUP=trading-systems-group +#export mysvn="svn+ssh://devsvn" +#export myrobosvn="svn+ssh://devsvn/robo/branches/trunk" +#export PATH=/opt/swt/bin:~/bin:/bb/util/common/studio12/SUNWspro/bin:${PATH} +#export DEVGIT=${BIGHOME}/devgit +#export VISUAL=/opt/swt/bin/nedit +#export MAIL=/usr/mail/${LOGNAME:?} +# +#codegrep() { +# if [[ $# -eq 0 ]] +# then +# echo "Usage: codegrep " +# else +# grep -nT --colour \ +# --exclude=tags \ +# --exclude=*.o \ +# --exclude=*.so \ +# --exclude=*.tsk \ +# --exclude=*.d \ +# --exclude=*.dd \ +# "$1" * +# fi +#} +# +##ssh() { +# #echo "wut" +# #[[ -n "$INSCREEN" ]] && TERM=screen-256color +# #env ssh -t $* +# #$SCREEN_TITLE_CMD +##} +# +#sshcd() { +# if [[ $# -lt 1 ]] +# then +# echo "Usage: sshcd []" +# else +# ssh -t $LOGNAME@$1 "export SSHCDPATH=${path:-$(pwd)}; exec $BASH --login " +# fi +#} +# +#biggest() { +# dir=${1:-.} +# find $dir -type f -exec du -a {} \+ | sort -rn +#} +# +## Screen variables +#function last2dirs { +# pwd | awk -F\/ '{print $(NF-1),$(NF)}' | sed 's# #/#' +#} +# +##screen specific functionality +##if [[ -n ${STY} ]] +##then +# PROMPT_COMMAND='echo -ne "\033k${HOSTNAME} $(last2dirs)\033\\"; +# history -a;' +##fi +# +#function dupscreen { +# screen bash -c "export SSHCDPATH=$PWD && exec $SHELL --login" +#} +# +#if [ -n "$BBENV" ] && [[ -f ~/bin/hijackEOD.sh ]] +#then +# source `which hijackEOD.sh` +#fi +# +# + +# +# Don't source the rest twice. +# +#if [ "$BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE" == "true" ]; then +# return +#fi + +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# +# Find out system details. +# +os=`uname -o` #GNU/Linux AIX Solaris +cpu=`uname -p` #x86_64 powerpc sparc +kernel=`uname -s` #Linux AIX SunOS +kversion=`uname -v` +krelease=`uname -r` +hostnm=`hostname` + +# +# User specific environment and startup programs +# +if [ $kernel == Linux ]; then + MYLOCAL=$HOME/local-lnx +elif [ $kernel == SunOS ]; then + MYLOCAL=$HOME/local-sun +fi +MYSCRIPTS=$HOME/devel/scripts +PATH=$MYLOCAL/bin:$PATH +PATH=$MYSCRIPTS/bash:$PATH +PATH=$MYSCRIPTS/bloomberg:$PATH + +# +# VIM +# +#VIMDIR=/depot/vim-7.3/bin +#VIM=${VIMDIR}/vim +#if [ "$kernel" == "Linux" ]; then +# alias vi=$VIM +# alias vim=$VIM +# alias gvim=${VIMDIR}/gvim +# alias ctags="/depot/ctag-5.5.4/bin/ctags" +#fi + +# +# GIT +# +[ -f $MYSCRIPTS/bash/git-completion.bash ] && . $MYSCRIPTSE/bash/git-completion.bash + +# +# GCC +# +#if [ -e /depot/gcc-4.7.2/bin ]; then +# PATH=/depot/gcc-4.7.2/bin:$PATH +# LD_LIBRARY_PATH=/depot/gcc-4.7.2/lib64:$LD_LIBRARY_PATH +#elif [ -e /depot/gcc-4.7.0/bin ]; then +# PATH=/depot/gcc-4.7.0/bin:$PATH +# LD_LIBRARY_PATH=/depot/gcc-4.7.0/lib64:$LD_LIBRARY_PATH +#elif [ -e /depot/gcc-4.5.2/bin ]; then +# PATH=/depot/gcc-4.5.2/bin:$PATH +# LD_LIBRARY_PATH=/depot/gcc-4.5.2/lib64:$LD_LIBRARY_PATH +#fi + +# +# GDB +# +#prepath /depot/gdb-7.5.1/bin + +# +# VTune Amplifier +# +#export INTEL_LICENSE_FILE=28518@us01-lic10:28518@us01-lic11:28518@us01-lic12:28518@tyndall +#alias vtune=/depot/vtune_amplifier_xe_2013_update5/bin64/amplxe-gui + +# +# PURIFY and all. +# +#postpath /depot/coverity/swat/bin +#export RSU_TEMPLATE2_INI=/depot/pure/templates2.ini +#export RSU_LICENSE_MAP=/depot/pure/PurifyPlus_License_Map +#export PURECOVOPTIONS="-force-rebuild=no -log-file=./%v.%p.log -counts-file=./%v.%p.pcv -windows=no" +#export PUREOPTIONS="-force-rebuild=no -always-use-cache-dir=yes -cache-dir=$HOME/tmp/pure_cache" +#export QUANTIFYOPTIONS="-force-rebuild=no -always-use-cache-dir=yes -cache-dir=$HOME/tmp/pure_cache" +#export LD_LIBRARY_PATH=$HOME/prj/fw/rmain/3pty/qt/4.7.2/amd64/lib:$LD_LIBRARY_PATH +#alias purecov="/depot/swe/a2007.12/bin/purecov" +#alias quantify"/depot/swe/a2007.12/bin/quantify" + +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# +# BLOOMBERG and TOMS +# + +# if chimera generated aliases exist, pull them into the current ENV +[ -f ~/.bbalias ] && . ~/.bbalias + +export BB=$HOME/devel/bb +export DEVGIT=$BB/devgit +PATH=$PATH:$BB/scripts + +getpw() { # BOX + if [[ $# -ne 1 ]]; then + echo "Usage: getpw " + else + local BOX="$1" + local BIN="/bb/bin/getprdwin" + $BIN -u op1 -i -s $BOX -d "op1 for $USER on $BOX" + fi +} +alias create_tags='/opt/swt/bin/ctags -R --verbose --exclude=.git --exclude=.doxygen --exclude="*.o" --exclude="llcalc*"' + +# +# set alias +# +alias ll='ls -la --color=tty' +alias cd='pushd >/dev/null' +alias bd='popd' +alias bb='pushd $HOME/devel/bb >/dev/null' +alias cgrep="grep --include \*.cpp --include \*.h --include \*.c --color=auto" +#complete -f --X '!*.mk' plink + +# +# Make sure to export PATH +# +export PATH +#export LM_LICENSE_FILE +export HISTFILESIZE=5000 # Store 5000 commands in history +export HISTCONTROL=ignoredups # Don't put duplicate lines in the history. + From 6d660a0755d3fa616f95ee8619d90b90a8f7fa0d Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 14 Dec 2015 00:22:06 +0000 Subject: [PATCH 08/30] Configuring VIM more. --- config/.tmux.conf | 5 + vim/colors/vahagn_black_terminal.vim | 2 +- vim/vimrc | 434 +++++++++++++-------------- 3 files changed, 218 insertions(+), 223 deletions(-) diff --git a/config/.tmux.conf b/config/.tmux.conf index f39cab7..4db64f0 100644 --- a/config/.tmux.conf +++ b/config/.tmux.conf @@ -17,6 +17,11 @@ bind j select-pane -D bind k select-pane -U bind l select-pane -R +bind -r C-h resize-pane -L +bind -r C-j resize-pane -D +bind -r C-k resize-pane -U +bind -r C-l resize-pane -R + bind m \ set -g mode-mouse on \;\ set -g mouse-resize=pane on \;\ diff --git a/vim/colors/vahagn_black_terminal.vim b/vim/colors/vahagn_black_terminal.vim index 9f6e932..e5a8c6b 100644 --- a/vim/colors/vahagn_black_terminal.vim +++ b/vim/colors/vahagn_black_terminal.vim @@ -18,7 +18,7 @@ hi ModeMsg term=bold cterm=bold gui=bold hi StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold hi StatusLineNC term=reverse cterm=reverse gui=reverse hi VertSplit term=reverse cterm=reverse gui=reverse -hi Visual term=reverse ctermbg=black guibg=grey60 +hi Visual term=reverse ctermbg=DarkGray guibg=grey60 hi VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold hi DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red hi Cursor guibg=Green guifg=Black diff --git a/vim/vimrc b/vim/vimrc index 361a4d0..fe9414c 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -308,8 +308,6 @@ if has("autocmd") " Put these in an autocmd group, so that we can delete them easily. augroup vimrcEx au! - - " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). @@ -324,225 +322,15 @@ 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' - - " - " Adds nice status and tabline. - " - Plugin 'bling/vim-airline' - let g:airline#extensions#tabline#enabled = 1 - let g:airline#extensions#tabline#left_sep = ' ' - let g:airline#extensions#tabline#left_alt_sep = '|' - " - " Color table and picker. - " :XtermColorTable - " press: # to yank, t to toggle, f to set text color - " - Plugin 'xterm-color-table.vim' - - " :A switches to the header file (or vise versa) - " :AS splits and switches - " :AV vertical splits and switches - " :AT new tab and switches - " :AN cycles through matches - " :IH switches to file under cursor - " :IHS splits and switches - " :IHV vertical splits and switches - " :IHT new tab and switches - " :IHN cycles through matches - " ih switches to file under cursor - " is switches to the alternate file of file under - " cursor (e.g. on switches to foo.cpp) - " ihn cycles through matches - Plugin 'vim-scripts/a.vim' - - " - " :set syntax=cpp.doxygen to highlight doxygen comments. - " - Plugin 'vim-scripts/DoxyGen-Syntax' - " - " In vim, place the cursor on the line and - " :DoxLic - generates license comment. - " :DoxAuthor - skeleton and leave the cursor just after @author tag. - " :Dox - generates function/class comment. - " :DoxUndoc(DEBUG) - if you want to ignore all code fragment ifdefed with - " DEBUG. - " :DoxBlock - - " - Plugin 'vim-scripts/DoxygenToolkit.vim' - - - " - call vundle#end() - filetype plugin indent on - filetype plugin on -endif - -if exists("dddd") - -"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 'danro/rename.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/taglist.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 configuration -" - -" - - - - - - - - - - - - - - -" 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 - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " 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. -if !exists(":DiffOrig") - command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis - \ | wincmd p | diffthis -endif - - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Key Mappings " - " -" .gvimrc content here. " if has("gui_running") ":tab drop {file} @@ -557,25 +345,18 @@ if has("gui_running") \set guioptions+=T \set showtabline=1 \endif - - " Open file in a new tab. - if has("browsefilter") - let g:browsefilter = "All Files (*.*)\t*\n" - endif - -else endif " open ctag definition in new tab map :tab split:exec("tag ".expand("")) " Create a new tab. -map :tabnew +"map :tabnew " " F4 grep the word under cursor. " -map :execute "grep " . expand("") . " -r --include \*.h --include \*.cpp --include \*.c --include \*.f ." cw +map :execute "grep " . expand("") . " -r --include \*.h --include \*.cpp --include \*.c --include \*.f ." cw " " Loads CF5Compile @@ -609,6 +390,215 @@ nnoremap tm :tabm nnoremap td :tabclose """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Experimental staff +" 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' + + " + " Adds nice status and tabline. + " + Plugin 'bling/vim-airline' + let g:airline#extensions#tabline#enabled = 1 + let g:airline#extensions#tabline#left_sep = ' ' + let g:airline#extensions#tabline#left_alt_sep = '|' + + " + " Manipulation with buffers and tabs. + " + Plugin 'vim-scripts/Buffergator' + let g:buffergator_suppress_keymaps = 1 + let g:buffergator_viewport_split_policy = "L" + map :BuffergatorToggle + map :BuffergatorTabsToggle + + " + " + " + "Plugin 'eiginn/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 + "map :Explore + "map :Explore %:p:h + + " + " + " + Plugin 'scrooloose/nerdtree' + let g:NERDTreeQuitOnOpen = 1 + let g:NERDTreeDirArrows = 1 + let g:NERDTreeIgnore = ['\.o$', '\.so$', '\.tsk$'] + map :NERDTreeToggle + map :NERDTreeFind + + " + " :A switches to the header file (or vise versa) + " :AS splits and switches + " :AV vertical splits and switches + " :AT new tab and switches + " :AN cycles through matches + " :IH switches to file under cursor + " :IHS splits and switches + " :IHV vertical splits and switches + " :IHT new tab and switches + " :IHN cycles through matches + " ih switches to file under cursor + " is switches to the alternate file of file under + " cursor (e.g. on switches to foo.cpp) + " ihn cycles through matches + " + Plugin 'vim-scripts/a.vim' + let g:alternateExtensions_h = "cpp,c" + let g:alternateExtensions_cpp = "h" + let g:alternateExtensions_c = "h" + + + " + " Comment code. + " gc - visusl mode - comment selection. + " + "Plugin 'tpope/vim-commentary' + " + " Git wrapper. + " + Plugin 'tpope/vim-fugitive' + " + " Shows git diff. + " [c - jump prev diff + " ]c - jump nex diff + " hs - stage the hunk + " hr - revert the hunk + " :GitGutterNextHunk + " :GitGutterPrevHunk + " :GitGutterStageHunk + " :GitGutterRevertHunk + " :GitGutterToggle + " :GitGutterLineHighlightsToggle + " + Plugin 'airblade/vim-gitgutter' + let g:gitgutter_sign_column_always = 1 + let g:gitgutter_map_keys = 0 + let g:gitgutter_realtime = 0 + let g:gitgutter_eager = 0 + + + " + " Check syntaxis on fly. + " + "Plugin 'scrooloose/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"] } + + " + " Nice colorschemes. + " + if has("gui_running") + Plugin 'nanotech/jellybeans.vim' + "colorscheme jellybeans + "let g:jellybeans_use_lowcolor_black = 0 + endif + if has("gui_running") + Plugin 'altercation/vim-colors-solarized.git' + let g:solarized_termcolors=256 + "set backgroung=dark + "set backgroung=light + "colorscheme solarized + endif + + " + " :set syntax=cpp.doxygen to highlight doxygen comments. + " + Plugin 'vim-scripts/DoxyGen-Syntax' + " + " In vim, place the cursor on the line and + " :DoxLic - generates license comment. + " :DoxAuthor - skeleton and leave the cursor just after @author tag. + " :Dox - generates function/class comment. + " :DoxUndoc(DEBUG) - if you want to ignore all code fragment ifdefed with + " DEBUG. + " :DoxBlock - + " + Plugin 'vim-scripts/DoxygenToolkit.vim' + " + " Color table and picker. + " :XtermColorTable + " press: # to yank, t to toggle, f to set text color + " + "Plugin 'xterm-color-table.vim' + + " + call vundle#end() + filetype plugin indent on + filetype plugin on +endif + +if exists("dddd") + +"Plugin 'Rip-Rip/clang_complete' +"Plugin 'flazz/vim-colorschemes' +"Plugin 'Valloric/YouCompleteMe' +"Plugin 'rhysd/vim-clang-format' +Plugin 'vim-scripts/Mark' +Plugin 'danro/rename.vim' +Plugin 'kana/vim-operator-user' + +Plugin 'kien/ctrlp.vim' +let g:ctrlp_root_markers = ['.ctrlp'] +let g:ctrlp_custom_ignore = { + \ 'file': '\v\.(o|d|dd)$', + \ } + +Plugin 'majutsushi/tagbar' +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" + +Plugin 'mattn/emmet-vim' +Plugin 'tmhedberg/matchit' +Plugin 'tpope/vim-dispatch' +Plugin 'tpope/vim-unimpaired' +Plugin 'vim-scripts/Align' +Plugin 'vim-scripts/taglist.vim' +Plugin 'vim-scripts/xml.vim' +Plugin 'junegunn/vim-easy-align' +Plugin 'ntpeters/vim-better-whitespace' +let g:strip_whitespace_on_save = 1 + +"Plugin 'vim-scripts/TagHighlight' +"Plugin 'gcmt/taboo.vim' +"let g:taboo_tab_format = "[%m:%N:%W] %f" + +" - - - - - - - - - - - - - - +" powerline +" - - - - - - - - - - - - - - +let g:Powerline_symbols = "unicode" + +" Ack +Plugin 'mileszs/ack.vim' +let g:ack_default_options = " --ignore-file=is:tags -s -H --nocolor --nogroup --column" +let g:ack_highlight = 1 + + +endif + From 0e4381543d56e65ab264287d971a110708048a0d Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sat, 23 Jan 2016 13:28:38 +0000 Subject: [PATCH 09/30] A try to configure tmux to pass key sequances correctly --- config/.tmux.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/config/.tmux.conf b/config/.tmux.conf index 4db64f0..b4c8e45 100644 --- a/config/.tmux.conf +++ b/config/.tmux.conf @@ -9,6 +9,7 @@ setw -g mode-keys vi set -g status-position top set -g default-terminal "screen-256color" +set-window-option -g xterm-keys on set -g mode-mouse off #bind p paste-buffer From a3579a36a0bd5f05aab9992d109158110f89c2eb Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 10 Feb 2016 12:50:57 -0500 Subject: [PATCH 10/30] .ctags added. --- config/.ctags | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 config/.ctags diff --git a/config/.ctags b/config/.ctags new file mode 100644 index 0000000..36b03aa --- /dev/null +++ b/config/.ctags @@ -0,0 +1,5 @@ +# Basic options +--recurse=yes +--tag-relative=yes +--exclude=.git + From 1ead0fd7c6127ef77a4dab7267a452c9e5a39377 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 10 Feb 2016 12:52:24 -0500 Subject: [PATCH 11/30] .tmux.conf revisited. --- config/.tmux.conf | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/config/.tmux.conf b/config/.tmux.conf index b4c8e45..65ad295 100644 --- a/config/.tmux.conf +++ b/config/.tmux.conf @@ -1,16 +1,33 @@ +# +# Ctrl-a is the prefix. +# set -g prefix C-a bind C-a send-prefix unbind C-b -set-option -g history-limit 10000 +# Start windows from #1 (default #0) +set -g base-index 1 +# Status bar is on top. +set -g status-position top +set -g status-utf8 on + +# Keep this much of history per window. +set -g history-limit 100000 + +# 256color mode. +set -g default-terminal "screen-256color" +setw -g xterm-keys on + +# VI mode set -g status-keys vi setw -g mode-keys vi -set -g status-position top - -set -g default-terminal "screen-256color" -set-window-option -g xterm-keys on -set -g mode-mouse off +# Setup 'v' to begin selection as in Vim +bind-key -t vi-copy v begin-selection +bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" +# Update default binding of 'Enter' to also use copy-pipe +#unbind -t vi-copy Enter +#bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" #bind p paste-buffer bind h select-pane -L @@ -18,10 +35,16 @@ bind j select-pane -D bind k select-pane -U bind l select-pane -R -bind -r C-h resize-pane -L -bind -r C-j resize-pane -D -bind -r C-k resize-pane -U -bind -r C-l resize-pane -R +#bind -r C-h resize-pane -L +#bind -r C-j resize-pane -D +#bind -r C-k resize-pane -U +#bind -r C-l resize-pane -R + +#No mouse +set -g mode-mouse off +set -g mouse-select-pane off +set -g mouse-resize-pane off +set -g mouse-select-window off bind m \ set -g mode-mouse on \;\ @@ -29,7 +52,8 @@ bind m \ set -g mouse-select-pane on \;\ set -g mouse-select-window on \;\ display 'Mouse: ON' -bind m \ +bind M \ + set -g mode-mouse off \;\ set -g mouse-resize=pane off \;\ set -g mouse-select-pane off \;\ set -g mouse-select-window off \;\ From 3dee0820e817ac8d295786a38a9a7d53c7df01ec Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 7 Mar 2016 22:23:50 +0000 Subject: [PATCH 12/30] Ignoring vim/bundle --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3819313..7090f34 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.swp *.swo +vim/bundle + From 7b539d82a2004309a9e5a7659eb9762af328fa85 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 18 Mar 2016 05:30:16 -0400 Subject: [PATCH 13/30] Moving company specific files to local. --- {mg => local/mg}/.vimrc.local | 0 {mg => local/mg}/build_and_run.csh | 0 {mg => local/mg}/create_dwa.csh | 0 {mg => local/mg}/create_iwa.csh | 0 {mg => local/mg}/cshrc | 0 {mg => local/mg}/integrate.csh | 0 {mg => local/mg}/merge.csh | 0 {mg => local/mg}/merge.tcl | 0 {mg => local/mg}/sync_home | 0 bash/bashrc.synopsys => local/snps/.bashrc.local | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename {mg => local/mg}/.vimrc.local (100%) rename {mg => local/mg}/build_and_run.csh (100%) rename {mg => local/mg}/create_dwa.csh (100%) rename {mg => local/mg}/create_iwa.csh (100%) rename {mg => local/mg}/cshrc (100%) rename {mg => local/mg}/integrate.csh (100%) rename {mg => local/mg}/merge.csh (100%) rename {mg => local/mg}/merge.tcl (100%) rename {mg => local/mg}/sync_home (100%) rename bash/bashrc.synopsys => local/snps/.bashrc.local (100%) diff --git a/mg/.vimrc.local b/local/mg/.vimrc.local similarity index 100% rename from mg/.vimrc.local rename to local/mg/.vimrc.local diff --git a/mg/build_and_run.csh b/local/mg/build_and_run.csh similarity index 100% rename from mg/build_and_run.csh rename to local/mg/build_and_run.csh diff --git a/mg/create_dwa.csh b/local/mg/create_dwa.csh similarity index 100% rename from mg/create_dwa.csh rename to local/mg/create_dwa.csh diff --git a/mg/create_iwa.csh b/local/mg/create_iwa.csh similarity index 100% rename from mg/create_iwa.csh rename to local/mg/create_iwa.csh diff --git a/mg/cshrc b/local/mg/cshrc similarity index 100% rename from mg/cshrc rename to local/mg/cshrc diff --git a/mg/integrate.csh b/local/mg/integrate.csh similarity index 100% rename from mg/integrate.csh rename to local/mg/integrate.csh diff --git a/mg/merge.csh b/local/mg/merge.csh similarity index 100% rename from mg/merge.csh rename to local/mg/merge.csh diff --git a/mg/merge.tcl b/local/mg/merge.tcl similarity index 100% rename from mg/merge.tcl rename to local/mg/merge.tcl diff --git a/mg/sync_home b/local/mg/sync_home similarity index 100% rename from mg/sync_home rename to local/mg/sync_home diff --git a/bash/bashrc.synopsys b/local/snps/.bashrc.local similarity index 100% rename from bash/bashrc.synopsys rename to local/snps/.bashrc.local From e683f35674e102bf5641bd8407c8d0acee2595d7 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 8 Apr 2016 13:37:27 -0400 Subject: [PATCH 14/30] Git ignore global. --- config/.gitconfig | 2 ++ config/.gitignore.global | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 config/.gitignore.global diff --git a/config/.gitconfig b/config/.gitconfig index 58cb9a1..71f9342 100644 --- a/config/.gitconfig +++ b/config/.gitconfig @@ -21,3 +21,5 @@ prompt = false [include] path = ~/.gitconfig.local +[core] + excludesfile = ~/.gitignore.global diff --git a/config/.gitignore.global b/config/.gitignore.global new file mode 100644 index 0000000..6e4fa7e --- /dev/null +++ b/config/.gitignore.global @@ -0,0 +1,5 @@ +*.swp +*.o +*.d +plink.log +llcalc_* From 3a585a64125b205569e1e980bb8b247f8f090bc6 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 8 Apr 2016 13:40:41 -0400 Subject: [PATCH 15/30] Bashrc cleaned up. Local definitions are moved to a separate file. --- config/.bashrc | 324 ++++++++++--------------------------------------- 1 file changed, 62 insertions(+), 262 deletions(-) mode change 100644 => 100755 config/.bashrc diff --git a/config/.bashrc b/config/.bashrc old mode 100644 new mode 100755 index e0c2805..82f8e36 --- a/config/.bashrc +++ b/config/.bashrc @@ -1,4 +1,4 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. +#!/bin/bash # ~/.bashrc skeleton # ~/.bashrc runs ONLY on non-login subshells! (different from ksh) @@ -7,240 +7,40 @@ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #echo "BASHRC has run" -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac - -# don't put duplicate lines or lines starting with space in the history. -# See bash(1) for more options -HISTCONTROL=ignoreboth -# append to the history file, don't overwrite it -shopt -s histappend -# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set a fancy prompt (non-color, unless we know we "want" color) -case "$TERM" in - xterm-color) color_prompt=yes;; -esac - -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - -if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] ' -else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi -unset color_prompt force_color_prompt - -# If this is an xterm set the title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of ls and also add handy aliases -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# colored GCC warnings and errors -export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' - -# some more ls aliases -alias ll='ls -lAF' - -# Alias definitions. -# You may want to put all your additions into a separate file like -# ~/.bash_aliases, instead of adding them here directly. -# See /usr/share/doc/bash-doc/examples in the bash-doc package. - -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Source global definitions +# Source global definitions # if [ -f /etc/bashrc ]; then - . /etc/bashrc + . /etc/bashrc else - # are we an interactive shell? - if [ "$PS1" ]; then - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' - # Turn on checkwinsize - shopt -s checkwinsize - [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " - fi + # are we an interactive shell? + if [ "$PS1" ]; then + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' + # Turn on checkwinsize + shopt -s checkwinsize + [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " + fi - if ! shopt -q login_shell ; then # We're not a login shell - for i in /etc/profile.d/*.sh; do - if [ -r "$i" ]; then - if [ "$PS1" ]; then - . $i - else - . $i &>/dev/null - fi - fi - done - unset i - fi + if ! shopt -q login_shell ; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + if [ "$PS1" ]; then + . $i + else + . $i &>/dev/null + fi + fi + done + unset i + fi fi umask 002 -# -#alias dirs='dirs -v' -#alias ack='ack --ignore-file=ext:d,dd' -# -#alias dirtree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' " -#alias currgit='cd /bb/mbig/mbig1205/devgit/s_tktapi2/src; echo -e "I am here $(pwd)"' -#alias tktapi='cd /bb/mbig/mbig1205/devgit/tktapi/src; echo -e "I am here $(pwd) \n $(ls)"' -#alias bastest='/bbsrc/abin/basclient' -#alias bas_codegen='/bb/shared/bin/bas_codegen.pl' -#alias metasymfind="cat - | awk '{ print \$1 }' | xargs symfind | awk 'BEGIN{FS=\"[\"} { print \$1 }' | sort | uniq | tr '\n' ' ' | sed -e 's/\(\b\S\)/-l\1/g' && echo \"\"" -# -#alias git-robo='ssh devgit svnsync $(git remote -v | grep "(fetch)" | cut -d ":" -f2 | cut -d "(" -f1); git fetch origin; git pull; git merge robo/trunk; read -p "!!!!! PUSH the merged version back !!!!! ? [Y] / Ctrl+C to stop"; git push' -#alias intuorcreate=/bbsrc/internal/isystest/uorcreate/intuorcreate -# -# -#export EDITOR=/opt/swt/bin/nedit -#export TERM=xterm -# -#export BIGHOME=/bb/mbig/mbig1205 -#export PLINK_PARALLEL_BUILD=true -#export EDITOR=/opt/swt/bin/nedit -#export PAGER=less -#export GROUP=trading-systems-group -#export mysvn="svn+ssh://devsvn" -#export myrobosvn="svn+ssh://devsvn/robo/branches/trunk" -#export PATH=/opt/swt/bin:~/bin:/bb/util/common/studio12/SUNWspro/bin:${PATH} -#export DEVGIT=${BIGHOME}/devgit -#export VISUAL=/opt/swt/bin/nedit -#export MAIL=/usr/mail/${LOGNAME:?} -# -#codegrep() { -# if [[ $# -eq 0 ]] -# then -# echo "Usage: codegrep " -# else -# grep -nT --colour \ -# --exclude=tags \ -# --exclude=*.o \ -# --exclude=*.so \ -# --exclude=*.tsk \ -# --exclude=*.d \ -# --exclude=*.dd \ -# "$1" * -# fi -#} -# -##ssh() { -# #echo "wut" -# #[[ -n "$INSCREEN" ]] && TERM=screen-256color -# #env ssh -t $* -# #$SCREEN_TITLE_CMD -##} -# -#sshcd() { -# if [[ $# -lt 1 ]] -# then -# echo "Usage: sshcd []" -# else -# ssh -t $LOGNAME@$1 "export SSHCDPATH=${path:-$(pwd)}; exec $BASH --login " -# fi -#} -# -#biggest() { -# dir=${1:-.} -# find $dir -type f -exec du -a {} \+ | sort -rn -#} -# -## Screen variables -#function last2dirs { -# pwd | awk -F\/ '{print $(NF-1),$(NF)}' | sed 's# #/#' -#} -# -##screen specific functionality -##if [[ -n ${STY} ]] -##then -# PROMPT_COMMAND='echo -ne "\033k${HOSTNAME} $(last2dirs)\033\\"; -# history -a;' -##fi -# -#function dupscreen { -# screen bash -c "export SSHCDPATH=$PWD && exec $SHELL --login" -#} -# -#if [ -n "$BBENV" ] && [[ -f ~/bin/hijackEOD.sh ]] -#then -# source `which hijackEOD.sh` -#fi -# -# - -# -# Don't source the rest twice. -# -#if [ "$BASHRC_VAHAGNK_DONT_SOURCE_THIS_FILE_TWICE" == "true" ]; then -# return -#fi - # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Find out system details. +# Find out system details. # os=`uname -o` #GNU/Linux AIX Solaris cpu=`uname -p` #x86_64 powerpc sparc @@ -249,6 +49,15 @@ kversion=`uname -v` krelease=`uname -r` hostnm=`hostname` +# +# Tmux usually sets screen-256color which is unknown to most of systems I work +# with. +# +if [ "$TERM" == "screen-256color" ]; then + export TERM="xterm-256color" +fi + +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # User specific environment and startup programs # @@ -260,27 +69,26 @@ fi MYSCRIPTS=$HOME/devel/scripts PATH=$MYLOCAL/bin:$PATH PATH=$MYSCRIPTS/bash:$PATH -PATH=$MYSCRIPTS/bloomberg:$PATH # -# VIM +# VIM # #VIMDIR=/depot/vim-7.3/bin #VIM=${VIMDIR}/vim #if [ "$kernel" == "Linux" ]; then -# alias vi=$VIM -# alias vim=$VIM -# alias gvim=${VIMDIR}/gvim -# alias ctags="/depot/ctag-5.5.4/bin/ctags" +# alias vi=$VIM +# alias vim=$VIM +# alias gvim=${VIMDIR}/gvim +# alias ctags="/depot/ctag-5.5.4/bin/ctags" #fi # -# GIT +# GIT # [ -f $MYSCRIPTS/bash/git-completion.bash ] && . $MYSCRIPTSE/bash/git-completion.bash # -# GCC +# GCC # #if [ -e /depot/gcc-4.7.2/bin ]; then # PATH=/depot/gcc-4.7.2/bin:$PATH @@ -294,18 +102,18 @@ PATH=$MYSCRIPTS/bloomberg:$PATH #fi # -# GDB +# GDB # #prepath /depot/gdb-7.5.1/bin # -# VTune Amplifier +# VTune Amplifier # #export INTEL_LICENSE_FILE=28518@us01-lic10:28518@us01-lic11:28518@us01-lic12:28518@tyndall #alias vtune=/depot/vtune_amplifier_xe_2013_update5/bin64/amplxe-gui # -# PURIFY and all. +# PURIFY and all. # #postpath /depot/coverity/swat/bin #export RSU_TEMPLATE2_INI=/depot/pure/templates2.ini @@ -319,42 +127,34 @@ PATH=$MYSCRIPTS/bloomberg:$PATH # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# BLOOMBERG and TOMS +# Run local settings. # +[ -f $PWD/.bashrc.local ] && . $PWD/.bashrc.local -# if chimera generated aliases exist, pull them into the current ENV -[ -f ~/.bbalias ] && . ~/.bbalias - -export BB=$HOME/devel/bb -export DEVGIT=$BB/devgit -PATH=$PATH:$BB/scripts - -getpw() { # BOX - if [[ $# -ne 1 ]]; then - echo "Usage: getpw " - else - local BOX="$1" - local BIN="/bb/bin/getprdwin" - $BIN -u op1 -i -s $BOX -d "op1 for $USER on $BOX" - fi -} -alias create_tags='/opt/swt/bin/ctags -R --verbose --exclude=.git --exclude=.doxygen --exclude="*.o" --exclude="llcalc*"' - +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # set alias # -alias ll='ls -la --color=tty' -alias cd='pushd >/dev/null' -alias bd='popd' -alias bb='pushd $HOME/devel/bb >/dev/null' -alias cgrep="grep --include \*.cpp --include \*.h --include \*.c --color=auto" -#complete -f --X '!*.mk' plink +if [ $kernel == AIX ]; then + alias l='ls -a' + alias ls='ls -a' + alias ll='ls -la' + alias pd='pushd >/dev/null' + alias bd='popd' +else + alias l='ls -a --color=tty' + alias ls='ls -a --color=tty' + alias ll='ls -la --color=tty' + alias pd='pushd >/dev/null' + alias bd='popd' +fi +alias cgrep="grep --include \*.cpp --include \*.h --include \*.c" # -# Make sure to export PATH +# Make sure to export PATH # export PATH #export LM_LICENSE_FILE -export HISTFILESIZE=5000 # Store 5000 commands in history -export HISTCONTROL=ignoredups # Don't put duplicate lines in the history. +export HISTFILESIZE=5000 # Store 5000 commands in history +export HISTCONTROL=ignoredups # Don't put duplicate lines in the history. From 2e69a93b14a7b169f0acb1716520565619e8f207 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 8 Apr 2016 13:43:07 -0400 Subject: [PATCH 16/30] Adds a function to local-vimrc plugin to load .vimrc.local at startup. --- vim/plugin/local-vimrc.vim | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/vim/plugin/local-vimrc.vim b/vim/plugin/local-vimrc.vim index b4a32f8..eafb3cf 100644 --- a/vim/plugin/local-vimrc.vim +++ b/vim/plugin/local-vimrc.vim @@ -26,14 +26,22 @@ let g:loaded_local_vimrc=1 " Section: Event group setup " Act when creating or loading a file augroup LocalVimrc - au BufNewFile,BufRead * call s:LoadConfig() + au BufNewFile,BufRead * call s:LocalVimrcLoadForFile() augroup END " Function: LoadConfig() " -" If the file .vimrc exists in the root of a git project - load it -function s:LoadConfig() +" If the file .vimrc exists in the path - load it +function s:LocalVimrcLoadForFile() let l:path = fnameescape(expand("%:p:h")) + call g:LocalVimrcLoad( l:path ) +endfunction + +" Function: LocalVimrcLoad() +" +" If the file .vimrc exists in the path - load it +function! g:LocalVimrcLoad(path) + let l:path = a:path if empty(l:path) return endif From 8d90b9f83f4b0628c28ab811bd84b08017529c0a Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 8 Apr 2016 14:06:50 -0400 Subject: [PATCH 17/30] .vimrc review --- vim/plugin/cf5-compile.vim | 31 +++++++++--- vim/vimrc | 97 ++++++++++++++++++++++++-------------- 2 files changed, 86 insertions(+), 42 deletions(-) diff --git a/vim/plugin/cf5-compile.vim b/vim/plugin/cf5-compile.vim index 1c84d0a..cca8e4c 100755 --- a/vim/plugin/cf5-compile.vim +++ b/vim/plugin/cf5-compile.vim @@ -128,7 +128,7 @@ function! s:CompileMSVC(run) "{{{2 endif endfunction -" +" " GCC " function! s:CompileGCC(run) "{{{2 @@ -138,7 +138,7 @@ function! s:CompileGCC(run) "{{{2 let ccline="g++ ".g:cppflags." ".g:lcppflags." ".g:ldflags." ".srcname." -o".exename call s:appendOutput(ccline) let cout = system( ccline ) - if v:shell_error + if v:shell_error call s:appendOutput(cout) return endif @@ -228,7 +228,7 @@ function! s:getOutputWindow() if (winnr < 0) execute "below 10new ".obuff setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap - " setlocal nomodifiable + " setlocal nomodifiable let winnr = bufwinnr('^'.obuff.'$') endif @@ -241,10 +241,10 @@ function! s:appendOutput( text ) if exists("g:cf5output") && (g:cf5output==1) let cwinnr = winnr() let owinnr = s:getOutputWindow() -" setlocal modifiable +" setlocal modifiable execute owinnr . 'wincmd w' execute 'normal! Go'.a:text -" setlocal nomodifiable +" setlocal nomodifiable execute cwinnr.'wincmd w' else echo a:text @@ -257,13 +257,18 @@ function! s:clearOutputWindow() if exists("g:cf5output") && (g:cf5output==1) let cwinnr = winnr() let owinnr = s:getOutputWindow() -" setlocal modifiable +" setlocal modifiable execute owinnr . 'wincmd w' execute 'normal ggdG' -" setlocal nomodifiable +" setlocal nomodifiable execute cwinnr . 'wincmd w' endif endfunction + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Public interface. +"" + " " Load compile instructions and call window or linux compiler. {{{1 " @@ -292,4 +297,16 @@ function! CF5Compile(run) " call s:Compile(a:run) endfunction +" +" Load compile instructions and call window or linux compiler. +" +function! CF5CompileAndRun() + call CF5Compile(1) +endfunction +" +" Load compile instructions and call window or linux compiler. +" +function! CF5CompileOnly() + call CF5Compile(0) +endfunction diff --git a/vim/vimrc b/vim/vimrc index fe9414c..7cccd08 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -18,7 +18,7 @@ set fileformat=unix set nobackup "set backupdir="~/tmp,." git commit doesn't work. " Try to set up UTF-8 encoding. -if has("multi_byte") +if has('multi_byte') if &termencoding == "" let &termencoding = &encoding endif @@ -85,11 +85,20 @@ set cino+=(0 " enable omni completion set omnifunc=syntaxcomplete#Complete +" If modlines available then turn it on so each file could set its settings. +" ex. # vim: set expandtab: +if exists('+modeline') + set modeline + set modelines=5 +endif +" read/write a .viminfo file, don't store more +if exists('+viminfo') + set viminfo='20,\"50 +endif -set viminfo='20,\"50 " read/write a .viminfo file, don't store more " than 50 lines of registers let g:netrw_preview = 1 " netrw open window to the right let g:netrw_browse_split = 3 " open in a tab @@ -102,8 +111,6 @@ set ttyfast "tf "smooths redraw by using more bandwidth " Set timeout for detecting command key sequence set timeoutlen=400 -"set autoread "update file modified outside of vim - " Quickly time out on keycodes, but never time out on mappings set notimeout ttimeout ttimeoutlen=200 " Use to toggle between 'paste' and 'nopaste' @@ -125,7 +132,7 @@ endif " " Configure color theme, fonts and other graphics. " -if has("gui_running") +if has('gui_running') " set color scheme colorscheme darkblue "set guioptions-=m @@ -147,7 +154,7 @@ endif " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. -if &t_Co > 2 || has("gui_running") +if &t_Co > 2 || has('gui_running') syntax on set hlsearch endif @@ -168,16 +175,16 @@ set cmdheight=2 set laststatus=2 " Display the cursor position on the last line of the screen or in the status " line of a window -if exists('&ruler') +if exists('+ruler') set ruler endif " Instead of failing a command because of unsaved changes, raise a dialogue " asking if you wish to save changed files. -if exists('&confirm') +if exists('+confirm') set confirm endif " Use visual bell instead of beeping when doing something wrong -if exists('&visualbell') +if exists('+visualbell') set visualbell " And reset the terminal code for the visual bell. If visualbell is set, and " this line is also included, vim will neither flash nor beep. If visualbell @@ -185,17 +192,17 @@ if exists('&visualbell') set t_vb= endif " Display line numbers on the left -if exists('&number') +if exists('+number') set number endif " Turn on spell check. -if exists("+spell") && &diff=="nodiff" +if exists('+spell') && !&diff set spell highlight clear SpellBad highlight SpellBad cterm=underline ctermfg=red endif " Show 80th column. -if exists("+colorcolumn") +if exists('+colorcolumn') set colorcolumn=+1 " color textwidth+1-th line endif @@ -227,14 +234,12 @@ endif - - """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " vimdiff " " Turn on spell check. -if &diff=="diff" +if &diff "turn off spelling set nospell @@ -245,6 +250,9 @@ if &diff=="diff" endif +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" TODO: review +" @@ -267,12 +275,6 @@ if exists('&hidden') set hidden endif -" Modelined are used to configure files. -if exists('&modeline') - set modeline - set modelines=10 -endif - " Set fold method if supported if has('folding') set nofoldenable @@ -290,7 +292,7 @@ if has('folding') endif " Only do this part when compiled with support for autocommands. -if has("autocmd") +if has('autocmd') " Enable file type detection. " Use the default filetype settings, so that mail gets 'tw' set to 72, @@ -332,7 +334,7 @@ endif " has("autocmd") " " -if has("gui_running") +if has('gui_running') ":tab drop {file} " Hide show menu and toolbar. @@ -354,9 +356,24 @@ map :tab split:exec("tag ".expand("")) "map :tabnew " -" F4 grep the word under cursor. +" Grep the word under cursor. " -map :execute "grep " . expand("") . " -r --include \*.h --include \*.cpp --include \*.c --include \*.f ." cw +" Grep options affect GNU grep. The intend is that greps not supporting the +" options will continue working without options. +" +let $GREP_OPTIONS.=' --exclude-dir=.git --exclude-dir=.svn' +let $GREP_OPTIONS.=' --exclude=tags --exclude=*.o --exclude=*.log' +let $GREP_OPTIONS.=' --exclude=*.swp' +let $GREP_OPTIONS.=' --exclude-dir=llcalc* --exclude-dir=00*' +"let $GREP_OPTIONS.=' --include *.sh' +"let $GREP_OPTIONS.=' --include *.php' +"let $GREP_OPTIONS.=' --include *.h --include *.cpp --include *.c' +"let $GREP_OPTIONS.=' --include *.py' +"let $GREP_OPTIONS.=' --include *.java' +"let $GREP_OPTIONS.=' --include *.f' +"let $GREP_OPTIONS.=' --include *.xsd --include *.xml' +"let $GREP_OPTIONS.=' --include Makefile' +map af :execute "grep! ".expand("")." -r ." cw " " Loads CF5Compile @@ -365,8 +382,8 @@ map :execute "grep " . expand("") . " -r --include \*.h --include if !exists('*CF5Compile') runtime plugin/cf5-compiler.vim endif -map :call CF5Compile(1) -map :call CF5Compile(0) +map a4 :call CF5CompileOnly() +map a5 :call CF5CompileAndRun() " " 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. @@ -377,8 +394,8 @@ inoremap u " noremap gk noremap gj -imap gk -imap gj +"imap gk +"imap gj " " Working with tabs especially if using console version. " @@ -389,6 +406,14 @@ nnoremap tl :tablast nnoremap tm :tabm nnoremap td :tabclose +" +" Locate and load .vimrc.local from curent directory. +" +if !exists('*LocalVimrcLoad') + runtime plugin/local-vimrc.vim +endif +call LocalVimrcLoad( getcwd() ) + """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Plugins " @@ -396,7 +421,7 @@ nnoremap td :tabclose " " Vundle experimental stuff here. " -if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) +if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() @@ -416,8 +441,8 @@ if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) Plugin 'vim-scripts/Buffergator' let g:buffergator_suppress_keymaps = 1 let g:buffergator_viewport_split_policy = "L" - map :BuffergatorToggle - map :BuffergatorTabsToggle + map ab :BuffergatorToggle + "map at :BuffergatorTabsToggle " " @@ -439,9 +464,11 @@ if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) Plugin 'scrooloose/nerdtree' let g:NERDTreeQuitOnOpen = 1 let g:NERDTreeDirArrows = 1 + let g:NERDTreeDirArrowExpandable = '+' + let g:NERDTreeDirArrowCollapsible = '-' let g:NERDTreeIgnore = ['\.o$', '\.so$', '\.tsk$'] - map :NERDTreeToggle - map :NERDTreeFind + map at :NERDTreeToggle + "map am :NERDTreeFind " " :A switches to the header file (or vise versa) @@ -463,7 +490,7 @@ if filereadable(expand("~/.vim/bundle/Vundle.vim/README.md")) let g:alternateExtensions_h = "cpp,c" let g:alternateExtensions_cpp = "h" let g:alternateExtensions_c = "h" - + map ah :A " " Comment code. From cd33a61a87158c47fee706bcb84540ad2a24abe6 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 13 Apr 2016 12:31:12 -0400 Subject: [PATCH 18/30] Use local terminfo for the systems which don't have screen-256color. --- config/.bashrc | 11 ++++--- terminfo/README | 2 ++ terminfo/screen-256color.terminfo | 27 ++++++++++++++++ terminfo/xterm-256color.terminfo | 51 +++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 terminfo/README create mode 100644 terminfo/screen-256color.terminfo create mode 100644 terminfo/xterm-256color.terminfo diff --git a/config/.bashrc b/config/.bashrc index 82f8e36..3bd123e 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -50,11 +50,12 @@ krelease=`uname -r` hostnm=`hostname` # -# Tmux usually sets screen-256color which is unknown to most of systems I work -# with. +# If there is no terminal info in the system for current terminal but there is +# one in local terminfo then use it. # -if [ "$TERM" == "screen-256color" ]; then - export TERM="xterm-256color" +/bin/tput -T $TERM longname 2>/dev/null >/dev/null +if [[ $? -ne 0 && -f $HOME/.terminfo/$kernel/${TERM:0:1}/$TERM ]]; then + export TERMINFO=$HOME/.terminfo/$kernel; fi # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -68,7 +69,7 @@ elif [ $kernel == SunOS ]; then fi MYSCRIPTS=$HOME/devel/scripts PATH=$MYLOCAL/bin:$PATH -PATH=$MYSCRIPTS/bash:$PATH +PATH=$MYSCRIPTS/bin:$PATH # # VIM diff --git a/terminfo/README b/terminfo/README new file mode 100644 index 0000000..d74551e --- /dev/null +++ b/terminfo/README @@ -0,0 +1,2 @@ +Hint: use 'tic' to compile terminfo files. + tic -o diff --git a/terminfo/screen-256color.terminfo b/terminfo/screen-256color.terminfo new file mode 100644 index 0000000..c852b5c --- /dev/null +++ b/terminfo/screen-256color.terminfo @@ -0,0 +1,27 @@ +# Reconstructed via infocmp from file: /opt/bb/share/terminfo/s/screen-256color +screen-256color|GNU Screen with 256 colors, + am, km, mir, msgr, xenl, + colors#256, cols#80, it#8, lines#24, pairs#32767, + acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, + clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM, + cvvis=\E[34l, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, enacs=\E(B\E)0, + flash=\Eg, home=\E[H, ht=^I, hts=\EH, ich=\E[%p1%d@, + il=\E[%p1%dL, il1=\E[L, ind=^J, initc@, is2=\E)0, kbs=^H, + kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kend=\E[4~, kf1=\EOP, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, + kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, + khome=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, + nel=\EE, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, + rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, + rmul=\E[24m, rs2=\Ec\E[?1000l\E[?25h, sc=\E7, + setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, + setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, + sgr=\E[0%?%p6%t;1%;%?%p1%t;3%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;m%?%p9%t\016%e\017%;, + sgr0=\E[m\017, smacs=^N, smcup=\E[?1049h, smir=\E[4h, + smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, tbc=\E[3g, diff --git a/terminfo/xterm-256color.terminfo b/terminfo/xterm-256color.terminfo new file mode 100644 index 0000000..efc5ee9 --- /dev/null +++ b/terminfo/xterm-256color.terminfo @@ -0,0 +1,51 @@ +# Reconstructed via infocmp from file: /opt/bb/share/terminfo/x/xterm-256color +xterm-256color|xterm with 256 colors, + am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, + colors#256, cols#80, it#8, lines#24, pairs#32767, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, + clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, + flash=\E[?5h$<100/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, + ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, + ind=^J, indn=\E[%p1%dS, + initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, + invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~, + kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, + kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^H, + kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, + kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~, + kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q, + kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~, + kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, + kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~, + kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S, + kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~, + kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~, + kf35=\E[23;5~, kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q, + kf39=\E[1;6R, kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~, + kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~, + kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~, + kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q, + kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~, + kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~, + kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, + kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\EOH, kich1=\E[2~, + kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~, + kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El, + memu=\Em, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, + rin=\E[%p1%dT, rmacs=\E(B, rmam=\E[?7l, rmcup=\E[?1049l, + rmir=\E[4l, rmkx=\E[?1l\E>, rmm=\E[?1034l, rmso=\E[27m, + rmul=\E[24m, rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, + setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, + setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, + sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, + sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smcup=\E[?1049h, + smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m, + smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, + u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, From e832a28038229be6e085f73f680d2384152a1a1e Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sun, 24 Apr 2016 22:22:09 +0000 Subject: [PATCH 19/30] Rename backup -> bin --- {backup => bin}/backup.git.sh | 0 {backup => bin}/backup.mybook.public.sh | 0 {backup => bin}/backup.mybook.vahagn.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {backup => bin}/backup.git.sh (100%) rename {backup => bin}/backup.mybook.public.sh (100%) rename {backup => bin}/backup.mybook.vahagn.sh (100%) diff --git a/backup/backup.git.sh b/bin/backup.git.sh similarity index 100% rename from backup/backup.git.sh rename to bin/backup.git.sh diff --git a/backup/backup.mybook.public.sh b/bin/backup.mybook.public.sh similarity index 100% rename from backup/backup.mybook.public.sh rename to bin/backup.mybook.public.sh diff --git a/backup/backup.mybook.vahagn.sh b/bin/backup.mybook.vahagn.sh similarity index 100% rename from backup/backup.mybook.vahagn.sh rename to bin/backup.mybook.vahagn.sh From f2af88b20fc3f9e890f00b8970ba4729d6184eab Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sun, 24 Apr 2016 22:25:08 +0000 Subject: [PATCH 20/30] Socks5 proxy to yerevak. --- bin/socks5_on_1080.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 bin/socks5_on_1080.sh diff --git a/bin/socks5_on_1080.sh b/bin/socks5_on_1080.sh new file mode 100755 index 0000000..a4cf1ce --- /dev/null +++ b/bin/socks5_on_1080.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ssh -f -N -D 192.168.0.3:1080 yerevak.vostan.org From 5053c86daab05be48de16b8cf5cf52d9e0b37249 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 3 Jun 2016 13:45:22 -0400 Subject: [PATCH 21/30] Git branch is added to bash prompt + colors are configured. --- config/.bashrc | 104 ++++++++++++++-- config/.dir_colors | 300 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 391 insertions(+), 13 deletions(-) create mode 100644 config/.dir_colors diff --git a/config/.bashrc b/config/.bashrc index 3bd123e..b1f0517 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -14,14 +14,6 @@ if [ -f /etc/bashrc ]; then . /etc/bashrc else - # are we an interactive shell? - if [ "$PS1" ]; then - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' - # Turn on checkwinsize - shopt -s checkwinsize - [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " - fi - if ! shopt -q login_shell ; then # We're not a login shell for i in /etc/profile.d/*.sh; do if [ -r "$i" ]; then @@ -49,15 +41,101 @@ kversion=`uname -v` krelease=`uname -r` hostnm=`hostname` +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# If there is no terminal info in the system for current terminal but there is -# one in local terminfo then use it. +# Terminal colors. # -/bin/tput -T $TERM longname 2>/dev/null >/dev/null -if [[ $? -ne 0 && -f $HOME/.terminfo/$kernel/${TERM:0:1}/$TERM ]]; then - export TERMINFO=$HOME/.terminfo/$kernel; +if [[ $- == *i* ]]; then + # + # If there is no terminal info in the system for current terminal but there is + # one in local terminfo then use it. + # + /bin/tput -T $TERM longname 2>/dev/null >/dev/null + if [[ $? -ne 0 && -f $HOME/.terminfo/$kernel/${TERM:0:1}/$TERM ]]; then + export TERMINFO=$HOME/.terminfo/$kernel; + fi + + ### + # Colors + ### + # reset terminal colors + c_reset="$(tput sgr0)" + # regular foreground + crf_red=$(tput setaf 1) + crf_green=$(tput setaf 2) + crf_orange=$(tput setaf 3) + crf_blue=$(tput setaf 4) + crf_pink=$(tput setaf 5) + crf_cyan=$(tput setaf 6) + crf_white=$(tput setaf 7) + # bold foreground + cbf_red=$(tput bold; tput setaf 1) + cbf_green=$(tput bold; tput setaf 2) + cbf_orange=$(tput bold; tput setaf 3) + cbf_blue=$(tput bold; tput setaf 4) + cbf_pink=$(tput bold; tput setaf 5) + cbf_cyan=$(tput bold; tput setaf 6) + cbf_white=$(tput bold; tput setaf 7) + + # + # Load better colors. + # + if [ -f ~/.dir_colors ]; then + eval $(dircolors ~/.dir_colors) + fi fi +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# +# Prompt. +# +if [[ "$PS1" ]]; then + export PROMPT_COMMAND=__prompt_command + function __prompt_command() + { + local es=$? + if [ $es -eq 0 ]; then + local exit_code_color=$crf_green + else + local exit_code_color=$crf_red + fi + + local git_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d ' ') + local svn_rev=$(svn info . 2> /dev/null | awk -F ':' '/Revision:/ { print $2 }') + +# PS1="$cbf_blue[$exit_code_color\#$cbf_blue]" # command counter + PS1="$cbf_blue[$cbf_blue$?$cbf_blue]\n" # command counter +# PS1+=" " + PS1+="$cbf_white\u$crf_blue@$cbf_white\h$cbf_white" # username@host +# PS1+=":" +# PS1+="$crf_green\w" # working dir + + if [ -n "$git_branch" ]; then + PS1+=" " + PS1+="$cbf_blue[${cbf_white}$cbf_orange$git_branch$cbf_blue]" + fi + + if [ -n "$svn_rev" ]; then + PS1+=" " + PS1+="$cbf_blue[${cbf_white}$cbf_orange$svn_rev$cbf_blue]" + fi + + PS1+=">" + +# PS1+="$c_reset\n" + } + + # are we an interactive shell? +# if [ "$PS1" ]; then +# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' +# # Turn on checkwinsize +# shopt -s checkwinsize +# [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " +# fi + +fi + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # User specific environment and startup programs diff --git a/config/.dir_colors b/config/.dir_colors new file mode 100644 index 0000000..8fb0fb4 --- /dev/null +++ b/config/.dir_colors @@ -0,0 +1,300 @@ +# Dark 256 color solarized theme for the color GNU ls utility. + # Used and tested with dircolors (GNU coreutils) 8.5 + # + # @author {@link http://sebastian.tramp.name Sebastian Tramp} + # @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL) + # + # More Information at + # https://github.com/seebi/dircolors-solarized + + # Term Section + TERM Eterm + TERM ansi + TERM color-xterm + TERM con132x25 + TERM con132x30 + TERM con132x43 + TERM con132x60 + TERM con80x25 + TERM con80x28 + TERM con80x30 + TERM con80x43 + TERM con80x50 + TERM con80x60 + TERM cons25 + TERM console + TERM cygwin + TERM dtterm + TERM dvtm + TERM dvtm-256color + TERM eterm-color + TERM fbterm + TERM gnome + TERM gnome-256color + TERM jfbterm + TERM konsole + TERM konsole-256color + TERM kterm + TERM linux + TERM linux-c + TERM mach-color + TERM mlterm + TERM putty + TERM putty-256color + TERM rxvt + TERM rxvt-256color + TERM rxvt-cygwin + TERM rxvt-cygwin-native + TERM rxvt-unicode + TERM rxvt-unicode256 + TERM rxvt-unicode-256color + TERM screen + TERM screen-16color + TERM screen-16color-bce + TERM screen-16color-s + TERM screen-16color-bce-s + TERM screen-256color + TERM screen-256color-bce + TERM screen-256color-s + TERM screen-256color-bce-s + TERM screen-256color-italic + TERM screen-bce + TERM screen-w + TERM screen.linux + TERM screen.xterm-256color + TERM st + TERM st-meta + TERM st-256color + TERM st-meta-256color + TERM tmux + TERM tmux-256color + TERM vt100 + TERM xterm + TERM xterm-16color + TERM xterm-256color + TERM xterm-256color-italic + TERM xterm-88color + TERM xterm-color + TERM xterm-debian + TERM xterm-termite + + ## Documentation + # + # standard colors + # + # Below are the color init strings for the basic file types. A color init + # string consists of one or more of the following numeric codes: + # Attribute codes: + # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed + # Text color codes: + # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white + # Background color codes: + # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white + # + # + # 256 color support + # see here: http://www.mail-archive.com/bug-coreutils@gnu.org/msg11030.html) + # + # Text 256 color coding: + # 38;5;COLOR_NUMBER + # Background 256 color coding: + # 48;5;COLOR_NUMBER + + ## Special files + + NORMAL 00;38;5;244 # no color code at all + #FILE 00 # regular file: use no color at all + RESET 0 # reset to "normal" color + DIR 00;38;5;33 # directory 01;34 + LINK 00;38;5;37 # symbolic link. (If you set this to 'target' instead of a + # numerical value, the color is as for the file pointed to.) + MULTIHARDLINK 00 # regular file with more than one link + FIFO 48;5;230;38;5;136;01 # pipe + SOCK 48;5;230;38;5;136;01 # socket + DOOR 48;5;230;38;5;136;01 # door + BLK 48;5;230;38;5;244;01 # block device driver + CHR 48;5;230;38;5;244;01 # character device driver + ORPHAN 48;5;235;38;5;160 # symlink to nonexistent file, or non-stat'able file + SETUID 48;5;160;38;5;230 # file that is setuid (u+s) + SETGID 48;5;136;38;5;230 # file that is setgid (g+s) + CAPABILITY 30;41 # file with capability + STICKY_OTHER_WRITABLE 48;5;64;38;5;230 # dir that is sticky and other-writable (+t,o+w) + OTHER_WRITABLE 48;5;235;38;5;33 # dir that is other-writable (o+w) and not sticky + STICKY 48;5;33;38;5;230 # dir with the sticky bit set (+t) and not other-writable + # This is for files with execute permission: + EXEC 00;38;5;64 + + ## Archives or compressed (violet + bold for compression) + .tar 00;38;5;61 + .tgz 00;38;5;61 + .arj 00;38;5;61 + .taz 00;38;5;61 + .lzh 00;38;5;61 + .lzma 00;38;5;61 + .tlz 00;38;5;61 + .txz 00;38;5;61 + .zip 00;38;5;61 + .z 00;38;5;61 + .Z 00;38;5;61 + .dz 00;38;5;61 + .gz 00;38;5;61 + .lz 00;38;5;61 + .xz 00;38;5;61 + .bz2 00;38;5;61 + .bz 00;38;5;61 + .tbz 00;38;5;61 + .tbz2 00;38;5;61 + .tz 00;38;5;61 + .deb 00;38;5;61 + .rpm 00;38;5;61 + .jar 00;38;5;61 + .rar 00;38;5;61 + .ace 00;38;5;61 + .zoo 00;38;5;61 + .cpio 00;38;5;61 + .7z 00;38;5;61 + .rz 00;38;5;61 + .apk 00;38;5;61 + .gem 00;38;5;61 + + # Image formats (yellow) + .jpg 00;38;5;136 + .JPG 00;38;5;136 #stupid but needed + .jpeg 00;38;5;136 + .gif 00;38;5;136 + .bmp 00;38;5;136 + .pbm 00;38;5;136 + .pgm 00;38;5;136 + .ppm 00;38;5;136 + .tga 00;38;5;136 + .xbm 00;38;5;136 + .xpm 00;38;5;136 + .tif 00;38;5;136 + .tiff 00;38;5;136 + .png 00;38;5;136 + .PNG 00;38;5;136 + .svg 00;38;5;136 + .svgz 00;38;5;136 + .mng 00;38;5;136 + .pcx 00;38;5;136 + .dl 00;38;5;136 + .xcf 00;38;5;136 + .xwd 00;38;5;136 + .yuv 00;38;5;136 + .cgm 00;38;5;136 + .emf 00;38;5;136 + .eps 00;38;5;136 + .CR2 00;38;5;136 + .ico 00;38;5;136 + + # Files of special interest (base1) + .tex 00;38;5;245 + .rdf 00;38;5;245 + .owl 00;38;5;245 + .n3 00;38;5;245 + .ttl 00;38;5;245 + .nt 00;38;5;245 + .torrent 00;38;5;245 + .xml 00;38;5;245 + *Makefile 00;38;5;245 + *Rakefile 00;38;5;245 + *Dockerfile 00;38;5;245 + *build.xml 00;38;5;245 + *rc 00;38;5;245 + *1 00;38;5;245 + .nfo 00;38;5;245 + *README 00;38;5;245 + *README.txt 00;38;5;245 + *readme.txt 00;38;5;245 + .md 00;38;5;245 + *README.markdown 00;38;5;245 + .ini 00;38;5;245 + .yml 00;38;5;245 + .cfg 00;38;5;245 + .conf 00;38;5;245 + .h 00;38;5;245 + .hpp 00;38;5;245 + .c 00;38;5;245 + .cpp 00;38;5;245 + .cxx 00;38;5;245 + .cc 00;38;5;245 + .objc 00;38;5;245 + .sqlite 00;38;5;245 + .go 00;38;5;245 + .sql 00;38;5;245 + .csv 00;38;5;245 + + # "unimportant" files as logs and backups (base01) + .log 00;38;5;240 + .bak 00;38;5;240 + .aux 00;38;5;240 + .lof 00;38;5;240 + .lol 00;38;5;240 + .lot 00;38;5;240 + .out 00;38;5;240 + .toc 00;38;5;240 + .bbl 00;38;5;240 + .blg 00;38;5;240 + *~ 00;38;5;240 + *# 00;38;5;240 + .part 00;38;5;240 + .incomplete 00;38;5;240 + .swp 00;38;5;240 + .tmp 00;38;5;240 + .temp 00;38;5;240 + .o 00;38;5;240 + .pyc 00;38;5;240 + .class 00;38;5;240 + .cache 00;38;5;240 + + # Audio formats (orange) + .aac 00;38;5;166 + .au 00;38;5;166 + .flac 00;38;5;166 + .mid 00;38;5;166 + .midi 00;38;5;166 + .mka 00;38;5;166 + .mp3 00;38;5;166 + .mpc 00;38;5;166 + .ogg 00;38;5;166 + .opus 00;38;5;166 + .ra 00;38;5;166 + .wav 00;38;5;166 + .m4a 00;38;5;166 + # http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions + .axa 00;38;5;166 + .oga 00;38;5;166 + .spx 00;38;5;166 + .xspf 00;38;5;166 + + # Video formats (as audio + bold) + .mov 00;38;5;166 + .MOV 00;38;5;166 + .mpg 00;38;5;166 + .mpeg 00;38;5;166 + .m2v 00;38;5;166 + .mkv 00;38;5;166 + .ogm 00;38;5;166 + .mp4 00;38;5;166 + .m4v 00;38;5;166 + .mp4v 00;38;5;166 + .vob 00;38;5;166 + .qt 00;38;5;166 + .nuv 00;38;5;166 + .wmv 00;38;5;166 + .asf 00;38;5;166 + .rm 00;38;5;166 + .rmvb 00;38;5;166 + .flc 00;38;5;166 + .avi 00;38;5;166 + .fli 00;38;5;166 + .flv 00;38;5;166 + .gl 00;38;5;166 + .m2ts 00;38;5;166 + .divx 00;38;5;166 + .webm 00;38;5;166 + # http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions + .axv 00;38;5;166 + .anx 00;38;5;166 + .ogv 00;38;5;166 + .ogx 00;38;5;166 From bb11ac83c156d96ecda3af9ae9a65cf4bf4c8b03 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 6 Jun 2016 00:14:26 +0100 Subject: [PATCH 22/30] Prompt is fixed. Now it shows git branch, exit status, bg jobs and time. --- config/.bashrc | 243 +++++++++++++++++++++++++++---------------------- 1 file changed, 135 insertions(+), 108 deletions(-) diff --git a/config/.bashrc b/config/.bashrc index b1f0517..531d9f0 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -9,30 +9,30 @@ # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Source global definitions +# Source global definitions # if [ -f /etc/bashrc ]; then - . /etc/bashrc + . /etc/bashrc else - if ! shopt -q login_shell ; then # We're not a login shell - for i in /etc/profile.d/*.sh; do - if [ -r "$i" ]; then - if [ "$PS1" ]; then - . $i - else - . $i &>/dev/null - fi - fi - done - unset i - fi + if ! shopt -q login_shell ; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + if [ "$PS1" ]; then + . $i + else + . $i &>/dev/null + fi + fi + done + unset i + fi fi umask 002 # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Find out system details. +# Find out system details. # os=`uname -o` #GNU/Linux AIX Solaris cpu=`uname -p` #x86_64 powerpc sparc @@ -43,99 +43,134 @@ hostnm=`hostname` # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Terminal colors. +# Terminal colors if interactive # -if [[ $- == *i* ]]; then +if [ -n "$PS1" ]; then # # If there is no terminal info in the system for current terminal but there is # one in local terminfo then use it. # - /bin/tput -T $TERM longname 2>/dev/null >/dev/null - if [[ $? -ne 0 && -f $HOME/.terminfo/$kernel/${TERM:0:1}/$TERM ]]; then + tput -T $TERM longname 2>/dev/null >/dev/null + if [ "$?" -ne "0" ] && [ -f $HOME/.terminfo/$kernel/${TERM:0:1}/$TERM ]; then export TERMINFO=$HOME/.terminfo/$kernel; fi - - ### - # Colors - ### - # reset terminal colors - c_reset="$(tput sgr0)" + # + # Number of colors and standard colors. + # + c_num=$(tput colors) # regular foreground - crf_red=$(tput setaf 1) - crf_green=$(tput setaf 2) - crf_orange=$(tput setaf 3) - crf_blue=$(tput setaf 4) - crf_pink=$(tput setaf 5) - crf_cyan=$(tput setaf 6) - crf_white=$(tput setaf 7) + c_red=$(tput setaf 1) + c_green=$(tput setaf 2) + c_orange=$(tput setaf 3) + c_blue=$(tput setaf 4) + c_pink=$(tput setaf 5) + c_cyan=$(tput setaf 6) + c_white=$(tput setaf 7) + c_viol=$(tput setaf 12) # bold foreground - cbf_red=$(tput bold; tput setaf 1) - cbf_green=$(tput bold; tput setaf 2) - cbf_orange=$(tput bold; tput setaf 3) - cbf_blue=$(tput bold; tput setaf 4) - cbf_pink=$(tput bold; tput setaf 5) - cbf_cyan=$(tput bold; tput setaf 6) - cbf_white=$(tput bold; tput setaf 7) - + #cbf_red=$(tput bold; tput setaf 1) # - # Load better colors. + # Load better colors for ls. # - if [ -f ~/.dir_colors ]; then + if [ $c_num -ge 256 ] && [ -f ~/.dir_colors ]; then eval $(dircolors ~/.dir_colors) fi fi # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Prompt. +# Prompt if interactive # -if [[ "$PS1" ]]; then - export PROMPT_COMMAND=__prompt_command +if [ -n "$PS1" ]; then + # + # Set better colors if available. + # + if [ $c_num -ge 256 ]; then + c_reset="$(tput sgr0)" + c_user="$c_green" + c_cwd="$c_viol" + c_time="$c_pink" + c_branch="$c_cyan" + c_exit="$c_red" + c_jobs="$c_orange" + else + c_reset="$(tput sgr0)" + c_user="$c_green" + c_cwd="$c_viol" + c_time="$c_pink" + c_branch="$c_cyan" + c_exit="$c_red" + c_jobs="$c_orange" + fi + + [ -n "$(which svn)" ] && prompt_check_svn=true + [ -n "$(which git)" ] && prompt_check_git=true + + # + # Colors should be set here and surrounded with \[\]otherwise bash fails to + # calculate prompt length. The text is set through PROMPT_COMMAND + PS1="\[$c_user\]\u@\h: \[$c_cwd\]\w" # username@host: working_dir + PS1+="\[$c_branch\]\$git_text" # git branch + PS1+="\[$c_branch\]\$svn_text" # svn revision + PS1+="\[$c_exit\]\$exit_text" # exit status of last command + PS1+="\[$c_jobs\]\$jobs_text" # background/suspended jobs + PS1+=" \[$c_time\]\t" # time + PS1+="\[$c_reset\]\$ " # reset colors and print $ + + export PROMPT_COMMAND="__prompt_command; $PROMPT_COMMAND" function __prompt_command() { - local es=$? - if [ $es -eq 0 ]; then - local exit_code_color=$crf_green - else - local exit_code_color=$crf_red - fi - - local git_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d ' ') - local svn_rev=$(svn info . 2> /dev/null | awk -F ':' '/Revision:/ { print $2 }') - -# PS1="$cbf_blue[$exit_code_color\#$cbf_blue]" # command counter - PS1="$cbf_blue[$cbf_blue$?$cbf_blue]\n" # command counter -# PS1+=" " - PS1+="$cbf_white\u$crf_blue@$cbf_white\h$cbf_white" # username@host -# PS1+=":" -# PS1+="$crf_green\w" # working dir - - if [ -n "$git_branch" ]; then - PS1+=" " - PS1+="$cbf_blue[${cbf_white}$cbf_orange$git_branch$cbf_blue]" - fi - - if [ -n "$svn_rev" ]; then - PS1+=" " - PS1+="$cbf_blue[${cbf_white}$cbf_orange$svn_rev$cbf_blue]" - fi - - PS1+=">" - -# PS1+="$c_reset\n" + # + # get exit code before any command is run. + # TODO: doesn't work on pi. + # + local exit_code="$?" + prompt_extra="" + # + # git branch if exist + # + if [ -n "$prompt_check_git" ]; then + local git_branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null | tr -d ' ') + if [ -n "$git_branch" ]; then + git_text="[$git_branch]" + else + git_text="" + fi + fi + # + # svn branch if exist + # + if [ -n "$prompt_check_svn" ]; then + local svn_rev=$(svn info . 2> /dev/null | awk -F ':' '/Revision:/ { print $2 }') + if [ -n "$svn_rev" ]; then + svn_text="[$svn_rev]" + else + svn_text="" + fi + fi + # + # exit code if not zero + # + if [ "$exit_code" -ne "0" ]; then + exit_text="[exit=$exit_code]" + else + exit_text="" + fi + # + # Info about jobs. + # + local jobs_bg=$(jobs -r | wc -l | tr -d ' ') + local jobs_stopped=$(jobs -s | wc -l | tr -d ' ') + if [ $jobs_bg -gt 0 ] || [ $jobs_stopped -gt 0 ]; then + jobs_text="[bg:$jobs_bg,stp:$jobs_stopped]" + else + jobs_text="" + fi } - - # are we an interactive shell? -# if [ "$PS1" ]; then -# PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' -# # Turn on checkwinsize -# shopt -s checkwinsize -# [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ " -# fi - + # Turn on checkwinsize + shopt -s checkwinsize fi - # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # User specific environment and startup programs @@ -150,24 +185,17 @@ PATH=$MYLOCAL/bin:$PATH PATH=$MYSCRIPTS/bin:$PATH # -# VIM +# VIM # -#VIMDIR=/depot/vim-7.3/bin -#VIM=${VIMDIR}/vim -#if [ "$kernel" == "Linux" ]; then -# alias vi=$VIM -# alias vim=$VIM -# alias gvim=${VIMDIR}/gvim -# alias ctags="/depot/ctag-5.5.4/bin/ctags" -#fi +export EDITOR=vim # -# GIT +# GIT # [ -f $MYSCRIPTS/bash/git-completion.bash ] && . $MYSCRIPTSE/bash/git-completion.bash # -# GCC +# GCC # #if [ -e /depot/gcc-4.7.2/bin ]; then # PATH=/depot/gcc-4.7.2/bin:$PATH @@ -181,18 +209,18 @@ PATH=$MYSCRIPTS/bin:$PATH #fi # -# GDB +# GDB # #prepath /depot/gdb-7.5.1/bin # -# VTune Amplifier +# VTune Amplifier # #export INTEL_LICENSE_FILE=28518@us01-lic10:28518@us01-lic11:28518@us01-lic12:28518@tyndall #alias vtune=/depot/vtune_amplifier_xe_2013_update5/bin64/amplxe-gui # -# PURIFY and all. +# PURIFY and all. # #postpath /depot/coverity/swat/bin #export RSU_TEMPLATE2_INI=/depot/pure/templates2.ini @@ -204,15 +232,16 @@ PATH=$MYSCRIPTS/bin:$PATH #alias purecov="/depot/swe/a2007.12/bin/purecov" #alias quantify"/depot/swe/a2007.12/bin/quantify" -# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Run local settings. +# Make sure to export PATH # -[ -f $PWD/.bashrc.local ] && . $PWD/.bashrc.local +export PATH +export HISTFILESIZE=5000 # Store 5000 commands in history +export HISTCONTROL=ignoredups # Don't put duplicate lines in the history. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# set alias +# Aliases # if [ $kernel == AIX ]; then alias l='ls -a' @@ -229,11 +258,9 @@ else fi alias cgrep="grep --include \*.cpp --include \*.h --include \*.c" +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -# Make sure to export PATH +# Run local settings. # -export PATH -#export LM_LICENSE_FILE -export HISTFILESIZE=5000 # Store 5000 commands in history -export HISTCONTROL=ignoredups # Don't put duplicate lines in the history. +[ -f $PWD/.bashrc.local ] && . $PWD/.bashrc.local From e46a578f17befeb9e079764ef0e1f7363dacbcf5 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 9 Jun 2016 09:12:18 -0400 Subject: [PATCH 23/30] Fix: Spell check now works in GUI mode again. --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 7cccd08..15d8be3 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -199,7 +199,7 @@ endif if exists('+spell') && !&diff set spell highlight clear SpellBad - highlight SpellBad cterm=underline ctermfg=red + highlight SpellBad cterm=underline ctermfg=red gui=undercurl guisp=Red endif " Show 80th column. if exists('+colorcolumn') From 48aacd2721541ddd88d4d93d9ea224c4979190ae Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Wed, 10 Aug 2016 04:27:52 -0400 Subject: [PATCH 24/30] Buffergator is configured to persist. --- vim/vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 15d8be3..758151e 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -439,6 +439,8 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) " Manipulation with buffers and tabs. " Plugin 'vim-scripts/Buffergator' + let g:buffergator_autodismiss_on_select = 0 + let g:buffergator_autoupdate = 1 let g:buffergator_suppress_keymaps = 1 let g:buffergator_viewport_split_policy = "L" map ab :BuffergatorToggle From 40af9cf335427c69e67ec070f4e01d89e8d42e01 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 27 Oct 2016 00:15:12 +0100 Subject: [PATCH 25/30] Command prompt time is moved after hostname + minor enhancements/bug fixes. --- config/.bashrc | 118 +++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 53 deletions(-) diff --git a/config/.bashrc b/config/.bashrc index 531d9f0..401792c 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -41,6 +41,23 @@ kversion=`uname -v` krelease=`uname -r` hostnm=`hostname` +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# +# Bash history +# + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth +# append to the history file, don't overwrite it +shopt -s histappend +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=5000 +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Terminal colors if interactive @@ -109,12 +126,13 @@ if [ -n "$PS1" ]; then # # Colors should be set here and surrounded with \[\]otherwise bash fails to # calculate prompt length. The text is set through PROMPT_COMMAND - PS1="\[$c_user\]\u@\h: \[$c_cwd\]\w" # username@host: working_dir + PS1="\[$c_user\]\u@\h:" # username@host: + PS1+="\[$c_time\]\t" # time + PS1+=" \[$c_cwd\]\w" # working_dir PS1+="\[$c_branch\]\$git_text" # git branch PS1+="\[$c_branch\]\$svn_text" # svn revision PS1+="\[$c_exit\]\$exit_text" # exit status of last command PS1+="\[$c_jobs\]\$jobs_text" # background/suspended jobs - PS1+=" \[$c_time\]\t" # time PS1+="\[$c_reset\]\$ " # reset colors and print $ export PROMPT_COMMAND="__prompt_command; $PROMPT_COMMAND" @@ -175,92 +193,86 @@ fi # # User specific environment and startup programs # -if [ $kernel == Linux ]; then + +# +# Set my paths. +# +if [ -e $HOME/local ]; then + MYLOCAL=$HOME/local +elif [ $kernel == Linux ] && [ -e $HOME/local-lnx ]; then MYLOCAL=$HOME/local-lnx -elif [ $kernel == SunOS ]; then +elif [ $kernel == SunOS ] && [ -e $HOME/local-sun ]; then MYLOCAL=$HOME/local-sun fi +if [ -e $MYLOCAL/bin ]; then + export PATH=$MYLOCAL/bin:$PATH +fi + MYSCRIPTS=$HOME/devel/scripts -PATH=$MYLOCAL/bin:$PATH -PATH=$MYSCRIPTS/bin:$PATH +if [ -e $MYSCRIPTS/bin ]; then + export PATH=$MYSCRIPTS/bin:$PATH +fi # # VIM # export EDITOR=vim +# +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +# +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + # # GIT # [ -f $MYSCRIPTS/bash/git-completion.bash ] && . $MYSCRIPTSE/bash/git-completion.bash # -# GCC +# colored GCC warnings and errors # -#if [ -e /depot/gcc-4.7.2/bin ]; then -# PATH=/depot/gcc-4.7.2/bin:$PATH -# LD_LIBRARY_PATH=/depot/gcc-4.7.2/lib64:$LD_LIBRARY_PATH -#elif [ -e /depot/gcc-4.7.0/bin ]; then -# PATH=/depot/gcc-4.7.0/bin:$PATH -# LD_LIBRARY_PATH=/depot/gcc-4.7.0/lib64:$LD_LIBRARY_PATH -#elif [ -e /depot/gcc-4.5.2/bin ]; then -# PATH=/depot/gcc-4.5.2/bin:$PATH -# LD_LIBRARY_PATH=/depot/gcc-4.5.2/lib64:$LD_LIBRARY_PATH -#fi - -# -# GDB -# -#prepath /depot/gdb-7.5.1/bin - -# -# VTune Amplifier -# -#export INTEL_LICENSE_FILE=28518@us01-lic10:28518@us01-lic11:28518@us01-lic12:28518@tyndall -#alias vtune=/depot/vtune_amplifier_xe_2013_update5/bin64/amplxe-gui - -# -# PURIFY and all. -# -#postpath /depot/coverity/swat/bin -#export RSU_TEMPLATE2_INI=/depot/pure/templates2.ini -#export RSU_LICENSE_MAP=/depot/pure/PurifyPlus_License_Map -#export PURECOVOPTIONS="-force-rebuild=no -log-file=./%v.%p.log -counts-file=./%v.%p.pcv -windows=no" -#export PUREOPTIONS="-force-rebuild=no -always-use-cache-dir=yes -cache-dir=$HOME/tmp/pure_cache" -#export QUANTIFYOPTIONS="-force-rebuild=no -always-use-cache-dir=yes -cache-dir=$HOME/tmp/pure_cache" -#export LD_LIBRARY_PATH=$HOME/prj/fw/rmain/3pty/qt/4.7.2/amd64/lib:$LD_LIBRARY_PATH -#alias purecov="/depot/swe/a2007.12/bin/purecov" -#alias quantify"/depot/swe/a2007.12/bin/quantify" - -# -# Make sure to export PATH -# -export PATH -export HISTFILESIZE=5000 # Store 5000 commands in history -export HISTCONTROL=ignoredups # Don't put duplicate lines in the history. +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Aliases # if [ $kernel == AIX ]; then - alias l='ls -a' alias ls='ls -a' alias ll='ls -la' alias pd='pushd >/dev/null' alias bd='popd' else - alias l='ls -a --color=tty' - alias ls='ls -a --color=tty' - alias ll='ls -la --color=tty' + alias ls='ls -a --color=auto' + alias ll='ls -la --color=auto' alias pd='pushd >/dev/null' alias bd='popd' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' fi alias cgrep="grep --include \*.cpp --include \*.h --include \*.c" + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Run local settings. # -[ -f $PWD/.bashrc.local ] && . $PWD/.bashrc.local +[ -x $PWD/.bashrc.local ] && . $PWD/.bashrc.local +# +# Clean error level. +# +[ 1 ] From 4aeb9960640a5472f1be26f382c021e64af8d38a Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sun, 5 Feb 2017 12:36:43 +0000 Subject: [PATCH 26/30] Using cf5-compile from github.com/vishap/cf5-compile --- vim/plugin/cf5-compile.vim | 312 ------------------------------------ vim/plugin/let-modeline.vim | 234 --------------------------- vim/vimrc | 90 ++++++----- 3 files changed, 51 insertions(+), 585 deletions(-) delete mode 100755 vim/plugin/cf5-compile.vim delete mode 100755 vim/plugin/let-modeline.vim diff --git a/vim/plugin/cf5-compile.vim b/vim/plugin/cf5-compile.vim deleted file mode 100755 index cca8e4c..0000000 --- a/vim/plugin/cf5-compile.vim +++ /dev/null @@ -1,312 +0,0 @@ -" Copyright (c) 2014 Vahagn Khachatryan -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to deal -" in the Software without restriction, including without limitation the rights -" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -" copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -" THE SOFTWARE. -" -" Name: cf5-compile.vim -" Version: 1.0.1 -" Authors: Vahagn Khachatryan -" -" Licence: http://www.opensource.org/licenses/mit-license.php -" The MIT License -" -" Summary: Vim plugin to compile the edited files and run it. -" -" Description: -" Functions to compile/link and run a single c/cpp/java/..etc -" file based programs. It's irreplaceable for small tests or -" experiments. -" -" How To Use -" -------------- -" Put this file into vim plugin directory. For linux users should -" be $HOME/.vim/plugin. -" In your .vimrc file add -" -" map :call CF5Compile(1) -" map :call CF5Compile(0) -" -" This will allow Ctrl-F5 to "compile and run" and F5 to only -" "compile" the file. Please, note that "filetype" is used to -" define the compiler/interpreter used. -" -" The value of the following variables are used while compiling -" a file: -" g:argv - command line arguments to pass to program. -" g:pyflags - flags to pass to python interpreter. -" g:cppflags - flags to pass to c++ compiler. -" g:wcppflags - flags to pass to (windows) compiler. -" g:lcppflags - flags to pass to (linux) compiler. -" g:ldflags - flags to pass to linker. -" g:ldlibpath - paths to add to PATH or LD_LIBRARY_PATH. -" -" I personally use this script with let-modeline.vim. The last -" allows to define some of compiler options right in the file. For -" example I have the following header in some of my cpp files: -" /* -" VIM: let g:lcppflags="-std=c++11 -O2 -pthread" -" VIM: let g:wcppflags="/O2 /EHsc /DWIN32" -" VIM: let g:cppflags=g:Iboost.g:Itbb -" VIM: let g:ldflags=g:Lboost.g:Ltbb.g:tbbmalloc.g:tbbmproxy -" VIM: let g:ldlibpath=g:Bboost.g:Btbb -" VIM: let g:argv="" -" */ -" -" You might also consider using independence.vim or localvimrc.vim -" in order to configure the plugin for a particular directory. -" -" Enjoy. -" -if exists('g:loaded_cf5_compiler') - finish -endif -let g:loaded_cf5_compiler = 1 - -" -" Init global variables with default values. -" -let g:argv="" -let g:flags="" -let g:pyflags="" -let g:cppflags="" -let g:wcppflags="/O2 /EHsc /DWIN32" -let g:lcppflags="-O2" -let g:ldflags="" -let g:wldflags="" -let g:ldlibpath="" -" -" This is an experimental option. -" =0 - no output window opened. -" =1 - output window opened. -" -let g:cf5output=0 - -" -" Microsoft Visual C++ -" -function! s:CompileMSVC(run) "{{{2 - let exename=expand("%:p:r:s,$,.exe,") - let srcname=expand("%") - " compile it - let ccline="cl ".g:cppflags." ".g:wcppflags." ".srcname." /Fe".exename." /link ".g:ldflags. " ".g:wldflags - echo ccline - let cout = system( ccline ) - if v:shell_error - echo cout - return - endif - echo cout - " run it - if a:run==1 - let en = "set PATH=\"".g:ldlibpath."%PATH%\"" - let cmdline=exename." ".g:argv - let cont = [ en, cmdline ] - let tf = tempname() - let tf = fnamemodify( tf, ":p:r") - let tf = tf.".bat" - call writefile( cont, tf ) - - let eout = system( tf ) - echo eout - - call delete( tf ) - endif -endfunction - -" -" GCC -" -function! s:CompileGCC(run) "{{{2 - let exename=expand("%:p:r:s,$,.exe,") - let srcname=expand("%") - " compile it - let ccline="g++ ".g:cppflags." ".g:lcppflags." ".g:ldflags." ".srcname." -o".exename - call s:appendOutput(ccline) - let cout = system( ccline ) - if v:shell_error - call s:appendOutput(cout) - return - endif - call s:appendOutput(cout) - " run it - if a:run == 1 - let $LD_LIBRARY_PATH="LD_LIBRARY_PATH=".g:ldlibpath.":".$LD_LIBRARY_PATH - let cmdline=exename." ".g:argv - call s:appendOutput(cmdline) - let eout = system( cmdline ) - call s:appendOutput(eout) - endif -endfunction - -function! s:CompileJava(run) "{{{2 - " compile it - let cmd = "javac " . g:javaflags . " " . expand("%") - echo cmd - let cout = system( cmd ) - echo cout - if v:shell_error - return - endif - " run it - "let classpath=expand("%:p:r") - let exename=expand("%:r") - let cmd = "java " . exename . " " . g:argv - echo cmd - let eout = system( cmd ) - echo eout -endfunction - -function! s:InterpretPython(run) - " Interpret it - let cmd = "python " . g:pyflags . " " . expand("%") . ' ' . g:argv - echo cmd - let cout = system( cmd ) - echo cout - if v:shell_error - return - endif -endfunction - -function! s:InterpretMatlab(run) - " Interpret it - let cmd = "octave " . g:flags . " " . expand("%") . ' ' . g:argv - echo cmd - let cout = system( cmd ) - echo cout - if v:shell_error - return - endif -endfunction - -function! s:Compile(run) - if &filetype=="c" || &filetype=="cpp" - if has("win32") || has("win64") - call s:CompileMSVC(a:run) - else - call s:CompileGCC(a:run) - endif - endif - if &filetype=="python" - call s:InterpretPython(a:run) - endif - if &filetype=="java" - call s:CompileJava(a:run) - endif - if &filetype=="matlab" - call s:InterpretMatlab(a:run) - endif -endfunction - -" -" Output Window {{{1 -" -" Create output window. {{{2 -" -function! s:getOutputWindow() - if !exists("w:outputwin") - let w:outputwin=tempname().'_output' - endif - let obuff = w:outputwin - - let winnr = bufwinnr('^'.obuff.'$') - - if (winnr < 0) - execute "below 10new ".obuff - setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap - " setlocal nomodifiable - let winnr = bufwinnr('^'.obuff.'$') - endif - - return winnr -endfunction -" -" Append text to output window. {{{2 -" -function! s:appendOutput( text ) - if exists("g:cf5output") && (g:cf5output==1) - let cwinnr = winnr() - let owinnr = s:getOutputWindow() -" setlocal modifiable - execute owinnr . 'wincmd w' - execute 'normal! Go'.a:text -" setlocal nomodifiable - execute cwinnr.'wincmd w' - else - echo a:text - endif -endfunction -" -" Clear text from output window. {{{2 -" -function! s:clearOutputWindow() - if exists("g:cf5output") && (g:cf5output==1) - let cwinnr = winnr() - let owinnr = s:getOutputWindow() -" setlocal modifiable - execute owinnr . 'wincmd w' - execute 'normal ggdG' -" setlocal nomodifiable - execute cwinnr . 'wincmd w' - endif -endfunction - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Public interface. -"" - -" -" Load compile instructions and call window or linux compiler. {{{1 -" -function! CF5Compile(run) - " - " Interpreters and compilers don't work with buffers, but ratter they run - " on files. So, make sure that the file is updated. - " - if &modified == 1 - echo "The buffer is not saved. First save it." - return - endif - " - " Set source specific compiler options. - " let-modeline.vim should be loaded for FirstModeLine. - " - if exists('*FirstModeLine') - call FirstModeLine() - endif - " - " Clear output window - " - call s:clearOutputWindow() - " - " Compile. - " - call s:Compile(a:run) -endfunction -" -" Load compile instructions and call window or linux compiler. -" -function! CF5CompileAndRun() - call CF5Compile(1) -endfunction -" -" Load compile instructions and call window or linux compiler. -" -function! CF5CompileOnly() - call CF5Compile(0) -endfunction - diff --git a/vim/plugin/let-modeline.vim b/vim/plugin/let-modeline.vim deleted file mode 100755 index d216139..0000000 --- a/vim/plugin/let-modeline.vim +++ /dev/null @@ -1,234 +0,0 @@ -" example -> VIM: let b:toto="foo" g:tata=4 g:egal="t=y".&tw -" =========================================================================== -" File: let-modeline.vim {{{1 -" Author: Luc Hermitte -" -" URL: http://hermitte.free.fr/vim/ressources/dollar_VIM/plugin/let-modeline.vim -" Version: 1.6 -" Last Update: 23rd Mar 2004 -" -" Purpose: {{{2 -" Defines the function : FirstModeLine() that extends the VIM modeline -" feature to variables. In VIM, it is possible to set options in the -" first and last lines. -> :h modeline -" The function proposed extends it to 'let {var}={val}' affectations. -" -" Exemples Of Useful Aplications: {{{2 -" Typical Example: {{{3 -" When editing a LaTeX document composed of several files, it is very -" practical to know the name of the main file whichever file is edited -- -" TKlatex does this thanks the global variable g:TeXfile. Hence it knows -" that latex should be called on this main file ; aux2tags.vim could also -" be told to compute the associated .aux file. -" Anyway. Defining (through menus or a let command) g:TeXfile each time is -" really boring. It bored me so much that I programmed a first version of -" this script. In every file of one of my projects I added the line : -" % VIM: let g:TeXfile=main.tex -" [main.tex is the name of the main file of the project] -" Thus, I can very simply call LaTeX from within VIM without having to -" wonder which file is the main one nor having to specify g:TeXfile each -" time. -" -" Using Callback Functions: {{{3 -" Actually, in order to affect g:TeXfile, I have to call another function. -" Hence, I define a callback function (in my (La)TeX ftplugin) that checks -" whether I want to set g:TeXfile. In that case, the callback function -" calls the right function and return true. Otherwise, it returns false. -" You will find the code of this precise callback function as an example at -" the end of this file. -" -" Tune C Compilations: {{{3 -" An easy way to tune the parameters of the compilation of simple programs -" without having to maintain a makefile: -" // VIM: let $CPPFLAGS='-I../../libs': -" -" --------------------------------------------------------------------------- -" Format: {{{2 -" On the _first_ line of any file, the extended modeline format is: -" {line} ::= [text]{white}VIM:[white]let{affectations} -" {affectations} ::= {sgl_affect.} -" {affectations} ::= {sgl_affect.}{white}{affectations} -" {sgl_affect.} ::= {variable}[white]=[white]{value} -" {variable} ::= cf. vim variable format ; beware simple -" variables (other than global-, buffer-, -" or window-variables) are not exported. -" Can also be an environment variable -> $VAR. -" {value} ::= string or numeral value : no function -" call allowed. -" -" Options: {{2 -" (*) 'modeline' : vim-option that must be set to 1 -" (*) 'modelines': vim-option corrsponding to the number of lines -" searched. -" (*) b:ModeLine_CallBack(var,val) : callback function -" Enable to define callback functions when needed. cf. lhlatex.vim -" -" Installation: {{{2 -" (*) Drop the file into your $$/plugin/ or $$/macros/ folder. -" (*) Source it from your .vimrc and add the autocommand: -" " Loads FirstModeLine() -" if !exists('*FirstModeLine') -" " :Runtime emules :runtime with VIM 5.x -" Runtime plugin/let-modeline.vim -" endif -" if exists('*FirstModeLine') -" aug ALL -" au! -" " To not interfer with Templates loaders -" au BufNewFile * :let b:this_is_new_buffer=1 -" " Modeline interpretation -" au BufEnter * :call FirstModeLine() -" aug END -" endif -" -" -" Remarks: {{{2 -" (*) The only way to call a function is through the callback feature. -" Affectation like 'let g:foo="abc".DEF()' are recognized and -" forbiden. -" (*) The modeline is recognized thanks to "VIM" in that *must* be in -" uppercase letters -" -" Changes: {{{2 -" v1.6: Support for environment variables. -" vim 6.x only -" Doesn't check into folded lines anymore -" v1.5: Check that the format of the variables and values is correct -" before it tries to set the variables -> no more error messages -" when using 2html.vim. -" v1.4: With Vim 6.x, it doesn't mess anymore with the search history -" v1.3: Parse several lines according to &modelines and &modeline -" v1.2: no-reinclusion mecanism -" v1.1b: extend variable names to accept underscores -" -" Todo: {{{2 -" (*) Enforce the patterns and the resulting errors -" (*) Permit to have comments ending characters at the end of the line. -" (*) Simplify the regexps -" -" }}}1 -" =========================================================================== -" Definitions: {{{1 -if exists("g:loaded_let_modeline") | finish | endif -let g:loaded_let_modeline = 1 - -" Internal function dedicated to the recognition of function calls {{{2 -function! s:FoundFunctionCall(value_str) - let str = substitute(a:value_str, '"[^"]*"', '', 'g') - let str = substitute(str, "'[^']*'", '', 'g') - return match(str, '(.*)') != -1 -endfunction - -" Internal function dedicated to the parsing of a line {{{2 -function! FML_parse_line(mtch) - " call confirm('Find:'.a:mtch, '&ok', 1) - if a:mtch !="" - let mtch = a:mtch - let re_var = '\s\+\([[:alnum:]:_$]\+\)' - " beware the comments ending characters - let re_val = '\(\%(' . "'[^']*'" . '\|"[^"]*"\|[-a-zA-Z0-9:_.&$]\)\+\)$' - let re_other = '^\(.\{-}\)' - let re_sub = re_other . re_var . '\s*=\s*' . re_val - while strlen(mtch) != 0 - let vari = substitute( mtch, re_sub, '\2', '' ) - let valu = substitute( mtch, re_sub, '\3', '' ) - " call confirm('regex: '.re_sub."\nmtch: <<".mtch.">>\nvar: ".vari."\nval: ".valu, '&ok', 1) - if (vari !~ '^[[:alnum:]:_$]\+$') || (valu !~ re_val) - return - endif - " Check : no function ! - if s:FoundFunctionCall(valu) - echohl ErrorMsg - echo "Find a function call in the affectation : let " . vari . " = " . valu - echohl None - return - endif - let mtch = substitute( mtch, re_sub, '\1', '' ) - ""echo vari . " = " . valu . " --- " . mtch . "\n" - " call confirm('vari: '.vari.' = '.valu." --- " . mtch, '&Ok', 1) - if exists("b:ModeLine_CallBack") - exe 'let res = '. b:ModeLine_CallBack . '("'.vari.'","'.valu.'")' - if res == 1 | return | endif - endif - " Else - execute "let " . vari . " = " . valu - endwhile - endif -endfunction - -" Internal function dedicated searching the matching lines {{{2 -function! s:Do_it_on_range(first, last) - " let modeline_pat = '[vV][iI][mM]\d*:\s*let\s*\zs.*$' - let modeline_pat = '[vV][iI][mM]\d*:\s*let\zs.*$' - if &verbose >= 2 " {{{ - echo "\n->"a:first.','.a:last. 'g/'.modeline_pat. - \ '/:call FML_parse_line(matchstr(getline("."),"'. - \ escape(modeline_pat, '\\') .'"))' - endif " }}} - let s:save_fold_enable= &foldenable - set nofoldenable - if exists(':try') - try - silent execute a:first.','.a:last. 'g/'.modeline_pat. - \ '/:call FML_parse_line(matchstr(getline("."),"'. - \ escape(modeline_pat, '\\') .'"))' - " Purge the history for the search pattern just used. - call histdel('search', -1) - finally - let &foldenable = s:save_fold_enable - endtry - else " Older versions of Vim - silent execute a:first.','.a:last. 'g/'.modeline_pat. - \ '/:call FML_parse_line(matchstr(getline("."),"'. - \ escape(modeline_pat, '\\') .'"))' - " Purge the history for the search pattern just used. - call histdel('search', -1) - let &foldenable = s:save_fold_enable - endif -endfunction - -" The main function {{{2 -function! FirstModeLine() - if !&modeline | return | endif - let pos = line('.') . 'normal! ' . virtcol('.') . '|' - let e1 = 1+&modelines-1 - let b2 = line('$') - &modelines+1 - " call confirm('e1='.e1."\nb2=".b2, '&ok', 1) - if e1 >= b2 - call s:Do_it_on_range(1, line('$')) - else - call s:Do_it_on_range(1, e1) - call s:Do_it_on_range(b2, line('$')) - endif - if !exists('b:this_is_new_buffer') - exe pos - else - unlet b:this_is_new_buffer - endif - " call confirm('fini!', '&ok', 1) -endfunction - -" }}}2 - -" }}}1 -" =========================================================================== -" Example of a callback function {{{1 -" Version I use in my (La)TeX ftplugin -if 0 - - let b:ModeLine_CallBack = "TeXModeLine_CallBack" - function! TeXModeLine_CallBack(var,val) - if match(a:var, "g:TeXfile") != -1 - " restore quotes around the file name - "let valu = substitute( valu, '^"\=\([[:alnum:].]\+\)"\=$', '"\1"', '' ) - call TKSetTeXfileName( 2, a:val ) - return 1 - else - return 0 - endif - endfunction - -endif -" }}}1 -" =========================================================================== -" vim600: set fdm=marker: diff --git a/vim/vimrc b/vim/vimrc index 758151e..0426bd2 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -375,15 +375,6 @@ let $GREP_OPTIONS.=' --exclude-dir=llcalc* --exclude-dir=00*' "let $GREP_OPTIONS.=' --include Makefile' map af :execute "grep! ".expand("")." -r ." cw -" -" Loads CF5Compile -" Compile and run file if Ctrl-F5 is pressed. -" -if !exists('*CF5Compile') - runtime plugin/cf5-compiler.vim -endif -map a4 :call CF5CompileOnly() -map a5 :call CF5CompileAndRun() " " 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. @@ -430,36 +421,12 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) " " Adds nice status and tabline. " - Plugin 'bling/vim-airline' + Plugin 'vim-airline/vim-airline' + "Plugin 'vim-airline/vim-airline-themes' let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#left_sep = ' ' let g:airline#extensions#tabline#left_alt_sep = '|' - - " - " Manipulation with buffers and tabs. - " - Plugin 'vim-scripts/Buffergator' - let g:buffergator_autodismiss_on_select = 0 - let g:buffergator_autoupdate = 1 - let g:buffergator_suppress_keymaps = 1 - let g:buffergator_viewport_split_policy = "L" - map ab :BuffergatorToggle - "map at :BuffergatorTabsToggle - - " - " - " - "Plugin 'eiginn/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 - "map :Explore - "map :Explore %:p:h - + let g:airline_powerline_fonts = 1 " " " @@ -471,6 +438,29 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) let g:NERDTreeIgnore = ['\.o$', '\.so$', '\.tsk$'] map at :NERDTreeToggle "map am :NERDTreeFind + " + " Commented out in favour of NERDTree + " + "Plugin 'eiginn/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 + "map :Explore + "map :Explore %:p:h + " + " Manipulation with buffers and tabs. + " + Plugin 'vim-scripts/Buffergator' + let g:buffergator_autodismiss_on_select = 0 + let g:buffergator_autoupdate = 1 + let g:buffergator_suppress_keymaps = 1 + let g:buffergator_viewport_split_policy = "L" + map ab :BuffergatorToggle + "map at :BuffergatorTabsToggle " " :A switches to the header file (or vise versa) @@ -493,16 +483,33 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) let g:alternateExtensions_cpp = "h" let g:alternateExtensions_c = "h" map ah :A + " + " Extends modeline to variables. + " Needed by CF5 compile to read options right from file. + " + Plugin 'vim-scripts/let-modeline.vim' + " + " CF5 compile. + " Compiling cpp files without make file. + " + Plugin 'vishap/cf5-compile' + map ac :call CF5CompileOnly() + map ar :call CF5CompileAndRun() + " " Comment code. - " gc - visusl mode - comment selection. + " gc - visual mode - comment selection. " - "Plugin 'tpope/vim-commentary' + Plugin 'tpope/vim-commentary' + nmap al CommentaryLine + vmap al Commentary " " Git wrapper. " Plugin 'tpope/vim-fugitive' + nmap git :Git + nmap gst :Gstatus " " Shows git diff. " [c - jump prev diff @@ -521,7 +528,7 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) let g:gitgutter_map_keys = 0 let g:gitgutter_realtime = 0 let g:gitgutter_eager = 0 - + let g:gitgutter_async = 1 " " Check syntaxis on fly. @@ -570,6 +577,11 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) " "Plugin 'xterm-color-table.vim' + + " Promising GDB manager. + " + Plugin 'vim-scripts/gdbmgr' + " call vundle#end() filetype plugin indent on From ee0d5924190b5485772291f2317a3dc3f2311e55 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Tue, 21 Feb 2017 09:13:59 -0500 Subject: [PATCH 27/30] cgrep --- config/.bashrc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/config/.bashrc b/config/.bashrc index 401792c..8106d64 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -259,7 +259,28 @@ else alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi -alias cgrep="grep --include \*.cpp --include \*.h --include \*.c" + +function cgrep() { + if [[ $# -eq 0 ]] + then + echo "Usage: codegrep " + else + grep -nR --colour \ + --include=\*.cpp \ + --include=\*.c \ + --include=\*.hpp \ + --include=\*.h \ + --include=\*.inc \ + --include=\*.php \ + --include=\*.py \ + --include=\*.sh \ + --exclude-dir=.git \ + --exclude-dir=.svn \ + --exclude-dir=llcalc* \ + --exclude-dir=00* \ + "$1" . + fi +} # Add an "alert" alias for long running commands. Use like so: From 7e2d5762e2f9c7a88c8f4526414e5881fb2b8716 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Sat, 27 May 2017 10:59:57 +0100 Subject: [PATCH 28/30] vim templates added --- vim/vimrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 0426bd2..c65b16e 100755 --- a/vim/vimrc +++ b/vim/vimrc @@ -495,7 +495,17 @@ if filereadable(expand('~/.vim/bundle/Vundle.vim/README.md')) Plugin 'vishap/cf5-compile' map ac :call CF5CompileOnly() map ar :call CF5CompileAndRun() - + + " + " Provide templates + " + Plugin 'aperezdc/vim-template' + "let g:templates_no_autocmd = 1 + let g:templates_no_builtin_templates = 1 + " + " Local vimrc + " + Plugin 'embear/vim-localvimrc' " " Comment code. From 0a7e572358a834874165cd81823375c93db1ae1f Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Thu, 22 Jun 2017 14:41:22 -0400 Subject: [PATCH 29/30] create_tags is added --- config/.bashrc | 33 +++++++++++++++++++++++++++++++++ config/.ctags | 27 +++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/config/.bashrc b/config/.bashrc index 8106d64..11d3699 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -282,6 +282,39 @@ function cgrep() { fi } +function create_tags() { + #Bloomberg + if [ -e /opt/swt/bin/ctags ]; then + CTAGS=/opt/swt/bin/ctags + else + CTAGS=ctags + fi + CTAGS_OPT='--recurse=yes ' + CTAGS_OPT+='--verbose ' + CTAGS_OPT+='--totals=yes ' + CTAGS_OPT+='--tag-relative=yes ' + + CTAGS_DIR='.ctags_dir' + if [ -f $PWD/$CTAGS_DIR ]; then + CTAGS_ROOT="$PWD" + elif [ -f $PWD/../$CTAGS_DIR ]; then + CTAGS_ROOT="$PWD/.." + elif [ -f $PWD/../../$CTAGS_DIR]; then + CTAGS_ROOT="$PWD/../.." + else + CTAGS_ROOT="$PWD" + fi + + if [ -f $CTAGS_ROOT/$CTAGS_DIR ]; then + CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR" + else + CTAGS_SRC='$@' + fi + + cd $CTAGS_ROOT + $CTAGS $CTAGS_OPT $CTAGS_SRC + cd - +} # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert diff --git a/config/.ctags b/config/.ctags index 36b03aa..f41233b 100644 --- a/config/.ctags +++ b/config/.ctags @@ -1,5 +1,24 @@ -# Basic options ---recurse=yes +--verbose --tag-relative=yes ---exclude=.git - +--exclude=.git* +--exclude=.doxygen +--exclude=*.o +--exclude=*.d +--exclude=*.a +--exclude=*.so +--exclude=*.tsk +--exclude=*.cap +--exclude=*.defs +--exclude=*.dep +--exclude=*.mem +--exclude=*.opts +--exclude=*.pub +--exclude=*.txt +--exclude=*.swp +--exclude=*.swo +--exclude=*.swn +--exclude=build +--exclude=llcalc* +--exclude=ported.* +--exclude=00* +--exclude=*plink* From fb0b718f2e80e96da7d1daa0997d3104de9e0b05 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Mon, 26 Jun 2017 05:33:50 -0400 Subject: [PATCH 30/30] Minor fixes on create_tags and .bashrc.local --- config/.bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/.bashrc b/config/.bashrc index 11d3699..bc62c81 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -308,7 +308,7 @@ function create_tags() { if [ -f $CTAGS_ROOT/$CTAGS_DIR ]; then CTAGS_SRC="-L $CTAGS_ROOT/$CTAGS_DIR" else - CTAGS_SRC='$@' + CTAGS_SRC="$%" fi cd $CTAGS_ROOT @@ -324,7 +324,7 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo # # Run local settings. # -[ -x $PWD/.bashrc.local ] && . $PWD/.bashrc.local +[ -x $HOME/.bashrc.local ] && . $HOME/.bashrc.local # # Clean error level.