nvim/after/ftplugin/python.lua

21 lines
597 B
Lua

-- Use sane tab settings for Python
vim.opt.expandtab = true
vim.opt.tabstop = 8
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
vim.opt.textwidth = 0
-- Auto-wrap comments using textwidth
vim.opt.formatoptions:append('c')
-- Automatically insert the current comment leader after hitting <Enter> in
-- Insert mode
vim.opt.formatoptions:append('r')
-- Automatically insert the current comment leader after hitting 'o' or 'O' in
-- Normal mode.
vim.opt.formatoptions:append('o')
-- Set file encoding and format to sane values for Python
vim.opt.encoding = 'utf-8'
vim.opt.fileformat = 'unix'