~wrm/dotfiles

da55858aa7f5fc285865bc4e27477708f9fcb458 — +wrm 2 months ago 2be7452
nvim: Make file-specific tab and linewrap rules explicit
1 files changed, 10 insertions(+), 3 deletions(-)

M .config/nvim/init.vim
M .config/nvim/init.vim => .config/nvim/init.vim +10 -3
@@ 85,9 85,6 @@ set path+=**
set wildmode=longest,list,full
set wildmenu

" Auto-wrap common non-code files
autocmd BufRead,BufNewFile *.txt,*.md,*.tex setlocal tw=80

" Highlight others
set t_Co=256 " Not needed anymore but doesn't hurt.
set colorcolumn=80


@@ 99,6 96,9 @@ set clipboard+=unnamedplus
" Disable comments carrying onto newlines
autocmd filetype * setlocal formatoptions-=c formatoptions-=r formatoptions-=o

" Auto-wrap common non-code files
autocmd BufRead,BufNewFile *.txt,*.md,*.tex setlocal tw=80

" Treat CNatural files as having C++ syntax
autocmd BufNewFile,BufRead *.cn setfiletype cn
autocmd FileType cn setlocal syntax=cpp


@@ 106,6 106,13 @@ autocmd FileType cn setlocal syntax=cpp
" Treat .html.sh extra specially.
autocmd BufNewFile,BufRead *.html.sh setlocal syntax=htmlsh

" Some general tab rules.
" Usually defined by a local vimrc file for a project's style rules.
set noexpandtab
set tabstop=8
set shiftwidth=8
autocmd FileType python setlocal expandtab tabstop=4 shiftwidth=4

" Transparent editing of gpg encrypted files
" Based on https://vim.fandom.com/wiki/Edit_gpg_encrypted_files