dotvim/init.vim

166 lines
4.1 KiB
VimL
Raw Normal View History

2015-10-10 15:34:29 +02:00
""
"" Environment
""
2015-10-10 19:38:14 +02:00
" Vim environment
2018-11-10 17:20:21 +01:00
let data = $XDG_DATA_HOME.'/nvim'
2016-04-13 21:39:52 +02:00
let config = $XDG_CONFIG_HOME.'/nvim'
2018-11-10 17:20:21 +01:00
let cache = $XDG_CACHE_HOME .'/nvim'
let plugins = data.'/plugins'
2016-04-13 21:39:52 +02:00
let &directory = cache.',~/,/tmp'
let &backupdir = cache.',~/,/tmp'
let &viminfo = cache.'/info'
2015-10-10 15:34:29 +02:00
2015-10-10 19:38:14 +02:00
" Ctags data
2016-04-13 21:39:52 +02:00
let &tags = cache.'/tags'
2015-10-10 17:23:21 +02:00
2015-10-10 19:38:14 +02:00
" Keep history
2016-04-13 21:39:52 +02:00
let &undodir = cache.'/undo'
2015-10-10 17:23:21 +02:00
set undofile
2013-11-22 18:20:32 +01:00
2015-10-11 14:52:54 +02:00
""
"" Plugins
""
2018-11-10 17:20:21 +01:00
call plug#begin(plugins)
" UI
Plug 'kien/ctrlp.vim'
Plug 'itchyny/lightline.vim'
Plug 'airblade/vim-gitgutter'
Plug 'majutsushi/tagbar', { 'on' : 'TagbarToggle' }
Plug 'mbbill/undotree', { 'on' : 'UndotreeToggle' }
Plug 'milkypostman/vim-togglelist'
" Syntax
Plug 'travitch/hasksyn'
Plug 'LnL7/vim-nix'
Plug 'ngn/vim-apl'
Plug 'vim-pandoc/vim-pandoc-syntax'
Plug 'kchmck/vim-coffee-script'
Plug 'hdima/python-syntax'
" Misc
Plug 'townk/vim-autoclose'
Plug 'tpope/vim-fugitive'
Plug 'ervandew/supertab'
Plug 'neomake/neomake'
call plug#end()
2015-10-11 14:52:54 +02:00
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:36:28 +02:00
"" Options
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:36:28 +02:00
set hidden " Hide buffers
set incsearch " Incremental search
2017-05-04 21:13:45 +02:00
set mouse=a " Enable mouse support
2015-10-10 15:34:29 +02:00
2015-10-10 17:36:28 +02:00
set ignorecase " Case insensitive search...
set smartcase " ...for lowercase terms
set showcmd " Show command while writing it
set ruler " Show line/column position
2016-01-17 16:04:28 +01:00
set nowrap " Disable line wrap
2015-10-11 13:55:15 +02:00
set novb " Disable visual beep
2015-10-11 15:05:33 +02:00
set nofoldenable " Disable folding
2015-10-10 17:36:28 +02:00
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
2016-04-13 21:39:52 +02:00
set clipboard=unnamedplus " Clipboard integration
2015-10-10 17:36:28 +02:00
set wildignore+=*/tmp/*,*.so,*.swp " Files to ignore
2015-10-12 00:09:54 +02:00
set shiftwidth=2 " Tab
set tabstop=2 "
set expandtab "
2015-10-10 17:36:28 +02:00
set number " Line numbering
2016-04-13 21:39:52 +02:00
set smartindent " Indentation
2015-10-10 17:36:28 +02:00
set noshowmode "
2018-06-01 22:56:45 +02:00
set shell=sh " Needs a POSIX shell
2015-10-10 19:38:14 +02:00
syntax on " Syntax highlighting
2016-04-13 21:39:52 +02:00
runtime colors.vim " Load color scheme
filetype indent plugin on " Identify file type
2015-10-10 17:36:28 +02:00
2015-10-10 19:38:14 +02:00
" Titlebar without “-VIM”
2015-10-10 17:36:28 +02:00
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
2015-10-10 15:34:29 +02:00
2018-07-29 17:35:57 +02:00
" change cursor style
2017-05-04 21:13:45 +02:00
autocmd VimLeave * set guicursor=a:hor20-blinkon20
2018-07-29 17:34:33 +02:00
" use pandoc markdown syntax
augroup pandoc_syntax
au! BufNewFile,BufFilePre,BufRead *.md set filetype=markdown.pandoc
augroup END
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:36:28 +02:00
"" Key bindings
2013-11-22 18:20:32 +01:00
""
2015-10-11 14:52:54 +02:00
let mapleader=","
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" 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>
2013-11-22 18:20:32 +01:00
2018-10-28 18:23:18 +01:00
" Plugins
2015-10-11 14:52:54 +02:00
map <Leader>t :TagbarToggle<CR>
2018-10-28 18:23:18 +01:00
map <Leader>u :UndotreeToggle<CR>
" Misc
2015-10-11 14:52:54 +02:00
inoremap jj <ESC>
2018-10-28 19:05:44 +01:00
noremap o o<ESC>
noremap O O<ESC>
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:23:21 +02:00
"" Plugin options
2013-11-22 18:20:32 +01:00
""
2015-10-10 17:23:21 +02:00
" Lightline
2016-04-13 21:39:52 +02:00
runtime lightline.vim
2013-11-22 18:20:32 +01:00
2018-11-10 17:20:21 +01:00
" Neomake
call neomake#configure#automake('nwr', 750)
let g:neomake_warning_sign = {
\ 'text': 'W→',
\ 'texthl': 'WarningMsg',
\ }
let g:neomake_error_sign = {
\ 'text': 'E→',
\ 'texthl': 'ErrorMsg',
\ }
let g:neomake_highlight_lines = 1
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" Tagbar
let g:tagbar_status_func = "TagbarStatusFunc"
2015-10-10 19:38:14 +02:00
let g:tagbar_compact = 1
let g:tagbar_iconchars = [">", ""]
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" MiniBufferExplorer
2015-10-10 19:38:14 +02:00
let g:miniBufExplMapWindowNavVim = 1
2015-10-10 17:23:21 +02:00
let g:miniBufExplMapWindowNavArrows = 1
2015-10-10 19:38:14 +02:00
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
2013-11-22 18:20:32 +01:00
2015-10-10 17:23:21 +02:00
" CtrlP
2015-10-10 19:38:14 +02:00
let g:ctrlp_clear_cache_on_exit = 0
2018-04-24 19:13:56 +02:00
let g:ctrlp_follow_symlinks = 1
2015-10-10 17:23:21 +02:00
let g:ctrlp_custom_ignore = {"dir": "\v[\/]\.(git|hg|svn|ve)$"}
2015-10-10 19:38:14 +02:00
let g:ctrlp_status_func = {"main": "CtrlPStatusMain",
\"prog": "CtrlPStatusProg"}
2018-07-29 17:43:26 +02:00
" Pandoc Markdown
let g:pandoc#syntax#conceal#use = 0