2024-09-27 15:48:26 +02:00
|
|
|
" Basic configuration {{{
|
2021-02-23 15:39:23 +01:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" 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
|
2022-02-26 13:46:24 +01:00
|
|
|
|
|
|
|
" Map leader to space (needs the noremap trick to avoid moving the cursor)
|
|
|
|
nnoremap <Space> <Nop>
|
|
|
|
let mapleader=" "
|
|
|
|
|
|
|
|
" Map localleader to '!' (if I want to filter text, I use visual mode)
|
|
|
|
let maplocalleader="!"
|
2021-02-23 15:39:23 +01:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" 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 {{{
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2024-07-22 18:05:54 +02:00
|
|
|
" Disable swap files
|
|
|
|
set noswapfile
|
|
|
|
" Enable undo files
|
2024-07-10 23:47:14 +02:00
|
|
|
set undofile
|
2021-02-23 15:39:23 +01:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" 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:¤
|
|
|
|
|
2023-04-19 10:34:39 +02:00
|
|
|
" Use patience diff
|
|
|
|
set diffopt+=algorithm:patience
|
2023-04-19 10:36:40 +02:00
|
|
|
" Align similar lines in each hunk
|
|
|
|
set diffopt+=linematch:50
|
2023-04-19 10:34:39 +02:00
|
|
|
|
2021-02-23 15:39:23 +01:00
|
|
|
" 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
|
|
|
|
|
2022-02-26 12:50:23 +01:00
|
|
|
" Timeout quickly for CursorHold events (and also swap file)
|
|
|
|
set updatetime=250
|
|
|
|
|
2023-02-26 14:19:41 +01:00
|
|
|
" Disable all mouse integrations
|
|
|
|
set mouse=
|
|
|
|
|
2021-02-23 15:39:23 +01:00
|
|
|
" Set dark mode by default
|
|
|
|
set background=dark
|
|
|
|
|
2024-03-13 14:08:57 +01:00
|
|
|
" Setup some overrides for gruvbox
|
|
|
|
lua << EOF
|
|
|
|
local gruvbox = require("gruvbox")
|
2024-03-14 11:56:08 +01:00
|
|
|
local colors = gruvbox.palette
|
2024-03-13 14:08:57 +01:00
|
|
|
|
|
|
|
gruvbox.setup({
|
|
|
|
overrides = {
|
|
|
|
-- Only URLs should be underlined
|
|
|
|
["@string.special.path"] = { link = "GruvboxOrange" },
|
2024-03-14 11:56:08 +01:00
|
|
|
-- Revert back to the better diff highlighting
|
|
|
|
DiffAdd = { fg = colors.green, bg = "NONE" },
|
|
|
|
DiffChange = { fg = colors.aqua, bg = "NONE" },
|
|
|
|
DiffDelete = { fg = colors.red, bg = "NONE" },
|
|
|
|
DiffText = { fg = colors.yellow, bg = colors.bg0 },
|
2024-07-25 21:17:50 +02:00
|
|
|
-- Directories "pop" better in blue
|
|
|
|
Directory = { link = "GruvboxBlueBold" },
|
2024-11-04 12:02:35 +01:00
|
|
|
},
|
|
|
|
-- Comments should not be italic, for e.g: box drawing
|
|
|
|
italic = {
|
|
|
|
-- Comments should not be italic, for e.g: box drawing
|
|
|
|
comments = false,
|
|
|
|
},
|
2024-03-13 14:08:57 +01:00
|
|
|
})
|
|
|
|
EOF
|
2021-09-29 18:43:37 +02:00
|
|
|
" Use my preferred colorscheme
|
2023-02-27 17:00:29 +01:00
|
|
|
colorscheme gruvbox
|
2021-02-23 15:39:23 +01:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" 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
|
|
|
|
" }}}
|
|
|
|
|
2023-04-23 16:57:46 +02:00
|
|
|
" Project-local settings {{{
|
2021-02-23 15:39:23 +01:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
2023-04-23 16:57:46 +02:00
|
|
|
" Securely read `.nvim.lua` or `.nvimrc`.
|
|
|
|
set exrc
|
2021-02-23 15:39:23 +01:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" vim: foldmethod=marker
|