vim: cleanup configuration

This commit is contained in:
Robert Kmiec
2019-05-22 14:17:30 +02:00
parent fb039cc690
commit 797765087b

154
.vimrc
View File

@@ -1,5 +1,6 @@
if &compatible if &compatible
set nocompatible " Be iMproved set nocompatible " Be iMproved
set modelines=0
endif endif
filetype plugin off filetype plugin off
@@ -8,7 +9,6 @@ filetype off " required
" set the runtime path to include Vundle and initialize " set the runtime path to include Vundle and initialize
set runtimepath+=~/.vim/bundle/Vundle.vim set runtimepath+=~/.vim/bundle/Vundle.vim
call vundle#begin() call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" let Vundle manage Vundle, required " let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim' Plugin 'VundleVim/Vundle.vim'
@@ -47,30 +47,23 @@ Plugin 'jez/vim-superman' "vman application
"Plugin 'vim-scripts/DoxygenToolkit.vim' " Doxygen support "Plugin 'vim-scripts/DoxygenToolkit.vim' " Doxygen support
"Plugin 'vim-scripts/a.vim' Curtine is the new a.vim "Plugin 'vim-scripts/a.vim' Curtine is the new a.vim
"Plugin 'vim-scripts/taglist.vim' "Plugin 'vim-scripts/taglist.vim'
Plugin 'airblade/vim-gitgutter' " Mark edited lines "Plugin 'airblade/vim-gitgutter' " Mark edited lines
Plugin 'mhinz/vim-signify' " Mark edited lines - faster gitgutter
Plugin 'ctrlpvim/ctrlp.vim' Plugin 'ctrlpvim/ctrlp.vim'
"Plugin 'ericcurtin/CurtineIncSw.vim' "Toggle .c .h files "Plugin 'ericcurtin/CurtineIncSw.vim' "Toggle .c .h files
Plugin 'flazz/vim-colorschemes' " lots of colorschemes Plugin 'flazz/vim-colorschemes' " lots of colorschemes
Plugin 'justinmk/vim-sneak' Plugin 'justinmk/vim-sneak' " easy movement
Plugin 'kergoth/vim-bitbake' " Bitbake templates and syntax Plugin 'kergoth/vim-bitbake' " Bitbake templates and syntax
Plugin 'ludovicchabant/vim-gutentags' "Auto generate tags Plugin 'ludovicchabant/vim-gutentags' "Auto generate tags
Plugin 'mileszs/ack.vim' " Ack integration Plugin 'mileszs/ack.vim' " Ack integration
Plugin 'rhysd/git-messenger.vim' " show git history
call vundle#end() " required call vundle#end() " required
map <F6> :call CurtineIncSw()<CR>
packadd termdebug
"let g:termdebugger="/opt/glibc-oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/mips-oe-linux/mips-oe-linux-gdb"
" ========== Vim Basic Settings =============" " ========== Vim Basic Settings ============="
filetype plugin indent on filetype plugin indent on
" Make vim incompatbile to vi.
set nocompatible
set modelines=0
"TAB settings. "TAB settings.
set tabstop=4 set tabstop=4
set shiftwidth=4 set shiftwidth=4
@@ -78,19 +71,21 @@ set softtabstop=4
" More Common Settings. " More Common Settings.
set encoding=utf-8 set encoding=utf-8
set scrolloff=8 set scrolloff=10
set autoindent set autoindent
set cino=l1,:0 set cino=l1,:0
set showmode set showmode
set showcmd set showcmd
set hidden set hidden
"set visualbell "set visualbell
set nowrapscan
"set cursorline set cursorline
set ttyfast set ttyfast
set lazyredraw
set ruler set ruler
set backspace=eol,indent,start set backspace=eol,indent,start
"set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P set statusline=%<%f%h%m%r%=%b\ 0x%B\ \ %l,%c%V\ %P
set laststatus=2 set laststatus=2
"set relativenumber "set relativenumber
@@ -98,7 +93,7 @@ set number
set norelativenumber set norelativenumber
set shell=/usr/local/bin/fish set shell=/usr/local/bin/fish
set lazyredraw set path+=**
if exists("+undofile") if exists("+undofile")
if isdirectory($HOME . '/.vim/undo') == 0 if isdirectory($HOME . '/.vim/undo') == 0
@@ -117,23 +112,11 @@ let g:gutentags_cache_dir='~/.vim/tags'
"Changing Leader Key "Changing Leader Key
let mapleader = "\\" let mapleader = "\\"
" Set title to window
set title
" Make pasting done without any indentation break " Make pasting done without any indentation break
set pastetoggle=<F3> set pastetoggle=<F3>
" Make Vim able to edit crontab fields again.
"set backupskip=/tmp/*,/private/tmp/*"
" Enable Mouse
"set mouse=a
syntax on syntax on
"Settings for Searching and Moving
"nnoremap / /\v
"vnoremap / /\v
"Control it with %/s///i - ignore and I - sens "Control it with %/s///i - ignore and I - sens
"set ignorecase "set ignorecase
set smartcase set smartcase
@@ -144,24 +127,14 @@ set showmatch
set matchtime=3 set matchtime=3
set hlsearch set hlsearch
nnoremap <leader><space> :noh<cr> nnoremap <leader><space> :noh<cr>
"nnoremap <tab> % nnoremap <tab> %
"vnoremap <tab> % "vnoremap <tab> %
" Make Vim to handle long lines nicely. " Make Vim to handle long lines nicely.
set wrap set wrap
set textwidth=79 set textwidth=79
"set formatoptions=cqran1j
set formatoptions=cqrnb1j set formatoptions=cqrnb1j
" Naviagations using keys up/down/left/right
" Disabling default keys to learn the hjkl
nnoremap <up> <C-w>k
nnoremap <down> <C-w>j
nnoremap <left> <C-w>h
nnoremap <right> <C-w>l
nnoremap <Home> :tabp<CR>
nnoremap <End> :tabn<CR>
nnoremap j gj nnoremap j gj
nnoremap k gk nnoremap k gk
@@ -177,36 +150,33 @@ vnoremap <F1> <ESC>
vnoremap <c-a> <c-a>gv vnoremap <c-a> <c-a>gv
vnoremap <c-x> <c-x>gv vnoremap <c-x> <c-x>gv
" Set vim to save the file on focus out. " Set vim to save the file on focus out
"au FocusLost * :wa "au FocusLost * :wa
nmap <leader>w :wa<CR>
" Adding More Shorcuts keys using leader key. " leader Command to remove white space from a file
" Leader Key provide separate namespace for specific commands.
",W Command to remove white space from a file.
""nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR> ""nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR>
" Re-hardwrap Paragraph " Re-hardwrap Paragraph
nnoremap <leader>q gqip nnoremap <leader>q gqip
" ,v Select just pasted text. " leader v Select just pasted text
"nnoremap <leader>v V`] "nnoremap <leader>v V`]
" jj For Quicker Escaping between normal and editing mode. " jj For Quicker Escaping between normal and editing mode
inoremap jj <ESC> inoremap jj <ESC>
inoremap jk <ESC>
" Working with split screen nicely " Resize Split When the window is resized
" Resize Split When the window is resized"
au VimResized * :wincmd = au VimResized * :wincmd =
" Wildmenu completion " " Wildmenu completion
set wildmenu set wildmenu
set wildmode=list:longest set wildmode=list:longest
set wildignore+=.hg,.git,.svn " Version Controls" set wildignore+=.hg,.git,.svn " Version Controls"
set wildignore+=*.aux,*.out,*.toc "Latex Indermediate files" set wildignore+=*.aux,*.out,*.toc "Latex Indermediate files"
set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg "Binary Imgs" set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg "Binary Imgs"
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest "Compiled Object files" set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest "Compiled Object files"
set wildignore+=*.spl "Compiled speolling world list" set wildignore+=*.spl "Compiled spelling world list"
set wildignore+=*.sw? "Vim swap files" set wildignore+=*.sw? "Vim swap files"
set wildignore+=*.DS_Store "OSX SHIT" set wildignore+=*.DS_Store "OSX SHIT"
set wildignore+=*.luac "Lua byte code" set wildignore+=*.luac "Lua byte code"
@@ -214,15 +184,6 @@ set wildignore+=migrations "Django migrations"
set wildignore+=*.pyc "Python Object codes" set wildignore+=*.pyc "Python Object codes"
set wildignore+=*.orig "Merge resolution files" set wildignore+=*.orig "Merge resolution files"
"Make Sure that Vim returns to the same line when we reopen a file"
augroup line_return
au!
au BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ execute 'normal! g`"zvzz' |
\ endif
augroup END
match Error /\s\+$\|DUPA\c/ match Error /\s\+$\|DUPA\c/
" Removing scrollbars " Removing scrollbars
@@ -236,7 +197,6 @@ if has("gui_running")
colorscheme molokai colorscheme molokai
set listchars=tab:▸\ ,eol" Invisibles using the Textmate style set listchars=tab:▸\ ,eol" Invisibles using the Textmate style
else else
set t_Co=256
colorscheme badwolf colorscheme badwolf
set background=dark set background=dark
" To show special characters in Vim " To show special characters in Vim
@@ -246,18 +206,24 @@ else
hi SpellBad cterm=underline hi SpellBad cterm=underline
endif endif
if &term =~ '256color'
" Disable Background Color Erase (BCE) so that color schemes
" work properly when Vim is used inside tmux and GNU screen.
set t_ut=
endif
" ========== Plugin Settings ==========" " ========== Plugin Settings =========="
" Mapping to NERDTree " Mapping to NERDTree
nnoremap <C-n> :NERDTreeToggle<cr> "nnoremap <C-n> :NERDTreeToggle<cr>
let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$'] "let NERDTreeIgnore=['\.vim$', '\~$', '\.pyc$']
" Mini Buffer some settigns." " Mini Buffer some settigns."
let g:miniBufExplMapWindowNavVim = 1 "let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1 "let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1 "let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1 "let g:miniBufExplModSelTarget = 1
let g:miniBufExplStatusLineText = '' "let g:miniBufExplStatusLineText = ''
" Tab color settings to make it more visible. " Tab color settings to make it more visible.
hi MBEChanged ctermfg=white hi MBEChanged ctermfg=white
@@ -266,10 +232,9 @@ hi MBENormal ctermfg=white
" Tagbar key bindings." " Tagbar key bindings."
"nmap <leader>t <ESC>:TagbarToggle<cr> "nmap <leader>t <ESC>:TagbarToggle<cr>
"imap <leader>t <ESC>:TagbarToggle<cr>i "imap <leader>t <ESC>:TagbarToggle<cr>i
nmap <leader>t :TlistToggle<cr> "nmap <leader>t :TlistToggle<cr>
imap <leader>t <ESC>:TagbarToggle<cr>i "imap <leader>t <ESC>:TagbarToggle<cr>i
nnoremap Y y$
map <Leader>a gg0VG$ map <Leader>a gg0VG$
nnoremap <leader>2 <esc>:set tabstop=2 softtabstop=2 shiftwidth=2<cr> nnoremap <leader>2 <esc>:set tabstop=2 softtabstop=2 shiftwidth=2<cr>
@@ -288,12 +253,12 @@ if has("autocmd")
autocmd WinLeave * set nocursorline autocmd WinLeave * set nocursorline
autocmd WinEnter * set cursorline autocmd WinEnter * set cursorline
autocmd FileType tex set textwidth=79 "autocmd FileType tex set textwidth=79
endif endif
if has("cscope") if has("cscope")
"use both cscope and ctags "use both cscope and ctags
set cscopetag "set cscopetag
" change this to 1 to search ctags DBs first " change this to 1 to search ctags DBs first
set csto=0 set csto=0
@@ -369,25 +334,21 @@ let g:ycm_autoclose_preview_window_after_completion = 0
let g:ycm_autoclose_preview_window_after_insertion = 1 let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_min_num_of_chars_for_completion = 99 let g:ycm_min_num_of_chars_for_completion = 99
"nnoremap <F10> :ConoLineColorDark<CR>
"nnoremap <S-F10> :ConoLineColorLight<CR>
map <F12> :colorscheme random<CR> map <F12> :colorscheme random<CR>
" Folding - space one line, home,end globally increase/decrease
set foldenable set foldenable
set foldlevelstart=5 set foldlevelstart=3
set foldnestmax=5 set foldnestmax=5
set foldtext=getline(v:foldstart)
set fillchars=fold:\
set foldmethod=syntax
nnoremap <space> za nnoremap <space> za
nnoremap <Home> zm
nnoremap <End> zr
nnoremap <leader>s :mksession!<CR> nnoremap <leader>s :mksession!<CR>
"print the register
nmap <leader>q "ap
"save register
nmap <leader>Q "ayydd
" Increment also letters
"set nrformats=alpha,octal,hex
" Jira config " Jira config
let b:jiracomplete_url = 'http://192.168.1.49:8080/jira' let b:jiracomplete_url = 'http://192.168.1.49:8080/jira'
let b:jiracomplete_username = 'r.kmiec' let b:jiracomplete_username = 'r.kmiec'
@@ -403,13 +364,13 @@ set updatetime=4000
" additional mapping : complete a classical C multi-line comment: " additional mapping : complete a classical C multi-line comment:
"inoremap <buffer> /*<CR> /*<CR><CR>/<Esc>kA<Space> "inoremap <buffer> /*<CR> /*<CR><CR>/<Esc>kA<Space>
" additional mapping : {<CR> always opens a block " additional mapping : {<CR> always opens a block
inoremap <buffer> {<CR> {<CR>}<Esc>O "inoremap <buffer> {<CR> {<CR>}<Esc>O
"vnoremap <buffer> {<CR> S{<CR>}<Esc>Pk=iB "vnoremap <buffer> {<CR> S{<CR>}<Esc>Pk=iB
inoremap :w<CR> <Esc>:w<CR>i inoremap :w<CR> <Esc>:w<CR>i
"let g:clang_format#code_style = "WebKit" "let g:clang_format#code_style = "WebKit"
let g:clang_format#command = "clang-format-3.9" let g:clang_format#command = "clang-format"
"let g:clang_format#auto_format_on_insert_leave = 1 "let g:clang_format#auto_format_on_insert_leave = 1
"let g:clang_format#auto_format = 1 "let g:clang_format#auto_format = 1
@@ -477,9 +438,6 @@ let g:clang_format#style_options = {
"let g:vebugger_leader='<Leader>d' "let g:vebugger_leader='<Leader>d'
"let g:vebugger_path_gdb='/home/kmir/ARM-TOOLCHAIN/cross/bin/arm-none-eabi-gdb' "let g:vebugger_path_gdb='/home/kmir/ARM-TOOLCHAIN/cross/bin/arm-none-eabi-gdb'
set foldtext=getline(v:foldstart)
set fillchars=fold:\
set foldmethod=syntax
set expandtab set expandtab
"nnoremap <F2> :silent ! plantuml %:p && eog -g %:p:r.png &<CR>:redraw!<CR> "nnoremap <F2> :silent ! plantuml %:p && eog -g %:p:r.png &<CR>:redraw!<CR>
@@ -490,18 +448,7 @@ let g:ctrlp_cmd = 'CtrlPLastMode'
let g:ctrlp_user_command = 'ack --cpp --cc -f %s' let g:ctrlp_user_command = 'ack --cpp --cc -f %s'
let g:ctrlp_working_path_mode = 'rw' let g:ctrlp_working_path_mode = 'rw'
if &term =~ '256color' tnoremap <Esc> <C-W><C-W>
" Disable Background Color Erase (BCE) so that color schemes
" work properly when Vim is used inside tmux and GNU screen.
set t_ut=
endif
let g:alternateSearchPath="sfr:../source,sfr:../src,sfr:../include,sfr:../inc,sfr:./Source,sfr:.."
set nowrapscan
tnoremap <Esc> <C-W>N
"set notimeout ttimeout timeoutlen=100
set spell set spell
set runtimepath+=/usr/share/vim/vimfiles set runtimepath+=/usr/share/vim/vimfiles
@@ -514,6 +461,7 @@ set dictionary+=/usr/share/dict/words
"let g:rtagsRcCmd='rtags-rc' "let g:rtagsRcCmd='rtags-rc'
set timeoutlen=1000 set timeoutlen=1000
set ttimeout
set ttimeoutlen=0 set ttimeoutlen=0
let g:matchparen_timeout = 2 let g:matchparen_timeout = 2
let g:matchparen_insert_timeout = 2 let g:matchparen_insert_timeout = 2
@@ -543,8 +491,6 @@ nnoremap S :%s//g<LEFT><LEFT>
xnoremap S :s//g<LEFT><LEFT> xnoremap S :s//g<LEFT><LEFT>
xmap <BS> x xmap <BS> x
set path+=**
function! FindAlternate() function! FindAlternate()
let l:ext = 'h' let l:ext = 'h'
let l:curr_ext = expand('%:e') let l:curr_ext = expand('%:e')
@@ -562,3 +508,7 @@ function! FindAlternate()
endfunction endfunction
nnoremap <F6> :call FindAlternate()<CR> nnoremap <F6> :call FindAlternate()<CR>
"let g:alternateSearchPath="sfr:../source,sfr:../src,sfr:../include,sfr:../inc,sfr:./Source,sfr:.."
"map <F6> :call CurtineIncSw()<CR>
packadd termdebug