Port over filetype plugin settings

This commit is contained in:
Kenneth Benzie 2024-04-02 23:02:49 +01:00
parent d7ac1f7213
commit 381d4e66cf
19 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1 @@
autocmd BufNewFile,BufReadPost CMakeCache.txt set filetype=cmakecache

2
after/ftdetect/cpp.vim Normal file
View File

@ -0,0 +1,2 @@
" Force *.def to C++ filetype for LLVM
au BufNewFile,BufReadPost *.def set filetype=cpp

3
after/ftdetect/llvm.vim Normal file
View File

@ -0,0 +1,3 @@
" Set .ll files to LLVM IR filetype
au BufNewFile,BufReadPost *.ll set filetype=llvm
au BufNewFile,BufReadPost *.test set filetype=llvm

View File

@ -0,0 +1,3 @@
" Force *.md to markdown filetype
au BufNewFile,BufReadPost *.md set filetype=markdown
au BufNewFile,BufReadPost *.ronn set filetype=markdown

View File

@ -0,0 +1,2 @@
" Force *.cl to OpenCL C filetype
au BufNewFile,BufReadPost *.cl set filetype=opencl

View File

@ -0,0 +1,3 @@
" Force lit.cfg/lit.local.cfg to be Python
au BufNewFile,BufReadPost lit.cfg set filetype=python
au BufNewFile,BufReadPost lit.local.cfg set filetype=python

View File

@ -0,0 +1 @@
autocmd BufNewFile,BufReadPost */requirements.txt set filetype=requirements

View File

@ -0,0 +1,2 @@
" Force *.td to tablegen filetype
au BufNewFile,BufReadPost *.td set filetype=tablegen

3
after/ftdetect/zsh.vim Normal file
View File

@ -0,0 +1,3 @@
" Force .enter/.exit to be zsh
au BufNewFile,BufReadPost .enter set filetype=zsh
au BufNewFile,BufReadPost .exit set filetype=zsh

View File

@ -0,0 +1,14 @@
vim.opt.spell = true
-- Auto-wrap text using textwidth
vim.opt.formatoptions:append('t')
-- When formatting text, recognize numbered lists
vim.opt.formatoptions:append('n')
-- Allow formatting of comments with 'gq'
vim.opt.formatoptions:append('q')
-- Automatically insert the current comment leader after hitting 'o' or 'O' in
-- Normal mode
vim.opt.formatoptions:append('o')
-- A pattern that is used to recognize a list header
vim.opt.formatlistpat = "^\\s*\\d\\+\\.\\s\\+\\|^[-*+]\\s\\+"

View File

@ -0,0 +1,5 @@
-- Setup tabs
vim.opt.expandtab = false
vim.opt.tabstop = 8
vim.opt.shiftwidth = 8
vim.opt.softtabstop = 8

View File

@ -1,3 +1,4 @@
vim.opt.spell = false
vim.opt.number = false
vim.opt.relativenumber = false
vim.opt.signcolumn = 'no'

3
after/ftplugin/llvm.lua Normal file
View File

@ -0,0 +1,3 @@
-- Include % and . in keywords for easier navigation of ID's
vim.opt.iskeyword:append('%')
vim.opt.iskeyword:append('.')

1
after/ftplugin/make.lua Normal file
View File

@ -0,0 +1 @@
vim.opt.tabstop = 8

2
after/ftplugin/man.lua Normal file
View File

@ -0,0 +1,2 @@
vim.opt.showbreak = ''
vim.opt.signcolumn = 'no'

View File

@ -0,0 +1 @@
vim.opt.commentstring = '//%s'

20
after/ftplugin/python.lua Normal file
View File

@ -0,0 +1,20 @@
-- 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'

1
after/ftplugin/tags.lua Normal file
View File

@ -0,0 +1 @@
vim.opt.expandtab = false

2
after/ftplugin/text.lua Normal file
View File

@ -0,0 +1,2 @@
vim.opt.spell = true
vim.opt.textwidth = 80