dotfiles/.vimrc

68 lines
1.5 KiB
VimL
Raw Normal View History

2021-12-03 00:01:50 -05:00
set nocompatible
filetype off
2021-12-03 00:41:17 -05:00
" ----[Plugins]----
call plug#begin()
2021-12-03 00:01:50 -05:00
Plug 'ms-jpq/coq_nvim', {'branch': 'coq'}
Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'}
Plug 'ms-jpq/coq.thirdparty', {'branch': '3p'}
call plug#end()
2021-12-03 00:41:17 -05:00
" ----[Look and Feel]----
2021-12-03 00:01:50 -05:00
" Syntax hilighting and line numbers
syntax on
set encoding=utf-8
set number relativenumber
set wildmode=longest,list,full
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
2021-12-03 00:41:17 -05:00
" Indents
filetype plugin indent on
" Tabbing
set tabstop=4
set shiftwidth=4
set softtabstop=4 expandtab
2021-12-03 00:01:50 -05:00
" Splits below and right
set splitbelow splitright
2021-12-03 00:41:17 -05:00
" Block cursor
set guicursor=i:block
2021-12-03 00:01:50 -05:00
2021-12-03 00:41:17 -05:00
" ----[File Specific Stuff]----
" yml
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType yml setlocal ts=2 sts=2 sw=2 expandtab
" ----[Macros]----
" Find and replace macro
nnoremap S :%s//g<Left><Left>
" Copy paste
vnoremap <C-c> "+y
map <C-p> "+P
2021-12-03 00:01:50 -05:00
" Markers
inoremap <leader><leader> <Esc>/<++><Enter>"_c4l
vnoremap <leader><leader> <Esc>/<++><Enter>"_c4l
map <leader><leader> <Esc>/<++><Enter>"_c4l
2021-12-03 00:41:17 -05:00
" sudo write, TODO: make this not fuck things up
" command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
" ----[Pre / Post Write]----
" Get rid of extra whitespace
autocmd BufWritePre * %s/\s\+$//e
2021-12-03 00:01:50 -05:00
" Run xrdb when Xresources or Xdefaults are changed
autocmd BufWritePost *Xresources,*Xdefaults !xrdb %
2021-12-02 11:14:39 -05:00
2021-12-03 00:01:50 -05:00
" Reload sxhkd when config is edited
autocmd BufWritePost sxhkdrc :silent !pkill sxhkd; sxhkd &