mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-30 20:40:42 +00:00
Move non-plugin settings to core/
This commit is contained in:
parent
768764a899
commit
9c8191bfa7
7 changed files with 18 additions and 6 deletions
21
home/.config/nvim/lua/core/autocmd.lua
Normal file
21
home/.config/nvim/lua/core/autocmd.lua
Normal 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]]
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue