Files
dotfiles/dotfiles/vim/vimrc
2020-06-15 15:24:06 +02:00

137 lines
3.8 KiB
VimL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
let mapleader = "\<Space>"
" ------------------------------------- Vundle Setup ---------------------------
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive' " Git wrapper
Plugin 'tmsvg/pear-tree' " parathesis matching
" Markdown
Plugin 'vimwiki/vimwiki'
Plugin 'dhruvasagar/vim-table-mode' " manage markdown tables
" fzf
if executable("fzf")
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
endif
" Colors
Plugin 'arcticicestudio/nord-vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
call vundle#end()
filetype plugin indent on
" ------------------------------------- Plugin Settings ------------------------
" PearTree
let g:pear_tree_smart_openers=1
let g:pear_tree_smart_closers=1
let g:pear_tree_smart_backspace=1
let g:pear_tree_pairs = {
\ '(': {'closer': ')'},
\ '[': {'closer': ']'},
\ '{': {'closer': '}'},
\ "'": {'closer': "'"},
\ '"': {'closer': '"'},
\ '<': {'closer': '>'}
\ }
" Vimwiki
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
" Airline
let g:airline_theme='nord'
let g:airline_powerline_fonts = 1
let g:bufferline_echo = 0
set guifont="InconsolataLGC Nerd Font Mono"
" fzf
nmap <C-f> :Files<CR>
" ------------------------------------- Colors ---------------------------------
syntax on
colorscheme nord
set colorcolumn=81
filetype indent plugin on
" ------------------------------------- General --------------------------------
set number
" :highlight LineNr ctermfg=white "color
set showmatch " Highlights paranthesis
set mat=5
set noswapfile
set confirm " can't quit without saving
set noshowmode " don't show mode in status
set noshowcmd " don't show command in status
set cursorline " highlight cursorline
set encoding=utf-8
set mouse=a
set mouse=c
set undolevels=1337
set backspace=indent,eol,start
set wildmenu " autocomplete :e
"set lazyredraw " redraw only when necessary
" ------------------------------------- Indents & Whitespaces ------------------
set tabstop=4 " how many spaces are a tab when opening a file
set softtabstop=4 " how many spaces get placed instead of a tab
set expandtab " tabs are spaces
set smartindent
" File specific indents
autocmd FileType rust setlocal tabstop=4 softtabstop=4 expandtab
autocmd FileType perl setlocal tabstop=8 softtabstop=8 noexpandtab
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 expandtab
set list
set listchars=tab:»\ ,extends:,precedes:,nbsp,trail
" ------------------------------------- Search ---------------------------------
set incsearch
set ignorecase
set smartcase " case sensitive with capital letters
set hlsearch " highlight all results
nnoremap<leader><space> :nohlsearch<CR>
" ------------------------------------- Cursor ---------------------------------
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"
" ------------------------------------- Folding --------------------------------
set foldenable
set foldlevelstart=30 " open folds at start
set foldnestmax=30
set foldmethod=indent
" ------------------------------------- netrw ----------------------------------
nmap <C-e> :Ex <CR>
let g:netrw_winsize = 25
let g:netrw_liststyle = 3 " Tree-like structure
let g:netrw_banner = 0 " Remove useless banner at the top of netrw
" ------------------------------------- Macros & Mappings ----------------------
cmap Wq wq
cmap Q q
cmap W w
cmap q1 q!
" Return to last edited line
if has("autocmd")
au BufReadPost * if line("' f\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" ------------------------------------- Pandoc ---------------------------------
nmap <leader>c :w! \| !~/scripts/pandoc-comp <c-r>%<CR><CR>
nmap <leader>o :!~/scripts/open-pdf <c-r>%<CR><CR>