dotfiles/nvim/.config/nvim/init.vim
Marty Oehme d9185d0542
nvim: Restructure directory slightly
Moved vim-plug plugin list to load into separate file so it is a coherent
plugin list to modify or disable.

Moved key mappings (`maps.vim`) into a separate keys directory so they
can be loaded in individual files if desired.
2020-11-12 14:29:48 +01:00

149 lines
4.4 KiB
VimL

" vim: set foldmethod=marker foldlevel=0 nomodeline:
" ================================================================================
" .init.vim / .vimrc of Marty Oehme {{{
" ================================================================================
"
" - stolen from many different sources including
" Steve Losh
" Junegunn Choi
" Tim Pope
" }}}
" VIM SETTINGS {{{
" ================================================================================
"
" set truecolor (neovim)
set termguicolors
" sets tabs to be 2 characters, expanded into spaces, but still removable with
" one press of backspace.
" great explanation: http://vimcasts.org/transcripts/2/en/
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
augroup LUAtabs
autocmd Filetype lua setlocal tabstop=4
autocmd Filetype lua setlocal shiftwidth=4
autocmd Filetype lua setlocal softtabstop=4
autocmd Filetype lua setlocal expandtab
augroup END
" make jumplist behave more like browser, when jumping back
" and then adding a new jump discards all the previous
" 'future-jump' tree, making more sense for wiki-like movement
set jumpoptions=stack
" set cursor line highlighting, esp useful when using with bracket
" highlighting and you don't know which side of the brace the cursor is on
set cursorline
" shows linenumbers relative to the one you are on, for easy movement and
" dNUMBERd deletions
set number relativenumber
" keeps an undofile next to files so that you can even undo if vim is closed
" in between
set undofile
" ignores case by default but will use case when search is specifically not
" all lowercased
set ignorecase
set smartcase
" shows previews of what substitute command will do (and a couple others)
set inccommand=split
" whenever vim loses focus, save
au FocusLost * :wa
" disables showing us the current mode in the command line since airline takes
" care of it
set noshowmode
" turn off modeline, to ensure security observation
set nomodeline
" i feel foldlevel 2 is generally pretty usable, for headlines and similar
set foldlevel=2
" highlight everything that goes over 80 columns
highlight ColorColumn ctermbg=magenta
call matchadd('ColorColumn', '\%81v', 100)
" pump all clippings into the system clipboard
set clipboard+=unnamedplus
" Special setting for editing gopass files - make sure nothing leaks outside
" the directories it is supposed to
au BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile nowritebackup viminfo=
au BufNewFile,BufRead /dev/shm/pass.?*/?*.txt setlocal noswapfile nobackup noundofile nowritebackup viminfo=
au BufNewFile,BufRead $TMPDIR/pass.?*/?*.txt setlocal noswapfile nobackup noundofile nowritebackup viminfo=
au BufNewFile,BufRead /tmp/pass.?*/?*.txt setlocal noswapfile nobackup noundofile nowritebackup viminfo=
" from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/init.vim
if has('nvim-0.4')
" make completion menu slightly transparent
set pumblend=17
set wildmode=longest:full
" Makes floating PopUpMenu for completing stuff on the command line.
" Very similar to completing in insert mode.
set wildoptions+=pum
else
set wildmode=longest,list,full
" Vim Galore recommended mappings
" Make next and previous use smart history
cnoremap <C-N> <Up>
cnoremap <C-P> <Down>
end
" turn of automatic resizing of individual splits
set noequalalways
" make sure there's always *some* context below cursor
set scrolloff=5
" in .tex files, default to latex over plaintext/context as syntax
let g:tex_flavor = "latex"
" }}}
" EXTERNAL FILES {{{
" ================================================================================
"
" Load vim-plug plugins
runtime plugins.vim
" Begin mapping definitions
runtime! keys/*.vim
" load colorscheme from dynamic file
" first one is here to make airline behave correctly without reload
runtime colorscheme.vim
" this one is here to override anything set by default in colorscheme plugin
" loading
autocmd VimEnter * runtime colorscheme.vim
" }}}
" ABBREVIATIONS {{{
" Typos
iabbrev adn and
iabbrev waht what
iabbrev tehn then
iabbrev whit with
iabbrev whith with
iabbrev grwoth growth
iabbrev teh the
iabbrev projcets projects
" Text expansion
iabbrev mo@ marty.oehme@gmail.com
iabbrev mo.me@ <https://martyoeh.me/>
iabbrev mcc@ Copyright 2020 Marty Oehme, all rights reserved.
"
" }}}
" END
" ================================================================================