tangled
alpha
login
or
join now
selman.me
/
rc.d
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
.config/nvim: clean custom filetypes a little
Selman Kayrancioglu
4 months ago
790b4537
414b1983
+17
-46
4 changed files
expand all
collapse all
unified
split
private_dot_config
nvim
after
syntax
massren.vim
filetype.lua
ftdetect
massren.lua
init.lua
+3
private_dot_config/nvim/after/syntax/massren.vim
···
1
1
+
syntax clear
2
2
+
syntax match massrenComment "^\/\/.*$"
3
3
+
highlight link massrenComment Comment
+13
private_dot_config/nvim/filetype.lua
···
1
1
+
print("Loaded filetype.lua")
2
2
+
3
3
+
vim.filetype.add({
4
4
+
pattern = {
5
5
+
[vim.fn.expand("~") .. "/.config/massren/temp/.*"] = "massren",
6
6
+
[".env.*"] = "dotenv",
7
7
+
},
8
8
+
9
9
+
extension = {
10
10
+
jenkinsfile = "groovy",
11
11
+
txtar = "txtar",
12
12
+
},
13
13
+
})
-13
private_dot_config/nvim/ftdetect/massren.lua
···
1
1
-
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
2
2
-
pattern = vim.fn.expand("~") .. "/.config/massren/temp/*",
3
3
-
callback = function()
4
4
-
vim.bo.filetype = "massren"
5
5
-
vim.bo.commentstring = "// %s"
6
6
-
7
7
-
vim.cmd([[
8
8
-
syntax clear
9
9
-
syntax match massrenComment "^\/\/.*$"
10
10
-
highlight link massrenComment Comment
11
11
-
]])
12
12
-
end,
13
13
-
})
+1
-33
private_dot_config/nvim/init.lua
···
43
43
vim.o.ignorecase = true
44
44
vim.o.smartcase = true
45
45
vim.o.splitkeep = "screen"
46
46
+
vim.o.filetype = "on"
46
47
47
48
vim.g.loaded_netrw = 1
48
49
vim.g.loaded_netrwPlugin = 1
···
94
95
vim.cmd("wincmd =")
95
96
end,
96
97
})
97
97
-
98
98
-
local function setup_qute_tab_edit()
99
99
-
local ft_name = "qute-tab-edit"
100
100
-
101
101
-
vim.filetype.add({
102
102
-
extension = {
103
103
-
["qute-tab-edit"] = ft_name,
104
104
-
},
105
105
-
filename = {
106
106
-
["qute-tab-edit"] = ft_name,
107
107
-
},
108
108
-
})
109
109
-
110
110
-
vim.api.nvim_set_hl(0, "QuteTabIndex", { link = "Number" })
111
111
-
vim.api.nvim_set_hl(0, "QuteTabTitle", { fg = "#98c379", bold = true })
112
112
-
vim.api.nvim_set_hl(0, "QuteTabURL", { link = "Underlined" })
113
113
-
114
114
-
-- Create FileType autocmd
115
115
-
vim.api.nvim_create_autocmd("FileType", {
116
116
-
pattern = ft_name,
117
117
-
callback = function()
118
118
-
vim.api.nvim_command("syntax clear")
119
119
-
120
120
-
vim.api.nvim_command("syntax match QuteTabIndex '^\\d\\+:'")
121
121
-
vim.api.nvim_command("syntax match QuteTabTitle ':\\s\\+\\zs.\\{-}\\ze\\s\\+(https\\?://.*)'")
122
122
-
vim.api.nvim_command("syntax match QuteTabURL '(https\\?://[^)]*)'")
123
123
-
124
124
-
vim.b.current_syntax = ft_name
125
125
-
end,
126
126
-
})
127
127
-
end
128
128
-
129
129
-
setup_qute_tab_edit()