2018-09-01 12:45:39 +02:00
|
|
|
|
|
|
|
" Make sure plug.vim is present
|
|
|
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
|
|
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
source ~/.vim/autoload/plug.vim
|
|
|
|
autocmd VimEnter * PlugInstall --sync
|
|
|
|
endif
|
|
|
|
|
2020-05-22 13:10:59 +02:00
|
|
|
" Plugin Manager
|
|
|
|
source ~/.vim/config/plugins.vim
|
2018-09-01 11:17:30 +02:00
|
|
|
|
|
|
|
" Prepare central backup/swap/undo directory
|
2018-09-01 12:45:39 +02:00
|
|
|
let &undodir = expand('~/.vim/.undo//')
|
2018-09-01 11:17:30 +02:00
|
|
|
let &backupdir = expand('~/.vim/.backup//')
|
|
|
|
let &directory = expand('~/.vim/.swp//')
|
|
|
|
|
2018-04-05 13:06:54 +02:00
|
|
|
syntax on
|
|
|
|
filetype plugin on
|
|
|
|
filetype plugin indent on
|
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
set encoding=utf-8
|
2018-04-05 13:06:54 +02:00
|
|
|
|
2019-12-09 18:25:18 +01:00
|
|
|
set foldmethod=syntax
|
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
" Use whitespace instead of tab
|
|
|
|
set expandtab
|
2018-04-05 13:06:54 +02:00
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
" Make a tabulator equal 4 spaces
|
2018-04-05 13:06:54 +02:00
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
2018-09-01 11:17:30 +02:00
|
|
|
|
|
|
|
" Enable persistent undo
|
|
|
|
set undofile
|
|
|
|
|
|
|
|
" Use relative line numbers
|
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
|
|
|
|
" Set linelength indicator to 120 characters
|
2018-04-05 13:06:54 +02:00
|
|
|
set cc=120
|
2018-09-01 11:17:30 +02:00
|
|
|
|
|
|
|
" Natural window splitting
|
2018-08-28 23:24:09 +02:00
|
|
|
set splitbelow
|
|
|
|
set splitright
|
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
" Set colors
|
2021-04-08 05:38:33 +02:00
|
|
|
if (has("nvim"))
|
|
|
|
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
|
|
|
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
|
|
|
endif
|
|
|
|
if (has("termguicolors"))
|
|
|
|
set termguicolors
|
|
|
|
endif
|
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
colorscheme happy_hacking
|
|
|
|
|
2018-10-24 22:53:03 +02:00
|
|
|
" Turn on the Wild menu
|
|
|
|
set wildmenu
|
2021-04-05 13:46:01 +02:00
|
|
|
set wildmode=list:longest
|
|
|
|
|
|
|
|
|
|
|
|
"
|
|
|
|
set updatetime=300
|
2018-10-24 22:53:03 +02:00
|
|
|
|
|
|
|
" Ignore compiled files
|
|
|
|
set wildignore=*.o,*~,*.pyc
|
|
|
|
if has("win16") || has("win32")
|
|
|
|
set wildignore+=.git\*,.hg\*,.svn\*
|
|
|
|
else
|
|
|
|
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
|
|
|
|
endif
|
|
|
|
|
|
|
|
" No annoying sound on errors
|
|
|
|
set noerrorbells
|
|
|
|
set novisualbell
|
|
|
|
set t_vb=
|
|
|
|
set tm=500
|
2019-11-17 20:47:04 +01:00
|
|
|
let mapleader=","
|
2018-08-28 23:24:09 +02:00
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
" Apply plugin configurations
|
2018-09-01 12:45:39 +02:00
|
|
|
source ~/.vim/config/pluginconfig.vim
|
2018-05-04 20:32:48 +02:00
|
|
|
|
2018-09-01 11:17:30 +02:00
|
|
|
" Apply custom keybindings
|
|
|
|
source ~/.vim/config/keybindings.vim
|
|
|
|
|
|
|
|
" Apply settings for custom filetypes
|
|
|
|
source ~/.vim/config/filetypes.vim
|
|
|
|
|
2018-04-05 13:06:54 +02:00
|
|
|
" Transparency
|
|
|
|
hi Normal guibg=NONE ctermbg=NONE
|
2021-04-05 13:46:01 +02:00
|
|
|
|
|
|
|
" Prevent accidental writes to buffers that shouldn't be edited
|
|
|
|
autocmd BufRead *.orig set readonly
|
|
|
|
autocmd BufRead *.pacnew set readonly
|
|
|
|
set nofoldenable
|