From 5f3ccd0dcada92e2ab06fbf6215b3f5a1ee0ac34 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 26 Jul 2015 18:17:27 +0200 Subject: original configuration from monochrome with custom color-scheme maxvb6 --- .gitmodules | 3 + autoload/pathogen.vim | 1 + colors/maxvb6.vim | 138 +++++++++++ vim-pathogen | 1 + vimrc | 622 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 765 insertions(+) create mode 100644 .gitmodules create mode 120000 autoload/pathogen.vim create mode 100644 colors/maxvb6.vim create mode 160000 vim-pathogen create mode 100644 vimrc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..8d5d904 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vim-pathogen"] + path = vim-pathogen + url = https://github.com/tpope/vim-pathogen.git diff --git a/autoload/pathogen.vim b/autoload/pathogen.vim new file mode 120000 index 0000000..9a7227e --- /dev/null +++ b/autoload/pathogen.vim @@ -0,0 +1 @@ +../vim-pathogen/autoload/pathogen.vim \ No newline at end of file diff --git a/colors/maxvb6.vim b/colors/maxvb6.vim new file mode 100644 index 0000000..98d149c --- /dev/null +++ b/colors/maxvb6.vim @@ -0,0 +1,138 @@ +" color theme for vim +" Maintainer: Max Christian Pohle +" Last Change: 11.09.2014 +" Web: http://max.entwicklerseite.de + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="maxvb6" + + +"set guifont=Liberation\ Mono\ Normal\ 14 +set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 + + +set number +set hls + +highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black + +highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight! link NonText Normal + +highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21 +highlight! link Boolean Statement +highlight! link Identifier Statement + +highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue + +highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown +highlight! link String Constant +highlight! link Number Constant + +highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen +highlight! link PreProc Comment + +highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey +highlight! link StatusLineNC StatusLine + +highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black +highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray +" highlight! link CursorLine LineNr +" highlight! link CursorColumn LineNr +" highlight! link ColorColumn LineNr + +" Cursor the character under the cursor +highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black +highlight iCursor gui=underline cterm=underline term=underline +highlight! link CursorLineNr Cursor +highlight! link CursorIM Cursor +highlight! link Visual Cursor +highlight! link VirualNOS Cursor +" highlight! link MatchParen LineNr +highlight MatchParen guibg=yellow ctermbg=yellow + +" WildMenu current match in 'wildmenu' completion +" Pmenu Popup menu: normal item. +" PmenuSel Popup menu: selected item. +" PmenuSbar Popup menu: scrollbar. +" PmenuThumb Popup menu: Thumb of the scrollbar. +highlight! link WildMenu Todo +highlight! link Popup LineNr +highlight! link PMenu Popup +highlight! link PMenuSel CursorLineNr +highlight! link PMenuSbar CursorLineNr +highlight! link PMenuThumb CursorLineNr + + +" Windows +highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray +highlight! link VertSplit Title +highlight! link StatusLine Title +highlight! link StatusLineNC Title +highlight! link TabLine Title +highlight! link TabLineFill TabLine +highlight! link TabLineSel TabLine +highlight TabLineSel gui=inverse cterm=inverse term=inverse + +highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown +highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown +highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown + +highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178 +highlight! link SpecialKey Special + +highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black +highlight! link ModeMsg Todo +highlight! link MoreMsg Todo +highlight! link ErrorMsg Todo +highlight! link Conceal Todo +highlight! link Directory Todo + +highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black +highlight! link WarningMsg Question + +highlight SpellBad gui=underline cterm=underline term=underline +highlight! link SpellCap SpellBad +highlight! link SpellLocal Todo +highlight! link SpellRare Todo +" *hl-Conceal* +" *hl-DiffAdd* +" DiffAdd diff mode: Added line |diff.txt| +" *hl-DiffChange* +" DiffChange diff mode: Changed line |diff.txt| +" *hl-DiffDelete* +" DiffDelete diff mode: Deleted line |diff.txt| +" *hl-DiffText* +" DiffText diff mode: Changed text within a changed line |diff.txt| +" *hl-ErrorMsg* +" Folded line used for closed folds +" *hl-FoldColumn* +" FoldColumn 'foldcolumn' +" *hl-SignColumn* +" SignColumn column where |signs| are displayed +" *hl-IncSearch* +" IncSearch 'incsearch' highlighting; also used for the text replaced with +" ":s///c" +" *hl-LineNr* +" MatchParen The character under the cursor or just before it, if it +" is a paired bracket, and its match. |pi_paren.txt| +" +" *hl-ModeMsg* +" *hl-NonText* +" *hl-Search* +" Search Last search pattern highlighting (see 'hlsearch'). +" Also used for highlighting the current line in the quickfix +" window and similar items that need to stand out. +" *hl-SpecialKey* +" to show unprintable characters in the text, 'listchars'. +" Generally: text that is displayed differently from what it +" really is. +" *hl-SpellBad* + + diff --git a/vim-pathogen b/vim-pathogen new file mode 160000 index 0000000..b9fb0df --- /dev/null +++ b/vim-pathogen @@ -0,0 +1 @@ +Subproject commit b9fb0dfd811004010f5f6903edef42d6004ebea2 diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..ea96df4 --- /dev/null +++ b/vimrc @@ -0,0 +1,622 @@ +call pathogen#infect() +" Pathogen + +filetype plugin indent on +set omnifunc=syntaxcomplete#Complete + +" conceal displays LaTeX formulars inline with UTF8 +set conceallevel=0 " 1,2 to enable it +set concealcursor= + +set linebreak + +"set wrap +set nowrap + +set noswapfile +"set noundofile +"set nobackup +"set nowritebackup +set backupdir=~/.vim/temp +set directory=~/.vim/temp +set undodir=~/.vim/temp + +" [code completion] +set completeopt=longest,menuone + +" [spell checker] +"set spell " enable spell checking +set spelllang=en,de + +set guifont=DejaVu\ Sans\ Mono\ bold\ 11 +"set guifont=Liberation\ Mono\ for\ Powerline\ 11 + + + +" [Kopieren und Einfuegen] +" verwendet das x-window-clipboard <3 +set clipboard=unnamedplus +"set clipboard=autoselectplus + + +" [SUCHEN] +" When 'ignorecase' and 'smartcase' are both on, if a pattern contains an uppercase letter, it is case sensitive, otherwise, it is not. For example, /The would find only "The", while /the would find "the" or "The" etc. +set ignorecase +set smartcase + +" [VIEW] +syntax on + + +" machen, dass der befehl wie z.B. " a p fuer register a +set showcmd +set number + +set guioptions+=m "show menu bar +set guioptions-=T "remove toolbar +set guioptions+=r "show right-hand scroll bar +set guioptions-=c "use console dialogs instead of popups +set guioptions+=a "autoselect: copy&paste using middleclick +set guioptions+=e "add tab pages +set guioptions+=p "use gui pointer callback for x11 + + +" ohne den naechsten eintrag verschwindet die powerline manchmal... +set laststatus=2 + +" set width for indentation +"set tabstop=2 +"set softtabstop=2 +"set shiftwidth=2 +" replace tabstop by space +"set expandtab + +" same in short... +set ts=2 sts=2 sw=2 expandtab + + +let $PAGER='' + +"set =^[[1;2A =^[[1;2B =^[[1;2C =^[[1;2D +"set =^[[24~ +"map +"nnoremap :test +"set =^[9;0011 +" map + +" q: ist der befehlseditor, damit kann man befehle kopieren in den textblock" +" q/ ist die history fuer die letzten suchen +" +" au=auto command, vimenter=event, *=filetype, NERDTree=command +" au vimenter * NERDTree + +"nnoremap :tabnext +"nnoremap :tabpreviews + +"nnoremap :bnext +"nnoremap :bprevious + +"nnoremap +"nnoremap +" +nnoremap :tabnext +nnoremap :tabprevious +" do not display full path as tabname +set guitablabel=%t + +"nnoremap :bnext +"nnoremap :bprevious + +"nnoremap :call s:LaunchCompletion() +"inoremap +nnoremap +"inoremap +inoremap +"inoremap +" open omni completion menu closing previous if open and opening new menu without changing the text +" +" simulate CTRL+C +vnoremap y +"vnoremap d +"noremap gP " interfers with VISUAL BLOCK mode + +" activate visual mode in normal mode +"map V +":map V +" these are mapped in visual mode +"map k +"map j +" increase/decrease indent in visual mode by tab and shift-tab +vmap >gv +vmap OA k +vmap OB j +vmap OC l +vmap OD h +" map shift-right to visually select and so on +nnoremap El +nnoremap vl +nnoremap vj +nnoremap vk +nnoremap vj + +" quickfix list (lists errors and warnings) +" nnoremap :cw +nnoremap :call ToggleQuickfixList() + + +"nnoremap :MBEbf +"nnoremap :MBEbb +nnoremap w +nnoremap W + + +" nnoremap :q +noremap! :w + +"nnoremap :PREVCOLOR +nnoremap :NEXTCOLOR + + +nnoremap ^ +vmap ^ + +nnoremap $ +vmap $ + +nnoremap \ + +" nnoremap :NERDTreeToggle +nnoremap :browse e +let NERDTreeShowHidden=1 +let NERDTreeQuiToNopen=1 +let NERDChristmasTree=1 +let NERDTreeMinimalUI=1 +let NERDTreeWinSize = 40 +let NERDTreeMapToggleHidden='\h' + +" -------------------------------------------------------------------- +let g:airline_left_sep = '▶' +let g:airline_right_sep = '◀' +"let g:airline_theme = 'powerlineish' +"let g:airline_theme = 'tomorrow' +let g:airline_theme = 'light' +let g:airline_powerline_fonts = 1 +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif +let g:airline_symbols.space = "\ua0" + + +let g:miniBufExplAutoStart = 1 +"let g:miniBufExplVSplit = 20 " column width in chars +"let g:miniBufExplBRSplit = 1 " Put new window below +let g:miniBufExplShowBufNumbers = 0 +let g:miniBufExplUseSingleClick = 1 +let g:miniBufExplCycleArround = 1 + let g:miniBufExplMapWindowNavVim = 1 + let g:miniBufExplMapWindowNavArrows = 1 + let g:miniBufExplMapCTabSwitchBufs = 1 + let g:miniBufExplModSelTarget = 1 +" MiniBufExpl Colors +hi MBENormal guifg=fg guibg=bg +hi MBEChanged guifg=red guibg=bg +hi MBEVisibleNormal guifg=bg guibg=fg +hi MBEVisibleChanged guifg=bg guibg=FG +hi MBEVisibleActiveNormal guifg=bg guibg=fg +hi MBEVisibleActiveChanged guifg=bg guibg=fg + + +if v:version >= 700 + au BufLeave * let b:winview = winsaveview() + au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif +endif + +" function! PlaySound() +" silent! exec '!play ~/.vim/support/tape.aiff &' +" endfunction +"autocmd CursorMovedI * call PlaySound() + + +set nocompatible +set modeline +set modelines=3 +" vim: syntax=vim +" +" +" +" clang_autocomplete options + + +let g:clang_use_library=1 +"let g:clang_library_path='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' +let g:clang_auto_select=0 +let g:clang_complete_auto=1 " automatically complete after ->, ., :: +let g:clang_periodic_quickfix=1 +let g:clang_close_preview=1 " If equal to 1, the preview window will be close automatically after a completion +"let g:clang_snippets=1 +"let g:clang_conceal_snippets=1 +"let g:clang_snippets_engine='clang_complete' +"let g:clang_complete_macros=1 +"let g:clang_complete_patterns=1 +"let g:clang_close_preview=1 + +" Show clang errors in the quickfix window +"let g:clang_complete_copen = 1 +" +" +let g:clang_user_options='|| exit 0' +let g:clang_sort_algo="alpha" + + + +" muss am ende stehen, macht das INSERT nicht angezeigt wird. macht ja airline +" auch schon. +set noshowmode " hide --INSERT-- from command line (as its already shown in airline) +set cursorline " highlight currently selected line + +set wildmenu " displays command options in status line / airline when pressing TAB +set wildmode=longest:full,full + +set scrolloff=2 " always keep at least two lines visible (when seeking) + +"noremap help vert help +cabbrev help tab help +"autocmd FileType help,* wincmd L + +"autocmd BufNew * if winnr('$') == 1 | tab sball | endif +"autocmd BufReadPost * tab ball +map ,e :e =expand("%:p:h") . "/" + +" If wanted, auto commenting can be disabled for all files with: +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o + +colorscheme maxvb6 +if has("gui_running") + "colorscheme Tomorrow-Night-Blue + "colorscheme bclear +else + " use 256 colors in Console mode if we think the terminal supports it + if &term =~? 'mlterm\|xterm\|screen' + set t_Co=256 + endif + "set t_Co=256 + "set t_AB=^[[48;5;%dm + "set t_AF=^[[38;5;%dm + "set term=ansi + "colorscheme ibmedit + "colorscheme h80 + "colorscheme greyhouse + "colorscheme tango-morning + "colorscheme jhlight + "colorscheme newspaper + "colorscheme relaxedgreen + let g:airline_theme = 'hybrid' + "highlight LineNr ctermfg=grey ctermbg=black +endif + + +" ex command for toggling hex mode - define mapping if desired +command -bar Hexmode call ToggleHex() + +" helper function to toggle hex mode +function ToggleHex() + " hex mode should be considered a read-only operation + " save values for modified and read-only for restoration later, + " and clear the read-only flag for now + let l:modified=&mod + let l:oldreadonly=&readonly + let &readonly=0 + let l:oldmodifiable=&modifiable + let &modifiable=1 + if !exists("b:editHex") || !b:editHex + " save old options + let b:oldft=&ft + let b:oldbin=&bin + " set new options + setlocal binary " make sure it overrides any textwidth, etc. + let &ft="xxd" + " set status + let b:editHex=1 + " switch to hex editor + %!xxd + else + " restore old options + let &ft=b:oldft + if !b:oldbin + setlocal nobinary + endif + " set status + let b:editHex=0 + " return to normal editing + %!xxd -r + endif + " restore values for modified and read only state + let &mod=l:modified + let &readonly=l:oldreadonly + let &modifiable=l:oldmodifiable +endfunction + + +" Show syntax highlighting groups for word under cursor +map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' + \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" + \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" + + +" Append modeline after last line in buffer using \ml +" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX +" files. +function! AppendModeline() + let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :", + \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') + let l:modeline = substitute(&commentstring, "%s", l:modeline, "") + call append(line("$"), l:modeline) +endfunction +nnoremap ml :call AppendModeline() + + +" make vimdiff ignore white spaces +set diffopt+=iwhite +set diffopt+=filler +set diffexpr="" +set nocompatible + + +set diffopt+=iwhite + + +set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 +highlight Cursor guifg=black guibg=lightgreen + + + +set virtualedit=onemore +" damit das highlight der klammern nicht genauso aussieht wie der cursor +hi MatchParen cterm=none ctermbg=yellow ctermfg=yellow + + +" An example for a vimrc file. +" +" Maintainer: Bram Moolenaar +" Last change: 2014 Nov 05 +" +" To use it, copy it to +" for Unix and OS/2: ~/.vimrc +" for Amiga: s:.vimrc +" for MS-DOS and Win32: $VIM\_vimrc +" for OpenVMS: sys$login:.vimrc + +" When started as "evim", evim.vim will already have done these settings. +if v:progname =~? "evim" + finish +endif + +" Use Vim settings, rather than Vi settings (much better!). +" This must be first, because it changes other options as a side effect. +set nocompatible + +" allow backspacing over everything in insert mode +set backspace=indent,eol,start + +if has("vms") + set nobackup " do not keep a backup file, use versions instead +else + set backup " keep a backup file (restore to previous version) + set undofile " keep an undo file (undo changes after closing) +endif +set history=50 " keep 50 lines of command line history +set ruler " show the cursor position all the time +set showcmd " display incomplete commands +set incsearch " do incremental searching + +" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries +" let &guioptions = substitute(&guioptions, "t", "", "g") + +" Don't use Ex mode, use Q for formatting +map Q gq + +" 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 + +" In many terminal emulators the mouse works just fine, thus enable it. +if has('mouse') + set mouse=a +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 + +" Only do this part when compiled with support for autocommands. +if has("autocmd") + + " Enable file type detection. + " Use the default filetype settings, so that mail gets 'tw' set to 72, + " 'cindent' is on in C files, etc. + " Also load indent files, to automatically do language-dependent indenting. + filetype plugin indent on + + " Put these in an autocmd group, so that we can delete them easily. + augroup vimrcEx + au! + + " For all text files set 'textwidth' to 78 characters. + autocmd FileType text setlocal textwidth=78 + + " 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). + " Also don't do it when the mark is in the first line, that is the default + " position when opening a file. + autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif + + augroup END + +else + + set autoindent " always set autoindenting on + +endif " has("autocmd") + +" 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 ++edit # | 0d_ | diffthis + \ | wincmd p | diffthis +endif + +if has('langmap') && exists('+langnoremap') + " Prevent that the langmap option applies to characters that result from a + " mapping. If unset (default), this may break plugins (but it's backward + " compatible). + set langnoremap +endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" An example for a vimrc file. +" +" Maintainer: Bram Moolenaar +" Last change: 2014 Nov 05 +" +" To use it, copy it to +" for Unix and OS/2: ~/.vimrc +" for Amiga: s:.vimrc +" for MS-DOS and Win32: $VIM\_vimrc +" for OpenVMS: sys$login:.vimrc + +" When started as "evim", evim.vim will already have done these settings. +if v:progname =~? "evim" + finish +endif + +" Use Vim settings, rather than Vi settings (much better!). +" This must be first, because it changes other options as a side effect. +set nocompatible + +" allow backspacing over everything in insert mode +set backspace=indent,eol,start + +if has("vms") + set nobackup " do not keep a backup file, use versions instead +else + set backup " keep a backup file (restore to previous version) + set undofile " keep an undo file (undo changes after closing) +endif +set history=50 " keep 50 lines of command line history +set ruler " show the cursor position all the time +set showcmd " display incomplete commands +set incsearch " do incremental searching + +" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries +" let &guioptions = substitute(&guioptions, "t", "", "g") + +" Don't use Ex mode, use Q for formatting +map Q gq + +" 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 + +" In many terminal emulators the mouse works just fine, thus enable it. +if has('mouse') + set mouse=a +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 + +" Only do this part when compiled with support for autocommands. +if has("autocmd") + + " Enable file type detection. + " Use the default filetype settings, so that mail gets 'tw' set to 72, + " 'cindent' is on in C files, etc. + " Also load indent files, to automatically do language-dependent indenting. + filetype plugin indent on + + " Put these in an autocmd group, so that we can delete them easily. + augroup vimrcEx + au! + + " For all text files set 'textwidth' to 78 characters. + autocmd FileType text setlocal textwidth=78 + + " 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). + " Also don't do it when the mark is in the first line, that is the default + " position when opening a file. + autocmd BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") | + \ exe "normal! g`\"" | + \ endif + + augroup END + +else + + set autoindent " always set autoindenting on + +endif " has("autocmd") + +" 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 ++edit # | 0d_ | diffthis + \ | wincmd p | diffthis +endif + +if has('langmap') && exists('+langnoremap') + " Prevent that the langmap option applies to characters that result from a + " mapping. If unset (default), this may break plugins (but it's backward + " compatible). + set langnoremap +endif -- cgit v1.2.3 From 983e0ed4d90c6410476583abbfdb3fa74b86fd36 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 27 Jul 2015 13:02:06 +0200 Subject: removed default font from color theme (should be placed in vimrc) --- colors/maxvb6.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colors/maxvb6.vim b/colors/maxvb6.vim index 98d149c..75fbc34 100644 --- a/colors/maxvb6.vim +++ b/colors/maxvb6.vim @@ -12,7 +12,7 @@ let g:colors_name="maxvb6" "set guifont=Liberation\ Mono\ Normal\ 14 -set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 +"set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 set number -- cgit v1.2.3 From 4a3e984105a960556bd727662c349170a61eb4fb Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Wed, 29 Jul 2015 11:14:50 +0200 Subject: added submodule for css indentation --- .gitmodules | 3 +++ indent/css.vim | 1 + indent/html.vim | 1 + indent/tpope | 1 + 4 files changed, 6 insertions(+) create mode 120000 indent/css.vim create mode 120000 indent/html.vim create mode 160000 indent/tpope diff --git a/.gitmodules b/.gitmodules index 8d5d904..fe221a9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "vim-pathogen"] path = vim-pathogen url = https://github.com/tpope/vim-pathogen.git +[submodule "indent/tpope"] + path = indent/tpope + url = https://gist.github.com/762326.git diff --git a/indent/css.vim b/indent/css.vim new file mode 120000 index 0000000..3c4fc9d --- /dev/null +++ b/indent/css.vim @@ -0,0 +1 @@ +tpope/indent/css.vim \ No newline at end of file diff --git a/indent/html.vim b/indent/html.vim new file mode 120000 index 0000000..3c4fc9d --- /dev/null +++ b/indent/html.vim @@ -0,0 +1 @@ +tpope/indent/css.vim \ No newline at end of file diff --git a/indent/tpope b/indent/tpope new file mode 160000 index 0000000..bcbd352 --- /dev/null +++ b/indent/tpope @@ -0,0 +1 @@ +Subproject commit bcbd35239db7f26447f1c2323037d20a5219471d -- cgit v1.2.3 From 64436bf70832028052dd278760761230d7d0bc77 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 6 Sep 2015 05:08:14 +0200 Subject: switched to vundle, cleaned and commented the vimrc --- .gitmodules | 3 + colors/maxvb6.vim | 8 +- vimrc | 767 ++++++++++++------------------------------------------ 3 files changed, 175 insertions(+), 603 deletions(-) diff --git a/.gitmodules b/.gitmodules index fe221a9..f17eb62 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "indent/tpope"] path = indent/tpope url = https://gist.github.com/762326.git +[submodule "indent/html5.vim"] + path = indent/html5.vim + url = https://github.com/othree/html5.vim.git diff --git a/colors/maxvb6.vim b/colors/maxvb6.vim index 75fbc34..eb3ddaa 100644 --- a/colors/maxvb6.vim +++ b/colors/maxvb6.vim @@ -11,9 +11,13 @@ endif let g:colors_name="maxvb6" +set guifont=Andale\ Mono\ 12 "set guifont=Liberation\ Mono\ Normal\ 14 "set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 - +"set guifont=Monospace\ 11 +"set guifont=DejaVu\ Sans\ Mono\ 11 +"set guifont=Liberation\ Mono\ for\ Powerline\ 11 +"set guifont=Envy\ Code\ R\ 11 set number set hls @@ -97,7 +101,7 @@ highlight! link Directory Todo highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black highlight! link WarningMsg Question -highlight SpellBad gui=underline cterm=underline term=underline +highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white highlight! link SpellCap SpellBad highlight! link SpellLocal Todo highlight! link SpellRare Todo diff --git a/vimrc b/vimrc index ea96df4..b14ac67 100644 --- a/vimrc +++ b/vimrc @@ -1,622 +1,187 @@ -call pathogen#infect() -" Pathogen +"================================================================================ +" Vundle: plugin manager... +set nocompatible| " do not try to be vi, be vim +filetype off| " Vundle needs this +set rtp+=~/.vim/plugins/Vundle.vim +call vundle#begin('~/.vim/plugins/') + +" Plugin dependant configurations... +Plugin 'VundleVim/Vundle.vim' +Plugin 'cscope_plus.vim' " run cscope -R -b in project folder then use +Plugin 'autoload_cscope.vim' " CTRL+\ s searches word under cursor, CTRL+T back +Plugin 'tpope/vim-fugitive' " the most complete GIT integration plugin +Plugin 'taglist-plus' " quick code navigator +let Tlist_Compact_Format = 1 +let Tlist_GainFocus_On_ToggleOpen = 1 +let Tlist_Close_On_Select = 1 +Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion +let g:ycm_global_ycm_extra_conf = '/home/max/.vim/_ycm_extra_conf.py' | " fallback, right one should be in the applications path +let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' +let g:ycm_key_select_completion = '' | " key completion key +let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar +let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar +let g:ycm_collect_identifiers_from_tags_files = 1 | " +let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode +inoremap ( ( +"if !exists("g:ycm_semantic_triggers") +" let g:ycm_semantic_triggers = {} +"endif +"let g:ycm_semantic_triggers['c'] = ['('] | " + + +call vundle#end() | " required +filetype plugin indent on | " required + +"================================================================================ +" custom config + +set noswapfile | " noundofile, nobackup, nowritebackup +set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory +set directory=~/.vim/temp | " +set undodir=~/.vim/temp | " + +set ts=2 sts=2 sw=2 expandtab | " indentation which i like +set autoindent | " always set autoindenting on +set copyindent | " copy the previous indentation on autoindenting +set scrolloff=2 | " always keeps at least two lines visible (when seeking) + +set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) +set number | " toggle line numbers +set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap +set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap +set diffopt+=iwhite,filler | " lets diff ignore white spaces +set spell| set spelllang=en,de| " enable spell checker +set showcmd | " displays status line messages while selecting (matrix size) +set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews +set linebreak | " do not wrap in the middle of words +set showbreak=› | " symbol used in the beginning of a wrapped line +set listchars=tab:▸\ ,eol:¬ | " symbols used when using :set list (which displays non-printable chars) + + +set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) +nnoremap g$| " and make the key position the cursor after the last char of that line:w + +" search... +set ignorecase|set smartcase " if search pattern contains uppercase then search is case sensitive +set incsearch " do incremental searching +set showmatch|set matchtime=4 " blinks matching braces + +set novisualbell " don't beep +set noerrorbells " don't beep +set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 " how the caret looks like -filetype plugin indent on -set omnifunc=syntaxcomplete#Complete - -" conceal displays LaTeX formulars inline with UTF8 -set conceallevel=0 " 1,2 to enable it -set concealcursor= - -set linebreak - -"set wrap -set nowrap - -set noswapfile -"set noundofile -"set nobackup -"set nowritebackup -set backupdir=~/.vim/temp -set directory=~/.vim/temp -set undodir=~/.vim/temp - -" [code completion] -set completeopt=longest,menuone - -" [spell checker] -"set spell " enable spell checking -set spelllang=en,de - -set guifont=DejaVu\ Sans\ Mono\ bold\ 11 -"set guifont=Liberation\ Mono\ for\ Powerline\ 11 - - - -" [Kopieren und Einfuegen] -" verwendet das x-window-clipboard <3 -set clipboard=unnamedplus -"set clipboard=autoselectplus - - -" [SUCHEN] -" When 'ignorecase' and 'smartcase' are both on, if a pattern contains an uppercase letter, it is case sensitive, otherwise, it is not. For example, /The would find only "The", while /the would find "the" or "The" etc. -set ignorecase -set smartcase - -" [VIEW] -syntax on - - -" machen, dass der befehl wie z.B. " a p fuer register a -set showcmd -set number - -set guioptions+=m "show menu bar -set guioptions-=T "remove toolbar -set guioptions+=r "show right-hand scroll bar -set guioptions-=c "use console dialogs instead of popups -set guioptions+=a "autoselect: copy&paste using middleclick -set guioptions+=e "add tab pages -set guioptions+=p "use gui pointer callback for x11 - - -" ohne den naechsten eintrag verschwindet die powerline manchmal... -set laststatus=2 - -" set width for indentation -"set tabstop=2 -"set softtabstop=2 -"set shiftwidth=2 -" replace tabstop by space -"set expandtab - -" same in short... -set ts=2 sts=2 sw=2 expandtab - - -let $PAGER='' - -"set =^[[1;2A =^[[1;2B =^[[1;2C =^[[1;2D -"set =^[[24~ -"map -"nnoremap :test -"set =^[9;0011 -" map - -" q: ist der befehlseditor, damit kann man befehle kopieren in den textblock" -" q/ ist die history fuer die letzten suchen -" -" au=auto command, vimenter=event, *=filetype, NERDTree=command -" au vimenter * NERDTree - -"nnoremap :tabnext -"nnoremap :tabpreviews - -"nnoremap :bnext -"nnoremap :bprevious - -"nnoremap -"nnoremap -" -nnoremap :tabnext -nnoremap :tabprevious -" do not display full path as tabname -set guitablabel=%t - -"nnoremap :bnext -"nnoremap :bprevious - -"nnoremap :call s:LaunchCompletion() -"inoremap -nnoremap -"inoremap -inoremap -"inoremap -" open omni completion menu closing previous if open and opening new menu without changing the text -" -" simulate CTRL+C -vnoremap y -"vnoremap d -"noremap gP " interfers with VISUAL BLOCK mode - -" activate visual mode in normal mode -"map V -":map V -" these are mapped in visual mode -"map k -"map j -" increase/decrease indent in visual mode by tab and shift-tab -vmap >gv -vmap OA k -vmap OB j -vmap OC l -vmap OD h -" map shift-right to visually select and so on -nnoremap El -nnoremap vl -nnoremap vj -nnoremap vk -nnoremap vj - -" quickfix list (lists errors and warnings) -" nnoremap :cw -nnoremap :call ToggleQuickfixList() - - -"nnoremap :MBEbf -"nnoremap :MBEbb -nnoremap w -nnoremap W - - -" nnoremap :q -noremap! :w - -"nnoremap :PREVCOLOR -nnoremap :NEXTCOLOR - - -nnoremap ^ -vmap ^ +if has("autocmd") + set modeline " set variables specific to a file, like indentation by adding a comment + set modelines=3 " how many lines in the beginning and end of the file can be mode lines? -nnoremap $ -vmap $ + + augroup resCur | " make cursor appear in its previous position when reopening a file... + "autocmd! + autocmd BufReadPost * call setpos(".", getpos("'\"")) + augroup END -nnoremap \ + augroup PreviewOnBottom | " will open new windows below the current (only in insert mode, so that the preview window is drawn below) + autocmd InsertEnter * set splitbelow + autocmd InsertLeave * set splitbelow! + augroup END -" nnoremap :NERDTreeToggle -nnoremap :browse e -let NERDTreeShowHidden=1 -let NERDTreeQuiToNopen=1 -let NERDChristmasTree=1 -let NERDTreeMinimalUI=1 -let NERDTreeWinSize = 40 -let NERDTreeMapToggleHidden='\h' + augroup OmniFunc | " this will enable omnicomplete just in case this configuration runs somewhere, where YouCompleteMe is not compiled + if exists("+omnifunc") + autocmd Filetype * + \ if &omnifunc == "" | + \ setlocal omnifunc=syntaxcomplete#Complete | + \ setlocal completeopt=longest,menuone | + \ endif + endif + augroup END -" -------------------------------------------------------------------- -let g:airline_left_sep = '▶' -let g:airline_right_sep = '◀' -"let g:airline_theme = 'powerlineish' -"let g:airline_theme = 'tomorrow' -let g:airline_theme = 'light' -let g:airline_powerline_fonts = 1 -if !exists('g:airline_symbols') - let g:airline_symbols = {} + autocmd FileType text setlocal textwidth=78 " text files: set 'textwidth' to 78 + autocmd FileType gitcommit set tw=72 " longer commit messages without auto line wrapping + autocmd FileType LaTeX let g:tex_flavor = "latex" |set conceallevel=1| set concealcursor= endif -let g:airline_symbols.space = "\ua0" - - -let g:miniBufExplAutoStart = 1 -"let g:miniBufExplVSplit = 20 " column width in chars -"let g:miniBufExplBRSplit = 1 " Put new window below -let g:miniBufExplShowBufNumbers = 0 -let g:miniBufExplUseSingleClick = 1 -let g:miniBufExplCycleArround = 1 - let g:miniBufExplMapWindowNavVim = 1 - let g:miniBufExplMapWindowNavArrows = 1 - let g:miniBufExplMapCTabSwitchBufs = 1 - let g:miniBufExplModSelTarget = 1 -" MiniBufExpl Colors -hi MBENormal guifg=fg guibg=bg -hi MBEChanged guifg=red guibg=bg -hi MBEVisibleNormal guifg=bg guibg=fg -hi MBEVisibleChanged guifg=bg guibg=FG -hi MBEVisibleActiveNormal guifg=bg guibg=fg -hi MBEVisibleActiveChanged guifg=bg guibg=fg - -if v:version >= 700 - au BufLeave * let b:winview = winsaveview() - au BufEnter * if(exists('b:winview')) | call winrestview(b:winview) | endif +"================================================================================ +" gui stuff and appearance +if &t_Co > 2 + set hlsearch " + set cursorline " highlight currently selected line endif -" function! PlaySound() -" silent! exec '!play ~/.vim/support/tape.aiff &' -" endfunction -"autocmd CursorMovedI * call PlaySound() - - -set nocompatible -set modeline -set modelines=3 -" vim: syntax=vim -" -" -" -" clang_autocomplete options - - -let g:clang_use_library=1 -"let g:clang_library_path='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' -let g:clang_auto_select=0 -let g:clang_complete_auto=1 " automatically complete after ->, ., :: -let g:clang_periodic_quickfix=1 -let g:clang_close_preview=1 " If equal to 1, the preview window will be close automatically after a completion -"let g:clang_snippets=1 -"let g:clang_conceal_snippets=1 -"let g:clang_snippets_engine='clang_complete' -"let g:clang_complete_macros=1 -"let g:clang_complete_patterns=1 -"let g:clang_close_preview=1 - -" Show clang errors in the quickfix window -"let g:clang_complete_copen = 1 -" -" -let g:clang_user_options='|| exit 0' -let g:clang_sort_algo="alpha" - - - -" muss am ende stehen, macht das INSERT nicht angezeigt wird. macht ja airline -" auch schon. -set noshowmode " hide --INSERT-- from command line (as its already shown in airline) -set cursorline " highlight currently selected line - -set wildmenu " displays command options in status line / airline when pressing TAB -set wildmode=longest:full,full - -set scrolloff=2 " always keep at least two lines visible (when seeking) - -"noremap help vert help -cabbrev help tab help -"autocmd FileType help,* wincmd L - -"autocmd BufNew * if winnr('$') == 1 | tab sball | endif -"autocmd BufReadPost * tab ball -map ,e :e =expand("%:p:h") . "/" - -" If wanted, auto commenting can be disabled for all files with: -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o +if has('mouse') + set mouse=a +endif -colorscheme maxvb6 if has("gui_running") - "colorscheme Tomorrow-Night-Blue - "colorscheme bclear + set guitablabel=%t " do not display full path as tabname + set guioptions+=m " menu bar + set guioptions+=T " toolbar + set guioptions+=r " right-hand scroll bar + set guioptions-=c " use console dialogs instead of popups + set guioptions+=a " autoselect: copy&paste using middleclick + set guioptions+=e " add tab pages + set guioptions+=p " use gui pointer callback for x11 + set toolbariconsize=large " make the icon toolbar as big as possible else - " use 256 colors in Console mode if we think the terminal supports it if &term =~? 'mlterm\|xterm\|screen' - set t_Co=256 + set t_Co=256 | " fixes incompatibilities with our color scheme endif - "set t_Co=256 - "set t_AB=^[[48;5;%dm - "set t_AF=^[[38;5;%dm - "set term=ansi - "colorscheme ibmedit - "colorscheme h80 - "colorscheme greyhouse - "colorscheme tango-morning - "colorscheme jhlight - "colorscheme newspaper - "colorscheme relaxedgreen - let g:airline_theme = 'hybrid' - "highlight LineNr ctermfg=grey ctermbg=black + set title | " set the terminal caption + set titleold="vim ended" | " set terminal title after closing vim + set titlestring="VIM-CONSOLE" | " set window title + set icon | " sets the terminal icon to vim + set ttyfast | " modern terminals are all fast in a way endif - -" ex command for toggling hex mode - define mapping if desired -command -bar Hexmode call ToggleHex() - -" helper function to toggle hex mode -function ToggleHex() - " hex mode should be considered a read-only operation - " save values for modified and read-only for restoration later, - " and clear the read-only flag for now - let l:modified=&mod - let l:oldreadonly=&readonly - let &readonly=0 - let l:oldmodifiable=&modifiable - let &modifiable=1 - if !exists("b:editHex") || !b:editHex - " save old options - let b:oldft=&ft - let b:oldbin=&bin - " set new options - setlocal binary " make sure it overrides any textwidth, etc. - let &ft="xxd" - " set status - let b:editHex=1 - " switch to hex editor - %!xxd - else - " restore old options - let &ft=b:oldft - if !b:oldbin - setlocal nobinary - endif - " set status - let b:editHex=0 - " return to normal editing - %!xxd -r - endif - " restore values for modified and read only state - let &mod=l:modified - let &readonly=l:oldreadonly - let &modifiable=l:oldmodifiable -endfunction - - -" Show syntax highlighting groups for word under cursor -map :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' - \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" - \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" - - -" Append modeline after last line in buffer using \ml -" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX -" files. -function! AppendModeline() - let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :", - \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') - let l:modeline = substitute(&commentstring, "%s", l:modeline, "") - call append(line("$"), l:modeline) -endfunction -nnoremap ml :call AppendModeline() - - -" make vimdiff ignore white spaces -set diffopt+=iwhite -set diffopt+=filler -set diffexpr="" -set nocompatible - - -set diffopt+=iwhite - - -set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 -highlight Cursor guifg=black guibg=lightgreen - - - -set virtualedit=onemore -" damit das highlight der klammern nicht genauso aussieht wie der cursor -hi MatchParen cterm=none ctermbg=yellow ctermfg=yellow - - -" An example for a vimrc file. +colorscheme maxvb6 +syntax enable + +"================================================================================ +" plugin hotkeys +nnoremap :TlistToggle| " bind TagList to Hotkey Ctrl+L + +" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE +" reacts on CTRL+P, CTRL+Space +inoremap pumvisible() ? "\" : "\u\" +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\\\" : "\" +inoremap pumvisible() ? "\\\" : "\" + +" custom commands... +cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user + +" custom hotkeys... +nnoremap :tabnext| " lets one use CTRL+Tab to switch between tabs +nnoremap :tabprevious| " use CTRL+Shift+Tab to switch to preview tab +nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines... +map h|map j|map k|map l| " window navigation shortcut + + +"================================================================================ +" deactivated on-demand commands (just in case one needs them one day) +" set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background +" map shift-right to visually select and so on +"nnoremap El +"nnoremap vl +"nnoremap vj +"nnoremap vk +"nnoremap vj +" noremap % v% " jump between braces and highlight +"nnoremap ^ +"vmap ^ +"nnoremap $ +"vmap $ +"nnoremap +"nnoremap +":inoremap pumvisible() ? "\" : "\u\" +"map OA k|map OB j|map OC l|map OD h| " allow cursor keys in insert mode " -" Maintainer: Bram Moolenaar -" Last change: 2014 Nov 05 +"inoremap pumvisible() ? "\" : "\" " breaks cursor keys! +" binding ESC can easily break cursor key movement on the console (tricky, because gvim works) " -" To use it, copy it to -" for Unix and OS/2: ~/.vimrc -" for Amiga: s:.vimrc -" for MS-DOS and Win32: $VIM\_vimrc -" for OpenVMS: sys$login:.vimrc - -" When started as "evim", evim.vim will already have done these settings. -if v:progname =~? "evim" - finish -endif - -" Use Vim settings, rather than Vi settings (much better!). -" This must be first, because it changes other options as a side effect. -set nocompatible - -" allow backspacing over everything in insert mode -set backspace=indent,eol,start - -if has("vms") - set nobackup " do not keep a backup file, use versions instead -else - set backup " keep a backup file (restore to previous version) - set undofile " keep an undo file (undo changes after closing) -endif -set history=50 " keep 50 lines of command line history -set ruler " show the cursor position all the time -set showcmd " display incomplete commands -set incsearch " do incremental searching - -" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries -" let &guioptions = substitute(&guioptions, "t", "", "g") - -" Don't use Ex mode, use Q for formatting -map Q gq - -" 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 - -" In many terminal emulators the mouse works just fine, thus enable it. -if has('mouse') - set mouse=a -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 - -" Only do this part when compiled with support for autocommands. -if has("autocmd") - - " Enable file type detection. - " Use the default filetype settings, so that mail gets 'tw' set to 72, - " 'cindent' is on in C files, etc. - " Also load indent files, to automatically do language-dependent indenting. - filetype plugin indent on - - " Put these in an autocmd group, so that we can delete them easily. - augroup vimrcEx - au! - - " For all text files set 'textwidth' to 78 characters. - autocmd FileType text setlocal textwidth=78 - - " 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). - " Also don't do it when the mark is in the first line, that is the default - " position when opening a file. - autocmd BufReadPost * - \ if line("'\"") > 1 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif - - augroup END - -else - - set autoindent " always set autoindenting on - -endif " has("autocmd") - -" 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 ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis -endif - -if has('langmap') && exists('+langnoremap') - " Prevent that the langmap option applies to characters that result from a - " mapping. If unset (default), this may break plugins (but it's backward - " compatible). - set langnoremap -endif - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" An example for a vimrc file. " -" Maintainer: Bram Moolenaar -" Last change: 2014 Nov 05 " -" To use it, copy it to -" for Unix and OS/2: ~/.vimrc -" for Amiga: s:.vimrc -" for MS-DOS and Win32: $VIM\_vimrc -" for OpenVMS: sys$login:.vimrc - -" When started as "evim", evim.vim will already have done these settings. -if v:progname =~? "evim" - finish -endif - -" Use Vim settings, rather than Vi settings (much better!). -" This must be first, because it changes other options as a side effect. -set nocompatible - -" allow backspacing over everything in insert mode -set backspace=indent,eol,start - -if has("vms") - set nobackup " do not keep a backup file, use versions instead -else - set backup " keep a backup file (restore to previous version) - set undofile " keep an undo file (undo changes after closing) -endif -set history=50 " keep 50 lines of command line history -set ruler " show the cursor position all the time -set showcmd " display incomplete commands -set incsearch " do incremental searching - -" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries -" let &guioptions = substitute(&guioptions, "t", "", "g") - -" Don't use Ex mode, use Q for formatting -map Q gq -" 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 - -" In many terminal emulators the mouse works just fine, thus enable it. -if has('mouse') - set mouse=a -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 - -" Only do this part when compiled with support for autocommands. -if has("autocmd") - - " Enable file type detection. - " Use the default filetype settings, so that mail gets 'tw' set to 72, - " 'cindent' is on in C files, etc. - " Also load indent files, to automatically do language-dependent indenting. - filetype plugin indent on - - " Put these in an autocmd group, so that we can delete them easily. - augroup vimrcEx - au! - - " For all text files set 'textwidth' to 78 characters. - autocmd FileType text setlocal textwidth=78 - - " 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). - " Also don't do it when the mark is in the first line, that is the default - " position when opening a file. - autocmd BufReadPost * - \ if line("'\"") > 1 && line("'\"") <= line("$") | - \ exe "normal! g`\"" | - \ endif - - augroup END - -else - - set autoindent " always set autoindenting on - -endif " has("autocmd") - -" 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 ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis -endif - -if has('langmap') && exists('+langnoremap') - " Prevent that the langmap option applies to characters that result from a - " mapping. If unset (default), this may break plugins (but it's backward - " compatible). - set langnoremap -endif +"inoremap +"inoremap -- cgit v1.2.3 From 4b98671e80723926b811f5655e792ecb57bad45d Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 6 Sep 2015 14:35:31 +0200 Subject: cleaned up git submodules, added an empty temp/-folder for backup/undo files --- .gitignore | 2 ++ .gitmodules | 9 +++------ doc/readme.md | 1 + doc/shortcuts.txt | 4 ++++ indent/tpope | 1 - plugins/Vundle.vim | 1 + temp/.keep | 3 +++ vim-pathogen | 1 - vimrc | 2 +- 9 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 .gitignore create mode 100644 doc/readme.md create mode 100644 doc/shortcuts.txt delete mode 160000 indent/tpope create mode 160000 plugins/Vundle.vim create mode 100644 temp/.keep delete mode 160000 vim-pathogen diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b36982 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/temp/** +!temp/.keep diff --git a/.gitmodules b/.gitmodules index f17eb62..1eed186 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ -[submodule "vim-pathogen"] - path = vim-pathogen - url = https://github.com/tpope/vim-pathogen.git -[submodule "indent/tpope"] - path = indent/tpope - url = https://gist.github.com/762326.git [submodule "indent/html5.vim"] path = indent/html5.vim url = https://github.com/othree/html5.vim.git +[submodule "plugins/Vundle.vim"] + path = plugins/Vundle.vim + url = https://github.com/VundleVim/Vundle.vim.git diff --git a/doc/readme.md b/doc/readme.md new file mode 100644 index 0000000..513fb41 --- /dev/null +++ b/doc/readme.md @@ -0,0 +1 @@ +

vim configuration

diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt new file mode 100644 index 0000000..9355433 --- /dev/null +++ b/doc/shortcuts.txt @@ -0,0 +1,4 @@ + +[visual mode] - with selected lines +gq - format text so that it fits in whatever :set textwidth was set + diff --git a/indent/tpope b/indent/tpope deleted file mode 160000 index bcbd352..0000000 --- a/indent/tpope +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bcbd35239db7f26447f1c2323037d20a5219471d diff --git a/plugins/Vundle.vim b/plugins/Vundle.vim new file mode 160000 index 0000000..0ee36b2 --- /dev/null +++ b/plugins/Vundle.vim @@ -0,0 +1 @@ +Subproject commit 0ee36b26e127cda512a8f2852a59e5a5f374c87f diff --git a/temp/.keep b/temp/.keep new file mode 100644 index 0000000..3d99c12 --- /dev/null +++ b/temp/.keep @@ -0,0 +1,3 @@ +this directory is meant to store backups and undo files. it improves the vim +experience when working with fuse mounted file systems, because they can get +really slow when doing those things remotely diff --git a/vim-pathogen b/vim-pathogen deleted file mode 160000 index b9fb0df..0000000 --- a/vim-pathogen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b9fb0dfd811004010f5f6903edef42d6004ebea2 diff --git a/vimrc b/vimrc index b14ac67..4359852 100644 --- a/vimrc +++ b/vimrc @@ -15,7 +15,7 @@ let Tlist_Compact_Format = 1 let Tlist_GainFocus_On_ToggleOpen = 1 let Tlist_Close_On_Select = 1 Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion -let g:ycm_global_ycm_extra_conf = '/home/max/.vim/_ycm_extra_conf.py' | " fallback, right one should be in the applications path +let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' let g:ycm_key_select_completion = '' | " key completion key let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar -- cgit v1.2.3 From 6b07aa894241e2bdf805ea5e0f7dc9c08be5f711 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 6 Sep 2015 14:45:20 +0200 Subject: cleaned up working directory --- .gitignore | 2 ++ .gitmodules | 3 --- autoload/pathogen.vim | 1 - indent/.keep | 1 + indent/css.vim | 1 - indent/html.vim | 1 - spell/.keep | 1 + 7 files changed, 4 insertions(+), 6 deletions(-) delete mode 120000 autoload/pathogen.vim create mode 100644 indent/.keep delete mode 120000 indent/css.vim delete mode 120000 indent/html.vim create mode 100644 spell/.keep diff --git a/.gitignore b/.gitignore index 7b36982..fbde122 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /temp/** !temp/.keep +/intent/** +!indent/.keep diff --git a/.gitmodules b/.gitmodules index 1eed186..57ae747 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "indent/html5.vim"] - path = indent/html5.vim - url = https://github.com/othree/html5.vim.git [submodule "plugins/Vundle.vim"] path = plugins/Vundle.vim url = https://github.com/VundleVim/Vundle.vim.git diff --git a/autoload/pathogen.vim b/autoload/pathogen.vim deleted file mode 120000 index 9a7227e..0000000 --- a/autoload/pathogen.vim +++ /dev/null @@ -1 +0,0 @@ -../vim-pathogen/autoload/pathogen.vim \ No newline at end of file diff --git a/indent/.keep b/indent/.keep new file mode 100644 index 0000000..f8e463a --- /dev/null +++ b/indent/.keep @@ -0,0 +1 @@ +this directory gets used for custom indentation rules. file naming follows the extension of the files the indentation is for and the extension .vim. diff --git a/indent/css.vim b/indent/css.vim deleted file mode 120000 index 3c4fc9d..0000000 --- a/indent/css.vim +++ /dev/null @@ -1 +0,0 @@ -tpope/indent/css.vim \ No newline at end of file diff --git a/indent/html.vim b/indent/html.vim deleted file mode 120000 index 3c4fc9d..0000000 --- a/indent/html.vim +++ /dev/null @@ -1 +0,0 @@ -tpope/indent/css.vim \ No newline at end of file diff --git a/spell/.keep b/spell/.keep new file mode 100644 index 0000000..6d81f6e --- /dev/null +++ b/spell/.keep @@ -0,0 +1 @@ +vim will automatically download spellchecker dictionaries to this directory -- cgit v1.2.3 From 81a481d42b50dfdf275989a7812f46b854672c40 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 7 Sep 2015 02:02:22 +0200 Subject: renamed colorscheme, included INSTALL instructions --- .gitignore | 2 + colors/coderonline.vim | 142 +++++++++++++++++++++++++++++++++++++++++++++++++ colors/maxvb6.vim | 142 ------------------------------------------------- doc/INSTALL | 23 ++++++++ doc/shortcuts.txt | 2 + vimrc | 2 +- 6 files changed, 170 insertions(+), 143 deletions(-) create mode 100644 colors/coderonline.vim delete mode 100644 colors/maxvb6.vim create mode 100644 doc/INSTALL diff --git a/.gitignore b/.gitignore index fbde122..e5a224b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ !temp/.keep /intent/** !indent/.keep +/spell/** +!spell/.keep diff --git a/colors/coderonline.vim b/colors/coderonline.vim new file mode 100644 index 0000000..eb8baa6 --- /dev/null +++ b/colors/coderonline.vim @@ -0,0 +1,142 @@ +" color theme for vim +" Maintainer: Max Christian Pohle +" Last Change: 07.09.2015 +" Web: http://max.coderonline.de/ + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="coderonline" + + +set guifont=Andale\ Mono\ 12 +"set guifont=Liberation\ Mono\ Normal\ 14 +"set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 +"set guifont=Monospace\ 11 +"set guifont=DejaVu\ Sans\ Mono\ 11 +"set guifont=Liberation\ Mono\ for\ Powerline\ 11 +"set guifont=Envy\ Code\ R\ 11 + +set number +set hls + +highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black + +highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black +highlight! link NonText Normal + +highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21 +highlight! link Boolean Statement +highlight! link Identifier Statement + +highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue + +highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown +highlight! link String Constant +highlight! link Number Constant + +highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen +highlight! link PreProc Comment + +highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey +highlight! link StatusLineNC StatusLine + +highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black +highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray +" highlight! link CursorLine LineNr +" highlight! link CursorColumn LineNr +" highlight! link ColorColumn LineNr + +" Cursor the character under the cursor +highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black +highlight iCursor gui=underline cterm=underline term=underline +highlight! link CursorLineNr Cursor +highlight! link CursorIM Cursor +highlight! link Visual Cursor +highlight! link VirualNOS Cursor +" highlight! link MatchParen LineNr +highlight MatchParen guibg=yellow ctermbg=yellow + +" WildMenu current match in 'wildmenu' completion +" Pmenu Popup menu: normal item. +" PmenuSel Popup menu: selected item. +" PmenuSbar Popup menu: scrollbar. +" PmenuThumb Popup menu: Thumb of the scrollbar. +highlight! link WildMenu Todo +highlight! link Popup LineNr +highlight! link PMenu Popup +highlight! link PMenuSel CursorLineNr +highlight! link PMenuSbar CursorLineNr +highlight! link PMenuThumb CursorLineNr + + +" Windows +highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray +highlight! link VertSplit Title +highlight! link StatusLine Title +highlight! link StatusLineNC Title +highlight! link TabLine Title +highlight! link TabLineFill TabLine +highlight! link TabLineSel TabLine +highlight TabLineSel gui=inverse cterm=inverse term=inverse + +highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown +highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown +highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown + +highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178 +highlight! link SpecialKey Special + +highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black +highlight! link ModeMsg Todo +highlight! link MoreMsg Todo +highlight! link ErrorMsg Todo +highlight! link Conceal Todo +highlight! link Directory Todo + +highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black +highlight! link WarningMsg Question + +highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white +highlight! link SpellCap SpellBad +highlight! link SpellLocal Todo +highlight! link SpellRare Todo +" *hl-Conceal* +" *hl-DiffAdd* +" DiffAdd diff mode: Added line |diff.txt| +" *hl-DiffChange* +" DiffChange diff mode: Changed line |diff.txt| +" *hl-DiffDelete* +" DiffDelete diff mode: Deleted line |diff.txt| +" *hl-DiffText* +" DiffText diff mode: Changed text within a changed line |diff.txt| +" *hl-ErrorMsg* +" Folded line used for closed folds +" *hl-FoldColumn* +" FoldColumn 'foldcolumn' +" *hl-SignColumn* +" SignColumn column where |signs| are displayed +" *hl-IncSearch* +" IncSearch 'incsearch' highlighting; also used for the text replaced with +" ":s///c" +" *hl-LineNr* +" MatchParen The character under the cursor or just before it, if it +" is a paired bracket, and its match. |pi_paren.txt| +" +" *hl-ModeMsg* +" *hl-NonText* +" *hl-Search* +" Search Last search pattern highlighting (see 'hlsearch'). +" Also used for highlighting the current line in the quickfix +" window and similar items that need to stand out. +" *hl-SpecialKey* +" to show unprintable characters in the text, 'listchars'. +" Generally: text that is displayed differently from what it +" really is. +" *hl-SpellBad* + + diff --git a/colors/maxvb6.vim b/colors/maxvb6.vim deleted file mode 100644 index eb3ddaa..0000000 --- a/colors/maxvb6.vim +++ /dev/null @@ -1,142 +0,0 @@ -" color theme for vim -" Maintainer: Max Christian Pohle -" Last Change: 11.09.2014 -" Web: http://max.entwicklerseite.de - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let g:colors_name="maxvb6" - - -set guifont=Andale\ Mono\ 12 -"set guifont=Liberation\ Mono\ Normal\ 14 -"set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline\ 14 -"set guifont=Monospace\ 11 -"set guifont=DejaVu\ Sans\ Mono\ 11 -"set guifont=Liberation\ Mono\ for\ Powerline\ 11 -"set guifont=Envy\ Code\ R\ 11 - -set number -set hls - -highlight Menu gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black -highlight Scrollbar gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black -highlight Tooltip gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black - -highlight Normal gui=none cterm=none term=none guibg=white ctermbg=white guifg=black ctermfg=black -highlight! link NonText Normal - -highlight Statement gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=#0000ff ctermfg=21 -highlight! link Boolean Statement -highlight! link Identifier Statement - -highlight Type gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=DarkBlue ctermfg=darkblue - -highlight Constant gui=none cterm=none term=none guibg=white ctermbg=white guifg=brown ctermfg=brown -highlight! link String Constant -highlight! link Number Constant - -highlight Comment gui=none cterm=none term=none guibg=white ctermbg=white guifg=DarkGreen ctermfg=DarkGreen -highlight! link PreProc Comment - -highlight StatusLine gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgrey -highlight! link StatusLineNC StatusLine - -highlight LineNr gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black -highlight CursorLine gui=none cterm=none term=none guibg=lightgray ctermbg=lightgray -" highlight! link CursorLine LineNr -" highlight! link CursorColumn LineNr -" highlight! link ColorColumn LineNr - -" Cursor the character under the cursor -highlight Cursor gui=inverse cterm=inverse term=inverse guibg=lightgray ctermbg=lightgray guifg=black ctermfg=black -highlight iCursor gui=underline cterm=underline term=underline -highlight! link CursorLineNr Cursor -highlight! link CursorIM Cursor -highlight! link Visual Cursor -highlight! link VirualNOS Cursor -" highlight! link MatchParen LineNr -highlight MatchParen guibg=yellow ctermbg=yellow - -" WildMenu current match in 'wildmenu' completion -" Pmenu Popup menu: normal item. -" PmenuSel Popup menu: selected item. -" PmenuSbar Popup menu: scrollbar. -" PmenuThumb Popup menu: Thumb of the scrollbar. -highlight! link WildMenu Todo -highlight! link Popup LineNr -highlight! link PMenu Popup -highlight! link PMenuSel CursorLineNr -highlight! link PMenuSbar CursorLineNr -highlight! link PMenuThumb CursorLineNr - - -" Windows -highlight Title gui=bold cterm=bold term=bold guibg=lightgray ctermbg=lightgray guifg=darkgray ctermfg=darkgray -highlight! link VertSplit Title -highlight! link StatusLine Title -highlight! link StatusLineNC Title -highlight! link TabLine Title -highlight! link TabLineFill TabLine -highlight! link TabLineSel TabLine -highlight TabLineSel gui=inverse cterm=inverse term=inverse - -highlight cParen gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown -highlight cBlock gui=none cterm=none term=none guibg=white ctermbg=cyan guifg=orange ctermfg=brown -highlight vimParenSep gui=none cterm=none term=none guibg=white ctermbg=white guifg=orange ctermfg=brown - -highlight Special gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=178 -highlight! link SpecialKey Special - -highlight Todo gui=none cterm=none term=none guibg=yellow ctermbg=yellow guifg=black ctermfg=black -highlight! link ModeMsg Todo -highlight! link MoreMsg Todo -highlight! link ErrorMsg Todo -highlight! link Conceal Todo -highlight! link Directory Todo - -highlight Question gui=bold cterm=bold term=bold guibg=white ctermbg=white guifg=black ctermfg=black -highlight! link WarningMsg Question - -highlight SpellBad gui=underline cterm=underline term=underline ctermbg=white -highlight! link SpellCap SpellBad -highlight! link SpellLocal Todo -highlight! link SpellRare Todo -" *hl-Conceal* -" *hl-DiffAdd* -" DiffAdd diff mode: Added line |diff.txt| -" *hl-DiffChange* -" DiffChange diff mode: Changed line |diff.txt| -" *hl-DiffDelete* -" DiffDelete diff mode: Deleted line |diff.txt| -" *hl-DiffText* -" DiffText diff mode: Changed text within a changed line |diff.txt| -" *hl-ErrorMsg* -" Folded line used for closed folds -" *hl-FoldColumn* -" FoldColumn 'foldcolumn' -" *hl-SignColumn* -" SignColumn column where |signs| are displayed -" *hl-IncSearch* -" IncSearch 'incsearch' highlighting; also used for the text replaced with -" ":s///c" -" *hl-LineNr* -" MatchParen The character under the cursor or just before it, if it -" is a paired bracket, and its match. |pi_paren.txt| -" -" *hl-ModeMsg* -" *hl-NonText* -" *hl-Search* -" Search Last search pattern highlighting (see 'hlsearch'). -" Also used for highlighting the current line in the quickfix -" window and similar items that need to stand out. -" *hl-SpecialKey* -" to show unprintable characters in the text, 'listchars'. -" Generally: text that is displayed differently from what it -" really is. -" *hl-SpellBad* - - diff --git a/doc/INSTALL b/doc/INSTALL new file mode 100644 index 0000000..3c37ac5 --- /dev/null +++ b/doc/INSTALL @@ -0,0 +1,23 @@ +# INSTALL +# this should briefly show you how to install this bundle +# +# step 1) +# download the current version using git +git clone http://git.entwicklerseite.de/vim .vim/ + +# step 2) +# create a symbolic link to the downloaded vim.rc in you $HOME-directory +ln -s .vim/vimrc .vimrc + +# step 3) +# get vim submodules, namely this is just vundle as this will download the rest by itsown +git submodule update --init --recursive + +# step 4) +# fix errors caused by the different vim version you might be using and define the spell checkers language. Starting Vim will show you which lines are not supported on your vim installation so that you can fix them: +vim vimrc + +# step 5) +# download spell file for you language +vim -c ":au! SpellFileMissing" + diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 9355433..18af473 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -2,3 +2,5 @@ [visual mode] - with selected lines gq - format text so that it fits in whatever :set textwidth was set +[commands] +:spell [word] - adds a word to the current dictionary (no mistake any more) diff --git a/vimrc b/vimrc index 4359852..4090dad 100644 --- a/vimrc +++ b/vimrc @@ -132,7 +132,7 @@ else set ttyfast | " modern terminals are all fast in a way endif -colorscheme maxvb6 +colorscheme coderonline syntax enable "================================================================================ -- cgit v1.2.3 From 10c70d67d60cb82572a7849826481e56b0347be5 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 7 Sep 2015 02:13:09 +0200 Subject: added vim screenshot to the documentation --- doc/INSTALL | 4 ++++ doc/coderonline-vim.png | Bin 0 -> 195172 bytes doc/readme.md | 7 +++++++ 3 files changed, 11 insertions(+) create mode 100644 doc/coderonline-vim.png diff --git a/doc/INSTALL b/doc/INSTALL index 3c37ac5..38068d5 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -21,3 +21,7 @@ vim vimrc # download spell file for you language vim -c ":au! SpellFileMissing" +# step 6) +# build YouCompleteMe (if you plan to use it) +cd plugins/YouCompleteMe +python2 ./install.py --clang-completer diff --git a/doc/coderonline-vim.png b/doc/coderonline-vim.png new file mode 100644 index 0000000..ac76bff Binary files /dev/null and b/doc/coderonline-vim.png differ diff --git a/doc/readme.md b/doc/readme.md index 513fb41..800c1a2 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -1 +1,8 @@

vim configuration

+This is the configuration I am using. + + +

coderonline.vim - colorscheme

+ + screenshot of vim + -- cgit v1.2.3 From b2b9fe7f6739b9970a6d1476e7e8cb7356474c94 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 7 Sep 2015 02:19:07 +0200 Subject: added favicon (the vim icon) --- favicon.ico | Bin 0 -> 32038 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 favicon.ico diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..ca0b3c3 Binary files /dev/null and b/favicon.ico differ -- cgit v1.2.3 From 22b8062ef4dc6962715e7fa67ba53197d583f005 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 7 Sep 2015 03:11:46 +0200 Subject: added instructions on how to add vim to thunars sendto menu --- doc/INSTALL | 6 ++++++ gvim.desktop | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gvim.desktop diff --git a/doc/INSTALL b/doc/INSTALL index 38068d5..1d664d3 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -25,3 +25,9 @@ vim -c ":au! SpellFileMissing" # build YouCompleteMe (if you plan to use it) cd plugins/YouCompleteMe python2 ./install.py --clang-completer + + +# step 7) +# add gvim functionality to thunar, so that sendto can be used to open a file in an existing vim instance (as a tab in this case) +mkdir -p .local/share/Thunar/sendto/ +cp ~/.vim/gvim.desktop ~/.local/share/Thunar/sendto/ diff --git a/gvim.desktop b/gvim.desktop new file mode 100644 index 0000000..37c6e58 --- /dev/null +++ b/gvim.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Vi IMproved Tab +Comment=Open file in an existing instance of vi and in a new tab +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +Exec=gvim f -N --remote-tab %F +Icon=gvim +Type=Application +Terminal=false +X-XClassHintResName=VIM +Categories=Utility;TextEditor; -- cgit v1.2.3 From f76eebbfdbfc709367475ba23b6523bd4f1598cd Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 7 Sep 2015 13:33:56 +0200 Subject: tab options, white space handling --- doc/shortcuts.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 18af473..c0911e1 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -3,4 +3,7 @@ gq - format text so that it fits in whatever :set textwidth was set [commands] -:spell [word] - adds a word to the current dictionary (no mistake any more) +:spell [word] - adds a word to the current dictionary (no mistake any more) +:set list - display non printable characters +:retab - replaces tabs with spaces +:set expandtab - in insert mode: replace tab with spaces -- cgit v1.2.3 From 2572ae93322fc8cde33beb54e92290d1831836df Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Wed, 9 Sep 2015 01:51:34 +0200 Subject: fixed bracket error and set default file format to utf-8 I also added some more notes to the INSTALL file, nothing special though --- .gitignore | 1 + doc/INSTALL | 11 +++++-- vimrc | 108 ++++++++++++++++++++++++++++++++---------------------------- 3 files changed, 67 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index e5a224b..93df1ba 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ !indent/.keep /spell/** !spell/.keep +/systags diff --git a/doc/INSTALL b/doc/INSTALL index 1d664d3..14fb286 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -28,6 +28,13 @@ python2 ./install.py --clang-completer # step 7) -# add gvim functionality to thunar, so that sendto can be used to open a file in an existing vim instance (as a tab in this case) +# create an entry in file managers right click menu 'open with' allowing you to open the file in a vim tab mkdir -p .local/share/Thunar/sendto/ -cp ~/.vim/gvim.desktop ~/.local/share/Thunar/sendto/ +cp ~/.vim/gvim-tab.desktop ~/.local/share/Thunar/sendto/ + +# step 8) +# add gvim functionality to thunar, so that sendto can be used to open a file in an existing vim instance (as a tab in this case) +cp ~/.vim/gvim-tab.desktop ~/.local/share/applications/ +update-desktop-database ~/.local/share/applications/ + + diff --git a/vimrc b/vimrc index 4090dad..7a0910f 100644 --- a/vimrc +++ b/vimrc @@ -7,40 +7,37 @@ call vundle#begin('~/.vim/plugins/') " Plugin dependant configurations... Plugin 'VundleVim/Vundle.vim' -Plugin 'cscope_plus.vim' " run cscope -R -b in project folder then use -Plugin 'autoload_cscope.vim' " CTRL+\ s searches word under cursor, CTRL+T back -Plugin 'tpope/vim-fugitive' " the most complete GIT integration plugin -Plugin 'taglist-plus' " quick code navigator -let Tlist_Compact_Format = 1 -let Tlist_GainFocus_On_ToggleOpen = 1 -let Tlist_Close_On_Select = 1 -Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion -let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path -let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' -let g:ycm_key_select_completion = '' | " key completion key -let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar -let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar -let g:ycm_collect_identifiers_from_tags_files = 1 | " -let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode -inoremap ( ( -"if !exists("g:ycm_semantic_triggers") -" let g:ycm_semantic_triggers = {} -"endif -"let g:ycm_semantic_triggers['c'] = ['('] | " - +Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use +Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back +Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin +Plugin 'taglist-plus' | " quick code navigator +let Tlist_Compact_Format = 1 | " +let Tlist_GainFocus_On_ToggleOpen = 1 | " +let Tlist_Close_On_Select = 1 | " +Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion +let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path +let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' +let g:ycm_key_select_completion = '' | " key completion key +let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar +let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar +let g:ycm_collect_identifiers_from_tags_files = 1 | " +let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode +"let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend) + +let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle call vundle#end() | " required filetype plugin indent on | " required - "================================================================================ " custom config +scriptencoding utf-8 | " tell vim that we are using utf-8 here set noswapfile | " noundofile, nobackup, nowritebackup set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory set directory=~/.vim/temp | " set undodir=~/.vim/temp | " -set ts=2 sts=2 sw=2 expandtab | " indentation which i like +set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softtabstop, shiftwidth) set autoindent | " always set autoindenting on set copyindent | " copy the previous indentation on autoindenting set scrolloff=2 | " always keeps at least two lines visible (when seeking) @@ -51,15 +48,24 @@ set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap set diffopt+=iwhite,filler | " lets diff ignore white spaces set spell| set spelllang=en,de| " enable spell checker -set showcmd | " displays status line messages while selecting (matrix size) +set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews set linebreak | " do not wrap in the middle of words -set showbreak=› | " symbol used in the beginning of a wrapped line -set listchars=tab:▸\ ,eol:¬ | " symbols used when using :set list (which displays non-printable chars) +set showcmd | " displays status line messages while selecting (matrix size) +set nofoldenable | " do not fold code automatically +set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include +set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) +set showbreak+=› | " symbol used in the beginning of a wrapped line +set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) +set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) +set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) +set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) +set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) -set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) -nnoremap g$| " and make the key position the cursor after the last char of that line:w + +nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before +nnoremap g$| " and make the key position the cursor after the last char of that line " search... set ignorecase|set smartcase " if search pattern contains uppercase then search is case sensitive @@ -74,7 +80,7 @@ if has("autocmd") set modeline " set variables specific to a file, like indentation by adding a comment set modelines=3 " how many lines in the beginning and end of the file can be mode lines? - + augroup resCur | " make cursor appear in its previous position when reopening a file... "autocmd! autocmd BufReadPost * call setpos(".", getpos("'\"")) @@ -121,6 +127,7 @@ if has("gui_running") set guioptions+=e " add tab pages set guioptions+=p " use gui pointer callback for x11 set toolbariconsize=large " make the icon toolbar as big as possible + else if &term =~? 'mlterm\|xterm\|screen' set t_Co=256 | " fixes incompatibilities with our color scheme @@ -136,30 +143,34 @@ colorscheme coderonline syntax enable "================================================================================ -" plugin hotkeys -nnoremap :TlistToggle| " bind TagList to Hotkey Ctrl+L +" custom commands... +map h|map j| " window navigation shortcuts +map k|map l| " window navigation shortcuts -" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE -" reacts on CTRL+P, CTRL+Space -inoremap pumvisible() ? "\" : "\u\" -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\" : "\" -inoremap pumvisible() ? "\\\" : "\" -inoremap pumvisible() ? "\\\" : "\" +cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user -" custom commands... -cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user +" custom hotkeys... +nnoremap :tabnext| " lets one use CTRL+Tab to switch between tabs +nnoremap :tabprevious| " use CTRL+Shift+Tab to switch to preview tab + +nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines -" custom hotkeys... -nnoremap :tabnext| " lets one use CTRL+Tab to switch between tabs -nnoremap :tabprevious| " use CTRL+Shift+Tab to switch to preview tab -nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines... -map h|map j|map k|map l| " window navigation shortcut +" plugin hotkeys +map :TlistToggle| " bind TagList to Hotkey Ctrl+L +inoremap ( (| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) "================================================================================ " deactivated on-demand commands (just in case one needs them one day) +" +" code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE +" reacts on CTRL+P, CTRL+Space +"inoremap pumvisible() ? "\" : "\u\" +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\" : "\" +"inoremap pumvisible() ? "\\\" : "\" +"inoremap pumvisible() ? "\\\" : "\" " set guiheadroom=0| " do not fill non-functional area of the empty editor with gtk background " map shift-right to visually select and so on "nnoremap El @@ -176,12 +187,7 @@ map h|map j|map k|map l| " window na "nnoremap ":inoremap pumvisible() ? "\" : "\u\" "map OA k|map OB j|map OC l|map OD h| " allow cursor keys in insert mode -" "inoremap pumvisible() ? "\" : "\" " breaks cursor keys! " binding ESC can easily break cursor key movement on the console (tricky, because gvim works) -" -" -" - "inoremap "inoremap -- cgit v1.2.3 From d1f054ef1a601b81054f74e18520a2bc8075c3d8 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Wed, 9 Sep 2015 17:29:01 +0200 Subject: added modeline to vimrc, commented vimrc further modeline says, that the window should be 160 columns width. It is usually bad habit to write lines that long, but in this case it improves the situation, because comments and corresponding commands can stay together in this way. --- doc/shortcuts.txt | 6 ++- vimrc | 132 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 73 insertions(+), 65 deletions(-) diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index c0911e1..9f4325f 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -1,9 +1,13 @@ [visual mode] - with selected lines -gq - format text so that it fits in whatever :set textwidth was set +gq - format text so that it fits in whatever :set textwidth was set [commands] :spell [word] - adds a word to the current dictionary (no mistake any more) :set list - display non printable characters :retab - replaces tabs with spaces :set expandtab - in insert mode: replace tab with spaces + +[navigation] + - go to tag under the cursor (help links as well) + - return back from tag under the cursor diff --git a/vimrc b/vimrc index 7a0910f..d66c1ba 100644 --- a/vimrc +++ b/vimrc @@ -1,36 +1,40 @@ -"================================================================================ +" vi:columns=160:list:ts=2:sts=2:sw=2 +"================================================================================ " Vundle: plugin manager... -set nocompatible| " do not try to be vi, be vim -filetype off| " Vundle needs this -set rtp+=~/.vim/plugins/Vundle.vim -call vundle#begin('~/.vim/plugins/') +set nocompatible | " do not try to be vi, be vim (required by Vundle) +filetype off | " Vundle needs this +set rtp+=~/.vim/plugins/Vundle.vim | " set runtimepath (required by Vundle) +call vundle#begin('~/.vim/plugins/') | " location where Vundle searches&installs plugins " Plugin dependant configurations... -Plugin 'VundleVim/Vundle.vim' -Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use -Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back -Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin -Plugin 'taglist-plus' | " quick code navigator -let Tlist_Compact_Format = 1 | " +Plugin 'VundleVim/Vundle.vim' | " Vundle itself (required) +Plugin 'cscope_plus.vim' | " run cscope -R -b in project folder then use +Plugin 'autoload_cscope.vim' | " CTRL+\ s searches word under cursor, CTRL+T back +Plugin 'tpope/vim-fugitive' | " the most complete GIT integration plugin + +Plugin 'taglist-plus' | " quick code navigator +let Tlist_Compact_Format = 1 | " let Tlist_GainFocus_On_ToggleOpen = 1 | " let Tlist_Close_On_Select = 1 | " + Plugin 'Valloric/YouCompleteMe' | " syntax checker and code completion let g:ycm_global_ycm_extra_conf = '' | " fallback, right one should be in the applications path let g:ycm_confirm_extra_conf = 0 | " disable 'do you really want to execute .py?' let g:ycm_key_select_completion = '' | " key completion key let g:ycm_error_symbol = '✖' | " insert this as an error symbol in the gutter bar let g:ycm_warning_symbol = '➔' | " insert this as a warning symbol in the gutter bar -let g:ycm_collect_identifiers_from_tags_files = 1 | " +let g:ycm_collect_identifiers_from_tags_files = 1 | " let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when leaving insert mode "let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend) let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle -call vundle#end() | " required -filetype plugin indent on | " required +call vundle#end() | " required by Vundle +filetype plugin indent on | " required by Vundle "================================================================================ " custom config -scriptencoding utf-8 | " tell vim that we are using utf-8 here +colorscheme coderonline +syntax enable set noswapfile | " noundofile, nobackup, nowritebackup set backupdir=~/.vim/temp | " using :set backup will copy current file to this directory @@ -42,8 +46,6 @@ set autoindent | " always set autoindenting on set copyindent | " copy the previous indentation on autoindenting set scrolloff=2 | " always keeps at least two lines visible (when seeking) -set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) -set number | " toggle line numbers set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap set diffopt+=iwhite,filler | " lets diff ignore white spaces @@ -55,34 +57,32 @@ set showcmd | " displays status line messages while selecting set nofoldenable | " do not fold code automatically set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include -set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) -set showbreak+=› | " symbol used in the beginning of a wrapped line -set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) -set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) -set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) -set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) -set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) - - -nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before -nnoremap g$| " and make the key position the cursor after the last char of that line - " search... -set ignorecase|set smartcase " if search pattern contains uppercase then search is case sensitive -set incsearch " do incremental searching -set showmatch|set matchtime=4 " blinks matching braces +set ignorecase|set smartcase | " if search pattern contains uppercase then search is case sensitive +set incsearch | " do incremental searching +set showmatch|set matchtime=4 | " blinks matching braces + +set novisualbell | " don't beep +set noerrorbells | " don't beep +set clipboard=unnamedplus | " makes copy and paste work (autoselectplus might work as well) +set number | " toggle line numbers -set novisualbell " don't beep -set noerrorbells " don't beep -set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 " how the caret looks like +if has("multi_byte") + scriptencoding utf-8 | " tell vim that we are using utf-8 here + set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) + set showbreak+=› | " symbol used in the beginning of a wrapped line + set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) + set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) + set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) + set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) + set listchars+=tab:▸\ | " symbols used when using :set list (which displays non-printable chars) +endif if has("autocmd") - set modeline " set variables specific to a file, like indentation by adding a comment - set modelines=3 " how many lines in the beginning and end of the file can be mode lines? - + set modeline | " set variables specific to a file, like indentation by adding a comment + set modelines=3 | " how many lines in the beginning and end of the file can be mode lines? augroup resCur | " make cursor appear in its previous position when reopening a file... - "autocmd! autocmd BufReadPost * call setpos(".", getpos("'\"")) augroup END @@ -95,22 +95,22 @@ if has("autocmd") if exists("+omnifunc") autocmd Filetype * \ if &omnifunc == "" | - \ setlocal omnifunc=syntaxcomplete#Complete | - \ setlocal completeopt=longest,menuone | + \ setlocal omnifunc=syntaxcomplete#Complete | + \ setlocal completeopt=longest,menuone | \ endif endif augroup END - autocmd FileType text setlocal textwidth=78 " text files: set 'textwidth' to 78 - autocmd FileType gitcommit set tw=72 " longer commit messages without auto line wrapping - autocmd FileType LaTeX let g:tex_flavor = "latex" |set conceallevel=1| set concealcursor= + autocmd FileType text setlocal textwidth=78 | " text files: set 'textwidth' to 78 + autocmd FileType gitcommit set tw=72 | " longer commit messages without auto line wrapping + autocmd FileType LaTeX let g:tex_flavor = "latex"| set conceallevel=1| set concealcursor= endif "================================================================================ " gui stuff and appearance if &t_Co > 2 - set hlsearch " - set cursorline " highlight currently selected line + set hlsearch | " highlight all search matches + set cursorline | " highlight currently selected line endif if has('mouse') @@ -118,29 +118,28 @@ if has('mouse') endif if has("gui_running") - set guitablabel=%t " do not display full path as tabname - set guioptions+=m " menu bar - set guioptions+=T " toolbar - set guioptions+=r " right-hand scroll bar - set guioptions-=c " use console dialogs instead of popups - set guioptions+=a " autoselect: copy&paste using middleclick - set guioptions+=e " add tab pages - set guioptions+=p " use gui pointer callback for x11 - set toolbariconsize=large " make the icon toolbar as big as possible - + set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like + set guitablabel=%t | " do not display full path as tabname + set guioptions+=m | " menu bar + set guioptions+=T | " toolbar + set guioptions+=r | " right-hand scroll bar + set guioptions-=c | " use console dialogs instead of popups + set guioptions+=a | " autoselect: copy&paste using middleclick + set guioptions+=e | " add tab pages + set guioptions+=p | " use gui pointer callback for x11 + set toolbariconsize=large | " make the icon toolbar as big as possible + "set columns=80 | " set initial window width (so that it fits the terminals) else - if &term =~? 'mlterm\|xterm\|screen' + if &term =~? 'mlterm\|xterm\|screen' set t_Co=256 | " fixes incompatibilities with our color scheme endif - set title | " set the terminal caption - set titleold="vim ended" | " set terminal title after closing vim - set titlestring="VIM-CONSOLE" | " set window title + set title | " set the terminal caption set icon | " sets the terminal icon to vim set ttyfast | " modern terminals are all fast in a way + "set titleold="vim ended" | " set terminal title after closing vim + "set titlestring="VIM-CONSOLE" | " set window title endif -colorscheme coderonline -syntax enable "================================================================================ " custom commands... @@ -150,17 +149,21 @@ map k|map l| " window navigation shortcuts cmap w!! w !sudo tee % >/dev/null| " write :w!! to execute :w as root user " custom hotkeys... -nnoremap :tabnext| " lets one use CTRL+Tab to switch between tabs +nnoremap :tabnext| " lets one use CTRL+Tab to switch between tabs nnoremap :tabprevious| " use CTRL+Shift+Tab to switch to preview tab nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines +nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before +nnoremap g$| " and make the key position the cursor after the last char of that line + + " plugin hotkeys map :TlistToggle| " bind TagList to Hotkey Ctrl+L inoremap ( (| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) -"================================================================================ +"================================================================================ " deactivated on-demand commands (just in case one needs them one day) " " code completion: http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE @@ -191,3 +194,4 @@ inoremap ( (| " when opening a bracket: call the OmniCo " binding ESC can easily break cursor key movement on the console (tricky, because gvim works) "inoremap "inoremap +" -- cgit v1.2.3 From 81571661d0c39e7261d1a55ff641e56970defff0 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 13 Sep 2015 21:54:53 +0200 Subject: vimdiff shortcuts added and support for CTRL+Shift+LeftArrow... --- doc/shortcuts.txt | 38 ++++++++++++++++++++++++++++++-------- vimrc | 5 ++++- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 9f4325f..3b714bc 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -1,13 +1,35 @@ - [visual mode] - with selected lines -gq - format text so that it fits in whatever :set textwidth was set +gq - formats text so that it fits in whatever :set textwidth was set + [commands] -:spell [word] - adds a word to the current dictionary (no mistake any more) -:set list - display non printable characters -:retab - replaces tabs with spaces -:set expandtab - in insert mode: replace tab with spaces +:spell [word] - adds a word to the current dictionary (no mistake any more) +:set list - display non printable characters +:retab - replaces tabs with spaces +:set expandtab - in insert mode: replace tab with spaces + [navigation] - - go to tag under the cursor (help links as well) - - return back from tag under the cursor + - look up the tag under the cursor (help links as well) + - return back from tag under the cursor + + +[macros] - record and play back a series of vim commands +qa - start (q) macro recording in register a (can be anything) +q - stop macro recording +@a - replay macro a +:'<,'>normal @a - apply a to every line in the current selection + + +[windows] +v - splits buffer vertically (screen uses |) +s - splits buffer horizontally (same as screen) +w - moves the cursor to the next window and back +[dir] - moves the cursor in that direction (use hjkl or arrow keys) + + +[vimdiff] +do - get changes from other window into the current +dp - put changes from current window into the other +]c - jump to the next change +[c - jump to the prevous change diff --git a/vimrc b/vimrc index d66c1ba..bbf0f03 100644 --- a/vimrc +++ b/vimrc @@ -28,9 +28,11 @@ let g:ycm_autoclose_preview_window_after_insertion=1 | " close the window when "let g:ycm_semantic_triggers = {'c' : ['(', ',']} | " add additional triggers (not recommend) let b:html_omni_flavor='xhtml' | " prever xhtml over html because that makes inline php code possible without hassle +let html_use_css = 1 | " when using :TOhtml no font-tags will be used, but proper css call vundle#end() | " required by Vundle filetype plugin indent on | " required by Vundle +behave mswin "================================================================================ " custom config colorscheme coderonline @@ -45,6 +47,7 @@ set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softt set autoindent | " always set autoindenting on set copyindent | " copy the previous indentation on autoindenting set scrolloff=2 | " always keeps at least two lines visible (when seeking) +set selectmode=key,mouse | " make [strg+]shift-{left|right} enter SELECT mode (windows alike) set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap @@ -68,8 +71,8 @@ set clipboard=unnamedplus | " makes copy and paste work (autoselectplus migh set number | " toggle line numbers if has("multi_byte") - scriptencoding utf-8 | " tell vim that we are using utf-8 here set encoding=utf-8 | " we need default utf-8 encoding to use cool chars as line break and so on (see below) + scriptencoding utf-8 | " tell vim that we are using utf-8 here set showbreak+=› | " symbol used in the beginning of a wrapped line set listchars=eol:↲ | " symbols used when using :set list (which displays non-printable chars) set listchars+=trail:· | " symbols used when using :set list (which displays non-printable chars) -- cgit v1.2.3 From 6f784b3a737827df10305e65d54cd1c92ce9c910 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 14 Sep 2015 00:38:30 +0200 Subject: added wildmenu support and some syntax tweaks --- vimrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vimrc b/vimrc index bbf0f03..b61537a 100644 --- a/vimrc +++ b/vimrc @@ -52,18 +52,19 @@ set selectmode=key,mouse | " make [strg+]shift-{left|right} enter SELECT mo set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap set diffopt+=iwhite,filler | " lets diff ignore white spaces -set spell| set spelllang=en,de| " enable spell checker +set spell spelllang=en,de | " enable spell checker set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews set linebreak | " do not wrap in the middle of words set showcmd | " displays status line messages while selecting (matrix size) set nofoldenable | " do not fold code automatically set tags+=~/.vim/systags | " ctags -R -f ~/.vim/systags /usr/include /usr/local/include +set wildmenu wildmode=full | " wildmenu code completion " search... -set ignorecase|set smartcase | " if search pattern contains uppercase then search is case sensitive +set ignorecase smartcase | " if search pattern contains uppercase then search is case sensitive set incsearch | " do incremental searching -set showmatch|set matchtime=4 | " blinks matching braces +set showmatch matchtime=4 | " blinks matching braces set novisualbell | " don't beep set noerrorbells | " don't beep -- cgit v1.2.3 From 44f1e79ccd79c3983b59cb9c36a2af1e55738da1 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 14 Sep 2015 02:52:01 +0200 Subject: marker doc added and some minor vimrc tweaks --- doc/shortcuts.txt | 3 +++ vimrc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 3b714bc..51a7521 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -20,6 +20,9 @@ q - stop macro recording @a - replay macro a :'<,'>normal @a - apply a to every line in the current selection +[marker] +ma - set marker a-z (a in this case) +'a - go to marker a [windows] v - splits buffer vertically (screen uses |) diff --git a/vimrc b/vimrc index b61537a..a355697 100644 --- a/vimrc +++ b/vimrc @@ -108,6 +108,9 @@ if has("autocmd") autocmd FileType text setlocal textwidth=78 | " text files: set 'textwidth' to 78 autocmd FileType gitcommit set tw=72 | " longer commit messages without auto line wrapping autocmd FileType LaTeX let g:tex_flavor = "latex"| set conceallevel=1| set concealcursor= + autocmd BufNewFile,BufReadPost *.config set filetype=xml | " visual studio config file + autocmd BufNewFile,BufReadPost *.csproj set filetype=xml | " visual studio project file + autocmd BufNewFile,BufReadPost *.sln set filetype=xml | " visual studio solution file endif "================================================================================ -- cgit v1.2.3 From f11183e8daa88e99215d48bb6c5c726e3d84b06c Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 14 Sep 2015 05:29:53 +0200 Subject: fixed some bugs with easy movement --- doc/shortcuts.txt | 3 +++ vimrc | 42 ++++++++++++++++++++++++++++++------------ 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 51a7521..6b88797 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -1,3 +1,6 @@ +[normal mode] +f{char} - move cursor to the character {char} + [visual mode] - with selected lines gq - formats text so that it fits in whatever :set textwidth was set diff --git a/vimrc b/vimrc index a355697..4788809 100644 --- a/vimrc +++ b/vimrc @@ -47,13 +47,14 @@ set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softt set autoindent | " always set autoindenting on set copyindent | " copy the previous indentation on autoindenting set scrolloff=2 | " always keeps at least two lines visible (when seeking) -set selectmode=key,mouse | " make [strg+]shift-{left|right} enter SELECT mode (windows alike) +set selectmode=mouse | " avoid using select mode (only with mouse) +set selection=exclusive | " includes last character of the selection into following command (like x or d) set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap set diffopt+=iwhite,filler | " lets diff ignore white spaces set spell spelllang=en,de | " enable spell checker -set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) +set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews set linebreak | " do not wrap in the middle of words set showcmd | " displays status line messages while selecting (matrix size) @@ -126,16 +127,17 @@ endif if has("gui_running") set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like - set guitablabel=%t | " do not display full path as tabname - set guioptions+=m | " menu bar - set guioptions+=T | " toolbar - set guioptions+=r | " right-hand scroll bar - set guioptions-=c | " use console dialogs instead of popups - set guioptions+=a | " autoselect: copy&paste using middleclick - set guioptions+=e | " add tab pages - set guioptions+=p | " use gui pointer callback for x11 - set toolbariconsize=large | " make the icon toolbar as big as possible - "set columns=80 | " set initial window width (so that it fits the terminals) + set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode + set guitablabel=%t | " do not display full path as tabname + set guioptions+=m | " menu bar + set guioptions+=T | " toolbar + set guioptions+=r | " right-hand scroll bar + set guioptions-=c | " use console dialogs instead of popups + set guioptions+=a | " autoselect: copy&paste using middleclick + set guioptions+=e | " add tab pages + set guioptions+=p | " use gui pointer callback for x11 + set toolbariconsize=large | " make the icon toolbar as big as possible + "set columns=80 | " set initial window width (so that it fits the terminals) else if &term =~? 'mlterm\|xterm\|screen' set t_Co=256 | " fixes incompatibilities with our color scheme @@ -163,6 +165,18 @@ nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before nnoremap g$| " and make the key position the cursor after the last char of that line +function ExtendedHome() + let column = col('.') + normal! ^ + if column == col('.') + normal! 0 + endif +endfunction +noremap ^ +noremap :call ExtendedHome() + +nnoremap u + " plugin hotkeys @@ -170,6 +184,10 @@ map :TlistToggle| " bind TagList to Hotkey Ctrl+L inoremap ( (| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) +set makeprg=make\ test +nnoremap :!make| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) + + "================================================================================ " deactivated on-demand commands (just in case one needs them one day) " -- cgit v1.2.3 From e4a3b3ce20fb6db3590b5065678e39817afe9083 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 14 Sep 2015 14:51:53 +0200 Subject: text insertion with middle click over ssh without -X works problem was set mouse=a, which is default but which needs a gui. GUI is only available when using ssh -X to connect and sometimes it causes trouble when using sudo. Deactivated mouse=a in console and replaced it with mouse=nh which will make the mouse working in help files as usual and in normal mode, but not in insert mode, where the console should handle mouse events. --- vimrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vimrc b/vimrc index 4788809..5d3417b 100644 --- a/vimrc +++ b/vimrc @@ -121,13 +121,11 @@ if &t_Co > 2 set cursorline | " highlight currently selected line endif -if has('mouse') - set mouse=a -endif if has("gui_running") - set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like + set mouse=a | " use mouse in gui-mode (which is default) set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode + set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like set guitablabel=%t | " do not display full path as tabname set guioptions+=m | " menu bar set guioptions+=T | " toolbar @@ -142,11 +140,14 @@ else if &term =~? 'mlterm\|xterm\|screen' set t_Co=256 | " fixes incompatibilities with our color scheme endif + set mouse=nh | " limits mouse usage to normal mode and help files, so that middle click text insertion works in insert mode set title | " set the terminal caption set icon | " sets the terminal icon to vim set ttyfast | " modern terminals are all fast in a way "set titleold="vim ended" | " set terminal title after closing vim "set titlestring="VIM-CONSOLE" | " set window title + "if has('mouse') + "endif endif -- cgit v1.2.3