Add textwidth, spellcheck and latex plugin
authorLukáš Jiřiště <jiriste@icpf.cas.cz>
Mon, 14 Oct 2024 11:52:09 +0000 (13:52 +0200)
committerLukáš Jiřiště <jiriste@icpf.cas.cz>
Mon, 14 Oct 2024 12:26:16 +0000 (14:26 +0200)
The standard text width is 80 chars now.
The spellcheck is turned on for git commits and got tex documents.
The latex plugin is called LaTeX-suite.
I probably should have split this into multiple commits but I did it all
at once and it is only a couple of lines.

vim/.vimrc

index e79d3f50fb3a44db6abc06c9aa365a8cb7615bff..5c27fd0b9be64efba29a4dc602b0d68b2353d36d 100644 (file)
@@ -5,9 +5,14 @@ call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
 " 42 Header on F1
 Plug 'https://github.com/42Paris/42header'
 
+Plug 'vim-latex/vim-latex'
+
 " List ends here. Plugins become visible to Vim after this call.
 call plug#end()
 
+" May be useful for vim-latex?
+let g:tex_flavor='latex'
+
 " Defining name and email for the 42 header
 let g:user42 = 'ljiriste'
 let g:mail42 = 'ljiriste@student.42prague.com'
@@ -15,11 +20,10 @@ let g:mail42 = 'ljiriste@student.42prague.com'
 set nocompatible
 set tabstop=4
 set shiftwidth=0
+set textwidth=80
 set number relativenumber
 set incsearch
 set autoindent
-syntax on
-filetype plugin indent on " redundant after syntax on
 set splitright
 
 " Add every subfolder of the vim root folder to path for find command
@@ -28,6 +32,12 @@ set path+=**
 " Add visual menu
 set wildmenu
 
+syntax on
+filetype plugin indent on " redundant after syntax on
+
+autocmd FileType gitcommit set spell spelllang=en_us
+autocmd FileType tex set spell spelllang=en_us
+
 function Cpp_class(classname)
        let skel = join(readfile(glob('~/.vim/templates/class_skeleton.h')), "\n")
        let skel = substitute(skel, 'Classname', a:classname, 'g')