From e5f4416a85dd3fb10c156e69f74631a79f9077fb Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 23 Feb 2021 14:39:23 +0000 Subject: [PATCH] home: vim: add 'init.vim' --- home/vim/default.nix | 2 + home/vim/init.vim | 96 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 home/vim/init.vim diff --git a/home/vim/default.nix b/home/vim/default.nix index 3094591..6bb6ef0 100644 --- a/home/vim/default.nix +++ b/home/vim/default.nix @@ -39,5 +39,7 @@ ale # Asynchronous Linting Engine lightline-ale # Status bar integration ]; + + extraConfig = builtins.readFile ./init.vim; }; } diff --git a/home/vim/init.vim b/home/vim/init.vim new file mode 100644 index 0000000..e1208a0 --- /dev/null +++ b/home/vim/init.vim @@ -0,0 +1,96 @@ +" Basic configuraion {{{ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Use UTF-8 +set encoding=utf-8 +set fileencodings=utf-8 + +" 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 +" }}} + +" Indentation configuration {{{ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Use space by default +set expandtab +" Indent and align to 4 spaces by default +set shiftwidth=4 +" -1 means the same as shiftwidth +set softtabstop=-1 +" Always indent by multiples of shiftwidth +set shiftround +" You shouldn't change the default tab width of 8 characters +set tabstop=8 +" }}} + +" File parameters {{{ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Disable backups, we have source control for that +set nobackup +" Disable swapfiles too +set noswapfile +" }}} + +" UI and UX parameters {{{ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" 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 +" Use the visual bell instead of beeping +set visualbell +" Disable bell completely by resetting the visual bell's escape sequence +set t_vb= + +" Color the 80th column +set colorcolumn=80 +" Show whitespace +set list +" Show a tab as an arrow, trailing spaces as ¤, non-breaking spaces as dots +set listchars=tab:>─,trail:·,nbsp:¤ + +" Don't redraw when executing macros +set lazyredraw + +" Timeout quickly on shortcuts, I can't wait two seconds to delete in visual +set timeoutlen=500 + +" Set dark mode by default +set background=dark + +" Use onedark +colorscheme onedark + +" 24-bit true color +set termguicolors +" }}} + +" Search parameters {{{ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Enable search high-lighting while the search is on-going +set hlsearch +" Ignore case on search +set ignorecase +" Ignore case unless there is an uppercase letter in the pattern +set smartcase +" }}} + +" Import settings when inside a git repository {{{ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let git_settings=system("git config --get vim.settings") +if strlen(git_settings) + exe "set" git_settings +endif +" }}} + +" vim: foldmethod=marker