nixos-configuration/home/neovim/init.vim

87 lines
1.7 KiB
VimL
Raw Permalink Normal View History

2022-10-29 02:25:11 +02:00
set number
set relativenumber
set expandtab
set shiftwidth=2
set tabstop=2
set ignorecase
set smartcase
" always set autoindenting on
set autoindent
" smart indent; stop indent when closing brackets etc
set smartindent
" highlight search result
set hlsearch
" incremental search
set incsearch
" yank into system clipboard
set clipboard=unnamedplus
" true color
set termguicolors
" other color for popup
highlight Pmenu ctermbg=gray guibg=gray
set signcolumn=yes
" break at last word instead of last char
set linebreak
set cursorline
" autoload file changes
set autoread
set smarttab
set shiftround
" invisible characters
set list
" keep 5 lines on the screen when scrolling
set scrolloff=5
" enhanced command line completion
set wildmenu
" Search down into subfolders
" Provides tab-completion for all file-related tasks
set path+=**
" show incomplete commands
set showcmd
" complete files like a shell
set wildmode=list:longest
" set spell langs
set spelllang=de,en
" persist undo history
set undofile
" clear highlighted search
noremap <space> :nohlsearch<cr>
" Append modeline after last line in buffer.
" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX files.
function! AppendModeline()
let l:modeline = printf(" vim: set filetype=%s ts=%d sw=%d tw=%d %s :",
\ &filetype, &tabstop, &shiftwidth, &textwidth, &expandtab ? 'et' : 'noet')
let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
call append(line("$"), l:modeline)
endfunction
nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
syntax enable
if executable('rg')
set grepprg=rg\ --color=never
let g:ctrlp_user_command='rg %s --files -i --color=never --glob ""'
let g:ctrlp_use_caching=0
endif