From: Jannik ZANDER Date: Mon, 18 Jun 2018 16:27:16 +0000 (+0200) Subject: Renamed: .vimrc -> .vim/vimrc X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=53835af25b52798f0026331625b572da89869887;p=dotfiles.git Renamed: .vimrc -> .vim/vimrc --- diff --git a/.vim/vimrc b/.vim/vimrc new file mode 100644 index 0000000..74791e3 --- /dev/null +++ b/.vim/vimrc @@ -0,0 +1,354 @@ +" section: environment {{{1 +" --------------------- + +silent !mkdir -p ~/.local/share/vim/{swap,backup,undo} +set directory=~/.local/share/vim/swap +set backupdir=~/.local/share/vim/backup +set undodir=~/.local/share/vim/undo +set viminfo+=n~/.local/share/vim/viminfo +"set runtimepath+=~/.cache/vim + +" section: plugins {{{1 +" --------------------- +"silent call plug#begin('~/.cache/vim/bundle') +"Plug 'easymotion/vim-easymotion' +"Plug 'tpope/vim-surround' +"Plug 'tpope/vim-commentary' +"Plug 'michaeljsmith/vim-indent-object' +"Plug 'tpope/vim-unimpaired' +"Plug 'tpope/vim-dispatch' +"Plug 'tpope/vim-repeat' +"Plug 'tpope/vim-fugitive' +"Plug 'tpope/vim-vinager' +"Plug 'scrooloose/syntastic' +"Plug 'vim-airline/vim-airline' +"Plug 'airblade/vim-gitgutter' +"Plug 'majutsushi/tagbar' +"Plug 'fholgado/minibufexpl.vim' +"Plug 'brookhong/cscope.vim' +"Plug 'ctrlpvim/ctrlp.vim' +"Plug 'brandonbloom/csearch.vim' +"Plug 'mileszs/ack.vim' +"Plug 'jeetsukumaran/vim-filesearch' +"Plug 'haya14busa/incsearch.vim' +"Plug 'altercation/vim-colors-solarized' +"Plug 'editorconfig/editorconfig-vim' +"Plug 'johnsyweb/vim-makeshift' +"Plug 'tfnico/vim-gradle' +"Plug 'a.vim' +"Plug 'heaths/vim-msbuild' +"Plug 'hdima/python-syntax' +"Plug 'klen/python-mode' +"Plug 'jalcine/cmake.vim' +"call plug#end() + +" section: options {{{1 +" --------------------- +"set autoindent +set autoread +set autowrite " automatically save before commands like :next and :make +set backspace=2 +if exists('+breakindent') + set breakindent showbreak=\ + +endif +set cmdheight=2 +setglobal commentstring=#\ %s +set complete-=i " searching includes can be slow +"if has("win32") || has("win64") +" does not work for msys2 +set clipboard=unnamed +"else +"set clipboard=unnamedplus +"endif +set fileformats=unix,dos,mac +"set foldmethod=syntax +"set foldlevel=1 +"set foldclose=all +"set foldopen+=jump +set guioptions+=a +set guioptions-=m "menu bar +set guioptions-=T "toolbar +set guioptions-=r "scroolbar +set history=200 +set incsearch " incremental search +set laststatus=2 " always show status line +set lazyredraw +set linebreak +set mouse=nvi +set mousemodel=popup +set number +"set pastetoggle= +set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin +set printoptions=paper:letter +set scrolloff=1 +set shiftround +set shortmess=aoOtI +"set showcmd " show (partial) command in status line. +set showmatch " show matching brackets. +set sidescrolloff=5 +set smartcase " case insensitive searches become sensitive with capitals +"setglobal tags=./tags; +set timeoutlen=500 " leader key timeout +set ttimeoutlen=50 " make esc work faster +set visualbell +if exists('+undofile') + set undofile +endif +set virtualedit=block +set updatetime=250 +set wildmenu +set wildmode=longest:full,full +set wildignore+=tags,.*.un~,*.pyc +set winaltkeys=no + +"if !has("gui_running") && $display == '' || !has("gui") +" set mouse= +"endif +" +"set makeprg=cmake\ --build\ . +" Visual studio 2013 +"set errorformat=\ %#%f(%l):\ %m +" Visual studio 2008 +"set errorformat=%.%#>\ %#%f(%l)\ :\ %m +" +" IAR compiler +set makeprg=vim-iarbuild.cmd +set errorformat=%f(%l)\ :\ %m + +"syn match pythonDefStatement /^\s*\%(def\|class\)/ +" \ nextgroup=pythonFunction skipwhite +"syn region pythonFunctionFold start="^\z(\s*\)\%(def\|class\)\>" +" \ end="\ze\%(\s*\n\)\+\%(\z1\s\)\@!." fold transparent + +"hi link pythonDefStatement Statement + +let g:syntastic_quiet_messages = { "type": "style" } + +" plugin settings {{{1 +let g:netrw_liststyle=3 +let g:netrw_banner = 0 +let g:netrw_sort_sequence = '[\/]$,*' + + + +"let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] +"let g:markdown_syntax_conceal = 0 + +" %s is replaced with fzf command +"let g:fzf_launcher = 'xterm -e bash -ic %s' +"let g:fzf_launcher = "in_a_new_term_function %s" + +"for airline +"let g:airline#extensions#tabline#enabled = 1 + +"for ack.vim +if executable('ag') + let g:ackprg = 'ag --vimgrep --skip-vcs-ignores' +endif + + +let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] +let g:editorconfig_verbose = 1 + +if has("win32") + let g:EditorConfig_exec_path = "C:\programs\editorconfig\bin\editorconfig.exe" +else + let g:editorconfig_core_mode = "python_builtin" +endif + +"set colorcolumn=80 +"highlight ColorColumn ctermbg=9 + +" block cursor in normal mode +let &t_ti.="\e[1 q" +let &t_SI.="\e[5 q" +let &t_EI.="\e[1 q" +let &t_te.="\e[0 q" + +let python_folding = 1 +" }}}2 +" section: commands {{{1 +"----------------------- +set shell=/bin/bash + +if has("cscope") + set nocscopetag + set cscopequickfix=s-,c-,d-,i-,t-,e- + set nocscopeverbose + if filereadable(".git/cscope.out") + cscope add .git/cscope.out + endif + set cscopeverbose + + function! Cscoperebuild() + cscope kill .git/cscope.out + silent execute "!./.git/hooks/cscope" + if v:shell_error + redraw! + echohl errormsg | echo "unable to run cscope command." | echohl none + else + if filereadable(".git/cscope.out") + redraw! + cscope add .git/cscope.out + else + redraw! + echohl errormsg | echo "unable to read cscope database." | echohl none + endif + endif + endfunction + + command! Cscope call Cscoperebuild() +endif" + + +" section: mappings {{{1 +" ---------------------- +" +let mapleader = "," + + +" Quickly edit/reload the vimrc file +nmap ev :e $MYVIMRC +nmap sv :so $MYVIMRC + +" Minibufferexplorer +nnoremap b :MBEToggle +"let g:miniBufExplMapWindowNavVim = 1 +"let g:miniBufExplMapCTabSwitchBufs = 1 +" +" Tagbar +nnoremap t :TagbarToggle + +" copy/paste from system clipboard +if has("win32") +vnoremap y "*y +vnoremap d "*d +nnoremap p "*p +nnoremap P "*P + +vnoremap p "*p +vnoremap P "*P +else +" nnoremap y "*y +" nnoremap p "*p +" nnoremap Y "+y +" nnoremap P "+p +" nnoremap y "*y +" nnoremap yy "*yy +" noremap p "*p +" noremap P "*P +endif + +if has("cscope") +" cnoreabbrev csa +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs add' : 'csa') +" cnoreabbrev csf +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs find' : 'csf') +" cnoreabbrev csk +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs kill' : 'csk') +" cnoreabbrev csr +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs reset' : 'csr') +" cnoreabbrev css +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs show' : 'css') +" cnoreabbrev csh +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs help' : 'csh') + + nnoremap fa :call CscopeFindInteractive(expand('')) + nnoremap l :call ToggleLocationList() + + " s: Find this C symbol + nnoremap fs :call CscopeFind('s', expand('')) + " g: Find this definition + nnoremap fg :call CscopeFind('g', expand('')) + " d: Find functions called by this function + nnoremap fd :call CscopeFind('d', expand('')) + " c: Find functions calling this function + nnoremap fc :call CscopeFind('c', expand('')) + " t: Find this text string + nnoremap ft :call CscopeFind('t', expand('')) + " e: Find this egrep pattern + nnoremap fe :call CscopeFind('e', expand('')) + " f: Find this file + nnoremap ff :call CscopeFind('f', expand('')) + " i: Find files #including this file + nnoremap fi :call CscopeFind('i', expand('')) + + "todo: figure out how to get cstag output in quickfix or a popup menu. + map :cstag =expand("") +endif + +" Maps Ctrl-[h,j,k,l] to windows split navigations +nnoremap +nnoremap +nnoremap +nnoremap + +" Maps leader-[h,j,k,l] to windows split navigations +"nnoremap h +"nnoremap j +"nnoremap k +"nnoremap l +" +"" Maps Ctrl-[h,j,k,l] to resizing a window split +"nnoremap < +"nnoremap - +"nnoremap + +"nnoremap > + +"exit insert mode +inoremap jj +inoremap j j +" folding +noremap za +" In the quickfix window, is used to jump to the error under the +" cursor, so undefine the mapping there. +autocmd BufReadPost quickfix nnoremap + +" section: autocommands {{{1 +" -------------------------- +if has("autocmd") + filetype plugin indent on + autocmd bufnewfile,bufread *.md set filetype=markdown + autocmd bufnewfile,bufread *.gradle set filetype=groovy +endif " has("autocmd") +" }}}1 +" section: visual {{{1 +" -------------------- + +" switch syntax highlighting on, when the terminal has colors +if (&t_Co > 2 || has("gui_running")) && has("syntax") + if exists("&guifont") + if has("mac") + set guifont=monaco:h11 + elseif has("unix") + set guifont=inconsolata\ 11 + elseif has("win32") +" set guifont=consolas:h11,courier\ new:h10 + set guifont=Consolas:h10:cANSI:qDRAFT + endif + endif + + + if exists("syntax_on") || exists("syntax_manual") + else + syntax on + endif + set list +" if !exists('g:colors_name') +" silent! colorscheme solarized +" endif +endif + +"colorscheme solarized +"let g:solarized_diffmode="high" +"let g:solarized_termtrans=1 +"let g:solarized_menu=0 +highlight Normal guibg=black guifg=white +set background=dark +set t_Co=256 +" }}}1 + +if filereadable(expand('~/.vimrc_local')) + source ~/.vimrc_local +endif + diff --git a/.vimrc b/.vimrc deleted file mode 100644 index 74791e3..0000000 --- a/.vimrc +++ /dev/null @@ -1,354 +0,0 @@ -" section: environment {{{1 -" --------------------- - -silent !mkdir -p ~/.local/share/vim/{swap,backup,undo} -set directory=~/.local/share/vim/swap -set backupdir=~/.local/share/vim/backup -set undodir=~/.local/share/vim/undo -set viminfo+=n~/.local/share/vim/viminfo -"set runtimepath+=~/.cache/vim - -" section: plugins {{{1 -" --------------------- -"silent call plug#begin('~/.cache/vim/bundle') -"Plug 'easymotion/vim-easymotion' -"Plug 'tpope/vim-surround' -"Plug 'tpope/vim-commentary' -"Plug 'michaeljsmith/vim-indent-object' -"Plug 'tpope/vim-unimpaired' -"Plug 'tpope/vim-dispatch' -"Plug 'tpope/vim-repeat' -"Plug 'tpope/vim-fugitive' -"Plug 'tpope/vim-vinager' -"Plug 'scrooloose/syntastic' -"Plug 'vim-airline/vim-airline' -"Plug 'airblade/vim-gitgutter' -"Plug 'majutsushi/tagbar' -"Plug 'fholgado/minibufexpl.vim' -"Plug 'brookhong/cscope.vim' -"Plug 'ctrlpvim/ctrlp.vim' -"Plug 'brandonbloom/csearch.vim' -"Plug 'mileszs/ack.vim' -"Plug 'jeetsukumaran/vim-filesearch' -"Plug 'haya14busa/incsearch.vim' -"Plug 'altercation/vim-colors-solarized' -"Plug 'editorconfig/editorconfig-vim' -"Plug 'johnsyweb/vim-makeshift' -"Plug 'tfnico/vim-gradle' -"Plug 'a.vim' -"Plug 'heaths/vim-msbuild' -"Plug 'hdima/python-syntax' -"Plug 'klen/python-mode' -"Plug 'jalcine/cmake.vim' -"call plug#end() - -" section: options {{{1 -" --------------------- -"set autoindent -set autoread -set autowrite " automatically save before commands like :next and :make -set backspace=2 -if exists('+breakindent') - set breakindent showbreak=\ + -endif -set cmdheight=2 -setglobal commentstring=#\ %s -set complete-=i " searching includes can be slow -"if has("win32") || has("win64") -" does not work for msys2 -set clipboard=unnamed -"else -"set clipboard=unnamedplus -"endif -set fileformats=unix,dos,mac -"set foldmethod=syntax -"set foldlevel=1 -"set foldclose=all -"set foldopen+=jump -set guioptions+=a -set guioptions-=m "menu bar -set guioptions-=T "toolbar -set guioptions-=r "scroolbar -set history=200 -set incsearch " incremental search -set laststatus=2 " always show status line -set lazyredraw -set linebreak -set mouse=nvi -set mousemodel=popup -set number -"set pastetoggle= -set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin -set printoptions=paper:letter -set scrolloff=1 -set shiftround -set shortmess=aoOtI -"set showcmd " show (partial) command in status line. -set showmatch " show matching brackets. -set sidescrolloff=5 -set smartcase " case insensitive searches become sensitive with capitals -"setglobal tags=./tags; -set timeoutlen=500 " leader key timeout -set ttimeoutlen=50 " make esc work faster -set visualbell -if exists('+undofile') - set undofile -endif -set virtualedit=block -set updatetime=250 -set wildmenu -set wildmode=longest:full,full -set wildignore+=tags,.*.un~,*.pyc -set winaltkeys=no - -"if !has("gui_running") && $display == '' || !has("gui") -" set mouse= -"endif -" -"set makeprg=cmake\ --build\ . -" Visual studio 2013 -"set errorformat=\ %#%f(%l):\ %m -" Visual studio 2008 -"set errorformat=%.%#>\ %#%f(%l)\ :\ %m -" -" IAR compiler -set makeprg=vim-iarbuild.cmd -set errorformat=%f(%l)\ :\ %m - -"syn match pythonDefStatement /^\s*\%(def\|class\)/ -" \ nextgroup=pythonFunction skipwhite -"syn region pythonFunctionFold start="^\z(\s*\)\%(def\|class\)\>" -" \ end="\ze\%(\s*\n\)\+\%(\z1\s\)\@!." fold transparent - -"hi link pythonDefStatement Statement - -let g:syntastic_quiet_messages = { "type": "style" } - -" plugin settings {{{1 -let g:netrw_liststyle=3 -let g:netrw_banner = 0 -let g:netrw_sort_sequence = '[\/]$,*' - - - -"let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] -"let g:markdown_syntax_conceal = 0 - -" %s is replaced with fzf command -"let g:fzf_launcher = 'xterm -e bash -ic %s' -"let g:fzf_launcher = "in_a_new_term_function %s" - -"for airline -"let g:airline#extensions#tabline#enabled = 1 - -"for ack.vim -if executable('ag') - let g:ackprg = 'ag --vimgrep --skip-vcs-ignores' -endif - - -let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] -let g:editorconfig_verbose = 1 - -if has("win32") - let g:EditorConfig_exec_path = "C:\programs\editorconfig\bin\editorconfig.exe" -else - let g:editorconfig_core_mode = "python_builtin" -endif - -"set colorcolumn=80 -"highlight ColorColumn ctermbg=9 - -" block cursor in normal mode -let &t_ti.="\e[1 q" -let &t_SI.="\e[5 q" -let &t_EI.="\e[1 q" -let &t_te.="\e[0 q" - -let python_folding = 1 -" }}}2 -" section: commands {{{1 -"----------------------- -set shell=/bin/bash - -if has("cscope") - set nocscopetag - set cscopequickfix=s-,c-,d-,i-,t-,e- - set nocscopeverbose - if filereadable(".git/cscope.out") - cscope add .git/cscope.out - endif - set cscopeverbose - - function! Cscoperebuild() - cscope kill .git/cscope.out - silent execute "!./.git/hooks/cscope" - if v:shell_error - redraw! - echohl errormsg | echo "unable to run cscope command." | echohl none - else - if filereadable(".git/cscope.out") - redraw! - cscope add .git/cscope.out - else - redraw! - echohl errormsg | echo "unable to read cscope database." | echohl none - endif - endif - endfunction - - command! Cscope call Cscoperebuild() -endif" - - -" section: mappings {{{1 -" ---------------------- -" -let mapleader = "," - - -" Quickly edit/reload the vimrc file -nmap ev :e $MYVIMRC -nmap sv :so $MYVIMRC - -" Minibufferexplorer -nnoremap b :MBEToggle -"let g:miniBufExplMapWindowNavVim = 1 -"let g:miniBufExplMapCTabSwitchBufs = 1 -" -" Tagbar -nnoremap t :TagbarToggle - -" copy/paste from system clipboard -if has("win32") -vnoremap y "*y -vnoremap d "*d -nnoremap p "*p -nnoremap P "*P - -vnoremap p "*p -vnoremap P "*P -else -" nnoremap y "*y -" nnoremap p "*p -" nnoremap Y "+y -" nnoremap P "+p -" nnoremap y "*y -" nnoremap yy "*yy -" noremap p "*p -" noremap P "*P -endif - -if has("cscope") -" cnoreabbrev csa -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs add' : 'csa') -" cnoreabbrev csf -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs find' : 'csf') -" cnoreabbrev csk -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs kill' : 'csk') -" cnoreabbrev csr -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs reset' : 'csr') -" cnoreabbrev css -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs show' : 'css') -" cnoreabbrev csh -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs help' : 'csh') - - nnoremap fa :call CscopeFindInteractive(expand('')) - nnoremap l :call ToggleLocationList() - - " s: Find this C symbol - nnoremap fs :call CscopeFind('s', expand('')) - " g: Find this definition - nnoremap fg :call CscopeFind('g', expand('')) - " d: Find functions called by this function - nnoremap fd :call CscopeFind('d', expand('')) - " c: Find functions calling this function - nnoremap fc :call CscopeFind('c', expand('')) - " t: Find this text string - nnoremap ft :call CscopeFind('t', expand('')) - " e: Find this egrep pattern - nnoremap fe :call CscopeFind('e', expand('')) - " f: Find this file - nnoremap ff :call CscopeFind('f', expand('')) - " i: Find files #including this file - nnoremap fi :call CscopeFind('i', expand('')) - - "todo: figure out how to get cstag output in quickfix or a popup menu. - map :cstag =expand("") -endif - -" Maps Ctrl-[h,j,k,l] to windows split navigations -nnoremap -nnoremap -nnoremap -nnoremap - -" Maps leader-[h,j,k,l] to windows split navigations -"nnoremap h -"nnoremap j -"nnoremap k -"nnoremap l -" -"" Maps Ctrl-[h,j,k,l] to resizing a window split -"nnoremap < -"nnoremap - -"nnoremap + -"nnoremap > - -"exit insert mode -inoremap jj -inoremap j j -" folding -noremap za -" In the quickfix window, is used to jump to the error under the -" cursor, so undefine the mapping there. -autocmd BufReadPost quickfix nnoremap - -" section: autocommands {{{1 -" -------------------------- -if has("autocmd") - filetype plugin indent on - autocmd bufnewfile,bufread *.md set filetype=markdown - autocmd bufnewfile,bufread *.gradle set filetype=groovy -endif " has("autocmd") -" }}}1 -" section: visual {{{1 -" -------------------- - -" switch syntax highlighting on, when the terminal has colors -if (&t_Co > 2 || has("gui_running")) && has("syntax") - if exists("&guifont") - if has("mac") - set guifont=monaco:h11 - elseif has("unix") - set guifont=inconsolata\ 11 - elseif has("win32") -" set guifont=consolas:h11,courier\ new:h10 - set guifont=Consolas:h10:cANSI:qDRAFT - endif - endif - - - if exists("syntax_on") || exists("syntax_manual") - else - syntax on - endif - set list -" if !exists('g:colors_name') -" silent! colorscheme solarized -" endif -endif - -"colorscheme solarized -"let g:solarized_diffmode="high" -"let g:solarized_termtrans=1 -"let g:solarized_menu=0 -highlight Normal guibg=black guifg=white -set background=dark -set t_Co=256 -" }}}1 - -if filereadable(expand('~/.vimrc_local')) - source ~/.vimrc_local -endif -