Files
dotfiles/.vimrc

167 lines
4.2 KiB
VimL
Raw Normal View History

2021-03-23 21:31:28 +01:00
" general configuration:
2023-05-24 15:32:23 +02:00
syntax on " Turn on colors filetype plugin on " Enables the ftplugin options filetype indent on
2021-04-19 22:34:32 +02:00
set nocompatible " turn off vi-compatibility (should be on by default)
2021-03-23 21:31:28 +01:00
set autoindent " Automaticaly indent while writing
set smarttab
set number
set incsearch
set hlsearch
set nosmartindent
set showcmd
set scrolloff=8
set enc=utf-8
set wrapscan " start searching at the beginning when EOF reached
" simple appending closing characters automatically
inoremap { {}<Left>
inoremap {<CR> {<CR><CR>}<Up>
inoremap {{ {
inoremap {} {}
inoremap <expr>} strpart(getline('.'), col('.')-1, 1) == "}" ? "\<Right>" : "}"
inoremap ( ()<Left>
inoremap (( (
inoremap () ()
" skipping over the closing character:
inoremap <expr>) strpart(getline('.'), col('.')-1, 1) == ")" ? "\<Right>" : ")"
inoremap [ []<Left>
inoremap [[ [
inoremap [] []
inoremap <expr>] strpart(getline('.'), col('.')-1, 1) == "]" ? "\<Right>" : "]"
inoremap < <><Left>
inoremap << <
inoremap <expr>> strpart(getline('.'), col('.')-1, 1) == ">" ? "\<Right>" : ">"
"inoremap " ""<Left>
"inoremap ' ''<Left>
" Tab navigation
nmap <C-t> :tabnew<CR>
2023-05-05 21:02:20 +02:00
nmap <C-h> :tabprev<CR>
nmap <C-l> :tabnext<CR>
2023-07-20 10:05:28 +02:00
" Resize windows with arrow keys
nmap <Up> :res -1<CR>
nmap <Down> :res +1<CR>
nmap <Left> :vertical res -1<CR>
nmap <Right> :vertical res +1<CR>
2021-03-23 21:31:28 +01:00
" redefine some default colors
highlight Search ctermfg=Black
highlight Comment ctermfg=012
"
" plugins
" =======
" Use vim-plug as plugin manager
" Autoinstall it when missing:
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Plugin config section. Plugins will be installed under ~/.vim/plugged/
call plug#begin()
" Ansible syntax highlighting
Plug 'pearofducks/ansible-vim'
" NERDtree
Plug 'preservim/nerdtree'
2023-07-11 10:44:52 +02:00
" One NERDtree for all tabs
Plug 'jistr/vim-nerdtree-tabs'
" Git plugin for NERDtree
Plug 'Xuyuanp/nerdtree-git-plugin'
" Statusline
Plug 'vim-airline/vim-airline'
2023-06-01 09:41:09 +02:00
" fugitive (git plugin, mainly for statusline)
Plug 'tpope/vim-fugitive'
" Git diff in sign column
Plug 'airblade/vim-gitgutter'
" Show commit messages under cursor with :GitMessenger or <leader>gm
Plug 'rhysd/git-messenger.vim'
" Latex plugin
Plug 'lervag/vimtex'
2023-05-05 12:30:51 +02:00
" Python-mode
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
2023-05-17 09:57:55 +02:00
" Latex-Suite
Plug 'vim-latex/vim-latex'
2023-05-24 15:32:23 +02:00
" tagalong
" to automatically edit closing HTML tags
" tag names should be changed either in insert mode or via 'cw'
Plug 'AndrewRadev/tagalong.vim'
2023-05-24 15:53:12 +02:00
" vim-css-color
Plug 'ap/vim-css-color'
2023-07-03 09:00:31 +02:00
" Format code with one button press
Plug 'vim-autoformat/vim-autoformat'
" for HTML formatting install tidy package
2023-07-17 13:04:18 +02:00
" Comment stuff out: one line with `gcc`, selection with `gc`
Plug 'tpope/vim-commentary'
2023-10-19 11:35:35 +02:00
" Show python coverage, needs coverage.py installed (globally)
" use with `:Coveragepy report` or `:Coveragepy show`
Plug 'alfredodeza/coveragepy.vim'
call plug#end()
2023-10-26 12:50:57 +02:00
" Set alias command for toggeling nerd tree
command NT NERDTreeTabsToggle
2021-03-23 21:31:28 +01:00
" special configuration:
" Python
2023-05-05 12:30:51 +02:00
" ======
"
" python-mode configuration (see :help pymode)
let g:pymode_options_max_line_length = 120
2021-03-23 21:31:28 +01:00
"let g:pydiction_location = '~/.vim/pydiction-1.2/complete-dict'
2023-05-17 09:57:55 +02:00
" vim-gitgutter
" =============
"
let g:gitgutter_sign_added = '▇▇'
let g:gitgutter_sign_modified = '▇▇'
let g:gitgutter_sign_removed = '▇▇'
2023-06-08 10:44:08 +02:00
highlight GitGutterAdd ctermfg = 2
2023-05-17 09:57:55 +02:00
highlight GitGutterChange ctermfg = 3
highlight GitGutterDelete ctermfg = 1
highlight SignColumn ctermbg=0
2021-03-23 21:31:28 +01:00
" Vala
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
" Disable valadoc syntax highlight
"let vala_ignore_valadoc = 1
" Enable comment strings
let vala_comment_strings = 1
" Highlight space errors
let vala_space_errors = 1
" Disable trailing space errors
"let vala_no_trail_space_error = 1
" Disable space-tab-space errors
"let vala_no_tab_space_error = 1
" Minimum lines used for comment syncing (default 50)
"let vala_minlines = 120
" ANTLR4 syntax highlighting
au BufRead,BufNewFile *.g4 set filetype=antlr4