You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.2 KiB
104 lines
2.2 KiB
vim.opt.mouse:append('a')
|
|
vim.opt.guicursor = ""
|
|
vim.opt.number = true
|
|
vim.opt.linebreak = true
|
|
vim.opt.shiftwidth = 2
|
|
vim.opt.tabstop = 2
|
|
vim.opt.softtabstop = 2
|
|
vim.opt.expandtab = true
|
|
vim.opt.smarttab = true
|
|
vim.opt.shiftround = true
|
|
vim.opt.autoindent = true
|
|
vim.opt.textwidth = 80
|
|
vim.opt.colorcolumn = "80"
|
|
vim.opt.list = true
|
|
vim.opt.wrap = false
|
|
vim.opt.conceallevel = 1
|
|
|
|
vim.opt.splitbelow = false
|
|
vim.opt.splitright = false
|
|
|
|
vim.g.indentLine_fileTypeExclude = { 'text', 'tex' }
|
|
|
|
vim.opt.undodir = vim.fn.stdpath('data') .. "/undodir"
|
|
vim.opt.undofile = true
|
|
vim.opt.hlsearch = false
|
|
vim.opt.incsearch = true
|
|
|
|
vim.opt.nu = true
|
|
vim.opt.rnu = true
|
|
vim.opt.termguicolors = true
|
|
|
|
vim.opt.scrolloff = 7
|
|
|
|
vim.cmd("filetype plugin indent on")
|
|
vim.cmd("filetype on")
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = "python",
|
|
callback = function(args)
|
|
vim.bo.textwidth = 0
|
|
vim.bo.formatprg = "autopep8"
|
|
vim.bo.shiftwidth = 4
|
|
vim.bo.tabstop = 4
|
|
vim.bo.softtabstop = 4
|
|
end
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd(
|
|
{ "BufRead", "BufNewFile" },
|
|
{
|
|
pattern = { "*.ms", "*.me", "*.mom" },
|
|
callback = function(args)
|
|
vim.bo.filetype = "groff"
|
|
end
|
|
}
|
|
)
|
|
|
|
vim.api.nvim_create_autocmd(
|
|
{ "BufRead", "BufNewFile" },
|
|
{
|
|
pattern = { "*.mdx", "*.md" },
|
|
callback = function(args)
|
|
vim.bo.filetype = "markdown"
|
|
end
|
|
}
|
|
)
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = { "tex", "text" },
|
|
callback = function(args)
|
|
vim.o.smarttab = false
|
|
vim.bo.autoindent = false
|
|
end
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = { "c", "cpp", "slang" },
|
|
callback = function(args)
|
|
vim.bo.cindent = true
|
|
end
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = "markdown",
|
|
callback = function(args)
|
|
vim.bo.shiftwidth = 2
|
|
vim.bo.tabstop = 2
|
|
vim.bo.softtabstop = 2
|
|
vim.bo.autoindent = true
|
|
end
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = "go",
|
|
callback = function(args)
|
|
vim.bo.shiftwidth = 4
|
|
vim.bo.expandtab = false
|
|
vim.bo.tabstop = 4
|
|
vim.bo.softtabstop = 4
|
|
vim.bo.preserveindent = true
|
|
vim.bo.copyindent = true
|
|
vim.api.nvim_set_keymap("n", "<F4>", ":w|:!cpgo test<CR>", { noremap = true })
|
|
end
|
|
})
|