dotvim/init.vim
2018-10-28 18:23:18 +01:00

155 lines
4.1 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.

""
"" Environment
""
" Vim environment
let cache = $XDG_CACHE_HOME .'/nvim'
let config = $XDG_CONFIG_HOME.'/nvim'
let plugins = cache.'/plugins'
let &directory = cache.',~/,/tmp'
let &backupdir = cache.',~/,/tmp'
let &viminfo = cache.'/info'
" Ctags data
let &tags = cache.'/tags'
" Keep history
let &undodir = cache.'/undo'
set undofile
""
"" Plugins
""
let &rtp .= ','.plugins.'/Vundle.vim'
call vundle#begin(plugins)
Plugin 'VundleVim/Vundle.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'itchyny/lightline.vim'
Plugin 'townk/vim-autoclose'
Plugin 'tpope/vim-fugitive'
Plugin 'travitch/hasksyn'
Plugin 'vim-pandoc/vim-pandoc-syntax'
Plugin 'LnL7/vim-nix'
Plugin 'kchmck/vim-coffee-script'
Plugin 'ngn/vim-apl'
Plugin 'hdima/python-syntax'
Plugin 'ervandew/supertab'
Plugin 'majutsushi/tagbar'
Plugin 'scrooloose/syntastic'
Plugin 'airblade/vim-gitgutter'
Plugin 'mbbill/undotree'
call vundle#end()
""
"" Options
""
set hidden " Hide buffers
set incsearch " Incremental search
set mouse=a " Enable mouse support
set ignorecase " Case insensitive search...
set smartcase " ...for lowercase terms
set showcmd " Show command while writing it
set ruler " Show line/column position
set nowrap " Disable line wrap
set novb " Disable visual beep
set nofoldenable " Disable folding
set nobackup " Disable ~backup
set noswapfile " Disable swap files
set writebackup " Enable temp backups
set nomodeline " Security
set tabpagemax=10 " Limit number of tabs to 10
set showmatch " Highlight matched parenthesis
set ffs=unix " Use UNIX file format
set clipboard=unnamedplus " Clipboard integration
set wildignore+=*/tmp/*,*.so,*.swp " Files to ignore
set shiftwidth=2 " Tab
set tabstop=2 "
set expandtab "
set number " Line numbering
set smartindent " Indentation
set noshowmode "
set shell=sh " Needs a POSIX shell
syntax on " Syntax highlighting
runtime colors.vim " Load color scheme
filetype indent plugin on " Identify file type
" Titlebar without “-VIM”
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
" change cursor style
autocmd VimLeave * set guicursor=a:hor20-blinkon20
" use pandoc markdown syntax
augroup pandoc_syntax
au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc
augroup END
""
"" Key bindings
""
let mapleader=","
" Windows navigation
map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>
" Plugins
map <Leader>t :TagbarToggle<CR>
map <Leader>u :UndotreeToggle<CR>
" Misc
inoremap jj <ESC>
""
"" Plugin options
""
" Lightline
runtime lightline.vim
" Syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_enable_signs = 1
let g:syntastic_auto_jump = 0
let g:syntastic_shell = "/bin/sh"
let g:syntastic_python_checkers = ["flake8"]
let g:syntastic_python_python_exe = 'python3'
" Tagbar
let g:tagbar_status_func = "TagbarStatusFunc"
let g:tagbar_compact = 1
let g:tagbar_iconchars = [">", ""]
" MiniBufferExplorer
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
" CtrlP
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_follow_symlinks = 1
let g:ctrlp_custom_ignore = {"dir": "\v[\/]\.(git|hg|svn|ve)$"}
let g:ctrlp_status_func = {"main": "CtrlPStatusMain",
\"prog": "CtrlPStatusProg"}
" Pandoc Markdown
let g:pandoc#syntax#conceal#use = 0