From d6d4b98ba687c04aaf4a50d69333174d23bda572 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Fri, 2 Sep 2022 08:09:46 +0200 Subject: [PATCH] Minimal vimrc --- .gitignore | 1 - .gitmodules | 3 - gvimrc | 48 ----- pack/minpac/opt/minpac | 1 - vimrc | 462 +---------------------------------------- 5 files changed, 2 insertions(+), 513 deletions(-) delete mode 100644 .gitignore delete mode 100644 .gitmodules delete mode 100644 gvimrc delete mode 160000 pack/minpac/opt/minpac diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 33dbcf7..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -pack diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index edd3c5a..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "pack/minpac/opt/minpac"] - path = pack/minpac/opt/minpac - url = https://github.com/k-takata/minpac.git diff --git a/gvimrc b/gvimrc deleted file mode 100644 index 66b9aa1..0000000 --- a/gvimrc +++ /dev/null @@ -1,48 +0,0 @@ - -" Use :help 'option' to see the documentation for the given option. - -set guioptions+=a -set guioptions=egmrti -set guioptions-=m "no menu bar -set guioptions-=T "no toolbar -set guioptions-=r "no scroolbar -set noguipty - -" mouse -set mousemodel=popup -set mousehide -set mouse=a - - -" mapping -map -map! - -" colors -highlight normal guibg=black guifg=white -highlight linenr guifg=grey -highlight BadWhitespace guifg=red -highlight Cursorline guibg=darkgrey -highlight Cursorcolumn guibg=darkgrey - -set gcr=a:blinkon0 - -" fonts -set guifont=Monospace\ 10 -if has("mac") -" set guifont=Menlo:h12 - set guifont=monaco:h11 -elseif has("unix") -" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 - set guifont=inconsolata\ 11 -elseif has("win32") -" set guifont=consolas:h11,courier\ new:h10 - set guifont=consolas:h10:cANSI:qDRAFT -endif - -" help -if has("win32") - let winhelpfile='windows.hlp' - map K :execute "!start winhlp32 -k " . winhelpfile -endif - diff --git a/pack/minpac/opt/minpac b/pack/minpac/opt/minpac deleted file mode 160000 index 093f008..0000000 --- a/pack/minpac/opt/minpac +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 093f00891aeb04e98ceb5a541885d025c9fae169 diff --git a/vimrc b/vimrc index 20edb5d..c55449b 100644 --- a/vimrc +++ b/vimrc @@ -1,461 +1,3 @@ -" Use :help 'option' to see the documentation for the given option. -if &compatible - set nocompatible -endif -filetype plugin indent on -syntax on - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Try to load minimal package manager -silent! packadd minpac - -if !exists('g:loaded_minpac') - " Plugin-less settings -else - call minpac#init() - call minpac#add('k-takata/minpac', {'type': 'opt'}) - " editing - call minpac#add('tpope/vim-repeat', {'type': 'opt'}) - call minpac#add('tpope/vim-surround', {'type': 'opt'}) - call minpac#add('tpope/vim-unimpaired', {'type': 'opt'}) - call minpac#add('tpope/vim-endwise', {'type': 'opt'}) - call minpac#add('tpope/vim-commentary', {'type': 'opt'}) -" call minpac#add('tpope/vim-fugitive', {'type': 'opt'}) - call minpac#add('tpope/vim-vinegar', {'type': 'opt'}) - call minpac#add('ervandew/supertab', {'type': 'opt'}) - " snippets - call minpac#add('SirVer/ultisnips', {'type': 'opt'}) - call minpac#add('garbas/vim-snipmate', {'type': 'opt'}) - call minpac#add('honza/vim-snippets', {'type': 'opt'}) - call minpac#add('tomtom/tlib_vim', {'type': 'opt'}) - call minpac#add('MarcWeber/vim-addon-mw-utils', {'type': 'opt'}) - " visuals - call minpac#add('Yggdroot/indentLine', {'type': 'opt'}) - call minpac#add('vim-airline/vim-airline', {'type': 'opt'}) - call minpac#add('mh21/errormarker.vim', {'type': 'opt'}) - call minpac#add('justinmk/vim-syntax-extra', {'type': 'opt'}) - call minpac#add('haya14busa/incsearch.vim', {'type': 'opt'}) - " browsing - call minpac#add('junegunn/fzf.vim', {'type': 'opt'}) - call minpac#add('majutsushi/tagbar', {'type': 'opt'}) - call minpac#add('jsfaint/gen_tags.vim', {'type': 'opt'}) - call minpac#add('calleerlandsson/pick.vim', {'type': 'opt'}) - " coding->linting->building->testing - call minpac#add('w0rp/ale', {'type': 'opt'}) - call minpac#add('igankevich/mesonic', {'type': 'opt'}) - call minpac#add('skywind3000/asyncrun.vim', {'type': 'opt'}) - " markdown - call minpac#add('previm/previm', {'type': 'opt'}) - call minpac#add('tyru/open-browser.vim', {'type': 'opt'}) - call minpac#add('plasticboy/vim-markdown', {'type': 'opt'}) - call minpac#add('vim-pandoc/vim-pandoc', {'type': 'opt'}) - call minpac#add('vim-pandoc/vim-pandoc-syntax', {'type': 'opt'}) - " others - call minpac#add('thanthese/Tortoise-Typing', {'type': 'opt'}) - -" Load plugins right now -"packloadall - - " Plugin settings -endif - -" Common settings - - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Key-mappings -let mapleader = ' ' -let localmapleader = ' ' - -nnoremap :Files -nnoremap :Buffers -nnoremap L :Lines -nnoremap T :Tags -nnoremap ` :Marks -nnoremap C :Commits -nnoremap S :Snippets - -nnoremap w :update -nnoremap t :term -nnoremap * :grep \| copen -nnoremap + :exe "resize " . (winheight(0) * 3/2) -nnoremap - :exe "resize " . (winheight(0) * 2/3) -"nnoremap html :-1read ~/.vim/template/html3jwf>a -"nnoremap php :-1read ~/.vim/template/php2ja -" -" Normal Mode -nnoremap Y y$ -nnoremap n nzzzv -nnoremap N Nzzzv - -" jk | Escaping! -inoremap jk -xnoremap jk -cnoremap jk - -" Circular windows -nnoremap w -nnoremap W - -" Movement in insert mode -inoremap h -inoremap a -inoremap j -inoremap k - -" Movement in command mode -cnoremap -cnoremap -cnoreabbrev w!! w !sudo tee "%" - -" Visual Mode indent -vnoremap < >gv - - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" indentation -set softtabstop=2 -set shiftwidth=2 -set tabstop=4 -set expandtab -set autoindent -set copyindent -set smarttab -set linebreak -set textwidth=0 -set breakindent -set breakindent showbreak=\ + -set shiftround -set formatoptions+=j -set nostartofline - -" searching -set incsearch hlsearch -set ignorecase smartcase -set magic -set showmatch -set complete-=i -set virtualedit=block -if has('unnamedplus') - set clipboard=unnamed,unnamedplus -endif - -" display -set scrolloff=5 -set sidescrolloff=5 -set display+=lastline -set lazyredraw -set number -set relativenumber -set title -set titlestring=%F -set matchtime=2 - -" folding -set foldmethod=syntax -set foldnestmax=1 -set nofoldenable - -" keyboard -set backspace=indent,eol,start -set ttimeoutlen=10 -set winaltkeys=no -set noerrorbells -set novisualbell -set t_vb= - -" command/status line -set showmode -set showcmd -set ruler -set laststatus=2 -set cmdheight=2 -set shortmess=aoOTI -set wildmenu -set wildmode=longest:full,full -set wildignore+=tags,*.pyc,*.jpg,*.png,*.gif,*.zip -set wildoptions=tagfile - -" buffers +source $VIMRUNTIME/defaults.vim +set tabstop=2 expandtab autoindent set hidden -set autoread -"set autowrite -"set autowriteall - -" temporary files -set undofile -set undodir=~/.vim/undo -set nobackup -set noswapfile -set viminfo= -set history=1000 -set tags=.git/tags -set sessionoptions-=optionsj -let g:session_directory = "~/.vim/session" -let g:session_autoload = "no" -let g:session_autosave = "no" -let g:session_command_aliases = 1 - -" netrw -set modifiable -let g:netrw_dirhistmax = 0 -let g:netrw_banner = 0 -let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+' -" like Nerdtree -"let g:netrw_liststyle = 3 -"let g:netrw_browse_split = 4 -"let g:netrw_altv = 1 -"let g:netrw_winsize = 25 - -" files -set path=.,,** -set shell=bash -let g:is_posix = 1 -if has("win32") - set shell=cmd - set shellcmdflag=/c -endif -scriptencoding utf-8 -set fileencoding=utf-8 -set fileencodings=utf-8,latin1,unicode -set fileformat=unix -set fileformats=unix,dos,mac -set fileignorecase - -" colors -set background=dark -set t_Co=256 -set cursorline -set cursorcolumn -highlight Cursorline cterm=NONE ctermbg=darkgrey -highlight Cursorcolumn ctermbg=darkgrey -highlight linenr ctermfg=grey -highlight! link folded normal -highlight BadWhitespace ctermfg=red -match BadWhitespace /\s\+$/ - -" fonts and chars -set list -if has('multi_byte') && &encoding ==# 'utf-8' -" let &listchars = 'tab:▸ ,extends:❯,precedes:❮,nbsp:±' -else -" let &listchars = 'tab:> ,extends:>,precedes:<,nbsp:.' -endif -"let &t_ti.="\e[1 q" -"let &t_SI.="\e[5 q" -"let &t_EI.="\e[1 q" -"let &t_te.="\e[0 q" - - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Functions - -" vimgrep file:line:coloumn:message -set grepformat^=%f:%l:%c:%m -set grepprg=ag\ --vimgrep\ --skip-vcs-ignores\ --path-to-ignore\ ~/.ignore\ --cpp\ --cc -command! -nargs=1 Ngrep lvimgrep "" $HOME/cloud/Notes/**/*.md - -function! s:CmakeInit() - let &errorformat="%f(%l) : %t%*\\D%n: %m,%*[^\"]\"%f\"%*\\D%l: %m,%f(%l) : %m,%*[^ ] %f %l: %m,%f:%l:%c:%m,%f(%l):%m,%f|%l| %m" - set makeprg=cmake -endfunction -"command! -bang -nargs=0 -complete=file CmakeInit call s:CmakeInit() - -function! s:Doxygen() - set errorformat+=%f:%l:\ %m - set makeprg=doxygen -endfunction -"command! -bang -nargs=0 -complete=file Doxygen call s:Doxygen() - -function! s:Iar() - set errorformat=%f(%l)\ :\ %m - set makeprg=vim-iarbuild.cmd -endfunction -"command! -bang -nargs=0 -complete=file Iar call s:Iar() - -function! Pandoc_Preview() - let b:curr_file = expand('%:p') - call system('pandoc --standalone "' . b:curr_file . '" > markdown-preview.html') - call system('firefox markdown-preview.html 1>/dev/null 2>/dev/null &') -endfunction - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Autocommands -if has('autocmd') - augroup filetypes - autocmd! - autocmd BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} set filetype=markdown - autocmd BufNewfile,BufRead *.gradle set filetype=groovy - autocmd BufNewfile,BufRead *.json set filetype=json - autocmd BufNewfile,BufRead *.yml set filetype=yaml - augroup end - - augroup formats - autocmd! - autocmd FileType c setlocal expandtab softtabstop=2 shiftwidth=2 - autocmd FileType cpp setlocal expandtab softtabstop=2 shiftwidth=2 - autocmd FileType make setlocal noexpandtab tabstop=8 shiftwidth=8 - autocmd FileType python setlocal expandtab softtabstop=4 shiftwidth=4 - \ formatoptions+=croq colorcolumn=79 - \ cinwords=if,elif,else,for,while,try,except,finally,def,class,with - autocmd FileType netrw setlocal bufhidden=wipe - augroup end - - augroup saveall - autocmd! - autocmd FocusLost * silent! wa - augroup end - - augroup numbers - autocmd! - autocmd BufEnter,FocusGained,InsertLeave * set relativenumber - autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber - augroup end - - augroup vimrc - autocmd! - autocmd BufWritePost vimrc,gvimrc,vimrc.local source $MYVIMRC - augroup end - - augroup quickfix - autocmd! - " autocmd QuickFixCmdPost [^l]* nested cwindow - " autocmd QuickFixCmdPost l* nested lwindow - autocmd QuickFixCmdPost * call asyncrun#quickfix_toggle(8, 1) - augroup end -endif - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -silent! packadd! matchit -silent! packadd! vim-syntax-extra -silent! packadd! vim-repeat -silent! packadd! vim-surround -silent! packadd! vim-unimpaired -"silent! packadd! vim-fugitive -silent! packadd! vim-commentary -silent! packadd! vim-vinegar -silent! packadd! vim-endwise -silent! packadd! supertab - -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" fzf -silent! packadd! fzf.vim -let g:fzf_buffers_jump = 1 -let g:fzf_tags_command = 'ctags -R' -let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"' - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -"silent! packadd! indentLine -"let g:indentLine_enabled = 0 -"autocmd! User indentLine doautocmd indentLine Syntax -"let g:indentLine_color_term = 239 -"let g:indentLine_color_gui = '#616161' - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Airline -silent! packadd! vim-airline - -if exists('*airline') - let g:airline#extensions#tabline#enabled = 1 - let g:airline#extensions#tabline#formatter = 'unique_tail_improved' - let g:airline#extensions#ale#enabled = 1 - let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}']) -endif - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" ALE -"silent! packadd! ale -let g:ale_enabled = 1 - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Tagbar -"silent! packadd! tagbar - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Gtags-Cscope -if executable('global') - silent! packadd! gen_tags.vim - - let GtagsCscope_Ignore_Case = 1 - let GtagsCscope_Absolute_Path = 1 - let GtagsCscope_Keep_Alive = 1 - let GtagsCscope_Auto_Load = 1 - let GtagsCscope_Quiet = 1 - set csprg=gtags-cscope - set cscopetag -endif - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Async shell commands -"silent! packadd! asyncrun.vim -let g:asyncrun_open = 8 -let g:asyncrun_status = "" -let g:asyncrun_auto = "make" -command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ -command! -bang -nargs=* -complete=file Grep AsyncRun -program=grep @ - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Error markers -"silent! packadd! errormarker.vim - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Meson build system -"silent! packadd! mesonic - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Snippets -if executable('python') -"silent! packadd! ultisnips -else -"silent! packadd! vim-snipmate -"silent! packadd! vim-snippets -"silent! packadd! tlib_vim -"silent! packadd! vim-addon-mw-utils -endif - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Jedi (python) -"silent! packadd! jedi-vim -"let g:polyglot_disabled = ['python'] -"let python_highlight_all = 1 - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" completor (python) -"silent! packadd! completor.vim -"let g:completor_clang_binary = '/usr/bin/clang' - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" validator (python) -"silent! packadd! validator.vim -"let g:completor_clang_tidy_binary = '/usr/bin/run-clang-tidy' -"let g:validator_c_checkers = ['clang-tidy'] -"let g:validator_cpp_checkers = ['clang-tidy'] - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" markdown -"silent! packadd! vim-pandoc -"silent! packadd! vim-pandoc-syntax -"silent! packadd! vim-javascript -"silent! packadd! vim-markdown -"silent! packadd! vim-markdown -silent! packadd! open-browser.vim -silent! packadd! previm -let g:previm_enable_realtime = 1 -nnoremap md :PrevimOpen -nnoremap pd :call Pandoc_Preview() - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" deoplete -set pyx=3 -set pyxversion=3 -set encoding=utf-8 -let g:deoplete#enable_at_startup = 1 - -silent! helptags ALL - -" local settings -if filereadable(expand('~/.vim/vimrc.local')) - source ~/.vim/vimrc.local -endif -- 2.43.0