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