118 lines
3.3 KiB
VimL
118 lines
3.3 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
|
|
|
|
" }}}
|
|
" PLUGIN INSTALLATION - handled by VIM-PLUG {{{
|
|
" ================================================================================
|
|
"
|
|
" automatically install vim-plug if it does not exist
|
|
" Note: this installs it in the neovim folder, not the vim folder
|
|
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
|
|
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | q
|
|
endif
|
|
|
|
" automatically install any missing plugins
|
|
autocmd VimEnter *
|
|
\ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
|
\| PlugInstall --sync | q
|
|
\| endif
|
|
|
|
" defines plugin directory
|
|
" Install plugins from vim with :PlugInstall
|
|
silent! if plug#begin('~/.local/share/nvim/plugged')
|
|
|
|
" ultimately the only thing left here should be a
|
|
runtime! pluglist/**/*.vim
|
|
|
|
" Plug 'liuchengxu/vim-which-key', { 'on': ['WhichKey', 'WhichKey!'] } ->
|
|
" instructions: http://liuchengxu.org/vim-which-key/, needs setup tp become
|
|
" useful. TODO enable when setup is more settled down
|
|
|
|
call plug#end()
|
|
endif
|
|
|
|
colo gruvbox
|
|
|
|
" }}}
|
|
" 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
|
|
|
|
" 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
|
|
|
|
" 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
|
|
|
|
" highlight everything that goes over 80 columns
|
|
highlight ColorColumn ctermbg=magenta
|
|
call matchadd('ColorColumn', '\%81v', 100)
|
|
|
|
" 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
|
|
|
|
" }}}
|
|
" KEYBINDINGS {{{
|
|
" ================================================================================
|
|
"
|
|
|
|
" Begin mapping definitions
|
|
runtime! **/maps.vim
|
|
|
|
" }}}
|
|
" ABBREVIATIONS {{{
|
|
|
|
" Typos
|
|
iabbrev adn and
|
|
iabbrev waht what
|
|
iabbrev tehn then
|
|
iabbrev whit with
|
|
iabbrev whith with
|
|
|
|
" Text expansion
|
|
iabbrev mo@ marty.oehme@gmail.com
|
|
iabbrev mo.me@ <https://martyoeh.me/>
|
|
iabbrev mcc@ Copyright 2019 Marty Oehme, all rights reserved.
|
|
|
|
"
|
|
" }}}
|
|
" END
|
|
" ================================================================================
|