~jamesp/dotfiles

170a070bd9f5405d2fbf53d5670bae603f136158 — James Pearson 10 months ago 0d1695c
Add .vimrc
2 files changed, 122 insertions(+), 11 deletions(-)

M .config/nvim/init.vim
A .vimrc
M .config/nvim/init.vim => .config/nvim/init.vim +3 -11
@@ 1,12 1,4 @@
" init.vim by James Pearson

" Include .vim files and .vimrc
"set runtimepath^=~/.vim runtimepath+=~/.vim/after
"let &packpath = &runtimepath
"source ~/.vimrc

" Limit Mutt email drafts to text width of 72 characters
au BufRead /tmp/mutt-* set tw=72

" Enable mouse
set mouse=a
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc

A .vimrc => .vimrc +119 -0
@@ 0,0 1,119 @@
" .vimrc by James Pearson

" Limit Mutt email drafts to text width of 72 characters; not needed
"au BufRead /tmp/mutt-* set tw=72

" Enable mouse
set mouse=a

" Start here from sircmpwn's dotfiles, slightly modified:
" https://git.sr.ht/~sircmpwn/dotfiles/tree/master/.vimrc
set nocompatible

"call plug#begin('~/.vim/plugged')
" Actual plugins
"Plug 'editorconfig/editorconfig-vim'
"Plug 'tpope/vim-fugitive'
"Plug 'tpope/vim-surround'
"Plug 'tpope/vim-repeat'
" Meta plugins
"Plug 'vim-scripts/ingo-library'
"Plug 'vim-scripts/SyntaxRange'
" Syntax highlighting
"Plug 'jparise/vim-graphql'
"Plug 'cespare/vim-toml'
"Plug 'beyondmarc/glsl.vim'
"Plug 'wannesm/wmgraphviz.vim'
"Plug 'ziglang/zig.vim'
"Plug 'gpanders/vim-scdoc'
"Plug 'https://tildegit.org/sloum/gemini-vim-syntax'
"Plug 'https://git.sr.ht/~sircmpwn/hare.vim'
"call plug#end()

set laststatus=2
set t_Co=256
set encoding=utf-8
set tabstop=8
set shiftwidth=8
set autoindent
set magic
set number
set scrolloff=3
set sidescroll=3
set ruler
set cc=80
set nowrap
set ignorecase
set smartcase
set splitbelow
set hidden
set notimeout
set incsearch
set showmatch
set hlsearch
set mouse=a
set noswapfile
set nofoldenable
set lazyredraw

let g:fzf_layout = { 'window': { 'width': 1.0, 'height': 0.5, 'relative': v:true, 'yoffset': 1.0, 'border': 'none' } }

let mapleader = "\<space>"
nnoremap \\ :noh<cr> " Clear higlighting
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR> " Trim trailing spaces
nnoremap Y y$
nnoremap cc :center<cr>
inoremap <C-c> <ESC>
set listchars=tab:▸\ ,eol:¬,space:.
nnoremap <leader>l :set list!<CR>
nnoremap <C-p> :FZF<cr>

syntax enable
colorscheme ron
highlight Search ctermbg=12
highlight NonText ctermfg=darkgrey
highlight SpecialKey ctermfg=darkgrey
highlight clear SignColumn
highlight Comment cterm=bold ctermfg=none
highlight StatusLine cterm=none ctermbg=none ctermfg=darkgrey
highlight StatusLineNC cterm=none ctermbg=none ctermfg=darkgrey
highlight Title cterm=none ctermfg=darkgrey
highlight TabLineFill cterm=none
highlight TabLine cterm=none ctermfg=darkgrey ctermbg=none
highlight ColorColumn ctermbg=darkgrey guibg=lightgrey
highlight Todo ctermbg=NONE ctermfg=red cterm=bold
highlight PreProc ctermfg=grey
highlight String ctermfg=darkblue cterm=italic
highlight Type ctermfg=darkblue
highlight lineNr ctermfg=grey cterm=italic
highlight cIncluded ctermfg=NONE cterm=bold
highlight pythonInclude ctermfg=blue
highlight pythonConditional ctermfg=darkcyan
highlight pythonBuiltin ctermfg=darkcyan
highlight Pmenu ctermbg=white ctermfg=black
highlight PmenuSel ctermbg=darkcyan ctermfg=black
highlight hareKeyword ctermbg=NONE ctermfg=darkcyan
highlight hareLabel ctermbg=NONE cterm=bold

autocmd FileType c setlocal noet ts=8 sw=8 tw=80
autocmd FileType h setlocal noet ts=8 sw=8 tw=80
autocmd FileType cpp setlocal noet ts=8 sw=8 tw=80
autocmd FileType s setlocal noet ts=8 sw=8
autocmd FileType go setlocal noet ts=4 sw=4
autocmd FileType sh setlocal noet ts=4 sw=4
autocmd BufRead,BufNewFile *.js setlocal et ts=2 sw=2
autocmd FileType html setlocal et ts=2 sw=2
autocmd FileType htmldjango setlocal et ts=2 sw=2
autocmd FileType scss setlocal et ts=2 sw=2
autocmd FileType yaml setlocal et ts=2 sw=2
autocmd FileType markdown setlocal tw=80 et ts=2 sw=2
autocmd FileType text setlocal tw=80
autocmd FileType meson setlocal noet ts=2 sw=2
autocmd FileType python setlocal et ts=4 sw=4
autocmd FileType tex hi Error ctermbg=NONE
autocmd FileType mail setlocal noautoindent
autocmd FileType gmi set wrap linebreak
augroup filetypedetect
  autocmd BufRead,BufNewFile *mutt-*              setfiletype mail
autocmd BufNewFile,BufRead * if expand('%:t') == 'APKBUILD' | set ft=sh | endif
autocmd BufNewFile,BufRead * if expand('%:t') == 'PKGBUILD' | set ft=sh | endif