mirror of
https://github.com/jessebot/dot_files.git
synced 2025-10-01 01:48:43 +00:00
fix calling setting fileformat to happen as an autocommand
This commit is contained in:
parent
b384c2d6a9
commit
4aedfbcdbf
2 changed files with 8 additions and 3 deletions
|
@ -7,8 +7,6 @@
|
||||||
-- turn off the mouse scrolling because it is confusing
|
-- turn off the mouse scrolling because it is confusing
|
||||||
vim.opt.mousescroll = 'ver:0,hor:0'
|
vim.opt.mousescroll = 'ver:0,hor:0'
|
||||||
|
|
||||||
vim.api.nvim_command('set ff=unix')
|
|
||||||
|
|
||||||
-- line numbers for debugging and screen sharing, takes up 4 columns
|
-- line numbers for debugging and screen sharing, takes up 4 columns
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.numberwidth = 4
|
vim.opt.numberwidth = 4
|
||||||
|
|
|
@ -4,6 +4,14 @@ local autocmd = vim.api.nvim_create_autocmd
|
||||||
-- Autocommands to run immediately for for ALL file types --
|
-- Autocommands to run immediately for for ALL file types --
|
||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
|
-- on file enter, set file format to unix
|
||||||
|
autocmd({"BufEnter", "BufWinEnter"}, {
|
||||||
|
pattern = {"*"},
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("set fileformat=unix")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- delete whitespace on save - https://vi.stackexchange.com/a/41388
|
-- delete whitespace on save - https://vi.stackexchange.com/a/41388
|
||||||
autocmd({ "BufWritePre", "ExitPre" }, {
|
autocmd({ "BufWritePre", "ExitPre" }, {
|
||||||
pattern = {"*"},
|
pattern = {"*"},
|
||||||
|
@ -14,7 +22,6 @@ autocmd({ "BufWritePre", "ExitPre" }, {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
-- Autocommands to run immediately for SPECIFIC file types --
|
-- Autocommands to run immediately for SPECIFIC file types --
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue