2019-07-28 02:39:47 +02:00
|
|
|
" Basic configuraion {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Don't try to be compatible with Vi
|
|
|
|
set nocompatible
|
|
|
|
" Use UTF-8
|
2019-07-14 02:04:31 +02:00
|
|
|
set encoding=utf-8
|
|
|
|
set fileencodings=utf-8
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-17 10:20:07 +02:00
|
|
|
" Allow unsaved buffers when switching windows
|
|
|
|
set hidden
|
|
|
|
|
|
|
|
" Allow command completion in command-line
|
|
|
|
set wildmenu
|
|
|
|
|
|
|
|
" Enable syntax high-lighting and file-type specific plugins
|
|
|
|
syntax on
|
|
|
|
filetype plugin indent on
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-17 10:20:07 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Indentation configuration {{{
|
2019-07-17 10:20:07 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2019-07-11 23:21:11 +02:00
|
|
|
" Use space by default
|
|
|
|
set expandtab
|
|
|
|
" Indent and align to 4 spaces by default
|
|
|
|
set shiftwidth=4
|
2019-11-25 10:58:00 +01:00
|
|
|
" -1 means the same as shiftwidth
|
2019-07-11 23:21:11 +02:00
|
|
|
set softtabstop=-1
|
2019-07-13 00:58:16 +02:00
|
|
|
" Always indent by multiples of shiftwidth
|
|
|
|
set shiftround
|
2019-07-11 23:21:11 +02:00
|
|
|
" You shouldn't change the default tab width of 8 characters
|
|
|
|
set tabstop=8
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Plugins {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Install with :PlugInstall
|
|
|
|
|
|
|
|
" FIXME: At some point I'll need to switch over to the native Vim 8.0 package
|
|
|
|
" feature. Either via manual git subtree management, or maybe through minpac?
|
|
|
|
"
|
|
|
|
" Install vim-plug if we don't already have it
|
|
|
|
" Credit to github.com/captbaritone
|
|
|
|
if empty(glob("~/.vim/autoload/plug.vim"))
|
|
|
|
" Ensure all needed directories exist (Thanks @kapadiamush)
|
|
|
|
execute '!mkdir -p ~/.vim/plugged'
|
|
|
|
execute '!mkdir -p ~/.vim/autoload'
|
|
|
|
" Download the actual plugin manager
|
|
|
|
execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
|
|
|
|
endif
|
|
|
|
|
|
|
|
call plug#begin('~/.vim/plugged')
|
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Theming {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""
|
|
|
|
" Nice dark theme
|
|
|
|
Plug 'nanotech/jellybeans.vim'
|
|
|
|
" Another nice dark theme
|
|
|
|
Plug 'morhetz/gruvbox'
|
2020-05-03 15:32:05 +02:00
|
|
|
" Simpler gruvbox
|
|
|
|
Plug 'lifepillar/vim-gruvbox8'
|
2019-11-25 10:49:36 +01:00
|
|
|
" Yet another nice dark theme
|
|
|
|
Plug 'jonathanfilip/vim-lucius'
|
|
|
|
" More dark colorschemes
|
|
|
|
Plug 'joshdick/onedark.vim'
|
|
|
|
" And even more
|
|
|
|
Plug 'rakr/vim-one'
|
|
|
|
" And another one
|
|
|
|
Plug 'junegunn/seoul256.vim'
|
2019-07-11 23:21:11 +02:00
|
|
|
" Fancy status bar
|
2019-10-05 21:26:36 +02:00
|
|
|
Plug 'itchyny/lightline.vim'
|
2020-04-21 20:00:48 +02:00
|
|
|
" Simplistic dark theme
|
|
|
|
Plug 'axvr/photon.vim'
|
2020-05-03 15:32:05 +02:00
|
|
|
" Another dark theme
|
|
|
|
Plug 'haishanh/night-owl.vim'
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Minimum viable vim config {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""
|
|
|
|
" Basic default vimrc file
|
|
|
|
Plug 'tpope/vim-sensible'
|
|
|
|
" High-light trailing whitespace
|
|
|
|
Plug 'ntpeters/vim-better-whitespace'
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-10-11 17:34:39 +02:00
|
|
|
" Program/language specific {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""
|
|
|
|
" Pandoc syntax file
|
|
|
|
Plug 'vim-pandoc/vim-pandoc-syntax'
|
|
|
|
" Pandoc commands
|
|
|
|
Plug 'vim-pandoc/vim-pandoc'
|
|
|
|
" A sane git syntax file
|
|
|
|
Plug 'tpope/vim-git'
|
|
|
|
" An awesome git wrapper
|
|
|
|
Plug 'tpope/vim-fugitive'
|
2019-10-12 13:29:38 +02:00
|
|
|
" Show git messages in preview window
|
|
|
|
Plug 'rhysd/git-messenger.vim'
|
2019-07-13 23:04:44 +02:00
|
|
|
" Pre-written functions for fzf mappings
|
|
|
|
Plug 'junegunn/fzf.vim'
|
2019-10-11 17:34:39 +02:00
|
|
|
" Rust syntax, folding, compiler etc...
|
|
|
|
Plug 'rust-lang/rust.vim'
|
2019-10-20 13:52:44 +02:00
|
|
|
" A better GNU Info reader than info
|
|
|
|
Plug 'HiPhish/info.vim', { 'on': 'Info' }
|
2019-12-17 16:52:40 +01:00
|
|
|
" Nix configuration files
|
|
|
|
Plug 'LnL7/vim-nix'
|
2020-04-06 18:40:12 +02:00
|
|
|
" TOML files
|
|
|
|
Plug 'cespare/vim-toml'
|
2020-07-15 02:10:13 +02:00
|
|
|
" Beancount fiels
|
|
|
|
Plug 'nathangrigg/vim-beancount'
|
2020-07-30 16:01:13 +02:00
|
|
|
" Jsonnet files
|
|
|
|
Plug 'google/vim-jsonnet'
|
2020-08-21 18:01:23 +02:00
|
|
|
" Tmux configuration file
|
|
|
|
Plug 'tmux-plugins/vim-tmux'
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Vim facilities enhancement {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
""""""""""""""""""""""""""""
|
|
|
|
" A better netrw
|
|
|
|
Plug 'tpope/vim-vinegar'
|
|
|
|
" Better quick-fix window
|
|
|
|
Plug 'romainl/vim-qf'
|
2019-10-11 17:16:43 +02:00
|
|
|
" Better folding
|
|
|
|
Plug 'Konfekt/FastFold'
|
2019-10-18 22:15:42 +02:00
|
|
|
" A nice little cheat-sheet
|
|
|
|
Plug 'lifepillar/vim-cheat40'
|
2020-01-22 16:32:41 +01:00
|
|
|
" UNIX integration
|
|
|
|
Plug 'tpope/vim-eunuch'
|
|
|
|
" Readline mappings
|
|
|
|
Plug 'tpope/vim-rsi'
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Mappings {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
""""""""""
|
|
|
|
" Easily delete, change and add surroundings in pairs
|
|
|
|
Plug 'tpope/vim-surround'
|
|
|
|
" Better repeatability with the '.' key
|
|
|
|
Plug 'tpope/vim-repeat'
|
|
|
|
" Some ex command mappings
|
|
|
|
Plug 'tpope/vim-unimpaired'
|
2020-06-20 18:15:52 +02:00
|
|
|
" Super-powered increment/decrement
|
|
|
|
Plug 'tpope/vim-speeddating'
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Snippets {{{
|
2019-07-13 23:04:44 +02:00
|
|
|
""""""""""
|
2019-07-11 23:21:11 +02:00
|
|
|
" Snippet manager
|
|
|
|
Plug 'SirVer/ultisnips'
|
|
|
|
" Snippet files for Ulti Snips
|
|
|
|
Plug 'honza/vim-snippets'
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-10-05 23:49:47 +02:00
|
|
|
" LSP {{{
|
|
|
|
"""""
|
|
|
|
" Asynchronous Linting Engine
|
|
|
|
Plug 'dense-analysis/ale'
|
|
|
|
" Pre-made ALE integration with lightline
|
|
|
|
Plug 'maximbaz/lightline-ale'
|
|
|
|
" }}}
|
2019-07-18 16:28:55 +02:00
|
|
|
|
2019-07-11 23:21:11 +02:00
|
|
|
call plug#end()
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" File parameters {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Disable backups, we have source control for that
|
|
|
|
set nobackup
|
|
|
|
" Disable swapfiles too
|
|
|
|
set noswapfile
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" UI and UX parameters {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Set the minimal amount of lignes under and above the cursor for context
|
|
|
|
set scrolloff=5
|
|
|
|
" Always show status line
|
|
|
|
set laststatus=2
|
|
|
|
" Enable Doxygen highlighting
|
|
|
|
let g:load_doxygen_syntax=1
|
|
|
|
" Make backspace behave as expected
|
|
|
|
set backspace=eol,indent,start
|
2019-07-17 10:20:07 +02:00
|
|
|
" Use the visual bell instead of beeping
|
2019-07-11 23:21:11 +02:00
|
|
|
set visualbell
|
2019-07-17 10:20:07 +02:00
|
|
|
" Disable bell completely by resetting the visual bell's escape sequence
|
2019-07-11 23:21:11 +02:00
|
|
|
set t_vb=
|
|
|
|
|
2019-07-17 10:20:07 +02:00
|
|
|
" Color the 80th column
|
|
|
|
set colorcolumn=80
|
|
|
|
" Show whitespace
|
|
|
|
set list
|
2019-11-05 11:44:09 +01:00
|
|
|
" Show a tab as an arrow, trailing spaces as ¤, non-breaking spaces as dots
|
|
|
|
set listchars=tab:>─,trail:·,nbsp:¤
|
2019-07-17 10:20:07 +02:00
|
|
|
|
2019-11-21 14:58:08 +01:00
|
|
|
" Don't redraw when executing macros
|
|
|
|
set lazyredraw
|
|
|
|
|
2019-07-18 20:58:12 +02:00
|
|
|
" Timeout quickly on shortcuts, I can't wait two seconds to delete in visual
|
2019-10-04 14:19:21 +02:00
|
|
|
set timeoutlen=500
|
2019-11-09 15:13:48 +01:00
|
|
|
|
|
|
|
" Set dark mode by default
|
|
|
|
set background=dark
|
|
|
|
|
2019-11-25 10:49:36 +01:00
|
|
|
" Use onedark
|
|
|
|
colorscheme onedark
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-18 20:58:12 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Search parameters {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2019-07-17 10:20:07 +02:00
|
|
|
" Enable search high-lighting while the search is on-going
|
|
|
|
set hlsearch
|
2019-07-11 23:21:11 +02:00
|
|
|
" Ignore case on search
|
|
|
|
set ignorecase
|
|
|
|
" Ignore case unless there is an uppercase letter in the pattern
|
|
|
|
set smartcase
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
2019-07-11 23:21:11 +02:00
|
|
|
|
2019-07-28 02:39:47 +02:00
|
|
|
" Import settings when inside a git repository {{{
|
2019-07-11 23:21:11 +02:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2019-07-14 02:04:31 +02:00
|
|
|
let git_settings=system("git config --get vim.settings")
|
2019-07-11 23:21:11 +02:00
|
|
|
if strlen(git_settings)
|
2019-07-13 23:53:26 +02:00
|
|
|
exe "set" git_settings
|
2019-07-11 23:21:11 +02:00
|
|
|
endif
|
2019-07-28 02:39:47 +02:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" vim: foldmethod=marker
|