From 7e7256d1dc22619373271ff12ff677e3b11067dc Mon Sep 17 00:00:00 2001 From: Blubber Date: Tue, 11 Oct 2016 23:37:37 +0200 Subject: merged git files into vimrc and added markers --- .vim/vimrc_files/colors.vim | 3 - .vim/vimrc_files/functions.vim | 21 ---- .vim/vimrc_files/highlights.vim | 26 ----- .vim/vimrc_files/keymaps.vim | 82 ---------------- .vim/vimrc_files/plugin_config.vim | 40 -------- .vim/vimrc_files/vundle.vim | 26 ----- .vimrc | 195 ++++++++++++++++++++++++++++++++++--- 7 files changed, 181 insertions(+), 212 deletions(-) delete mode 100644 .vim/vimrc_files/colors.vim delete mode 100644 .vim/vimrc_files/functions.vim delete mode 100644 .vim/vimrc_files/highlights.vim delete mode 100644 .vim/vimrc_files/keymaps.vim delete mode 100644 .vim/vimrc_files/plugin_config.vim delete mode 100644 .vim/vimrc_files/vundle.vim diff --git a/.vim/vimrc_files/colors.vim b/.vim/vimrc_files/colors.vim deleted file mode 100644 index 3a68794..0000000 --- a/.vim/vimrc_files/colors.vim +++ /dev/null @@ -1,3 +0,0 @@ -" dotfiles -- .vim/vimrc_files/colors.vim -" author: johannst - diff --git a/.vim/vimrc_files/functions.vim b/.vim/vimrc_files/functions.vim deleted file mode 100644 index 9f2a1fd..0000000 --- a/.vim/vimrc_files/functions.vim +++ /dev/null @@ -1,21 +0,0 @@ -" dotfiles -- .vim/vimrc_files/functions.vim -" author: johannst - -" Split Window and scroll down -function! SplitScroll() - :wincmd v - :wincmd w - execute "normal! \" - :set scrollbind - :wincmd w - :set scrollbind -endfunc - -" toggle relative line number mode -function! ToggleRelativeNumber() - if(&relativenumber == 1) - set norelativenumber - else - set relativenumber - endif -endfunc diff --git a/.vim/vimrc_files/highlights.vim b/.vim/vimrc_files/highlights.vim deleted file mode 100644 index 02371e9..0000000 --- a/.vim/vimrc_files/highlights.vim +++ /dev/null @@ -1,26 +0,0 @@ -" dotfiles -- .vim/vimrc_files/highlights.vim -" author: johannst - -" hi clear CursorLine -" augroup CLClear -" autocmd! ColorScheme * hi clear CursorLine -" augroup END - -"hi LineNr ctermfg=208 - -" Highlight color of current line -hi CursorLineNR cterm=bold ctermfg=255 ctermbg=208 -"hi CursorLineNR cterm=bold ctermfg=226 -augroup CLNRSet - autocmd! ColorScheme * hi CursorLineNR cterm=bold ctermfg=255 ctermbg=208 - "autocmd! ColorScheme * hi CursorLineNR cterm=bold ctermfg=226 -augroup END - -" Highlight status line -hi StatusLine ctermbg=38 ctermfg=0 cterm=NONE term=NONE gui=NONE -"hi StatusLineNC ctermbg=81 ctermfg=0 - -" matching brackets -"hi MatchParen cterm=underline ctermbg=141 ctermfg=yellow -hi MatchParen cterm=underline ctermbg=89 ctermfg=208 -"hi MatchParen cterm=underline ctermbg=DarkMagenta ctermfg=12 diff --git a/.vim/vimrc_files/keymaps.vim b/.vim/vimrc_files/keymaps.vim deleted file mode 100644 index d520ad7..0000000 --- a/.vim/vimrc_files/keymaps.vim +++ /dev/null @@ -1,82 +0,0 @@ -" dotfiles -- .vim/vimrc_files/keymaps.vim -" author: johannst - -" set leader key -"execute "set =\es" -let mapleader="S" - -" re-source .vimrc -map v :source ~/.vimrc - -"remap esc button -imap jj - -" prevent quit accidentlty -map :q :bd -map :qa :bd -map :wq :w:bd -noremap q :q - -" re-adjust indentation -map f mzgg=G`z - -" navigate between different splits -map j -map k -map l -map h -map j -map k -map l -map h - -" resize splits -"map 5- -"map 5+ -"map 5< -"map 5> - -" navigate between different buffers -nnoremap :bprevious -nnoremap :bnext -nnoremap :bprevious -nnoremap :bnext - -" ctrl-ae jump to line start/end -nnoremap 0 -nnoremap $ -inoremap 0 -inoremap $ -vnoremap 0 -vnoremap $ -cnoremap -cnoremap - -" Shortcut to toggle relative numbering mode -nnoremap :call ToggleRelativeNumber() - -" add a marker fold snippet (for C/C++) -nnoremap o//{{{ o//}}}A -imap -" only works with v-block (not v-line) -vnoremap VV''>o//}}}'<A - -" substitute selection -vnoremap "hy:%s/h/h/gc - -" yank/paste into/from register -vnoremap "ay -inoremap a -cnoremap a - -" +-----------------+ -" | Plugin specific | -" +-----------------+ -" Open BufferExplorer -nnoremap :call BufExplorer() - -" Toggle Tagbar -nnoremap t :TagbarToggle - -" build tags of your own project with Ctrl-F12 -map :!ctags -R --sort=yes --c++-kinds=+pl --fields=+iaS --extra=+q --language-force=C++ . diff --git a/.vim/vimrc_files/plugin_config.vim b/.vim/vimrc_files/plugin_config.vim deleted file mode 100644 index c7b1a8f..0000000 --- a/.vim/vimrc_files/plugin_config.vim +++ /dev/null @@ -1,40 +0,0 @@ -" dotfiles -- .vim/vimrc_files/plugin_config.vim -" author: johannst - -" +----------------------------+ -" | Vim-Airline | -" +----------------------------+ -" Enable the list of buffers -let g:airline#extensions#tabline#enabled = 1 -" Show just the filename -let g:airline#extensions#tabline#fnamemod = ':t' - -let g:airline_powerline_fonts = 1 - -if !exists('g:airline_symbols') - let g:airline_symbols = {} -endif - -" +----------------------------+ -" | Tagbar | -" +----------------------------+ -let g:tagbar_ctags_bin='~/.vim/bin/ctags' - -" +----------------------------+ -" | OmniCppComplete | -" +----------------------------+ -" add tags -" set tags+=~/.vim/tags/cpp_tags - -" OmniCppComplete -"let OmniCpp_NamespaceSearch = 1 -"let OmniCpp_GlobalScopeSearch = 1 -"let OmniCpp_ShowAccess = 1 -"let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters -"let OmniCpp_MayCompleteDot = 1 " autocomplete after . -"let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> -"let OmniCpp_MayCompleteScope = 1 " autocomplete after :: -"let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] -"" automatically open and close the popup menu / preview window -"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif -"set completeopt=menuone,menu,longest,preview diff --git a/.vim/vimrc_files/vundle.vim b/.vim/vimrc_files/vundle.vim deleted file mode 100644 index 6b8b21a..0000000 --- a/.vim/vimrc_files/vundle.vim +++ /dev/null @@ -1,26 +0,0 @@ -" dotfiles -- .vim/vimrc_files/vundle.vim -" author: johannst - -" to install plugins open vim and run :PluginInstall from within vim OR -" vim +PluginInstall +qall from cmd line - -filetype off " necessary for vundle!!! -set rtp+=~/.vim/bundle/Vundle.vim - -call vundle#begin() - -Plugin 'VundleVim/Vundle.vim' - -Plugin 'jlanzarotta/bufexplorer' - -Plugin 'vim-airline/vim-airline' -Plugin 'vim-airline/vim-airline-themes' - -Plugin 'majutsushi/tagbar' - -Plugin 'kien/ctrlp.vim' - -" c++ modifief headers: http://www.vim.org/scripts/script.php?script_id=2358 -"Plugin 'vim-scripts/OmniCppComplete' - -call vundle#end() diff --git a/.vimrc b/.vimrc index 9058add..b0faa2d 100644 --- a/.vimrc +++ b/.vimrc @@ -1,10 +1,57 @@ " dotfiles -- .vimrc " author: johannst -set nocompatible " make Vim less Vi +set nocompatible " make vim less vi -source ~/.vim/vimrc_files/vundle.vim -source ~/.vim/vimrc_files/plugin_config.vim +"{{{ Vundle + + " to install plugins open vim and run :PluginInstall from within vim OR + " vim +PluginInstall +qall from cmd line + + filetype off " necessary for vundle!!! + set rtp+=~/.vim/bundle/Vundle.vim + + call vundle#begin() + Plugin 'VundleVim/Vundle.vim' + Plugin 'jlanzarotta/bufexplorer' + Plugin 'vim-airline/vim-airline' + Plugin 'vim-airline/vim-airline-themes' + Plugin 'majutsushi/tagbar' + Plugin 'kien/ctrlp.vim' + " c++ modifief headers: http://www.vim.org/scripts/script.php?script_id=2358 + "Plugin 'vim-scripts/OmniCppComplete' + call vundle#end() + +"}}} +"{{{ Plugin Config + + " powerline + let g:airline#extensions#tabline#enabled = 1 + let g:airline#extensions#tabline#fnamemod = ':t' + let g:airline_powerline_fonts = 1 + if !exists('g:airline_symbols') + let g:airline_symbols = {} + endif + + " tagbar + let g:tagbar_ctags_bin='~/.vim/bin/ctags' + + " omni complete + " add tags + " set tags+=~/.vim/tags/cpp_tags + "let OmniCpp_NamespaceSearch = 1 + "let OmniCpp_GlobalScopeSearch = 1 + "let OmniCpp_ShowAccess = 1 + "let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters + "let OmniCpp_MayCompleteDot = 1 " autocomplete after . + "let OmniCpp_MayCompleteArrow = 1 " autocomplete after -> + "let OmniCpp_MayCompleteScope = 1 " autocomplete after :: + "let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"] + "" automatically open and close the popup menu / preview window + "au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif + "set completeopt=menuone,menu,longest,preview + +"}}} " +----------------------------+ " | Color Settings | @@ -92,21 +139,141 @@ set novisualbell autocmd QuickFixCmdPost [^l]* nested cwindow autocmd QuickFixCmdPost l* nested lwindow -" +----------------------------+ -" | Source Extrenal Files | -" +----------------------------+ -source ~/.vim/vimrc_files/colors.vim -source ~/.vim/vimrc_files/keymaps.vim -source ~/.vim/vimrc_files/highlights.vim -source ~/.vim/vimrc_files/functions.vim +"{{{ Keymaps + + " set leader key + "execute "set =\es" + let mapleader=";" + + " re-source .vimrc + map v :source ~/.vimrc + + "remap esc button + imap jj + + " quit buffer + noremap q :bd + + " re-adjust indentation + map f mzgg=G`z + + " navigate between different splits + map j + map k + map l + map h + map j + map k + map l + map h + + " resize splits + "map 5- + "map 5+ + "map 5< + "map 5> + + " navigate between different buffers + nnoremap :bprevious + nnoremap :bnext + nnoremap :bprevious + nnoremap :bnext + + " ctrl-ae jump to line start/end + nnoremap 0 + nnoremap $ + inoremap 0 + inoremap $ + vnoremap 0 + vnoremap $ + cnoremap + cnoremap + + " Shortcut to toggle relative numbering mode + nnoremap :call ToggleRelativeNumber() + + " add a marker fold snippet (for C/C++) + nnoremap o//{{{ o//}}}A + imap + " only works with v-block (not v-line) + vnoremap VV''>o//}}}'<A + + " substitute selection + vnoremap "hy:%s/h/h/gc + + " yank/paste into/from register + vnoremap "ay + inoremap a + cnoremap a + + " +-----------------+ + " | Plugin specific | + " +-----------------+ + " Open BufferExplorer + nnoremap :call BufExplorer() + + " Toggle Tagbar + nnoremap t :TagbarToggle + + " build tags of your own project with Ctrl-F12 + map :!ctags -R --sort=yes --c++-kinds=+pl --fields=+iaS --extra=+q --language-force=C++ . + +"}}} +"{{{ Global Highlighting + + " hi clear CursorLine + " augroup CLClear + " autocmd! ColorScheme * hi clear CursorLine + " augroup END + + "hi LineNr ctermfg=208 + + " Highlight color of current line + hi CursorLineNR cterm=bold ctermfg=255 ctermbg=208 + "hi CursorLineNR cterm=bold ctermfg=226 + augroup CLNRSet + autocmd! ColorScheme * hi CursorLineNR cterm=bold ctermfg=255 ctermbg=208 + "autocmd! ColorScheme * hi CursorLineNR cterm=bold ctermfg=226 + augroup END + + " Highlight status line + hi StatusLine ctermbg=38 ctermfg=0 cterm=NONE term=NONE gui=NONE + "hi StatusLineNC ctermbg=81 ctermfg=0 + + " matching brackets + "hi MatchParen cterm=underline ctermbg=141 ctermfg=yellow + hi MatchParen cterm=underline ctermbg=89 ctermfg=208 + "hi MatchParen cterm=underline ctermbg=DarkMagenta ctermfg=12 + +"}}} +"{{{ Functions + " Split Window and scroll down + function! SplitScroll() + :wincmd v + :wincmd w + execute "normal! \" + :set scrollbind + :wincmd w + :set scrollbind + endfunc + + " toggle relative line number mode + function! ToggleRelativeNumber() + if(&relativenumber == 1) + set norelativenumber + else + set relativenumber + endif + endfunc +"}}} " +----------------------------+ " | Tmux specific settings | " +----------------------------+ " tmux will send xterm-style keys when its xterm-keys option is on if &term =~ '^screen' - execute "set =\e[1;*A" - execute "set =\e[1;*B" - execute "set =\e[1;*C" - execute "set =\e[1;*D" + execute "set =\e[1;*A" + execute "set =\e[1;*B" + execute "set =\e[1;*C" + execute "set =\e[1;*D" endif -- cgit v1.2.3