Separating vim's config from neovim's config simplifies the deployment of lua for neovim's configuration. At the same time, clean up current neovim config by removing all outdated options and options with equal or even better defaults. Furthermore, the 'old' vim configuration should be kept as-is to ensure compability with older systems if needed.
127 lines
2.6 KiB
VimL
127 lines
2.6 KiB
VimL
" disable autocmd
|
||
set secure
|
||
|
||
" file/directory matching
|
||
set wildmode=list:longest,full
|
||
" ignore case when completing
|
||
if exists('+wildignorecase')
|
||
set wildignorecase
|
||
endif
|
||
" ignorelist
|
||
set wildignore=*.o,*.d,*.so,*.class,*.aux,*.log,*.out,*.toc,*.pdf,*.pyc
|
||
|
||
" increase command history
|
||
set history=1000
|
||
" increase count of possible undos
|
||
set undolevels=1000
|
||
|
||
" use unix line-endings and recognize dos endings
|
||
set fileformats=unix,dos
|
||
|
||
" tabs
|
||
set tabstop=4
|
||
set shiftwidth=4
|
||
set autoindent
|
||
set smartindent
|
||
set smarttab
|
||
|
||
" allow backspacing over autoindent and line breaks
|
||
set backspace=indent,eol,start
|
||
|
||
" already display matches while searching
|
||
set incsearch
|
||
" only check for case if the searched word contains a capital
|
||
set ignorecase
|
||
set smartcase
|
||
" highlight all matches. use <C-L> to remove the highlights
|
||
set hlsearch
|
||
|
||
" treat hyphenated words as a single word
|
||
set iskeyword+=-
|
||
|
||
" syntax folding
|
||
if has('folding')
|
||
set foldmethod=syntax
|
||
" only use folding when there is enough space
|
||
" if &columns > 80
|
||
" set foldcolumn=2
|
||
" endif
|
||
set foldlevel=99
|
||
|
||
" dont open fold for block movements
|
||
set foldopen-=block
|
||
endif
|
||
|
||
" allow buffers with changes to be hidden
|
||
set hidden
|
||
|
||
" correct splitting
|
||
if has('vertsplit')
|
||
set splitright
|
||
set splitbelow
|
||
endif
|
||
|
||
" Visual
|
||
" set text color for dark terminal background
|
||
set background=dark
|
||
|
||
" activate syntax highlighting
|
||
if has('syntax')
|
||
syntax enable
|
||
endif
|
||
|
||
" set colorscheme
|
||
colorscheme dichromatic
|
||
" TODO: use `colorscheme ron` as fallback?
|
||
|
||
" display line at which the current is positioned
|
||
if exists('+cursorline')
|
||
set cursorline
|
||
" remove line and make the line bold instead
|
||
highlight CursorLine term=bold cterm=bold
|
||
highlight CursorLineNR term=bold cterm=bold ctermbg=darkgrey
|
||
endif
|
||
|
||
" display warning column at 81 and 121
|
||
let &colorcolumn="81,121"
|
||
highlight ColorColumn ctermbg=235 guibg=#2d2d2d
|
||
|
||
" display line numbers
|
||
set number
|
||
|
||
" show cursor position all the time
|
||
set ruler
|
||
|
||
" show vim tabs all the time
|
||
set showtabline=2
|
||
|
||
" show currently typed command
|
||
set showcmd
|
||
|
||
" define characters to display when using 'set list'
|
||
set listchars=tab:→\ ,trail:∙,eol:¬,extends:❯,precedes:❮,nbsp:␣
|
||
|
||
" enable nvim-colorizer
|
||
if has('nvim')
|
||
set termguicolors
|
||
lua require'colorizer'.setup()
|
||
endif
|
||
|
||
" increase completion performance and reduce time until timeout
|
||
set updatetime=300
|
||
set timeoutlen=500
|
||
|
||
" copy paste between vim and everything else
|
||
set clipboard=unnamedplus
|
||
|
||
" Misc
|
||
set mouse=n
|
||
|
||
" remove windows ^M when the encoding gets messed up
|
||
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
|
||
|
||
" autoreload vimrc when writing init.vim
|
||
au! BufWritePost $MYVIMRC source %
|
||
|
||
" add convenience command for force-saving read-only files
|
||
cmap w!! w !sudo tee %
|