User Tools

Site Tools


programming:vimrc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
programming:vimrc [2018/10/18 11:49] – created clemixprogramming:vimrc [2020/01/24 22:46] (current) – [Install] clemix
Line 22: Line 22:
 " let Vundle manage Vundle, required " let Vundle manage Vundle, required
 Plugin 'VundleVim/Vundle.vim' Plugin 'VundleVim/Vundle.vim'
 +Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
 +Plugin 'tpope/vim-fugitive'
 +Plugin 'kien/ctrlp.vim'
 +Plugin 'nvie/vim-flake8'
 +Plugin 'vim-syntastic/syntastic'
 +Bundle 'Valloric/YouCompleteMe'
 +Plugin 'editorconfig/editorconfig-vim'
 +
 " Plugin 'osfameron/perl-tags-vim' " Plugin 'osfameron/perl-tags-vim'
 " The following are examples of different formats supported. " The following are examples of different formats supported.
Line 43: Line 51:
 call vundle#end()            " required call vundle#end()            " required
 filetype plugin indent on    " required filetype plugin indent on    " required
 +
 +"python with virtualenv support
 +py << EOF
 +import os
 +import sys
 +if 'VIRTUAL_ENV' in os.environ:
 +  project_base_dir = os.environ['VIRTUAL_ENV']
 +  activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
 +  execfile(activate_this, dict(__file__=activate_this))
 +EOF
 +
 +let g:ycm_autoclose_preview_window_after_completion=1
 +map <leader> :YcmCompleter GoToDefinitionElseDeclaration<CR>
 +
 " To ignore plugin indent changes, instead use: " To ignore plugin indent changes, instead use:
 "filetype plugin on "filetype plugin on
Line 81: Line 103:
  
  
-set statusline=%F%m%r%h%w\ [%L]\ [%{&ff}]\ %y\ [%p%%]\ [POS=%04l,%04v]\ %{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k+"set statusline=%F%m%r%h%w\ [%L]\ [%{&ff}]\ %y\ [%p%%]\ [POS=%04l,%04v]\ %{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\ &bomb)?\",B\":\"\").\"]\ \"}%k
              | | | | |    |            |    |              |      |              | | | | |    |            |    |              |      |
              | | | | |    |            |    |              |      + Show encoding              | | | | |    |            |    |              |      + Show encoding
Line 145: Line 167:
  
 set nowrap set nowrap
 +set colorcolumn=80
  
 set wildmode=longest,list " list all possible files|directorys if you open a file with :e or :view or :tabnew set wildmode=longest,list " list all possible files|directorys if you open a file with :e or :view or :tabnew
Line 153: Line 176:
 :nnoremap <F8> :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR> :nnoremap <F8> :let @/='\<<C-R>=expand("<cword>")<CR>\>'<CR>:set hls<CR>
 :nnoremap <F9> :TagbarToggle<CR> :nnoremap <F9> :TagbarToggle<CR>
-:nnoremap <F7> :ts <C-R><C-W><CR>+:nmap <F7> :ts <C-R><C-W><CR>
  
  schaltet die Darstellung von Leerzeichen, TABs und Zeilenenden an/aus:  schaltet die Darstellung von Leerzeichen, TABs und Zeilenenden an/aus:
Line 175: Line 198:
     let spellst = ["en"]     let spellst = ["en"]
         " toggle spelling with F2 key         " toggle spelling with F2 key
-        map <F3> :set spell!<CR><Bar>:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)<CR>+        map <F3> :set spell!<CR><Bar>:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)<CR> *]S* <CR>
         " they were using white on white         " they were using white on white
         highlight PmenuSel ctermfg=black ctermbg=lightgray         highlight PmenuSel ctermfg=black ctermbg=lightgray
Line 181: Line 204:
         set sps=best,5         set sps=best,5
     " highlighting     " highlighting
-    hi SpellBad ctermfg=Red ctermbg=Black cterm=underline +    hi SpellBad ctermfg=Red cterm=underline 
-    hi SpellCap ctermfg=blue ctermbg=black cterm=underline+    hi SpellCap ctermfg=blue cterm=underline
  
     imap <F4> <ESC>z=<CR>i     imap <F4> <ESC>z=<CR>i
Line 256: Line 279:
 command! -nargs=* Find :call Find(<f-args>) command! -nargs=* Find :call Find(<f-args>)
  
-function! Grn(...) +"colorscheme habiLight 
-    if a:0==2 +"colorscheme eclipse
-        let path=a:1 +
-        let query=a:2 +
-    else +
-        let path="./" +
-        let query=a:1 +
-    endif+
  
-    let ignore " | egrep -v '.git|.svn|CVS'"+set clipboard=unnamedplus
  
-    let l:list=system("grep -rn '".query."' --exclude-dir=.svn --exclude-dir=.git --exclude-dir=CVS --exclude=tags ".path." "+"execute pathogen#infect() 
-    let l:num=strlen(substitute(l:list, "[^\n]", "", "g"))+" 
 +autocmd BufWritePre * %s/\s\+$//e 
 +</file>
  
-    if l:num 1 +====== Install ====== 
-        echo "'".query."' not found" +<code bash> 
-        return +git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim 
-    endif+vim +PluginInstall +qall 
 +</code>
  
-    if l:num == 1 +Install YCM https://github.com/ycm-core/YouCompleteMe#linux-64-bit 
-        exe "open " substitute(l:list, "\n", "", "g") +<code bash
-    else +sudo apt install build-essential cmake python3-dev
-        let tmpfile = tempname() +
-        exe "redir! " . tmpfile +
-        silent echon l:list +
-        redir END +
-        let old_efm = &efm +
-        set efm=%f+
  
-        if exists(":cgetfile"+cd ~/.vim/bundle/YouCompleteMe 
-            execute "silent! cgetfile " tmpfile +python3 install.py --clang-completer 
-        else +</code>
-            execute "silent! cfile " tmpfile +
-        endif+
  
-        let &efm old_efm+====== Alias Helpers ====== 
 +<code bash> 
 +alias ctags-perl="ctags -f tags --recurse --totals \ 
 +--exclude='.*.swp' --exclude=.svn \ 
 +--exclude=.git --exclude='*~'
 +--extras=+q \ 
 +--languages=Perl \ 
 +--langmap=Perl:+.t"
  
-        Open the quickfix window below the current window +alias ctags-c++="ctags -R \ 
-        botright copen+--exclude='.*.swp' --exclude=.svn \ 
 +--exclude=.git --exclude='*~'
 +--c++-kinds=+p \ 
 +--fields=+iaS \ 
 +--extras=+q \ 
 +--langmap=c++:.ino.c.h.cpp.hpp"
  
-        call delete(tmpfile) +alias ctags-python="ctags -R \ 
-    endif+--exclude='.*.swp' --exclude=.svn \ 
 +--exclude=.git --exclude='*~'
 +--fields=+l \ 
 +--extras=+q \ 
 +--languages=python \ 
 +--python-kinds=-iv"
  
-endfunction 
  
-command! -nargs=* Grn :call Grn(<f-args>)+alias grn="grep -rn --exclude tags" 
 +alias git-show-files="git log --pretty=format--name-only  -n1" 
 +alias git-hist="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
  
-"colorscheme habiLight +</code>
-"colorscheme eclipse +
- +
-set clipboard=unnamedplus +
- +
-"execute pathogen#infect() +
-+
-autocmd BufWritePre * %s/\s\+$//+
-</file>+
programming/vimrc.1539856171.txt.gz · Last modified: by clemix

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki