Skip to content

Commit 7b2e89d

Browse files
Clean up language specifc settings
1 parent 67080aa commit 7b2e89d

8 files changed

Lines changed: 26 additions & 13 deletions

File tree

nvim/lua/plugins/bash.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ end
66

77
local function configure()
88
install_lsp_and_dap_if_needed()
9-
vim.bo.filetype = "sh"
9+
vim.filetype.add({
10+
pattern = { ["/tmp/bash%-fc.*"] = "sh" },
11+
})
1012
vim.lsp.enable("bashls")
1113
end
1214

nvim/lua/plugins/crontab.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
local function configure()
2-
vim.bo.filetype = "crontab"
2+
vim.filetype.add({
3+
extension = { crontab = "crontab" },
4+
})
35
end
46

57
return {

nvim/lua/plugins/csharp.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local function non_standard_options()
2-
vim.opt.tabstop = 4
3-
vim.opt.softtabstop = 4
4-
vim.opt.shiftwidth = 4
2+
vim.opt_local.tabstop = 4
3+
vim.opt_local.softtabstop = 4
4+
vim.opt_local.shiftwidth = 4
55
end
66

77
local function go_to_test_file_key_mapping()

nvim/lua/plugins/d2.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
local function configure()
22
vim.cmd("TSInstall d2")
3-
vim.bo.filetype = "d2"
3+
vim.filetype.add({
4+
extension = { d2 = "d2" },
5+
})
46
end
57

68
return {

nvim/lua/plugins/markdown.lua

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1+
local function set_options()
2+
vim.opt_local.spell = true
3+
vim.opt_local.textwidth = 80
4+
end
5+
16
local function configure()
27
require("installer").install_if_missing({
38
"marksman", -- LSP requires `sudo dnf install libicu` or `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1`
49
})
5-
vim.opt_local.filetype = "markdown"
6-
vim.opt_local.spell = true
7-
vim.opt_local.textwidth = 80
10+
vim.api.nvim_create_autocmd("FileType", {
11+
pattern = "markdown",
12+
callback = set_options,
13+
})
14+
set_options()
815
vim.lsp.enable("marksman")
916
end
1017

1118
return {
1219
"local/markdown",
1320
config = configure,
1421
ft = "markdown",
15-
event = "BufEnter *.page",
1622
virtual = true,
1723
}

nvim/lua/plugins/nushell.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
local function configure()
22
-- lsp comes with nushell out-of-the-box
33
vim.lsp.enable("nushell")
4-
vim.bo.commentstring = "# %s"
54
end
65

76
return {

nvim/lua/plugins/python.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ end
1212
return {
1313
"local/python",
1414
config = configure,
15-
ft = "py",
15+
ft = "python",
1616
virtual = true,
1717
}

nvim/lua/plugins/xml.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
local function configure()
2-
vim.bo.filetype = "xml"
2+
vim.filetype.add({
3+
extension = { xaml = "xml", props = "xml", csproj = "xml" },
4+
})
35
end
46

57
return {

0 commit comments

Comments
 (0)