Move non-plugin settings to core/

This commit is contained in:
ItsDrike 2021-12-07 22:13:22 +01:00
parent 768764a899
commit 9c8191bfa7
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843
7 changed files with 18 additions and 6 deletions

View file

@ -0,0 +1,21 @@
local vim = require("vim")
local cmd = vim.cmd
-- Disable automatic commenting on newlines
cmd[[autocmd FileType * setlocal formatoptions-=cro]]
-- Have vim jump to last position when reopening a file
cmd[[autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif]]
-- Automatically delete all trailing whitespace on save
cmd[[autocmd BufWritePre * %s/\s\+$//e]]
-- Enable spellcheck for certain file types
cmd[[autocmd FileType tex,latex,markdown,gitcommit setlocal spell spelllang=en_us]]
-- Use auto-wrap for certain file types at 119 chars
cmd[[autocmd FileType markdown setlocal textwidth=119]]
-- Don't show line numbers in terminal
cmd[[autocmd BufEnter term://* setlocal nonumber | setlocal norelativenumber]]