2024-01-30 07:41:31 +01:00
|
|
|
packadd termdebug
|
|
|
|
|
|
|
|
|
2023-08-19 11:12:22 +02:00
|
|
|
set nocompatible
|
|
|
|
|
2024-01-18 21:23:17 +01:00
|
|
|
" mouse support
|
|
|
|
set mouse=
|
2023-08-19 11:12:22 +02:00
|
|
|
|
2024-01-18 21:23:17 +01:00
|
|
|
" real backspace, please
|
|
|
|
set backspace=indent,eol,start
|
2023-08-19 11:12:22 +02:00
|
|
|
|
2024-01-18 22:04:58 +01:00
|
|
|
" disable welcome screen
|
|
|
|
set shm+=I
|
|
|
|
|
2024-01-18 21:23:17 +01:00
|
|
|
" don't complain about $( )
|
|
|
|
let g:is_posix=1
|
2023-12-31 21:59:50 +01:00
|
|
|
|
2024-01-21 21:52:18 +01:00
|
|
|
set number
|
2024-01-18 21:23:17 +01:00
|
|
|
set cursorline
|
2024-01-21 21:52:18 +01:00
|
|
|
|
|
|
|
"set cursorline
|
2024-01-18 21:23:17 +01:00
|
|
|
set scrolloff=3
|
|
|
|
set spelllang=de,en
|
2024-01-21 21:52:18 +01:00
|
|
|
|
2024-01-18 21:23:17 +01:00
|
|
|
syntax on
|
|
|
|
filetype plugin on
|
|
|
|
set omnifunc=syntaxcomplete#Complete
|
2023-08-19 11:12:22 +02:00
|
|
|
|
2024-01-21 21:52:18 +01:00
|
|
|
" colors
|
|
|
|
set t_Co=257
|
|
|
|
set background=dark
|
|
|
|
colorscheme candle-grey-transparent
|
|
|
|
hi CursorLineNr ctermbg=NONE ctermfg=30 cterm=NONE
|
|
|
|
hi CursorLine ctermbg=NONE ctermfg=NONE cterm=NONE
|
|
|
|
|
2023-08-19 11:12:22 +02:00
|
|
|
" SEARCH
|
|
|
|
set hlsearch
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
|
|
|
|
" SPACES (TABS)
|
|
|
|
set tabstop=8
|
|
|
|
set shiftwidth=4
|
|
|
|
let &softtabstop=&shiftwidth
|
|
|
|
|
|
|
|
set expandtab
|
|
|
|
set smarttab
|
|
|
|
|
|
|
|
set textwidth=72
|
2023-10-15 21:29:44 +02:00
|
|
|
" set colorcolumn=72
|
2023-12-08 18:02:01 +01:00
|
|
|
set formatprg=par\ -w72q
|
2023-08-19 11:12:22 +02:00
|
|
|
|
|
|
|
set list
|
2023-12-12 08:39:33 +01:00
|
|
|
set listchars=tab:>_,trail:>
|
2023-08-19 11:12:22 +02:00
|
|
|
set fillchars=vert:\|,eob:\
|
|
|
|
|
2024-02-01 07:56:35 +01:00
|
|
|
" disable annoances
|
|
|
|
set noshowcmd
|
|
|
|
set noshowmode
|
|
|
|
let html_no_rendering=1
|
|
|
|
|
2024-01-31 14:10:49 +01:00
|
|
|
|
|
|
|
let g:currentmode={
|
|
|
|
\ 'n' : 'NORMAL',
|
|
|
|
\ 'v' : 'VISUAL',
|
|
|
|
\ 'V' : 'V·Line',
|
|
|
|
\ '^V' : 'V·Block',
|
|
|
|
\ 'i' : 'INSERT',
|
|
|
|
\ 'R' : 'R',
|
|
|
|
\ 'Rv' : 'V·Replace',
|
|
|
|
\ 'c' : 'Command',
|
|
|
|
\}
|
|
|
|
|
2024-02-01 07:56:35 +01:00
|
|
|
set statusline=%#Comment#
|
|
|
|
set statusline+=[%{toupper(g:currentmode[mode()])}]
|
2024-01-31 14:10:49 +01:00
|
|
|
set statusline+=\ [%f]
|
|
|
|
set statusline+=%m%r%h%w%q
|
|
|
|
set statusline+=%=
|
|
|
|
set statusline+=\ [BUF:%n]
|
|
|
|
set statusline+=\ [%{&fileencoding?&fileencoding:&encoding}]
|
|
|
|
set statusline+=\ [%{&fileformat}]
|
|
|
|
set statusline+=\ [CHAR:%b/0x%B]
|
|
|
|
set statusline+=\ [ROW:%l\ COL:%c]
|
|
|
|
set statusline+=\ [%p%%]
|
|
|
|
|
2024-02-01 07:56:35 +01:00
|
|
|
set laststatus=2
|
|
|
|
|
2024-01-21 21:52:18 +01:00
|
|
|
" " autocomplete
|
|
|
|
" set wildmenu
|
|
|
|
" set wildmode=longest:full,full
|
|
|
|
"
|
|
|
|
" function! CleverTab()
|
|
|
|
" if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
|
|
|
|
" return "\<Tab>"
|
|
|
|
" else
|
|
|
|
" return "\<C-N>"
|
|
|
|
" endif
|
|
|
|
" endfunction
|
|
|
|
" inoremap <tab> <C-R>=CleverTab()<CR>
|
2024-01-19 22:17:16 +01:00
|
|
|
|
2024-01-18 21:23:17 +01:00
|
|
|
function! s:build_quickfix_list(lines)
|
|
|
|
call setqflist(map(copy(a:lines), '{ "filename": v:val, "lnum": 1 }'))
|
|
|
|
copen
|
|
|
|
cc
|
|
|
|
endfunction
|
|
|
|
|
2024-01-21 21:52:18 +01:00
|
|
|
let g:fzf_layout = { 'down': '60%' }
|
2024-01-19 22:17:16 +01:00
|
|
|
nnoremap <c-o> :Files<CR>
|
2024-01-18 22:04:58 +01:00
|
|
|
nnoremap <c-b> :Buffers<CR>
|
2024-01-18 21:23:17 +01:00
|
|
|
|
|
|
|
let g:fzf_action = {
|
|
|
|
\ 'ctrl-t': 'tab split',
|
2024-01-19 22:17:16 +01:00
|
|
|
\ 'ctrl-x': 'vsplit' }
|
|
|
|
|
|
|
|
let g:fzf_vim = {}
|
2024-01-19 23:46:43 +01:00
|
|
|
let g:fzf_vim.tags_command = 'ksh -ic mktags'
|
2024-01-19 22:17:16 +01:00
|
|
|
|
2024-01-21 21:52:18 +01:00
|
|
|
command! MyFiles call fzf#run(fzf#wrap({
|
|
|
|
\ 'source': 'list-myfiles',
|
|
|
|
\ 'sink': 'edit',
|
|
|
|
\ 'options': ['--multi', '--pointer', '→', '--marker', '♡', '--preview', 'cat {}']
|
|
|
|
\ }))
|
|
|
|
|
2024-01-19 22:17:16 +01:00
|
|
|
let g:mapleader = ","
|
|
|
|
nnoremap <leader>f :Files<CR>
|
2024-01-21 21:52:18 +01:00
|
|
|
nnoremap <leader>b :Buffers<CR>
|
2024-01-19 22:17:16 +01:00
|
|
|
nnoremap <leader>l :Lines<CR>
|
|
|
|
nnoremap <leader>t :Tags<CR>
|
2024-01-21 21:52:18 +01:00
|
|
|
nnoremap <leader>m :MyFiles<CR>
|
|
|
|
nnoremap <leader>h :History<CR>
|
2024-01-19 22:17:16 +01:00
|
|
|
|
|
|
|
let g:tagbar_ctags_bin = "ectags"
|
|
|
|
noremap <leader>tt :TagbarToggle<CR>
|
|
|
|
|
|
|
|
" TAGS FILE
|
2024-01-19 23:46:43 +01:00
|
|
|
set tags=./tags;/
|
2024-01-19 22:17:16 +01:00
|
|
|
"nnoremap gt :cs find 1 <C-R>=expand("<cword>")<CR><CR>
|
|
|
|
"nnoremap gs :cs find 4 <C-R>=expand("<cword>")<CR><CR>
|
2024-01-24 08:07:09 +01:00
|
|
|
nnoremap gb <c-o>
|
2024-01-19 22:17:16 +01:00
|
|
|
"nnoremap gh :FSHere<CR>
|
2024-01-24 08:27:45 +01:00
|
|
|
nnoremap gs :call Cscope('0', expand('<cword>'), 0)<CR>
|
|
|
|
nnoremap gc :call Cscope('3', expand('<cword>'), 0)<CR>
|
|
|
|
nnoremap ge :call Cscope('6', expand('<cword>'), 0)<CR>
|
|
|
|
|
2024-01-19 22:17:16 +01:00
|
|
|
|
|
|
|
let g:fzf_tags_prompt = "Gd "
|
|
|
|
noreabbrev <expr> ts getcmdtype() == ":" && getcmdline() == 'ts' ? 'FZFTselect' : 'ts'
|
|
|
|
nmap gt <Plug>(fzf_tags)
|
|
|
|
|
|
|
|
let g:autotagTagsFile = ".tags"
|
|
|
|
let g:autotagCtagsCmd = "ectags"
|
2024-01-18 21:23:17 +01:00
|
|
|
|
|
|
|
|
2024-01-30 07:41:31 +01:00
|
|
|
let g:termdebugger = "egdb"
|
|
|
|
|
2024-01-18 21:23:17 +01:00
|
|
|
" HIGHLIGHT SPECIAL WORDS
|
|
|
|
match ErrorMsg '\(TODO:\|FIXME\|XXX\|workaround\|WTF\|: error:.*\|\s\+$\| \+\ze\t\)'
|
|
|
|
|
|
|
|
" DIFF
|
|
|
|
set formatoptions=crolj
|
2023-08-19 11:12:22 +02:00
|
|
|
|
2024-01-31 08:01:52 +01:00
|
|
|
" VIMDIFF COLORS
|
|
|
|
hi DiffAdd ctermbg=22 ctermfg=NONE cterm=NONE
|
|
|
|
hi DiffDelete ctermbg=234 ctermfg=NONE cterm=NONE
|
|
|
|
hi DiffChange ctermbg=236 ctermfg=NONE cterm=NONE
|
|
|
|
hi DiffText ctermbg=red ctermfg=NONE cterm=NONE
|
|
|
|
|
|
|
|
" SPLIT AND FOLD COLORS
|
|
|
|
hi VertSplit ctermbg=NONE ctermfg=246 cterm=NONE
|
|
|
|
hi FoldColumn ctermbg=NONE ctermfg=251 cterm=NONE
|
|
|
|
hi Folded ctermbg=233 ctermfg=251 cterm=NONE
|
|
|
|
|
|
|
|
" SPELL COLOR
|
|
|
|
hi SpellBad ctermbg=NONE ctermfg=124
|
|
|
|
|
2023-08-19 11:12:22 +02:00
|
|
|
" TEMPORARY FILES
|
|
|
|
set undofile
|
|
|
|
set undodir=~/.local/vim/undo//
|
|
|
|
set backup
|
|
|
|
set backupcopy=yes
|
|
|
|
set backupdir=~/.local/vim/backup//
|
|
|
|
set directory=~/.local/vim/swapfiles//
|
|
|
|
silent execute '!mkdir -p ~/.local/vim/backup ~/.local/vim/undo ~/.local/vim/swapfiles'
|
|
|
|
|
2024-01-19 22:17:16 +01:00
|
|
|
|
|
|
|
" PLUGIN: EASY ALIGN
|
|
|
|
xmap ga <Plug>(EasyAlign)
|
|
|
|
nmap ga <Plug>(EasyAlign)
|
|
|
|
|
2024-01-24 08:27:45 +01:00
|
|
|
function! LoadCscope()
|
|
|
|
let db = findfile("cscope.out", ".;")
|
|
|
|
if (!empty(db))
|
|
|
|
let path = strpart(db, 0, match(db, "/cscope.out$"))
|
|
|
|
set nocscopeverbose " suppress 'duplicate connection' error
|
|
|
|
exe "cs add " . db . " " . path
|
|
|
|
set cscopeverbose
|
|
|
|
" else add the database pointed to by environment variable
|
|
|
|
elseif $CSCOPE_DB != ""
|
|
|
|
cs add $CSCOPE_DB
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2023-08-19 11:12:22 +02:00
|
|
|
augroup mystuff
|
|
|
|
au!
|
2024-01-24 08:30:44 +01:00
|
|
|
au BufEnter * call LoadCscope()
|
2023-10-30 20:13:00 +01:00
|
|
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
|
2023-08-19 11:12:22 +02:00
|
|
|
au BufRead,BufNewFile *.h,*.c set filetype=c.doxygen
|
|
|
|
au BufRead,BufNewFile Makefile,/usr/src/*.c,/usr/src/*.h,*.gmk setl sw=8 sts=8 noet
|
|
|
|
au BufWritePost vimrc so ~/.vim/vimrc
|
|
|
|
augroup end
|
2024-01-18 21:23:17 +01:00
|
|
|
|